public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Dave Hansen <dave@sr71.net>
To: linux-kernel@vger.kernel.org
Cc: x86@kernel.org, Dave Hansen <dave@sr71.net>,
	dave.hansen@linux.intel.com, luto@kernel.org,
	peterz@infradead.org
Subject: [PATCH 5/5] x86, msr: use Intel family macros for msr events code
Date: Wed, 01 Jun 2016 10:34:46 -0700	[thread overview]
Message-ID: <20160601173446.5A0B30CB@viggo.jf.intel.com> (raw)
In-Reply-To: <20160601173440.4BF4BE10@viggo.jf.intel.com>


From: Dave Hansen <dave.hansen@linux.intel.com>

Use the new INTEL_FAM6_MODEL_* macros for arch/x86/events/msr.c.

This code appears to be missing handling for "WESTMERE2" and
"SKYLAKE_X".

Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
---

 b/arch/x86/events/msr.c |   59 ++++++++++++++++++++++++------------------------
 1 file changed, 30 insertions(+), 29 deletions(-)

diff -puN arch/x86/events/msr.c~x86-intel-familites-msr arch/x86/events/msr.c
--- a/arch/x86/events/msr.c~x86-intel-familites-msr	2016-06-01 10:20:12.546391511 -0700
+++ b/arch/x86/events/msr.c	2016-06-01 10:20:12.550391692 -0700
@@ -1,4 +1,5 @@
 #include <linux/perf_event.h>
+#include <asm/intel-family.h>
 
 enum perf_msr_id {
 	PERF_MSR_TSC			= 0,
@@ -34,39 +35,39 @@ static bool test_intel(int idx)
 		return false;
 
 	switch (boot_cpu_data.x86_model) {
-	case 30: /* 45nm Nehalem    */
-	case 26: /* 45nm Nehalem-EP */
-	case 46: /* 45nm Nehalem-EX */
-
-	case 37: /* 32nm Westmere    */
-	case 44: /* 32nm Westmere-EP */
-	case 47: /* 32nm Westmere-EX */
-
-	case 42: /* 32nm SandyBridge         */
-	case 45: /* 32nm SandyBridge-E/EN/EP */
-
-	case 58: /* 22nm IvyBridge       */
-	case 62: /* 22nm IvyBridge-EP/EX */
-
-	case 60: /* 22nm Haswell Core */
-	case 63: /* 22nm Haswell Server */
-	case 69: /* 22nm Haswell ULT */
-	case 70: /* 22nm Haswell + GT3e (Intel Iris Pro graphics) */
-
-	case 61: /* 14nm Broadwell Core-M */
-	case 86: /* 14nm Broadwell Xeon D */
-	case 71: /* 14nm Broadwell + GT3e (Intel Iris Pro graphics) */
-	case 79: /* 14nm Broadwell Server */
-
-	case 55: /* 22nm Atom "Silvermont"                */
-	case 77: /* 22nm Atom "Silvermont Avoton/Rangely" */
-	case 76: /* 14nm Atom "Airmont"                   */
+	case INTEL_FAM6_MODEL_NEHALEM:
+	case INTEL_FAM6_MODEL_NEHALEM_EP:
+	case INTEL_FAM6_MODEL_NEHALEM_EX:
+
+	case INTEL_FAM6_MODEL_WESTMERE:
+	case INTEL_FAM6_MODEL_WESTMERE_EP:
+	case INTEL_FAM6_MODEL_WESTMERE_EX:
+
+	case INTEL_FAM6_MODEL_SANDYBRIDGE:
+	case INTEL_FAM6_MODEL_SANDYBRIDGE_X:
+
+	case INTEL_FAM6_MODEL_IVYBRIDGE:
+	case INTEL_FAM6_MODEL_IVYBRIDGE_X:
+
+	case INTEL_FAM6_MODEL_HASWELL_CORE:
+	case INTEL_FAM6_MODEL_HASWELL_X:
+	case INTEL_FAM6_MODEL_HASWELL_ULT:
+	case INTEL_FAM6_MODEL_HASWELL_GT3E:
+
+	case INTEL_FAM6_MODEL_BROADWELL_CORE_M:
+	case INTEL_FAM6_MODEL_BROADWELL_XEON_D:
+	case INTEL_FAM6_MODEL_BROADWELL_GT3E:
+	case INTEL_FAM6_MODEL_BROADWELL_X:
+
+	case INTEL_FAM6_MODEL_ATOM_SILVERMONT1:
+	case INTEL_FAM6_MODEL_ATOM_SILVERMONT2:
+	case INTEL_FAM6_MODEL_ATOM_AIRMONT:
 		if (idx == PERF_MSR_SMI)
 			return true;
 		break;
 
-	case 78: /* 14nm Skylake Mobile */
-	case 94: /* 14nm Skylake Desktop */
+	case INTEL_FAM6_MODEL_SKYLAKE_MOBILE:
+	case INTEL_FAM6_MODEL_SKYLAKE_DESKTOP:
 		if (idx == PERF_MSR_SMI || idx == PERF_MSR_PPERF)
 			return true;
 		break;
_

      parent reply	other threads:[~2016-06-01 17:34 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-01 17:34 [PATCH 1/5] x86, intel: Introduce macros for Intel family numbers Dave Hansen
2016-06-01 17:34 ` [PATCH 2/5] x86, perf: use Intel family macros for core perf events Dave Hansen
2016-06-01 17:46   ` Peter Zijlstra
2016-06-01 17:34 ` [PATCH 3/5] x86, rapl: use Intel family macros for rapl Dave Hansen
2016-06-01 17:34 ` [PATCH 4/5] x86, intel_idle: use Intel family macros for intel_idle Dave Hansen
2016-06-01 17:34 ` Dave Hansen [this message]

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=20160601173446.5A0B30CB@viggo.jf.intel.com \
    --to=dave@sr71.net \
    --cc=dave.hansen@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@kernel.org \
    --cc=peterz@infradead.org \
    --cc=x86@kernel.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