[PATCH][2.6.9-rc1-mm1] Prescott fix for perfctr

From: Mikael Pettersson
Date: Thu Aug 26 2004 - 09:24:50 EST


Andrew,

This eliminates a potential oops in perfctr's x86 initialisation
code when running on a P4 Model 3 Prescott processor. The P4M3
removed two control registers. I knew that and handled it in the
control setup validation code, but I forgot to also modify the
initialisation code to avoid clearing them.

Perfctr hasn't been hit by this problem on the P4M3 Noconas,
but people are reporting that oprofile and the NMI watchdog
oops due to this on P4M3 Prescotts.

Signed-off-by: Mikael Pettersson <mikpe@xxxxxxxxx>

diff -ruN linux-2.6.9-rc1-mm1/drivers/perfctr/x86.c linux-2.6.9-rc1-mm1.perfctr-p4m3-fix/drivers/perfctr/x86.c
--- linux-2.6.9-rc1-mm1/drivers/perfctr/x86.c 2004-08-26 14:33:03.000000000 +0200
+++ linux-2.6.9-rc1-mm1.perfctr-p4m3-fix/drivers/perfctr/x86.c 2004-08-26 15:26:28.000000000 +0200
@@ -865,7 +865,10 @@
/* clear PEBS_ENABLE and PEBS_MATRIX_VERT; they handle both PEBS
and ReplayTagging, and should exist even if PEBS is disabled */
clear_msr_range(0x3F1, 2);
- clear_msr_range(0x3A0, 31);
+ clear_msr_range(0x3A0, 26);
+ if (p4_IQ_ESCR_ok)
+ clear_msr_range(0x3BA, 2);
+ clear_msr_range(0x3BC, 3);
clear_msr_range(0x3C0, 6);
clear_msr_range(0x3C8, 6);
clear_msr_range(0x3E0, 2);
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/