public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Jaswinder Singh Rajput <jaswinder@kernel.org>
Cc: Ingo Molnar <mingo@elte.hu>, Paul Mackerras <paulus@samba.org>,
	lkml <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] perfcounters: IRQ and NMI support on AMD CPUs
Date: Thu, 05 Mar 2009 20:34:21 +0100	[thread overview]
Message-ID: <1236281661.5187.432.camel@laptop> (raw)
In-Reply-To: <1236279393.3316.13.camel@localhost.localdomain>

On Fri, 2009-03-06 at 00:26 +0530, Jaswinder Singh Rajput wrote:

> But kerneltop is still not working and I am not getting any NMI Interrupts.

Does the below work for you?

The BKGD suggests its 48 for all existing machines (it certainly is for
mine).

Index: linux-2.6/arch/x86/kernel/cpu/perf_counter.c
===================================================================
--- linux-2.6.orig/arch/x86/kernel/cpu/perf_counter.c
+++ linux-2.6/arch/x86/kernel/cpu/perf_counter.c
@@ -959,20 +959,8 @@ static struct pmc_x86_ops *pmc_amd_init(
 
 	nr_counters_generic = 4;
 	nr_counters_fixed = 0;
-	counter_value_mask = ~0ULL;
-
-	rdmsrl(MSR_K7_PERFCTR0, old);
-	wrmsrl(MSR_K7_PERFCTR0, counter_value_mask);
-	/*
-	 * read the truncated mask
-	 */
-	rdmsrl(MSR_K7_PERFCTR0, counter_value_mask);
-	wrmsrl(MSR_K7_PERFCTR0, old);
-
-	bits = 32 + fls(counter_value_mask >> 32);
-	if (bits == 32)
-		bits = fls((u32)counter_value_mask);
-	counter_value_bits = bits;
+	counter_value_mask = 0x0000FFFFFFFFFFFFULL;
+	counter_value_bits = 48;
 
 	pr_info("AMD Performance Monitoring support detected.\n");
 



  parent reply	other threads:[~2009-03-05 19:34 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-05 17:20 [PATCH] perfcounters: IRQ and NMI support on AMD CPUs Peter Zijlstra
2009-03-05 17:25 ` Ingo Molnar
2009-03-05 17:27 ` [tip:perfcounters/core] " Peter Zijlstra
2009-03-12  1:44   ` Robert Richter
2009-03-12  9:12     ` Peter Zijlstra
2009-03-05 18:32 ` [PATCH] " Jaswinder Singh Rajput
2009-03-05 18:45   ` Peter Zijlstra
2009-03-05 18:56     ` Jaswinder Singh Rajput
2009-03-05 19:07       ` Peter Zijlstra
2009-03-05 19:37         ` Jaswinder Singh Rajput
2009-03-05 19:34       ` Peter Zijlstra [this message]
2009-03-05 19:41         ` Ingo Molnar
2009-03-05 20:01           ` Jaswinder Singh Rajput
2009-03-06  6:37             ` Mike Galbraith
2009-03-06  6:51               ` Mike Galbraith
2009-03-06  7:11                 ` Mike Galbraith

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=1236281661.5187.432.camel@laptop \
    --to=peterz@infradead.org \
    --cc=jaswinder@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=paulus@samba.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox