linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dave Hansen <dave@sr71.net>
To: linux-kernel@vger.kernel.org
Cc: x86@kernel.org, jacob.jun.pan@intel.com,
	Dave Hansen <dave@sr71.net>,
	dave.hansen@linux.intel.com, rafael.j.wysocki@intel.com,
	lenb@kernel.org, linux-pm@vger.kernel.org
Subject: [PATCH 04/20] x86, intel_idle: use Intel family macros for intel_idle
Date: Thu, 02 Jun 2016 17:19:32 -0700	[thread overview]
Message-ID: <20160603001932.EE978EB9@viggo.jf.intel.com> (raw)
In-Reply-To: <20160603001927.F2A7D828@viggo.jf.intel.com>


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

Use the new INTEL_FAM6_* macros for intel_idle.c.  Also fix up
some of the macros to be consistent with how some of the
intel_idle code refers to the model.

There's on oddity here: model 0x1F is uniquely referred to here
and nowhere else that I could find.  0x1E/0x1F are just spelled
out as "Intel Core i7 and i5 Processors" in the SDM or as "Intel
processors based on the Nehalem, Westmere microarchitectures" in
the RDPMC section.  Comments between tables 19-19 and 19-20 in
the SDM seem to point to 0x1F being some kind of Westmere, so
let's call it "WESTMERE2".

Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com>
Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Cc: Len Brown <lenb@kernel.org>
Cc: linux-pm@vger.kernel.org
---

 b/arch/x86/include/asm/intel-family.h |    8 ++-
 b/drivers/idle/intel_idle.c           |   71 +++++++++++++++++-----------------
 2 files changed, 42 insertions(+), 37 deletions(-)

diff -puN arch/x86/include/asm/intel-family.h~x86-intel-familites-intelidle arch/x86/include/asm/intel-family.h
--- a/arch/x86/include/asm/intel-family.h~x86-intel-familites-intelidle	2016-06-02 15:20:30.210490378 -0700
+++ b/arch/x86/include/asm/intel-family.h	2016-06-02 15:23:52.474698344 -0700
@@ -6,6 +6,9 @@
  *
  * The "_X" parts are generally the EP and EX Xeons, or the
  * "Extreme" ones, like Broadwell-E.
+ *
+ * Things ending in "2" are usually because we have no better
+ * name for them.  There's no processor called "WESTMERE2".
  */
 
 #define INTEL_FAM6_CORE_YONAH		0x0E
@@ -18,6 +21,7 @@
 #define INTEL_FAM6_NEHALEM_EP		0x1A
 #define INTEL_FAM6_NEHALEM_EX		0x2E
 #define INTEL_FAM6_WESTMERE		0x25
+#define INTEL_FAM6_WESTMERE2		0x1F
 #define INTEL_FAM6_WESTMERE_EP		0x2C
 #define INTEL_FAM6_WESTMERE_EX		0x2F
 
@@ -49,9 +53,9 @@
 #define INTEL_FAM6_ATOM_PENWELL		0x27
 #define INTEL_FAM6_ATOM_CLOVERVIEW	0x35
 #define INTEL_FAM6_ATOM_CEDARVIEW	0x36
-#define INTEL_FAM6_ATOM_SILVERMONT1	0x37
+#define INTEL_FAM6_ATOM_SILVERMONT1	0x37 /* BayTrail/BYT */
 #define INTEL_FAM6_ATOM_SILVERMONT2	0x4D /* Avaton/Rangely */
-#define INTEL_FAM6_ATOM_AIRMONT		0x4C
+#define INTEL_FAM6_ATOM_AIRMONT		0x4C /* CherryTrail */
 #define INTEL_FAM6_ATOM_GOLDMONT	0x5C
 #define INTEL_FAM6_ATOM_DENVERTON	0x5F /* Goldmont Microserver */
 
diff -puN drivers/idle/intel_idle.c~x86-intel-familites-intelidle drivers/idle/intel_idle.c
--- a/drivers/idle/intel_idle.c~x86-intel-familites-intelidle	2016-06-02 15:20:30.211490424 -0700
+++ b/drivers/idle/intel_idle.c	2016-06-02 15:21:33.410367264 -0700
@@ -62,6 +62,7 @@
 #include <linux/cpu.h>
 #include <linux/module.h>
 #include <asm/cpu_device_id.h>
+#include <asm/intel-family.h>
 #include <asm/mwait.h>
 #include <asm/msr.h>
 
@@ -1020,38 +1021,38 @@ static const struct idle_cpu idle_cpu_bx
 	{ X86_VENDOR_INTEL, 6, model, X86_FEATURE_MWAIT, (unsigned long)&cpu }
 
 static const struct x86_cpu_id intel_idle_ids[] __initconst = {
-	ICPU(0x1a, idle_cpu_nehalem),
-	ICPU(0x1e, idle_cpu_nehalem),
-	ICPU(0x1f, idle_cpu_nehalem),
-	ICPU(0x25, idle_cpu_nehalem),
-	ICPU(0x2c, idle_cpu_nehalem),
-	ICPU(0x2e, idle_cpu_nehalem),
-	ICPU(0x1c, idle_cpu_atom),
-	ICPU(0x26, idle_cpu_lincroft),
-	ICPU(0x2f, idle_cpu_nehalem),
-	ICPU(0x2a, idle_cpu_snb),
-	ICPU(0x2d, idle_cpu_snb),
-	ICPU(0x36, idle_cpu_atom),
-	ICPU(0x37, idle_cpu_byt),
-	ICPU(0x4c, idle_cpu_cht),
-	ICPU(0x3a, idle_cpu_ivb),
-	ICPU(0x3e, idle_cpu_ivt),
-	ICPU(0x3c, idle_cpu_hsw),
-	ICPU(0x3f, idle_cpu_hsw),
-	ICPU(0x45, idle_cpu_hsw),
-	ICPU(0x46, idle_cpu_hsw),
-	ICPU(0x4d, idle_cpu_avn),
-	ICPU(0x3d, idle_cpu_bdw),
-	ICPU(0x47, idle_cpu_bdw),
-	ICPU(0x4f, idle_cpu_bdw),
-	ICPU(0x56, idle_cpu_bdw),
-	ICPU(0x4e, idle_cpu_skl),
-	ICPU(0x5e, idle_cpu_skl),
-	ICPU(0x8e, idle_cpu_skl),
-	ICPU(0x9e, idle_cpu_skl),
-	ICPU(0x55, idle_cpu_skx),
-	ICPU(0x57, idle_cpu_knl),
-	ICPU(0x5c, idle_cpu_bxt),
+	ICPU(INTEL_FAM6_NEHALEM_EP,		idle_cpu_nehalem),
+	ICPU(INTEL_FAM6_NEHALEM,		idle_cpu_nehalem),
+	ICPU(INTEL_FAM6_WESTMERE2,		idle_cpu_nehalem),
+	ICPU(INTEL_FAM6_WESTMERE,		idle_cpu_nehalem),
+	ICPU(INTEL_FAM6_WESTMERE_EP,		idle_cpu_nehalem),
+	ICPU(INTEL_FAM6_NEHALEM_EX,		idle_cpu_nehalem),
+	ICPU(INTEL_FAM6_ATOM_PINEVIEW,		idle_cpu_atom),
+	ICPU(INTEL_FAM6_ATOM_LINCROFT,		idle_cpu_lincroft),
+	ICPU(INTEL_FAM6_WESTMERE_EX,		idle_cpu_nehalem),
+	ICPU(INTEL_FAM6_SANDYBRIDGE,		idle_cpu_snb),
+	ICPU(INTEL_FAM6_SANDYBRIDGE_X,		idle_cpu_snb),
+	ICPU(INTEL_FAM6_ATOM_CEDARVIEW,		idle_cpu_atom),
+	ICPU(INTEL_FAM6_ATOM_SILVERMONT1,	idle_cpu_byt),
+	ICPU(INTEL_FAM6_ATOM_AIRMONT,		idle_cpu_cht),
+	ICPU(INTEL_FAM6_IVYBRIDGE,		idle_cpu_ivb),
+	ICPU(INTEL_FAM6_IVYBRIDGE_X,		idle_cpu_ivt),
+	ICPU(INTEL_FAM6_HASWELL_CORE,		idle_cpu_hsw),
+	ICPU(INTEL_FAM6_HASWELL_X,		idle_cpu_hsw),
+	ICPU(INTEL_FAM6_HASWELL_ULT,		idle_cpu_hsw),
+	ICPU(INTEL_FAM6_HASWELL_GT3E,		idle_cpu_hsw),
+	ICPU(INTEL_FAM6_ATOM_SILVERMONT2,	idle_cpu_avn),
+	ICPU(INTEL_FAM6_BROADWELL_CORE,		idle_cpu_bdw),
+	ICPU(INTEL_FAM6_BROADWELL_GT3E,		idle_cpu_bdw),
+	ICPU(INTEL_FAM6_BROADWELL_X,		idle_cpu_bdw),
+	ICPU(INTEL_FAM6_BROADWELL_XEON_D,	idle_cpu_bdw),
+	ICPU(INTEL_FAM6_SKYLAKE_MOBILE,		idle_cpu_skl),
+	ICPU(INTEL_FAM6_SKYLAKE_DESKTOP,	idle_cpu_skl),
+	ICPU(INTEL_FAM6_KABYLAKE_MOBILE,	idle_cpu_skl),
+	ICPU(INTEL_FAM6_KABYLAKE_DESKTOP,	idle_cpu_skl),
+	ICPU(INTEL_FAM6_SKYLAKE_X,		idle_cpu_skx),
+	ICPU(INTEL_FAM6_XEON_PHI_KNL,		idle_cpu_knl),
+	ICPU(INTEL_FAM6_ATOM_GOLDMONT,		idle_cpu_bxt),
 	{}
 };
 MODULE_DEVICE_TABLE(x86cpu, intel_idle_ids);
@@ -1261,13 +1262,13 @@ static void intel_idle_state_table_updat
 {
 	switch (boot_cpu_data.x86_model) {
 
-	case 0x3e: /* IVT */
+	case INTEL_FAM6_IVYBRIDGE_X:
 		ivt_idle_state_table_update();
 		break;
-	case 0x5c: /* BXT */
+	case INTEL_FAM6_ATOM_GOLDMONT:
 		bxt_idle_state_table_update();
 		break;
-	case 0x5e: /* SKL-H */
+	case INTEL_FAM6_SKYLAKE_DESKTOP:
 		sklh_idle_state_table_update();
 		break;
 	}
_

  parent reply	other threads:[~2016-06-03  0:19 UTC|newest]

Thread overview: 54+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-03  0:19 [PATCH 01/20] [v2] x86, intel: Introduce macros for Intel family numbers Dave Hansen
2016-06-03  0:19 ` [PATCH 02/20] x86, perf: use Intel family macros for core perf events Dave Hansen
2016-06-08 11:00   ` [tip:perf/core] perf/x86/intel: Use " tip-bot for Dave Hansen
2016-06-08 14:09     ` Vince Weaver
2016-06-08 14:16       ` Borislav Petkov
2016-06-08 16:25       ` Ingo Molnar
2016-06-08 16:34         ` Borislav Petkov
2016-06-08 19:51           ` Stephane Eranian
2016-06-08 20:15           ` Vince Weaver
2016-06-08 20:48             ` Borislav Petkov
2016-06-03  0:19 ` [PATCH 03/20] x86, rapl: use Intel family macros for rapl Dave Hansen
2016-06-08 11:01   ` [tip:perf/core] perf/x86/rapl: Use Intel family macros for RAPL tip-bot for Dave Hansen
2016-06-03  0:19 ` Dave Hansen [this message]
2016-06-08 14:14   ` [tip:x86/cpu] x86/intel_idle: Use Intel family macros for intel_idle tip-bot for Dave Hansen
2016-06-17  2:39   ` [PATCH 04/20] x86, intel_idle: use " Len Brown
2016-06-03  0:19 ` [PATCH 05/20] x86, msr: use Intel family macros for msr events code Dave Hansen
2016-06-08 11:01   ` [tip:perf/core] perf/x86/msr: Use Intel family macros for MSR " tip-bot for Dave Hansen
2016-06-03  0:19 ` [PATCH 06/20] x86, msr: add missing Intel models Dave Hansen
2016-06-08 11:02   ` [tip:perf/core] perf/x86/msr: Add " tip-bot for Dave Hansen
2016-06-03  0:19 ` [PATCH 07/20] x86, intel: use Intel model macros intead of open-coding Dave Hansen
2016-06-08 14:13   ` [tip:x86/cpu] x86, powercap, rapl: Use " tip-bot for Dave Hansen
2016-06-03  0:19 ` [PATCH 08/20] x86, rapl: reorder cpu detection table Dave Hansen
2016-06-08 14:13   ` [tip:x86/cpu] x86, powercap, rapl: Reorder CPU " tip-bot for Dave Hansen
2016-06-03  0:19 ` [PATCH 09/20] x86, platform: use new Intel model number macros Dave Hansen
2016-06-08 14:15   ` [tip:x86/cpu] x86/platform: Use " tip-bot for Dave Hansen
2016-06-03  0:19 ` [PATCH 10/20] x86, cstate: use Intel Model name macros Dave Hansen
2016-06-08 11:02   ` [tip:perf/core] perf/x86/cstate: Use " tip-bot for Dave Hansen
2016-06-03  0:19 ` [PATCH 11/20] x86, uncore: use Intel family name macros for uncore Dave Hansen
2016-06-08 11:03   ` [tip:perf/core] perf/x86/uncore: Use " tip-bot for Dave Hansen
2016-06-03  0:19 ` [PATCH 12/20] x86, edac: use Intel family name macros for edac driver Dave Hansen
2016-06-03  0:19 ` [PATCH 13/20] x86, cpufreq: use Intel family name macros for intel_pstate cpufreq driver Dave Hansen
2016-06-08 14:15   ` [tip:x86/cpu] x86/cpufreq: Use Intel family name macros for the " tip-bot for Dave Hansen
2016-06-03  0:19 ` [PATCH 14/20] x86, acpi, lss: use Intel family name macros for lpss driver Dave Hansen
2016-06-08 14:16   ` [tip:x86/cpu] x86/acpi/lss: Use Intel family name macros for the acpi_lpss driver tip-bot for Dave Hansen
2016-06-03  0:19 ` [PATCH 15/20] x86, intel_telemetry: use Intel family name macros for telemetry driver Dave Hansen
2016-06-08 14:16   ` [tip:x86/cpu] x86/intel_telemetry: Use " tip-bot for Dave Hansen
2016-06-03  0:19 ` [PATCH 16/20] x86, pmc_core: use Intel family name macros for pmc_core driver Dave Hansen
2016-06-08 14:12   ` [tip:perf/core] x86/pmc_core: Use " tip-bot for Dave Hansen
2016-06-03  0:19 ` [PATCH 17/20] x86, mmc: use Intel family name macros for mmc driver Dave Hansen
2016-06-08 14:16   ` [tip:x86/cpu] x86, mmc: Use " tip-bot for Dave Hansen
2016-06-03  0:19 ` [PATCH 18/20] x86, thermal: clean up and fix cpu model detection for intel_soc_dts_thermal Dave Hansen
2016-06-08 14:17   ` [tip:x86/cpu] x86, thermal: Clean up and fix CPU " tip-bot for Dave Hansen
2016-06-03  0:19 ` [PATCH 19/20] x86, rapl: add Skylake server model detection Dave Hansen
2016-06-08 11:03   ` [tip:perf/core] perf/x86/rapl: Add " tip-bot for Jacob Pan
2016-06-08 14:12     ` Vince Weaver
2016-06-10 12:35       ` Jacob Pan
2016-06-10 15:46         ` Dave Hansen
2016-06-03  0:19 ` [PATCH 20/20] x86, powercap, rapl: add Skylake Server model number Dave Hansen
2016-06-08 14:14   ` [tip:x86/cpu] x86, powercap, rapl: Add " tip-bot for Dave Hansen
2016-06-03  0:38 ` [PATCH 01/20] [v2] x86, intel: Introduce macros for Intel family numbers Rafael J. Wysocki
2016-06-08  9:56 ` [tip:x86/urgent] x86/cpu/intel: " tip-bot for Dave Hansen
2016-06-08 10:03 ` tip-bot for Dave Hansen
2016-06-08 11:01 ` [PATCH 01/20] [v2] x86, intel: " Ingo Molnar
  -- strict thread matches above, loose matches on Subject: below --
2016-06-02  0:11 [PATCH 01/20] " Dave Hansen
2016-06-02  0:12 ` [PATCH 04/20] x86, intel_idle: use Intel family macros for intel_idle Dave Hansen

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=20160603001932.EE978EB9@viggo.jf.intel.com \
    --to=dave@sr71.net \
    --cc=dave.hansen@linux.intel.com \
    --cc=jacob.jun.pan@intel.com \
    --cc=lenb@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=rafael.j.wysocki@intel.com \
    --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;
as well as URLs for NNTP newsgroup(s).