static int __init cpum_cf_init(void)
{
	int rc;

	if (!cpum_cf_avail())
		return -ENODEV;

	/* clear bit 15 of cr0 to unauthorize problem-state to
	 * extract measurement counters */
	ctl_clear_bit(0, 48);

	/* register handler for measurement-alert interruptions */
	rc = register_external_irq(EXT_IRQ_MEASURE_ALERT,
				   cpumf_measurement_alert);
	if (rc) {
		pr_err("Registering for CPU-measurement alerts "
		       "failed with rc=%i\n", rc);
		return rc;
	}

	rc = cpuhp_setup_state(CPUHP_AP_PERF_S390_CF_ONLINE,
				"perf/s390/cf:online",
				cpum_cf_online_cpu, cpum_cf_offline_cpu);
	if (!rc)
		cpum_cf_initalized = true;

	return rc;
}
Beispiel #2
0
void
cio_release_console(void)
{
	ioinfo[console_subchannel.irq] = NULL;
	ctl_clear_bit(6, 24);
	console_subchannel_in_use = 0;
}
Beispiel #3
0
void
cio_release_console(void)
{
	console_subchannel.schib.pmcw.intparm = 0;
	cio_modify(&console_subchannel);
	ctl_clear_bit(6, 24);
	console_subchannel_in_use = 0;
}
NORET_TYPE void
machine_kexec(struct kimage *image)
{
	clear_all_subchannels();
	cio_reset_channel_paths();

	/* Disable lowcore protection */
	ctl_clear_bit(0,28);

	on_each_cpu(kexec_halt_all_cpus, image, 0, 0);
	for (;;);
}
Beispiel #5
0
/*
 * s390_init_machine_check
 *
 * initialize machine check handling
 */
static int
machine_check_init(void)
{
    init_MUTEX_LOCKED(&m_sem);
    ctl_clear_bit(14, 25);	/* disable damage MCH */
    ctl_set_bit(14, 26);	/* enable degradation MCH */
    ctl_set_bit(14, 27);	/* enable system recovery MCH */
#ifdef CONFIG_MACHCHK_WARNING
    ctl_set_bit(14, 24);	/* enable warning MCH */
#endif
    return 0;
}
Beispiel #6
0
void isc_unregister(unsigned int isc)
{
	spin_lock(&isc_ref_lock);
	
	if (isc > MAX_ISC || isc_refs[isc] == 0) {
		WARN_ON(1);
		goto out_unlock;
	}
	if (isc_refs[isc] == 1)
		ctl_clear_bit(6, 31 - isc);
	isc_refs[isc]--;
out_unlock:
	spin_unlock(&isc_ref_lock);
}
Beispiel #7
0
/*
 * s390_init_machine_check
 *
 * initialize machine check handling
 */
void s390_init_machine_check( void )
{
	crwe_t  *pcrwe;	 /* CRW buffer element pointer */
	mache_t *pmache;   /* machine check element pointer */

	init_MUTEX_LOCKED( &s_sem );

	pcrwe = kmalloc( MAX_CRW_PENDING * sizeof( crwe_t), GFP_KERNEL);

	if ( pcrwe )
	{
		int i;

		crw_buffer_anchor = pcrwe;

		for ( i=0; i < MAX_CRW_PENDING-1; i++)
		{
			pcrwe->crwe_next = (crwe_t *)((unsigned long)pcrwe + sizeof(crwe_t));
   		pcrwe            = pcrwe->crwe_next;

		} /* endfor */	

		pcrwe->crwe_next = NULL;

	}
	else
	{
		panic( "s390_init_machine_check : unable to obtain memory\n");		

	} /* endif */

	pmache = kmalloc( MAX_MACH_PENDING * sizeof( mache_t), GFP_KERNEL);

	if ( pmache )
	{
		int i;

		for ( i=0; i < MAX_MACH_PENDING; i++)
		{
			s390_enqueue_free_mchchk( pmache );
		   pmache = (mache_t *)((unsigned long)pmache + sizeof(mache_t));

		} /* endfor */	
	}
	else
	{
		panic( "s390_init_machine_check : unable to obtain memory\n");		

	} /* endif */

#ifdef S390_MACHCHK_DEBUG
	printk( KERN_NOTICE "init_mach : starting machine check handler\n");
#endif	

	kernel_thread( s390_machine_check_handler, &s_sem, CLONE_FS | CLONE_FILES);

	ctl_clear_bit( 14, 25 );  // disable damage MCH 	

	ctl_set_bit( 14, 26 ); /* enable degradation MCH */
	ctl_set_bit( 14, 27 ); /* enable system recovery MCH */
#if 1
  	ctl_set_bit( 14, 28 );		// enable channel report MCH
#endif
#ifdef CONFIG_MACHCHK_WARNING
	ctl_set_bit( 14, 24);   /* enable warning MCH */
#endif

#ifdef S390_MACHCHK_DEBUG
	printk( KERN_DEBUG "init_mach : machine check buffer : head = %08X\n",
            (unsigned)&mchchk_queue_head);
	printk( KERN_DEBUG "init_mach : machine check buffer : tail = %08X\n",
            (unsigned)&mchchk_queue_tail);
	printk( KERN_DEBUG "init_mach : machine check buffer : free = %08X\n",
            (unsigned)&mchchk_queue_free);
	printk( KERN_DEBUG "init_mach : CRW entry buffer anchor = %08X\n",
            (unsigned)&crw_buffer_anchor);
	printk( KERN_DEBUG "init_mach : machine check handler ready\n");
#endif	

	return;
}