diff --git a/arch/x86/oprofile/op_model_ppro.c b/arch/x86/oprofile/op_model_ppro.c index 3f1b81a..7b142da 100644 --- a/arch/x86/oprofile/op_model_ppro.c +++ b/arch/x86/oprofile/op_model_ppro.c @@ -132,13 +132,15 @@ static int ppro_check_ctrs(struct pt_regs * const regs, rdmsrl(msrs->counters[i].addr, val); if (CTR_OVERFLOWED(val)) { oprofile_add_sample(regs, i); + /* + * We need to unmask the apic vector *before* + * writing reset_value to msr counter + */ + apic_write(APIC_LVTPC, APIC_DM_NMI); wrmsrl(msrs->counters[i].addr, -reset_value[i]); } } - /* Only P6 based Pentium M need to re-unmask the apic vector but it - * doesn't hurt other P6 variant */ - apic_write(APIC_LVTPC, apic_read(APIC_LVTPC) & ~APIC_LVT_MASKED); /* We can't work out if we really handled an interrupt. We * might have caught a *second* counter just after overflowing