]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - arch/x86/oprofile/op_model_ppro.c
Merge commit 'tip/perfcounters-for-linus' into oprofile/master
[karo-tx-linux.git] / arch / x86 / oprofile / op_model_ppro.c
index 0a261a5c696e5bdad2b2c28c058916fffb666b67..cd72d5c73b490c3cc4341c5f5c7eee4b1f076832 100644 (file)
@@ -118,6 +118,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;
@@ -128,6 +135,7 @@ static int ppro_check_ctrs(struct pt_regs * const regs,
                wrmsrl(msrs->counters[i].addr, -reset_value[i]);
        }
 
+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);