From aba787af49b2356b22310fdc26abbbc639cf53c0 Mon Sep 17 00:00:00 2001 From: Ingo Molnar Date: Thu, 5 Feb 2009 15:23:08 +0100 Subject: [PATCH] --- yaml --- r: 147211 b: refs/heads/master c: 82aa9a1829199233f9bdaf26e2ee271114f4701e h: refs/heads/master i: 147209: ddb60ee36e5d516ade82696ed884542df3fb95a5 147207: c24fd6d06dee18e70375df012769626c18f4fa40 v: v3 --- [refs] | 2 +- trunk/arch/x86/oprofile/op_model_ppro.c | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index 59600e2bd037..38d040c4b31e 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 5b75af0a02fcf3b8899f38ff6f22164c5d8e2fdd +refs/heads/master: 82aa9a1829199233f9bdaf26e2ee271114f4701e diff --git a/trunk/arch/x86/oprofile/op_model_ppro.c b/trunk/arch/x86/oprofile/op_model_ppro.c index 07c914555a5e..85eb6268374f 100644 --- a/trunk/arch/x86/oprofile/op_model_ppro.c +++ b/trunk/arch/x86/oprofile/op_model_ppro.c @@ -126,6 +126,13 @@ static int ppro_check_ctrs(struct pt_regs * const regs, u64 val; int i; + /* + * This can happen if perf counters are in use when + * we steal the die notifier NMI. + */ + if (unlikely(!reset_value)) + goto out; + for (i = 0 ; i < num_counters; ++i) { if (!reset_value[i]) continue; @@ -136,6 +143,7 @@ static int ppro_check_ctrs(struct pt_regs * const regs, } } +out: /* 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);