* RE: [PATCH] [RESEND] Use of Performance Monitoring Counters based on Model number
@ 2003-07-29 20:28 Pallipadi, Venkatesh
0 siblings, 0 replies; 2+ messages in thread
From: Pallipadi, Venkatesh @ 2003-07-29 20:28 UTC (permalink / raw)
To: torvalds; +Cc: linux-kernel, Pallipadi, Venkatesh, Nakajima, Jun
[-- Attachment #1: Type: text/plain, Size: 3728 bytes --]
Oops. Sorry about the wrapped lines in my last mail. Sending the patch
as an attachment this time.
Thanks,
-Venkatesh
> -----Original Message-----
> From: Pallipadi, Venkatesh
> Sent: Tuesday, July 29, 2003 11:15 AM
> To: torvalds@osdl.org
> Cc: linux-kernel@vger.kernel.org; Mallick, Asit K; Nakajima, Jun
> Subject: [PATCH] [RESEND] Use of Performance Monitoring
> Counters based on Model number
>
>
>
>
>
> Attaching a modified version of this patch, based on the
> feedback that I
> got for my previous post.
>
> Feedback and Resolution:
> 1) If you're going to do this you should fix up arch/i386/oprofile/ to
> error out similarly at least
> - Done. Made a similar change in oprofile code. Infact it
> already had a
> check for 0xf, 0x3. Added one for 0x6, 0xd.
>
> 2) How about some macros for those magic numbers?
> #define INTEL_MODEL_THINGABABOBBERPERON 0xd
> - Not sure whether I need to add macros for family and
> models. We don't
> seem to have macros for them anywhere else in kernel code.
>
> 3) It'd also be nice to let the user know why things aren't working
> instead of silent failure.
> - Done. Added a message while in nmi_init.
>
> Let me know if you have any questions. Please Apply.
>
> Thanks,
> -Venkatesh
>
> > -----Original Message-----
> > From: Pallipadi, Venkatesh
> > Sent: Wednesday, July 16, 2003 10:08 AM
> > To: 'torvalds@osdl.org'
> > Cc: 'linux-kernel@vger.kernel.org'; Mallick, Asit K
> > Subject: [PATCH] Use of Performance Monitoring Counters based
> > on Model number
> >
> >
> >
> >
> > 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.6.0-test1/arch/i386/kernel/nmi.c.orig 2003-07-13
> 20:34:40.000000000 -0700
> +++ linux-2.6.0-test1/arch/i386/kernel/nmi.c 2003-07-17
> 17:26:45.000000000 -0700
> @@ -162,9 +162,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;
> @@ -348,9 +354,19 @@
> case X86_VENDOR_INTEL:
> switch (boot_cpu_data.x86) {
> case 6:
> + if (boot_cpu_data.x86_model > 0xd) {
> + printk (KERN_INFO "Performance Counter
> support for this CPU model not yet added.\n");
> + return;
> + }
> +
> setup_p6_watchdog();
> break;
> case 15:
> + if (boot_cpu_data.x86_model > 0x3) {
> + printk (KERN_INFO "Performance Counter
> support for this CPU model not yet added.\n");
> + return;
> + }
> +
> if (!setup_p4_watchdog())
> return;
> break;
> --- linux-2.6.0-test1/arch/i386/oprofile/nmi_int.c.orig
> 2003-07-17
> 17:20:30.000000000 -0700
> +++ linux-2.6.0-test1/arch/i386/oprofile/nmi_int.c 2003-07-17
> 17:21:06.000000000 -0700
> @@ -285,6 +285,9 @@
> {
> __u8 cpu_model = current_cpu_data.x86_model;
>
> + if (cpu_model > 0xd)
> + return 0;
> +
> if (cpu_model > 5) {
> nmi_ops.cpu_type = "i386/piii";
> } else if (cpu_model > 2) {
>
>
> -
> 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/
>
[-- Attachment #2: 2.5_nmi_ver1.patch --]
[-- Type: application/octet-stream, Size: 1373 bytes --]
--- linux-2.6.0-test1/arch/i386/kernel/nmi.c.orig 2003-07-13 20:34:40.000000000 -0700
+++ linux-2.6.0-test1/arch/i386/kernel/nmi.c 2003-07-17 17:26:45.000000000 -0700
@@ -162,9 +162,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;
@@ -348,9 +354,19 @@
case X86_VENDOR_INTEL:
switch (boot_cpu_data.x86) {
case 6:
+ if (boot_cpu_data.x86_model > 0xd) {
+ printk (KERN_INFO "Performance Counter support for this CPU model not yet added.\n");
+ return;
+ }
+
setup_p6_watchdog();
break;
case 15:
+ if (boot_cpu_data.x86_model > 0x3) {
+ printk (KERN_INFO "Performance Counter support for this CPU model not yet added.\n");
+ return;
+ }
+
if (!setup_p4_watchdog())
return;
break;
--- linux-2.6.0-test1/arch/i386/oprofile/nmi_int.c.orig 2003-07-17 17:20:30.000000000 -0700
+++ linux-2.6.0-test1/arch/i386/oprofile/nmi_int.c 2003-07-17 17:21:06.000000000 -0700
@@ -285,6 +285,9 @@
{
__u8 cpu_model = current_cpu_data.x86_model;
+ if (cpu_model > 0xd)
+ return 0;
+
if (cpu_model > 5) {
nmi_ops.cpu_type = "i386/piii";
} else if (cpu_model > 2) {
^ permalink raw reply [flat|nested] 2+ messages in thread* [PATCH] [RESEND] Use of Performance Monitoring Counters based on Model number
@ 2003-07-29 18:15 Pallipadi, Venkatesh
0 siblings, 0 replies; 2+ messages in thread
From: Pallipadi, Venkatesh @ 2003-07-29 18:15 UTC (permalink / raw)
To: torvalds; +Cc: linux-kernel, Mallick, Asit K, Nakajima, Jun
Attaching a modified version of this patch, based on the feedback that I
got for my previous post.
Feedback and Resolution:
1) If you're going to do this you should fix up arch/i386/oprofile/ to
error out similarly at least
- Done. Made a similar change in oprofile code. Infact it already had a
check for 0xf, 0x3. Added one for 0x6, 0xd.
2) How about some macros for those magic numbers?
#define INTEL_MODEL_THINGABABOBBERPERON 0xd
- Not sure whether I need to add macros for family and models. We don't
seem to have macros for them anywhere else in kernel code.
3) It'd also be nice to let the user know why things aren't working
instead of silent failure.
- Done. Added a message while in nmi_init.
Let me know if you have any questions. Please Apply.
Thanks,
-Venkatesh
> -----Original Message-----
> From: Pallipadi, Venkatesh
> Sent: Wednesday, July 16, 2003 10:08 AM
> To: 'torvalds@osdl.org'
> Cc: 'linux-kernel@vger.kernel.org'; Mallick, Asit K
> Subject: [PATCH] Use of Performance Monitoring Counters based
> on Model number
>
>
>
>
> 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.6.0-test1/arch/i386/kernel/nmi.c.orig 2003-07-13
20:34:40.000000000 -0700
+++ linux-2.6.0-test1/arch/i386/kernel/nmi.c 2003-07-17
17:26:45.000000000 -0700
@@ -162,9 +162,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;
@@ -348,9 +354,19 @@
case X86_VENDOR_INTEL:
switch (boot_cpu_data.x86) {
case 6:
+ if (boot_cpu_data.x86_model > 0xd) {
+ printk (KERN_INFO "Performance Counter
support for this CPU model not yet added.\n");
+ return;
+ }
+
setup_p6_watchdog();
break;
case 15:
+ if (boot_cpu_data.x86_model > 0x3) {
+ printk (KERN_INFO "Performance Counter
support for this CPU model not yet added.\n");
+ return;
+ }
+
if (!setup_p4_watchdog())
return;
break;
--- linux-2.6.0-test1/arch/i386/oprofile/nmi_int.c.orig 2003-07-17
17:20:30.000000000 -0700
+++ linux-2.6.0-test1/arch/i386/oprofile/nmi_int.c 2003-07-17
17:21:06.000000000 -0700
@@ -285,6 +285,9 @@
{
__u8 cpu_model = current_cpu_data.x86_model;
+ if (cpu_model > 0xd)
+ return 0;
+
if (cpu_model > 5) {
nmi_ops.cpu_type = "i386/piii";
} else if (cpu_model > 2) {
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2003-07-29 20:28 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-07-29 20:28 [PATCH] [RESEND] Use of Performance Monitoring Counters based on Model number Pallipadi, Venkatesh
-- strict thread matches above, loose matches on Subject: below --
2003-07-29 18:15 Pallipadi, Venkatesh
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®