[PATCH] Use of Performance Monitoring Counters based on Model number

From: Pallipadi, Venkatesh (venkatesh.pallipadi@intel.com)
Date: Wed Jul 16 2003 - 12:07:49 EST


Attached is a small patch to make Linux kernel use of performance
monitoring MSRs based on known processor models. Future processor
implementation models may not support the same MSR layout.

Please apply.

Thanks,
-Venkatesh

--- linux-2.5.72-monitor/arch/i386/kernel/nmi.c.org 2003-06-16
21:20:02.000000000 -0700
+++ linux-2.5.72-monitor/arch/i386/kernel/nmi.c 2003-06-20
15:47:29.000000000 -0700
@@ -157,9 +157,15 @@
         case X86_VENDOR_INTEL:
                 switch (boot_cpu_data.x86) {
                 case 6:
+ if (boot_cpu_data.x86_model > 0xd)
+ break;
+
                         wrmsr(MSR_P6_EVNTSEL0, 0, 0);
                         break;
                 case 15:
+ if (boot_cpu_data.x86_model > 0x3)
+ break;
+
                         wrmsr(MSR_P4_IQ_CCCR0, 0, 0);
                         wrmsr(MSR_P4_CRU_ESCR0, 0, 0);
                         break;
@@ -324,9 +338,15 @@
         case X86_VENDOR_INTEL:
                 switch (boot_cpu_data.x86) {
                 case 6:
+ if (boot_cpu_data.x86_model > 0xd)
+ return;
+
                         setup_p6_watchdog();
                         break;
                 case 15:
+ if (boot_cpu_data.x86_model > 0x3)
+ return;
+
                         if (!setup_p4_watchdog())
                                 return;
                         break;

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Wed Jul 23 2003 - 22:00:25 EST