All of lore.kernel.org
 help / color / mirror / Atom feed
From: Philippe Elie <phil.el@wanadoo.fr>
To: Andrew Morton <akpm@osdl.org>
Cc: linux-kernel@vger.kernel.org, Will Cohen <wcohen@redhat.com>,
	John Levon <levon@movementarian.org>
Subject: [PATCH] oprofile add Pentium Mobile support
Date: Thu, 12 Feb 2004 22:41:52 +0000	[thread overview]
Message-ID: <20040212224152.GE316@zaniah> (raw)

Hi Andrew, all

apply cleanly to 2.6.3-rc2


From: Will Cohen <wcohen@redhat.com>

Add oprofile support for Pentium Mobile (P6 core). Pentium Mobile needs
to unmask LVPTC vector, since it doesn't hurt other P6 core based cpus
we do it unconditionally for all these.

This patch require userspace tools >= 0.8 (only in sourceforge cvs currently)


regards,
Phil


diff -uprN -X /home/phe/dontdiff-2.6.0 linux-temp/arch/i386/oprofile/nmi_int.c linux-2.5/arch/i386/oprofile/nmi_int.c
--- linux-temp/arch/i386/oprofile/nmi_int.c	2004-02-12 22:00:59.000000000 +0000
+++ linux-2.5/arch/i386/oprofile/nmi_int.c	2004-02-12 22:27:31.000000000 +0000
@@ -335,7 +335,9 @@ static int __init ppro_init(void)
 	if (cpu_model > 0xd)
 		return 0;
 
-	if (cpu_model > 5) {
+	if (cpu_model == 9) {
+		nmi_ops.cpu_type = "i386/p6_mobile";
+	} else if (cpu_model > 5) {
 		nmi_ops.cpu_type = "i386/piii";
 	} else if (cpu_model > 2) {
 		nmi_ops.cpu_type = "i386/pii";
diff -uprN -X /home/phe/dontdiff-2.6.0 linux-temp/arch/i386/oprofile/op_model_ppro.c linux-2.5/arch/i386/oprofile/op_model_ppro.c
--- linux-temp/arch/i386/oprofile/op_model_ppro.c	2004-02-12 22:00:59.000000000 +0000
+++ linux-2.5/arch/i386/oprofile/op_model_ppro.c	2004-02-12 22:27:31.000000000 +0000
@@ -13,6 +13,7 @@
 #include <linux/oprofile.h>
 #include <asm/ptrace.h>
 #include <asm/msr.h>
+#include <asm/apic.h>
  
 #include "op_x86_model.h"
 #include "op_counter.h"
@@ -101,6 +102,10 @@ static int ppro_check_ctrs(unsigned int 
 		}
 	}
 
+	/* 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);
+
 	/* We can't work out if we really handled an interrupt. We
 	 * might have caught a *second* counter just after overflowing
 	 * the interrupt for this counter then arrives

             reply	other threads:[~2004-02-12 21:44 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-02-12 22:41 Philippe Elie [this message]
2004-02-16 10:23 ` [PATCH] oprofile add Pentium Mobile support Mikael Pettersson
2004-02-16 13:55   ` Will Cohen
2004-02-16 14:20     ` Mikael Pettersson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20040212224152.GE316@zaniah \
    --to=phil.el@wanadoo.fr \
    --cc=akpm@osdl.org \
    --cc=levon@movementarian.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=wcohen@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.