mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: mingo@kernel.org, tglx@linutronix.de, ak@linux.intel.com,
	eranian@google.com, dzickus@redhat.com, andi@firstfloor.org,
	jmario@redhat.com, acme@kernel.org
Cc: linux-kernel@vger.kernel.org, "Peter Zijlstra" <peterz@infradead.org>
Subject: [PATCH 3/4] perf,x86: Attempt to sanitize the HSW supplier info
Date: Thu, 23 Oct 2014 12:51:22 +0200	[thread overview]
Message-ID: <20141023105658.236729829@infradead.org> (raw)
In-Reply-To: <20141023105119.173457103@infradead.org>

[-- Attachment #1: peterz-hsw-offcore-fix-3.patch --]
[-- Type: text/plain, Size: 2172 bytes --]

The SDM states the HSW/BDW supplier and snoop info are identical to
SNB/IVB, make it so.

Furthermore, it states you have to minimally program a request and
supplier type, but the current code does not set a supplier for the
ACCESS events.

This significantly alters the actual events and does away with some of
the weirdness found by decoding the magic numbers. If this breaks
things someone needs to go explain things and augment the SDM.

Cc: Andi Kleen <ak@linux.intel.com>
Cc: Stephane Eranian <eranian@google.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: http://lkml.kernel.org/n/tip-@git.kernel.org
---
 arch/x86/kernel/cpu/perf_event_intel.c |   17 ++++++-----------
 1 file changed, 6 insertions(+), 11 deletions(-)

--- a/arch/x86/kernel/cpu/perf_event_intel.c
+++ b/arch/x86/kernel/cpu/perf_event_intel.c
@@ -544,11 +544,6 @@ static __initconst const u64 hsw_hw_cach
 #define HSW_DMND_WRITE		(HSW_DMND_RFO|SNB_LLC_RFO)
 #define HSW_DMND_PREFETCH	(HSW_PF_DATA_RD|HSW_PF_RFO|HSW_PF_IFETCH)
 
-#define HSW_DRAM_ANY		(SNB_NO_SUPP|SNB_SNP_ANY|(0x78ULL << 23)) /* WTF */
-
-#define HSW_L3_ACCESS		(0) /* XXX no supplier! */
-#define NSW_L3_MISS		(HSW_DRAM_ANY|SNB_NON_DRAM)
-
 static __initconst const u64 hsw_hw_cache_extra_regs
 				[PERF_COUNT_HW_CACHE_MAX]
 				[PERF_COUNT_HW_CACHE_OP_MAX]
@@ -556,16 +551,16 @@ static __initconst const u64 hsw_hw_cach
 {
  [ C(LL  ) ] = {
 	[ C(OP_READ) ] = {
-		[ C(RESULT_ACCESS) ] = HSW_DMND_READ|HSW_L3_ACCESS,
-		[ C(RESULT_MISS)   ] = HSW_DMND_READ|HSW_L3_MISS,
+		[ C(RESULT_ACCESS) ] = HSW_DMND_READ|SNB_L3_ACCESS,
+		[ C(RESULT_MISS)   ] = HSW_DMND_READ|SNB_L3_MISS,
 	},
 	[ C(OP_WRITE) ] = {
-		[ C(RESULT_ACCESS) ] = HSW_DMND_WRITE|HSW_L3_ACCESS,
-		[ C(RESULT_MISS)   ] = HSW_DMND_WRITE|HSW_L3_MISS,
+		[ C(RESULT_ACCESS) ] = HSW_DMND_WRITE|SNB_L3_ACCESS,
+		[ C(RESULT_MISS)   ] = HSW_DMND_WRITE|SNB_L3_MISS,
 	},
 	[ C(OP_PREFETCH) ] = {
-		[ C(RESULT_ACCESS) ] = HSW_DMND_PREFETCH|HSW_L3_ACCESS,
-		[ C(RESULT_MISS)   ] = HSW_DMND_PREFETCH|HSW_L3_MISS,
+		[ C(RESULT_ACCESS) ] = HSW_DMND_PREFETCH|SNB_L3_ACCESS,
+		[ C(RESULT_MISS)   ] = HSW_DMND_PREFETCH|SNB_L3_MISS,
 	},
  },
 };



  parent reply	other threads:[~2014-10-23 11:00 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-23 10:51 [PATCH 0/4] Attempt to cleanup the HSW offcore bits Peter Zijlstra
2014-10-23 10:51 ` [PATCH 1/4] perf,x86: De-obfuscate " Peter Zijlstra
2014-10-23 12:16   ` Borislav Petkov
2014-10-23 13:13     ` Peter Zijlstra
2014-10-23 10:51 ` [PATCH 2/4] perf,x86: HSW offcore prefetch events Peter Zijlstra
2014-10-23 10:51 ` Peter Zijlstra [this message]
2014-10-23 10:51 ` [PATCH 4/4] perf,x86: Introduce HSW cache numa events Peter Zijlstra
2014-10-27 12:23 ` [PATCH 0/4] Attempt to cleanup the HSW offcore bits Andi Kleen
2014-10-27 13:07   ` Peter Zijlstra
2014-10-27 14:28     ` Andi Kleen
2014-10-27 14:48       ` Peter Zijlstra
2014-10-28 21:53       ` Thomas Gleixner
2014-10-29 11:00         ` Ingo Molnar

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=20141023105658.236729829@infradead.org \
    --to=peterz@infradead.org \
    --cc=acme@kernel.org \
    --cc=ak@linux.intel.com \
    --cc=andi@firstfloor.org \
    --cc=dzickus@redhat.com \
    --cc=eranian@google.com \
    --cc=jmario@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=tglx@linutronix.de \
    /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

Powered by JetHome