wrmsr(nmi_perfctr_msr, -(cpu_khz/nmi_hz*1000), -1); 
wrmsrl(nmi_perfctr_msr, -((u64)cpu_khz * 1000 / nmi_hz)); 
void nmi_watchdog_tick (struct pt_regs * regs, unsigned reason){	int sum;	int touched = 0;	sum = read_pda(apic_timer_irqs);	if (__get_cpu_var(nmi_touch)) {		__get_cpu_var(nmi_touch) = 0;		touched = 1;	}	if (!touched && __get_cpu_var(last_irq_sum) == sum) {		/*		 * Ayiee, looks like this CPU is stuck ...		 * wait a few IRQs (5 seconds) before doing the oops ...		 */		local_inc(&__get_cpu_var(alert_counter));		if (local_read(&__get_cpu_var(alert_counter)) == 5*nmi_hz) {			if (notify_die(DIE_NMI, "nmi", regs, reason, 2, SIGINT)							== NOTIFY_STOP) {				local_set(&__get_cpu_var(alert_counter), 0);				return;			}			die_nmi("NMI Watchdog detected LOCKUP on CPU %d\n", regs);		}	} else {		__get_cpu_var(last_irq_sum) = sum;		local_set(&__get_cpu_var(alert_counter), 0);	}	if (nmi_perfctr_msr) { 		if (nmi_perfctr_msr == MSR_P4_IQ_COUNTER0) { 			/* 			 * P4 quirks: 			 * - An overflown perfctr will assert its interrupt 			 *   until the OVF flag in its CCCR is cleared. 			 * - LVTPC is masked on interrupt and must be 			 *   unmasked by the LVTPC handler. 			 */ 			wrmsr(MSR_P4_IQ_CCCR0, nmi_p4_cccr_val, 0); 			apic_write(APIC_LVTPC, APIC_DM_NMI); 		}		wrmsr(nmi_perfctr_msr, -(cpu_khz/nmi_hz*1000), -1);	}}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/42ac8ff2ce58138ba1339296406bde6636792bd8/nmi.c/clean/arch/x86_64/kernel/nmi.c