All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: LKML <linux-kernel@vger.kernel.org>
Cc: x86@kernel.org, Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Mark Gross <mgross@linux.intel.com>,
	Tony Luck <tony.luck@intel.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Darren Hart <dvhart@infradead.org>,
	Andy Shevchenko <andy@infradead.org>,
	"Rafael J. Wysocki" <rjw@rjwysocki.net>,
	Len Brown <lenb@kernel.org>,
	linux-acpi@vger.kernel.org,
	Viresh Kumar <viresh.kumar@linaro.org>,
	linux-pm@vger.kernel.org,
	Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>,
	linux-edac@vger.kernel.org, platform-driver-x86@vger.kernel.org,
	Jean Delvare <jdelvare@suse.com>,
	Guenter Roeck <linux@roeck-us.net>,
	linux-hwmon@vger.kernel.org, Zhang Rui <rui.zhang@intel.com>,
	Daniel Lezcano <daniel.lezcano@linaro.org>,
	Amit Kucheria <amit.kucheria@verdurent.com>,
	Chanwoo Choi <cw00.choi@samsung.com>,
	Jacob Pan <jacob.jun.pan@linux.intel.com>,
	Adrian Hunter <adrian.hunter@intel.com>,
	Ulf Hansson <ulf.hansson@linaro.org>,
	linux-mmc@vger.kernel.org, Bjorn Helgaas <bhelgaas@google.com>,
	linux-pci@vger.kernel.org, Takashi Iwai <tiwai@suse.com>,
	alsa-devel@alsa-project.org,
	Herbert Xu <herbert@gondor.apana.org.au>,
	"David S. Miller" <davem@davemloft.net>,
	linux-crypto@vger.kernel.org
Subject: [patch 02/22] x86/cpu: Add conistent CPU match macros
Date: Fri, 20 Mar 2020 14:13:47 +0100	[thread overview]
Message-ID: <20200320131508.826011988@linutronix.de> (raw)
In-Reply-To: 20200320131345.635023594@linutronix.de

Finding all places which build x86_cpu_id match tables is tedious and the
logic is hidden in lots of differently named macro wrappers.

Most of these initializer macros use plain C89 initializers which rely on
the ordering of the struct members. So new members could only be added at
the end of the struct, but that's ugly as hell and C99 initializers are
really the right thing to use.

Provide a set of macros which:

  - Have a proper naming scheme, starting with X86_MATCH_

  - Use C99 initializers

The set of provided macros are all subsets of the base macro

    X86_MATCH_VENDOR_FAM_MODEL_FEATURE()

which allows to supply all possible selection criteria:

      vendor, family, model, feature

The other macros shorten this to avoid typing all arguments when they are
not needed and would require one of the _ANY constants. They have been
created due to the requirements of the existing usage sites.

Also a add a few model constants for Centaur CPUs and QUARK.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
 arch/x86/include/asm/cpu_device_id.h |  140 ++++++++++++++++++++++++++++++++---
 arch/x86/include/asm/intel-family.h  |    6 +
 arch/x86/kernel/cpu/match.c          |   13 ++-
 3 files changed, 146 insertions(+), 13 deletions(-)

--- a/arch/x86/include/asm/cpu_device_id.h
+++ b/arch/x86/include/asm/cpu_device_id.h
@@ -5,21 +5,143 @@
 /*
  * Declare drivers belonging to specific x86 CPUs
  * Similar in spirit to pci_device_id and related PCI functions
- */
-#include <linux/mod_devicetable.h>
-
-/*
+ *
  * The wildcard initializers are in mod_devicetable.h because
  * file2alias needs them. Sigh.
  */
+#include <linux/mod_devicetable.h>
+/* Get the INTEL_FAM* model defines */
+#include <asm/intel-family.h>
+/* And the X86_VENDOR_* ones */
+#include <asm/processor.h>
 
-#define X86_FEATURE_MATCH(x) {			\
-	.vendor		= X86_VENDOR_ANY,	\
-	.family		= X86_FAMILY_ANY,	\
-	.model		= X86_MODEL_ANY,	\
-	.feature	= x,			\
+/* Centaur FAM6 models */
+#define X86_CENTAUR_FAM6_C7_A		0xa
+#define X86_CENTAUR_FAM6_C7_D		0xd
+#define X86_CENTAUR_FAM6_NANO		0xf
+
+/**
+ * X86_MATCH_VENDOR_FAM_MODEL_FEATURE - Base macro for CPU matching
+ * @_vendor:	The vendor name, e.g. INTEL, AMD, HYGON, ..., ANY
+ *		The name is expanded to X86_VENDOR_@_vendor
+ * @_family:	The family number or X86_FAMILY_ANY
+ * @_model:	The model number, model constant or X86_MODEL_ANY
+ * @_feature:	A X86_FEATURE bit or X86_FEATURE_ANY
+ * @_data:	Driver specific data or NULL. The internal storage
+ *		format is unsigned long. The supplied value, pointer
+ *		etc. is casted to unsigned long internally.
+ *
+ * Use only if you need all selectors. Otherwise use one of the shorter
+ * macros of the X86_MATCH_* family. If there is no matching shorthand
+ * macro, consider to add one. If you really need to wrap one of the macros
+ * into another macro at the usage site for good reasons, then please
+ * start this local macro with X86_MATCH to allow easy grepping.
+ */
+#define X86_MATCH_VENDOR_FAM_MODEL_FEATURE(_vendor, _family, _model,	\
+					   _feature, _data) {		\
+	.vendor		= X86_VENDOR_##_vendor,				\
+	.family		= _family,					\
+	.model		= _model,					\
+	.feature	= _feature,					\
+	.driver_data	= (unsigned long) _data				\
 }
 
+/**
+ * X86_MATCH_VENDOR_FAM_FEATURE - Macro for matching vendor, family and CPU feature
+ * @vendor:	The vendor name, e.g. INTEL, AMD, HYGON, ..., ANY
+ *		The name is expanded to X86_VENDOR_@vendor
+ * @family:	The family number or X86_FAMILY_ANY
+ * @feature:	A X86_FEATURE bit
+ * @data:	Driver specific data or NULL. The internal storage
+ *		format is unsigned long. The supplied value, pointer
+ *		etc. is casted to unsigned long internally.
+ *
+ * All other missing arguments of X86_MATCH_VENDOR_FAM_MODEL_FEATURE() are
+ * set to wildcards.
+ */
+#define X86_MATCH_VENDOR_FAM_FEATURE(vendor, family, feature, data)	\
+	X86_MATCH_VENDOR_FAM_MODEL_FEATURE(vendor, family,		\
+					   X86_MODEL_ANY, feature, data)
+
+/**
+ * X86_MATCH_VENDOR_FEATURE - Macro for matching vendor and CPU feature
+ * @vendor:	The vendor name, e.g. INTEL, AMD, HYGON, ..., ANY
+ *		The name is expanded to X86_VENDOR_@vendor
+ * @feature:	A X86_FEATURE bit
+ * @data:	Driver specific data or NULL. The internal storage
+ *		format is unsigned long. The supplied value, pointer
+ *		etc. is casted to unsigned long internally.
+ *
+ * All other missing arguments of X86_MATCH_VENDOR_FAM_MODEL_FEATURE() are
+ * set to wildcards.
+ */
+#define X86_MATCH_VENDOR_FEATURE(vendor, feature, data)			\
+	X86_MATCH_VENDOR_FAM_FEATURE(vendor, X86_FAMILY_ANY, feature, data)
+
+/**
+ * X86_MATCH_FEATURE - Macro for matching a CPU feature
+ * @feature:	A X86_FEATURE bit
+ * @data:	Driver specific data or NULL. The internal storage
+ *		format is unsigned long. The supplied value, pointer
+ *		etc. is casted to unsigned long internally.
+ *
+ * All other missing arguments of X86_MATCH_VENDOR_FAM_MODEL_FEATURE() are
+ * set to wildcards.
+ */
+#define X86_MATCH_FEATURE(feature, data)				\
+	X86_MATCH_VENDOR_FEATURE(ANY, feature, data)
+
+/* Transitional to keep the existing code working */
+#define X86_FEATURE_MATCH(feature)	X86_MATCH_FEATURE(feature, NULL)
+
+/**
+ * X86_MATCH_VENDOR_FAM_MODEL - Match vendor, family and model
+ * @vendor:	The vendor name, e.g. INTEL, AMD, HYGON, ..., ANY
+ *		The name is expanded to X86_VENDOR_@vendor
+ * @family:	The family number or X86_FAMILY_ANY
+ * @model:	The model number, model constant or X86_MODEL_ANY
+ * @data:	Driver specific data or NULL. The internal storage
+ *		format is unsigned long. The supplied value, pointer
+ *		etc. is casted to unsigned long internally.
+ *
+ * All other missing arguments of X86_MATCH_VENDOR_FAM_MODEL_FEATURE() are
+ * set to wildcards.
+ */
+#define X86_MATCH_VENDOR_FAM_MODEL(vendor, family, model, data)		\
+	X86_MATCH_VENDOR_FAM_MODEL_FEATURE(vendor, family, model,	\
+					   X86_FEATURE_ANY, data)
+
+/**
+ * X86_MATCH_VENDOR_FAM - Match vendor and family
+ * @vendor:	The vendor name, e.g. INTEL, AMD, HYGON, ..., ANY
+ *		The name is expanded to X86_VENDOR_@vendor
+ * @family:	The family number or X86_FAMILY_ANY
+ * @data:	Driver specific data or NULL. The internal storage
+ *		format is unsigned long. The supplied value, pointer
+ *		etc. is casted to unsigned long internally.
+ *
+ * All other missing arguments to X86_MATCH_VENDOR_FAM_MODEL_FEATURE() are
+ * set of wildcards.
+ */
+#define X86_MATCH_VENDOR_FAM(vendor, family, data)			\
+	X86_MATCH_VENDOR_FAM_MODEL(vendor, family, X86_MODEL_ANY, data)
+
+/**
+ * X86_MATCH_INTEL_FAM6_MODEL - Match vendor INTEL, family 6 and model
+ * @model:	The model name without the INTEL_FAM6_ prefix or ANY
+ *		The model name is expanded to INTEL_FAM6_@model internally
+ * @data:	Driver specific data or NULL. The internal storage
+ *		format is unsigned long. The supplied value, pointer
+ *		etc. is casted to unsigned long internally.
+ *
+ * The vendor is set to INTEL, the family to 6 and all other missing
+ * arguments of X86_MATCH_VENDOR_FAM_MODEL_FEATURE() are set to wildcards.
+ *
+ * See X86_MATCH_VENDOR_FAM_MODEL_FEATURE() for further information.
+ */
+#define X86_MATCH_INTEL_FAM6_MODEL(model, data)				\
+	X86_MATCH_VENDOR_FAM_MODEL(INTEL, 6, INTEL_FAM6_##model, data)
+
 /*
  * Match specific microcode revisions.
  *
--- a/arch/x86/include/asm/intel-family.h
+++ b/arch/x86/include/asm/intel-family.h
@@ -35,6 +35,9 @@
  * The #define line may optionally include a comment including platform names.
  */
 
+/* Wildcard match for FAM6 so X86_MATCH_INTEL_FAM6_MODEL(ANY) works */
+#define INTEL_FAM6_ANY			X86_MODEL_ANY
+
 #define INTEL_FAM6_CORE_YONAH		0x0E
 
 #define INTEL_FAM6_CORE2_MEROM		0x0F
@@ -118,6 +121,9 @@
 #define INTEL_FAM6_XEON_PHI_KNL		0x57 /* Knights Landing */
 #define INTEL_FAM6_XEON_PHI_KNM		0x85 /* Knights Mill */
 
+/* Family 5 */
+#define INTEL_FAM5_QUARK_X1000		0x09 /* Quark X1000 SoC */
+
 /* Useful macros */
 #define INTEL_CPU_FAM_ANY(_family, _model, _driver_data)	\
 {								\
--- a/arch/x86/kernel/cpu/match.c
+++ b/arch/x86/kernel/cpu/match.c
@@ -16,12 +16,17 @@
  * respective wildcard entries.
  *
  * A typical table entry would be to match a specific CPU
- * { X86_VENDOR_INTEL, 6, 0x12 }
- * or to match a specific CPU feature
- * { X86_FEATURE_MATCH(X86_FEATURE_FOOBAR) }
+ *
+ * X86_MATCH_VENDOR_FAM_MODEL_FEATURE(INTEL, 6, INTEL_FAM6_BROADWELL,
+ *				      X86_FEATURE_ANY, NULL);
  *
  * Fields can be wildcarded with %X86_VENDOR_ANY, %X86_FAMILY_ANY,
- * %X86_MODEL_ANY, %X86_FEATURE_ANY or 0 (except for vendor)
+ * %X86_MODEL_ANY, %X86_FEATURE_ANY (except for vendor)
+ *
+ * asm/cpu_device_id.h contains a set of useful macros which are shortcuts
+ * for various common selections. The above can be shortened to:
+ *
+ * X86_MATCH_INTEL_FAM6_MODEL(BROADWELL, NULL);
  *
  * Arrays used to match for this should also be declared using
  * MODULE_DEVICE_TABLE(x86cpu, ...)


WARNING: multiple messages have this Message-ID (diff)
From: Thomas Gleixner <tglx@linutronix.de>
To: LKML <linux-kernel@vger.kernel.org>
Cc: x86@kernel.org, Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Mark Gross <mgross@linux.intel.com>,
	Tony Luck <tony.luck@intel.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Darren Hart <dvhart@infradead.org>,
	Andy Shevchenko <andy@infradead.org>,
	"Rafael J. Wysocki" <rjw@rjwysocki.net>,
	Len Brown <lenb@kernel.org>,
	linux-acpi@vger.kernel.org,
	Viresh Kumar <viresh.kumar@linaro.org>,
	linux-pm@vger.kernel.org,
	Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>,
	linux-edac@vger.kernel.org, platform-driver-x86@vger.kernel.org,
	Jean Delvare <jdelvare@suse.com>,
	Guenter Roeck <linux@roeck-us.net>,
	linux-hwmon@vger.kernel.org, Zhang Rui <rui.zhang@intel.com>,
	Daniel Lezcano <daniel.lezcano@linaro.org>,
	Amit Kucheria <amit.kucheria@verdurent.com>,
	Chanw
Subject: [patch 02/22] x86/cpu: Add conistent CPU match macros
Date: Fri, 20 Mar 2020 14:13:47 +0100	[thread overview]
Message-ID: <20200320131508.826011988@linutronix.de> (raw)
In-Reply-To: 20200320131345.635023594@linutronix.de

Finding all places which build x86_cpu_id match tables is tedious and the
logic is hidden in lots of differently named macro wrappers.

Most of these initializer macros use plain C89 initializers which rely on
the ordering of the struct members. So new members could only be added at
the end of the struct, but that's ugly as hell and C99 initializers are
really the right thing to use.

Provide a set of macros which:

  - Have a proper naming scheme, starting with X86_MATCH_

  - Use C99 initializers

The set of provided macros are all subsets of the base macro

    X86_MATCH_VENDOR_FAM_MODEL_FEATURE()

which allows to supply all possible selection criteria:

      vendor, family, model, feature

The other macros shorten this to avoid typing all arguments when they are
not needed and would require one of the _ANY constants. They have been
created due to the requirements of the existing usage sites.

Also a add a few model constants for Centaur CPUs and QUARK.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
 arch/x86/include/asm/cpu_device_id.h |  140 ++++++++++++++++++++++++++++++++---
 arch/x86/include/asm/intel-family.h  |    6 +
 arch/x86/kernel/cpu/match.c          |   13 ++-
 3 files changed, 146 insertions(+), 13 deletions(-)

--- a/arch/x86/include/asm/cpu_device_id.h
+++ b/arch/x86/include/asm/cpu_device_id.h
@@ -5,21 +5,143 @@
 /*
  * Declare drivers belonging to specific x86 CPUs
  * Similar in spirit to pci_device_id and related PCI functions
- */
-#include <linux/mod_devicetable.h>
-
-/*
+ *
  * The wildcard initializers are in mod_devicetable.h because
  * file2alias needs them. Sigh.
  */
+#include <linux/mod_devicetable.h>
+/* Get the INTEL_FAM* model defines */
+#include <asm/intel-family.h>
+/* And the X86_VENDOR_* ones */
+#include <asm/processor.h>
 
-#define X86_FEATURE_MATCH(x) {			\
-	.vendor		= X86_VENDOR_ANY,	\
-	.family		= X86_FAMILY_ANY,	\
-	.model		= X86_MODEL_ANY,	\
-	.feature	= x,			\
+/* Centaur FAM6 models */
+#define X86_CENTAUR_FAM6_C7_A		0xa
+#define X86_CENTAUR_FAM6_C7_D		0xd
+#define X86_CENTAUR_FAM6_NANO		0xf
+
+/**
+ * X86_MATCH_VENDOR_FAM_MODEL_FEATURE - Base macro for CPU matching
+ * @_vendor:	The vendor name, e.g. INTEL, AMD, HYGON, ..., ANY
+ *		The name is expanded to X86_VENDOR_@_vendor
+ * @_family:	The family number or X86_FAMILY_ANY
+ * @_model:	The model number, model constant or X86_MODEL_ANY
+ * @_feature:	A X86_FEATURE bit or X86_FEATURE_ANY
+ * @_data:	Driver specific data or NULL. The internal storage
+ *		format is unsigned long. The supplied value, pointer
+ *		etc. is casted to unsigned long internally.
+ *
+ * Use only if you need all selectors. Otherwise use one of the shorter
+ * macros of the X86_MATCH_* family. If there is no matching shorthand
+ * macro, consider to add one. If you really need to wrap one of the macros
+ * into another macro at the usage site for good reasons, then please
+ * start this local macro with X86_MATCH to allow easy grepping.
+ */
+#define X86_MATCH_VENDOR_FAM_MODEL_FEATURE(_vendor, _family, _model,	\
+					   _feature, _data) {		\
+	.vendor		= X86_VENDOR_##_vendor,				\
+	.family		= _family,					\
+	.model		= _model,					\
+	.feature	= _feature,					\
+	.driver_data	= (unsigned long) _data				\
 }
 
+/**
+ * X86_MATCH_VENDOR_FAM_FEATURE - Macro for matching vendor, family and CPU feature
+ * @vendor:	The vendor name, e.g. INTEL, AMD, HYGON, ..., ANY
+ *		The name is expanded to X86_VENDOR_@vendor
+ * @family:	The family number or X86_FAMILY_ANY
+ * @feature:	A X86_FEATURE bit
+ * @data:	Driver specific data or NULL. The internal storage
+ *		format is unsigned long. The supplied value, pointer
+ *		etc. is casted to unsigned long internally.
+ *
+ * All other missing arguments of X86_MATCH_VENDOR_FAM_MODEL_FEATURE() are
+ * set to wildcards.
+ */
+#define X86_MATCH_VENDOR_FAM_FEATURE(vendor, family, feature, data)	\
+	X86_MATCH_VENDOR_FAM_MODEL_FEATURE(vendor, family,		\
+					   X86_MODEL_ANY, feature, data)
+
+/**
+ * X86_MATCH_VENDOR_FEATURE - Macro for matching vendor and CPU feature
+ * @vendor:	The vendor name, e.g. INTEL, AMD, HYGON, ..., ANY
+ *		The name is expanded to X86_VENDOR_@vendor
+ * @feature:	A X86_FEATURE bit
+ * @data:	Driver specific data or NULL. The internal storage
+ *		format is unsigned long. The supplied value, pointer
+ *		etc. is casted to unsigned long internally.
+ *
+ * All other missing arguments of X86_MATCH_VENDOR_FAM_MODEL_FEATURE() are
+ * set to wildcards.
+ */
+#define X86_MATCH_VENDOR_FEATURE(vendor, feature, data)			\
+	X86_MATCH_VENDOR_FAM_FEATURE(vendor, X86_FAMILY_ANY, feature, data)
+
+/**
+ * X86_MATCH_FEATURE - Macro for matching a CPU feature
+ * @feature:	A X86_FEATURE bit
+ * @data:	Driver specific data or NULL. The internal storage
+ *		format is unsigned long. The supplied value, pointer
+ *		etc. is casted to unsigned long internally.
+ *
+ * All other missing arguments of X86_MATCH_VENDOR_FAM_MODEL_FEATURE() are
+ * set to wildcards.
+ */
+#define X86_MATCH_FEATURE(feature, data)				\
+	X86_MATCH_VENDOR_FEATURE(ANY, feature, data)
+
+/* Transitional to keep the existing code working */
+#define X86_FEATURE_MATCH(feature)	X86_MATCH_FEATURE(feature, NULL)
+
+/**
+ * X86_MATCH_VENDOR_FAM_MODEL - Match vendor, family and model
+ * @vendor:	The vendor name, e.g. INTEL, AMD, HYGON, ..., ANY
+ *		The name is expanded to X86_VENDOR_@vendor
+ * @family:	The family number or X86_FAMILY_ANY
+ * @model:	The model number, model constant or X86_MODEL_ANY
+ * @data:	Driver specific data or NULL. The internal storage
+ *		format is unsigned long. The supplied value, pointer
+ *		etc. is casted to unsigned long internally.
+ *
+ * All other missing arguments of X86_MATCH_VENDOR_FAM_MODEL_FEATURE() are
+ * set to wildcards.
+ */
+#define X86_MATCH_VENDOR_FAM_MODEL(vendor, family, model, data)		\
+	X86_MATCH_VENDOR_FAM_MODEL_FEATURE(vendor, family, model,	\
+					   X86_FEATURE_ANY, data)
+
+/**
+ * X86_MATCH_VENDOR_FAM - Match vendor and family
+ * @vendor:	The vendor name, e.g. INTEL, AMD, HYGON, ..., ANY
+ *		The name is expanded to X86_VENDOR_@vendor
+ * @family:	The family number or X86_FAMILY_ANY
+ * @data:	Driver specific data or NULL. The internal storage
+ *		format is unsigned long. The supplied value, pointer
+ *		etc. is casted to unsigned long internally.
+ *
+ * All other missing arguments to X86_MATCH_VENDOR_FAM_MODEL_FEATURE() are
+ * set of wildcards.
+ */
+#define X86_MATCH_VENDOR_FAM(vendor, family, data)			\
+	X86_MATCH_VENDOR_FAM_MODEL(vendor, family, X86_MODEL_ANY, data)
+
+/**
+ * X86_MATCH_INTEL_FAM6_MODEL - Match vendor INTEL, family 6 and model
+ * @model:	The model name without the INTEL_FAM6_ prefix or ANY
+ *		The model name is expanded to INTEL_FAM6_@model internally
+ * @data:	Driver specific data or NULL. The internal storage
+ *		format is unsigned long. The supplied value, pointer
+ *		etc. is casted to unsigned long internally.
+ *
+ * The vendor is set to INTEL, the family to 6 and all other missing
+ * arguments of X86_MATCH_VENDOR_FAM_MODEL_FEATURE() are set to wildcards.
+ *
+ * See X86_MATCH_VENDOR_FAM_MODEL_FEATURE() for further information.
+ */
+#define X86_MATCH_INTEL_FAM6_MODEL(model, data)				\
+	X86_MATCH_VENDOR_FAM_MODEL(INTEL, 6, INTEL_FAM6_##model, data)
+
 /*
  * Match specific microcode revisions.
  *
--- a/arch/x86/include/asm/intel-family.h
+++ b/arch/x86/include/asm/intel-family.h
@@ -35,6 +35,9 @@
  * The #define line may optionally include a comment including platform names.
  */
 
+/* Wildcard match for FAM6 so X86_MATCH_INTEL_FAM6_MODEL(ANY) works */
+#define INTEL_FAM6_ANY			X86_MODEL_ANY
+
 #define INTEL_FAM6_CORE_YONAH		0x0E
 
 #define INTEL_FAM6_CORE2_MEROM		0x0F
@@ -118,6 +121,9 @@
 #define INTEL_FAM6_XEON_PHI_KNL		0x57 /* Knights Landing */
 #define INTEL_FAM6_XEON_PHI_KNM		0x85 /* Knights Mill */
 
+/* Family 5 */
+#define INTEL_FAM5_QUARK_X1000		0x09 /* Quark X1000 SoC */
+
 /* Useful macros */
 #define INTEL_CPU_FAM_ANY(_family, _model, _driver_data)	\
 {								\
--- a/arch/x86/kernel/cpu/match.c
+++ b/arch/x86/kernel/cpu/match.c
@@ -16,12 +16,17 @@
  * respective wildcard entries.
  *
  * A typical table entry would be to match a specific CPU
- * { X86_VENDOR_INTEL, 6, 0x12 }
- * or to match a specific CPU feature
- * { X86_FEATURE_MATCH(X86_FEATURE_FOOBAR) }
+ *
+ * X86_MATCH_VENDOR_FAM_MODEL_FEATURE(INTEL, 6, INTEL_FAM6_BROADWELL,
+ *				      X86_FEATURE_ANY, NULL);
  *
  * Fields can be wildcarded with %X86_VENDOR_ANY, %X86_FAMILY_ANY,
- * %X86_MODEL_ANY, %X86_FEATURE_ANY or 0 (except for vendor)
+ * %X86_MODEL_ANY, %X86_FEATURE_ANY (except for vendor)
+ *
+ * asm/cpu_device_id.h contains a set of useful macros which are shortcuts
+ * for various common selections. The above can be shortened to:
+ *
+ * X86_MATCH_INTEL_FAM6_MODEL(BROADWELL, NULL);
  *
  * Arrays used to match for this should also be declared using
  * MODULE_DEVICE_TABLE(x86cpu, ...)

  parent reply	other threads:[~2020-03-20 13:17 UTC|newest]

Thread overview: 161+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-20 13:13 [patch 00/22] x86/treewide: Consolidate CPU match macro maze and get rid of C89 (sic!) initializers Thomas Gleixner
2020-03-20 13:13 ` Thomas Gleixner
2020-03-20 13:13 ` [patch 01/22] x86/devicetable: Move x86 specific macro out of generic code Thomas Gleixner
2020-03-20 13:13   ` Thomas Gleixner
2020-03-20 14:33   ` Andy Shevchenko
2020-03-20 14:33     ` Andy Shevchenko
2020-03-20 14:33     ` Andy Shevchenko
2020-03-20 20:24     ` Thomas Gleixner
2020-03-20 20:24       ` Thomas Gleixner
2020-03-20 20:24       ` Thomas Gleixner
2020-03-24 22:32   ` [tip: x86/cpu] " tip-bot2 for Thomas Gleixner
2020-03-20 13:13 ` Thomas Gleixner [this message]
2020-03-20 13:13   ` [patch 02/22] x86/cpu: Add conistent CPU match macros Thomas Gleixner
2020-03-20 14:29   ` Bjorn Helgaas
2020-03-20 14:29     ` Bjorn Helgaas
2020-03-20 14:29     ` Bjorn Helgaas
2020-03-20 14:39   ` Andy Shevchenko
2020-03-20 14:39     ` Andy Shevchenko
2020-03-20 14:39     ` Andy Shevchenko
2020-03-20 20:27     ` Thomas Gleixner
2020-03-20 20:27       ` Thomas Gleixner
2020-03-20 20:27       ` Thomas Gleixner
2020-03-24 22:32   ` [tip: x86/cpu] x86/cpu: Add consistent " tip-bot2 for Thomas Gleixner
2020-03-20 13:13 ` [patch 03/22] x86/cpu/bugs: Convert to new matching macros Thomas Gleixner
2020-03-20 13:13   ` Thomas Gleixner
2020-03-24 22:32   ` [tip: x86/cpu] " tip-bot2 for Thomas Gleixner
2020-03-20 13:13 ` [patch 04/22] x86/perf/events: Convert to new CPU match macros Thomas Gleixner
2020-03-20 13:13   ` Thomas Gleixner
2020-03-24 22:32   ` [tip: x86/cpu] " tip-bot2 for Thomas Gleixner
2020-03-20 13:13 ` [patch 05/22] x86/kvm: " Thomas Gleixner
2020-03-20 13:13   ` Thomas Gleixner
2020-03-24 22:32   ` [tip: x86/cpu] " tip-bot2 for Thomas Gleixner
2020-03-20 13:13 ` [patch 06/22] x86/kernel: " Thomas Gleixner
2020-03-20 13:13   ` Thomas Gleixner
2020-03-24 22:32   ` [tip: x86/cpu] " tip-bot2 for Thomas Gleixner
2020-03-20 13:13 ` [patch 07/22] x86/platform: " Thomas Gleixner
2020-03-20 13:13   ` Thomas Gleixner
2020-03-24 22:32   ` [tip: x86/cpu] " tip-bot2 for Thomas Gleixner
2020-03-20 13:13 ` [patch 08/22] ACPI: Convert to new X86 " Thomas Gleixner
2020-03-20 13:13   ` Thomas Gleixner
2020-03-20 14:47   ` Andy Shevchenko
2020-03-20 14:47     ` Andy Shevchenko
2020-03-20 14:47     ` Andy Shevchenko
2020-03-20 20:32     ` Thomas Gleixner
2020-03-20 20:32       ` Thomas Gleixner
2020-03-20 20:32       ` Thomas Gleixner
2020-03-23 16:38       ` mark gross
2020-03-23 16:38         ` mark gross
2020-03-23 16:38         ` mark gross
2020-03-24 22:32   ` [tip: x86/cpu] " tip-bot2 for Thomas Gleixner
2020-03-20 13:13 ` [patch 09/22] cpufreq: " Thomas Gleixner
2020-03-20 13:13   ` Thomas Gleixner
2020-03-20 14:50   ` Andy Shevchenko
2020-03-20 14:50     ` Andy Shevchenko
2020-03-20 14:50     ` Andy Shevchenko
2020-03-20 20:30     ` Thomas Gleixner
2020-03-20 20:30       ` Thomas Gleixner
2020-03-20 20:30       ` Thomas Gleixner
2020-03-20 21:52       ` Andy Shevchenko
2020-03-20 21:52         ` Andy Shevchenko
2020-03-20 21:52         ` Andy Shevchenko
2020-03-20 22:18         ` Thomas Gleixner
2020-03-20 22:18           ` Thomas Gleixner
2020-03-20 22:18           ` Thomas Gleixner
2020-03-24  6:01   ` [cpufreq] 06c4d00466: will-it-scale.per_process_ops -53.4% regression kernel test robot
2020-03-24  6:01     ` kernel test robot
2020-03-24  6:01     ` kernel test robot
2020-03-24  6:01     ` kernel test robot
2020-03-24 10:24     ` Andy Shevchenko
2020-03-24 10:24       ` Andy Shevchenko
2020-03-24 10:24       ` Andy Shevchenko
2020-03-24 10:24       ` Andy Shevchenko
2020-03-24 15:38       ` Srinivas Pandruvada
2020-03-24 15:38         ` Srinivas Pandruvada
2020-03-24 15:38         ` Srinivas Pandruvada
2020-03-24 15:38         ` Srinivas Pandruvada
2020-03-25  7:51         ` Rong Chen
2020-03-25  7:51           ` Rong Chen
2020-03-25  7:51           ` Rong Chen
2020-03-25  7:51           ` Rong Chen
2020-03-25  7:50       ` Rong Chen
2020-03-25  7:50         ` Rong Chen
2020-03-25  7:50         ` Rong Chen
2020-03-25  7:50         ` Rong Chen
2020-03-25 10:32         ` Thomas Gleixner
2020-03-25 10:32           ` Thomas Gleixner
2020-03-25 10:32           ` Thomas Gleixner
2020-03-25 10:32           ` Thomas Gleixner
2020-03-26  8:33           ` kernel test robot
2020-03-26  8:33             ` kernel test robot
2020-03-26  8:33             ` kernel test robot
2020-03-26  8:33             ` kernel test robot
2020-03-25 12:41     ` [tip: x86/cpu] cpufreq/intel_pstate: Fix wrong macro conversion tip-bot2 for Thomas Gleixner
2020-03-24 13:51   ` [patch V2 09/22] cpufreq: Convert to new X86 CPU match macros Thomas Gleixner
2020-03-24 13:51     ` Thomas Gleixner
2020-03-24 13:51     ` Thomas Gleixner
2020-03-24 15:37     ` Rafael J. Wysocki
2020-03-24 15:37       ` Rafael J. Wysocki
2020-03-24 15:37       ` Rafael J. Wysocki
2020-03-24 22:32     ` [tip: x86/cpu] " tip-bot2 for Thomas Gleixner
2020-03-20 13:13 ` [patch 10/22] EDAC: " Thomas Gleixner
2020-03-20 13:13   ` Thomas Gleixner
2020-03-24 19:31   ` Luck, Tony
2020-03-24 19:31     ` Luck, Tony
2020-03-24 19:31     ` Luck, Tony
2020-03-24 22:32   ` [tip: x86/cpu] " tip-bot2 for Thomas Gleixner
2020-03-20 13:13 ` [patch 11/22] platform/x86: Convert to new " Thomas Gleixner
2020-03-20 13:13   ` Thomas Gleixner
2020-03-20 14:52   ` Andy Shevchenko
2020-03-20 14:52     ` Andy Shevchenko
2020-03-20 14:52     ` Andy Shevchenko
2020-03-24 22:32   ` [tip: x86/cpu] " tip-bot2 for Thomas Gleixner
2020-03-20 13:13 ` [patch 12/22] hwmon: Convert to new X86 " Thomas Gleixner
2020-03-20 13:13   ` Thomas Gleixner
2020-03-24 22:32   ` [tip: x86/cpu] " tip-bot2 for Thomas Gleixner
2020-03-20 13:13 ` [patch 13/22] thermal: " Thomas Gleixner
2020-03-20 13:13   ` Thomas Gleixner
2020-03-24 22:32   ` [tip: x86/cpu] " tip-bot2 for Thomas Gleixner
2020-03-20 13:13 ` [patch 14/22] extcon: axp288: " Thomas Gleixner
2020-03-20 13:13   ` Thomas Gleixner
2020-03-24 22:32   ` [tip: x86/cpu] " tip-bot2 for Thomas Gleixner
2020-03-20 13:14 ` [patch 15/22] intel_idle: " Thomas Gleixner
2020-03-20 13:14   ` Thomas Gleixner
2020-03-24 22:32   ` [tip: x86/cpu] " tip-bot2 for Thomas Gleixner
2020-03-20 13:14 ` [patch 16/22] mmc: sdhci-acpi: " Thomas Gleixner
2020-03-20 13:14   ` Thomas Gleixner
2020-03-24 22:32   ` [tip: x86/cpu] " tip-bot2 for Thomas Gleixner
2020-03-20 13:14 ` [patch 17/22] PCI: intel-mid: " Thomas Gleixner
2020-03-20 13:14   ` Thomas Gleixner
2020-03-20 14:30   ` Bjorn Helgaas
2020-03-20 14:30     ` Bjorn Helgaas
2020-03-20 14:30     ` Bjorn Helgaas
2020-03-24 22:32   ` [tip: x86/cpu] " tip-bot2 for Thomas Gleixner
2020-03-20 13:14 ` [patch 18/22] powercap/intel_rapl: " Thomas Gleixner
2020-03-20 13:14   ` Thomas Gleixner
2020-03-24 22:32   ` [tip: x86/cpu] " tip-bot2 for Thomas Gleixner
2020-03-20 13:14 ` [patch 19/22] ASoC: Intel: " Thomas Gleixner
2020-03-20 13:14   ` Thomas Gleixner
2020-03-20 14:58   ` Andy Shevchenko
2020-03-20 14:58     ` Andy Shevchenko
2020-03-20 14:58     ` Andy Shevchenko
2020-03-24 22:32   ` [tip: x86/cpu] " tip-bot2 for Thomas Gleixner
2020-03-20 13:14 ` [patch 20/22] crypto: Convert to new " Thomas Gleixner
2020-03-20 13:14   ` Thomas Gleixner
2020-03-24 22:32   ` [tip: x86/cpu] " tip-bot2 for Thomas Gleixner
2020-03-20 13:14 ` [patch 21/22] hwrng: via_rng - Convert to new X86 " Thomas Gleixner
2020-03-20 13:14   ` Thomas Gleixner
2020-03-24 22:32   ` [tip: x86/cpu] hwrng: via_rng: " tip-bot2 for Thomas Gleixner
2020-03-20 13:14 ` [patch 22/22] x86/cpu: Cleanup the now unused " Thomas Gleixner
2020-03-20 13:14   ` Thomas Gleixner
2020-03-24 22:32   ` [tip: x86/cpu] " tip-bot2 for Thomas Gleixner
2020-03-20 14:31 ` [patch 00/22] x86/treewide: Consolidate CPU match macro maze and get rid of C89 (sic!) initializers Andy Shevchenko
2020-03-20 14:31   ` Andy Shevchenko
2020-03-20 14:31   ` Andy Shevchenko
2020-03-20 14:59 ` Greg Kroah-Hartman
2020-03-20 14:59   ` Greg Kroah-Hartman
2020-03-20 14:59   ` Greg Kroah-Hartman
2020-03-24 18:58 ` [PATCH 23/22] x86/smpboot: Remove the last ICPU() macro Borislav Petkov
2020-03-24 18:58   ` Borislav Petkov
2020-03-24 18:58   ` Borislav Petkov
2020-04-13  8:40   ` [tip: x86/cleanups] " tip-bot2 for Borislav Petkov

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=20200320131508.826011988@linutronix.de \
    --to=tglx@linutronix.de \
    --cc=adrian.hunter@intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=amit.kucheria@verdurent.com \
    --cc=andy@infradead.org \
    --cc=bhelgaas@google.com \
    --cc=cw00.choi@samsung.com \
    --cc=daniel.lezcano@linaro.org \
    --cc=davem@davemloft.net \
    --cc=dvhart@infradead.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=herbert@gondor.apana.org.au \
    --cc=jacob.jun.pan@linux.intel.com \
    --cc=jdelvare@suse.com \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-edac@vger.kernel.org \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=mgross@linux.intel.com \
    --cc=pbonzini@redhat.com \
    --cc=platform-driver-x86@vger.kernel.org \
    --cc=rjw@rjwysocki.net \
    --cc=rui.zhang@intel.com \
    --cc=srinivas.pandruvada@linux.intel.com \
    --cc=tiwai@suse.com \
    --cc=tony.luck@intel.com \
    --cc=ulf.hansson@linaro.org \
    --cc=viresh.kumar@linaro.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 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.