* [PATCH] Use of Performance Monitoring Counters based on Model number
@ 2003-07-16 17:07 Pallipadi, Venkatesh
2003-07-16 17:19 ` John Levon
0 siblings, 1 reply; 3+ messages in thread
From: Pallipadi, Venkatesh @ 2003-07-16 17:07 UTC (permalink / raw)
To: torvalds; +Cc: linux-kernel, Mallick, Asit K
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;
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] Use of Performance Monitoring Counters based on Model number
2003-07-16 17:07 [PATCH] Use of Performance Monitoring Counters based on Model number Pallipadi, Venkatesh
@ 2003-07-16 17:19 ` John Levon
2003-07-16 18:05 ` Dave Jones
0 siblings, 1 reply; 3+ messages in thread
From: John Levon @ 2003-07-16 17:19 UTC (permalink / raw)
To: Pallipadi, Venkatesh; +Cc: torvalds, linux-kernel, Mallick, Asit K
On Wed, Jul 16, 2003 at 10:07:49AM -0700, Pallipadi, Venkatesh wrote:
> 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.
If you're going to do this you should fix up arch/i386/oprofile/ to
error out similarly at least
regards
john
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] Use of Performance Monitoring Counters based on Model number
2003-07-16 17:19 ` John Levon
@ 2003-07-16 18:05 ` Dave Jones
0 siblings, 0 replies; 3+ messages in thread
From: Dave Jones @ 2003-07-16 18:05 UTC (permalink / raw)
To: John Levon; +Cc: Pallipadi, Venkatesh, torvalds, linux-kernel, Mallick, Asit K
On Wed, Jul 16, 2003 at 06:19:56PM +0100, John Levon wrote:
> > 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.
> If you're going to do this you should fix up arch/i386/oprofile/ to
> error out similarly at least
It'd also be nice to let the user know why things aren't working
instead of silent failure. A simple
printk (KERN_INFO "Performance counter support for this CPU not yet added.\n");
Should do the trick.
Dave
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2003-07-16 17:57 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-07-16 17:07 [PATCH] Use of Performance Monitoring Counters based on Model number Pallipadi, Venkatesh
2003-07-16 17:19 ` John Levon
2003-07-16 18:05 ` Dave Jones
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).