All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	stable@vger.kernel.org, David Woodhouse <dwmw@amazon.co.uk>,
	Thomas Gleixner <tglx@linutronix.de>,
	Borislav Petkov <bp@suse.de>,
	gnomes@lxorguk.ukuu.org.uk, ak@linux.intel.com,
	ashok.raj@intel.com, dave.hansen@intel.com, karahmed@amazon.de,
	arjan@linux.intel.com, torvalds@linux-foundation.org,
	peterz@infradead.org, bp@alien8.de, pbonzini@redhat.com,
	tim.c.chen@linux.intel.com, gregkh@linux-foundation.org
Subject: [PATCH 4.14 08/64] x86/cpufeatures: Add CPUID_7_EDX CPUID leaf
Date: Mon,  5 Feb 2018 10:22:27 -0800	[thread overview]
Message-ID: <20180205182138.910331112@linuxfoundation.org> (raw)
In-Reply-To: <20180205182138.571333346@linuxfoundation.org>

4.14-stable review patch.  If anyone has any objections, please let me know.

------------------

From: David Woodhouse dwmw@amazon.co.uk

commit 95ca0ee8636059ea2800dfbac9ecac6212d6b38f

This is a pure feature bits leaf. There are two AVX512 feature bits in it
already which were handled as scattered bits, and three more from this leaf
are going to be added for speculation control features.

Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Reviewed-by: Borislav Petkov <bp@suse.de>
Cc: gnomes@lxorguk.ukuu.org.uk
Cc: ak@linux.intel.com
Cc: ashok.raj@intel.com
Cc: dave.hansen@intel.com
Cc: karahmed@amazon.de
Cc: arjan@linux.intel.com
Cc: torvalds@linux-foundation.org
Cc: peterz@infradead.org
Cc: bp@alien8.de
Cc: pbonzini@redhat.com
Cc: tim.c.chen@linux.intel.com
Cc: gregkh@linux-foundation.org
Link: https://lkml.kernel.org/r/1516896855-7642-2-git-send-email-dwmw@amazon.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


---
 arch/x86/include/asm/cpufeature.h        |    7 +++++--
 arch/x86/include/asm/cpufeatures.h       |    8 +++++---
 arch/x86/include/asm/disabled-features.h |    3 ++-
 arch/x86/include/asm/required-features.h |    3 ++-
 arch/x86/kernel/cpu/common.c             |    1 +
 arch/x86/kernel/cpu/scattered.c          |    2 --
 6 files changed, 15 insertions(+), 9 deletions(-)

--- a/arch/x86/include/asm/cpufeature.h
+++ b/arch/x86/include/asm/cpufeature.h
@@ -29,6 +29,7 @@ enum cpuid_leafs
 	CPUID_8000_000A_EDX,
 	CPUID_7_ECX,
 	CPUID_8000_0007_EBX,
+	CPUID_7_EDX,
 };
 
 #ifdef CONFIG_X86_FEATURE_NAMES
@@ -79,8 +80,9 @@ extern const char * const x86_bug_flags[
 	   CHECK_BIT_IN_MASK_WORD(REQUIRED_MASK, 15, feature_bit) ||	\
 	   CHECK_BIT_IN_MASK_WORD(REQUIRED_MASK, 16, feature_bit) ||	\
 	   CHECK_BIT_IN_MASK_WORD(REQUIRED_MASK, 17, feature_bit) ||	\
+	   CHECK_BIT_IN_MASK_WORD(REQUIRED_MASK, 18, feature_bit) ||	\
 	   REQUIRED_MASK_CHECK					  ||	\
-	   BUILD_BUG_ON_ZERO(NCAPINTS != 18))
+	   BUILD_BUG_ON_ZERO(NCAPINTS != 19))
 
 #define DISABLED_MASK_BIT_SET(feature_bit)				\
 	 ( CHECK_BIT_IN_MASK_WORD(DISABLED_MASK,  0, feature_bit) ||	\
@@ -101,8 +103,9 @@ extern const char * const x86_bug_flags[
 	   CHECK_BIT_IN_MASK_WORD(DISABLED_MASK, 15, feature_bit) ||	\
 	   CHECK_BIT_IN_MASK_WORD(DISABLED_MASK, 16, feature_bit) ||	\
 	   CHECK_BIT_IN_MASK_WORD(DISABLED_MASK, 17, feature_bit) ||	\
+	   CHECK_BIT_IN_MASK_WORD(DISABLED_MASK, 18, feature_bit) ||	\
 	   DISABLED_MASK_CHECK					  ||	\
-	   BUILD_BUG_ON_ZERO(NCAPINTS != 18))
+	   BUILD_BUG_ON_ZERO(NCAPINTS != 19))
 
 #define cpu_has(c, bit)							\
 	(__builtin_constant_p(bit) && REQUIRED_MASK_BIT_SET(bit) ? 1 :	\
--- a/arch/x86/include/asm/cpufeatures.h
+++ b/arch/x86/include/asm/cpufeatures.h
@@ -13,7 +13,7 @@
 /*
  * Defines x86 CPU feature bits
  */
-#define NCAPINTS			18	   /* N 32-bit words worth of info */
+#define NCAPINTS			19	   /* N 32-bit words worth of info */
 #define NBUGINTS			1	   /* N 32-bit bug flags */
 
 /*
@@ -206,8 +206,6 @@
 #define X86_FEATURE_RETPOLINE		( 7*32+12) /* Generic Retpoline mitigation for Spectre variant 2 */
 #define X86_FEATURE_RETPOLINE_AMD	( 7*32+13) /* AMD Retpoline mitigation for Spectre variant 2 */
 #define X86_FEATURE_INTEL_PPIN		( 7*32+14) /* Intel Processor Inventory Number */
-#define X86_FEATURE_AVX512_4VNNIW	( 7*32+16) /* AVX-512 Neural Network Instructions */
-#define X86_FEATURE_AVX512_4FMAPS	( 7*32+17) /* AVX-512 Multiply Accumulation Single precision */
 
 #define X86_FEATURE_MBA			( 7*32+18) /* Memory Bandwidth Allocation */
 #define X86_FEATURE_RSB_CTXSW		( 7*32+19) /* Fill RSB on context switches */
@@ -319,6 +317,10 @@
 #define X86_FEATURE_SUCCOR		(17*32+ 1) /* Uncorrectable error containment and recovery */
 #define X86_FEATURE_SMCA		(17*32+ 3) /* Scalable MCA */
 
+/* Intel-defined CPU features, CPUID level 0x00000007:0 (EDX), word 18 */
+#define X86_FEATURE_AVX512_4VNNIW	(18*32+ 2) /* AVX-512 Neural Network Instructions */
+#define X86_FEATURE_AVX512_4FMAPS	(18*32+ 3) /* AVX-512 Multiply Accumulation Single precision */
+
 /*
  * BUG word(s)
  */
--- a/arch/x86/include/asm/disabled-features.h
+++ b/arch/x86/include/asm/disabled-features.h
@@ -71,6 +71,7 @@
 #define DISABLED_MASK15	0
 #define DISABLED_MASK16	(DISABLE_PKU|DISABLE_OSPKE|DISABLE_LA57)
 #define DISABLED_MASK17	0
-#define DISABLED_MASK_CHECK BUILD_BUG_ON_ZERO(NCAPINTS != 18)
+#define DISABLED_MASK18	0
+#define DISABLED_MASK_CHECK BUILD_BUG_ON_ZERO(NCAPINTS != 19)
 
 #endif /* _ASM_X86_DISABLED_FEATURES_H */
--- a/arch/x86/include/asm/required-features.h
+++ b/arch/x86/include/asm/required-features.h
@@ -106,6 +106,7 @@
 #define REQUIRED_MASK15	0
 #define REQUIRED_MASK16	(NEED_LA57)
 #define REQUIRED_MASK17	0
-#define REQUIRED_MASK_CHECK BUILD_BUG_ON_ZERO(NCAPINTS != 18)
+#define REQUIRED_MASK18	0
+#define REQUIRED_MASK_CHECK BUILD_BUG_ON_ZERO(NCAPINTS != 19)
 
 #endif /* _ASM_X86_REQUIRED_FEATURES_H */
--- a/arch/x86/kernel/cpu/common.c
+++ b/arch/x86/kernel/cpu/common.c
@@ -745,6 +745,7 @@ void get_cpu_cap(struct cpuinfo_x86 *c)
 		cpuid_count(0x00000007, 0, &eax, &ebx, &ecx, &edx);
 		c->x86_capability[CPUID_7_0_EBX] = ebx;
 		c->x86_capability[CPUID_7_ECX] = ecx;
+		c->x86_capability[CPUID_7_EDX] = edx;
 	}
 
 	/* Extended state features: level 0x0000000d */
--- a/arch/x86/kernel/cpu/scattered.c
+++ b/arch/x86/kernel/cpu/scattered.c
@@ -21,8 +21,6 @@ struct cpuid_bit {
 static const struct cpuid_bit cpuid_bits[] = {
 	{ X86_FEATURE_APERFMPERF,       CPUID_ECX,  0, 0x00000006, 0 },
 	{ X86_FEATURE_EPB,		CPUID_ECX,  3, 0x00000006, 0 },
-	{ X86_FEATURE_AVX512_4VNNIW,    CPUID_EDX,  2, 0x00000007, 0 },
-	{ X86_FEATURE_AVX512_4FMAPS,    CPUID_EDX,  3, 0x00000007, 0 },
 	{ X86_FEATURE_CAT_L3,		CPUID_EBX,  1, 0x00000010, 0 },
 	{ X86_FEATURE_CAT_L2,		CPUID_EBX,  2, 0x00000010, 0 },
 	{ X86_FEATURE_CDP_L3,		CPUID_ECX,  2, 0x00000010, 1 },

  parent reply	other threads:[~2018-02-05 18:24 UTC|newest]

Thread overview: 74+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-05 18:22 [PATCH 4.14 00/64] 4.14.18-stable review Greg Kroah-Hartman
2018-02-05 18:22 ` [PATCH 4.14 01/64] scripts/faddr2line: fix CROSS_COMPILE unset error Greg Kroah-Hartman
2018-02-05 18:22 ` [PATCH 4.14 02/64] powerpc/64s: Wire up cpu_show_meltdown() Greg Kroah-Hartman
2018-02-05 18:22 ` [PATCH 4.14 03/64] powerpc/64s: Allow control of RFI flush via debugfs Greg Kroah-Hartman
2018-02-05 18:22 ` [PATCH 4.14 04/64] x86/retpoline: Remove the esp/rsp thunk Greg Kroah-Hartman
2018-02-05 18:22 ` [PATCH 4.14 05/64] KVM: x86: Make indirect calls in emulator speculation safe Greg Kroah-Hartman
2018-02-05 18:22 ` [PATCH 4.14 06/64] KVM: VMX: Make indirect call " Greg Kroah-Hartman
2018-02-05 18:22 ` [PATCH 4.14 07/64] module/retpoline: Warn about missing retpoline in module Greg Kroah-Hartman
2018-02-05 18:22 ` Greg Kroah-Hartman [this message]
2018-02-05 18:22 ` [PATCH 4.14 09/64] x86/cpufeatures: Add Intel feature bits for Speculation Control Greg Kroah-Hartman
2018-02-05 18:22 ` [PATCH 4.14 10/64] x86/cpufeatures: Add AMD " Greg Kroah-Hartman
2018-02-05 18:22 ` [PATCH 4.14 11/64] x86/msr: Add definitions for new speculation control MSRs Greg Kroah-Hartman
2018-02-05 18:22 ` [PATCH 4.14 12/64] x86/pti: Do not enable PTI on CPUs which are not vulnerable to Meltdown Greg Kroah-Hartman
2018-02-05 18:22 ` [PATCH 4.14 13/64] x86/cpufeature: Blacklist SPEC_CTRL/PRED_CMD on early Spectre v2 microcodes Greg Kroah-Hartman
2018-02-05 18:22 ` [PATCH 4.14 14/64] x86/speculation: Add basic IBPB (Indirect Branch Prediction Barrier) support Greg Kroah-Hartman
2018-02-05 18:22 ` [PATCH 4.14 15/64] x86/alternative: Print unadorned pointers Greg Kroah-Hartman
2018-02-05 18:22 ` [PATCH 4.14 16/64] x86/nospec: Fix header guards names Greg Kroah-Hartman
2018-02-05 18:22 ` [PATCH 4.14 17/64] x86/bugs: Drop one "mitigation" from dmesg Greg Kroah-Hartman
2018-02-05 18:22 ` [PATCH 4.14 18/64] x86/cpu/bugs: Make retpoline module warning conditional Greg Kroah-Hartman
2018-02-05 18:22 ` [PATCH 4.14 19/64] x86/cpufeatures: Clean up Spectre v2 related CPUID flags Greg Kroah-Hartman
2018-02-05 18:22 ` [PATCH 4.14 20/64] x86/retpoline: Simplify vmexit_fill_RSB() Greg Kroah-Hartman
2018-02-05 18:22 ` [PATCH 4.14 21/64] x86/speculation: Simplify indirect_branch_prediction_barrier() Greg Kroah-Hartman
2018-02-05 18:22 ` [PATCH 4.14 22/64] auxdisplay: img-ascii-lcd: add missing MODULE_DESCRIPTION/AUTHOR/LICENSE Greg Kroah-Hartman
2018-02-05 18:22 ` [PATCH 4.14 23/64] iio: adc/accel: Fix up module licenses Greg Kroah-Hartman
2018-02-05 18:22 ` [PATCH 4.14 24/64] pinctrl: pxa: pxa2xx: add missing MODULE_DESCRIPTION/AUTHOR/LICENSE Greg Kroah-Hartman
2018-02-05 18:22 ` [PATCH 4.14 25/64] ASoC: pcm512x: " Greg Kroah-Hartman
2018-02-05 18:22 ` [PATCH 4.14 26/64] KVM: nVMX: Eliminate vmcs02 pool Greg Kroah-Hartman
2018-02-05 18:22 ` [PATCH 4.14 27/64] KVM: VMX: introduce alloc_loaded_vmcs Greg Kroah-Hartman
2018-02-05 18:22 ` [PATCH 4.14 28/64] objtool: Improve retpoline alternative handling Greg Kroah-Hartman
2018-02-05 18:22 ` [PATCH 4.14 29/64] objtool: Add support for alternatives at the end of a section Greg Kroah-Hartman
2018-02-05 18:22 ` [PATCH 4.14 30/64] objtool: Warn on stripped section symbol Greg Kroah-Hartman
2018-02-05 18:22 ` [PATCH 4.14 31/64] x86/mm: Fix overlap of i386 CPU_ENTRY_AREA with FIX_BTMAP Greg Kroah-Hartman
2018-02-05 18:22 ` [PATCH 4.14 32/64] x86/spectre: Check CONFIG_RETPOLINE in command line parser Greg Kroah-Hartman
2018-02-05 18:22 ` [PATCH 4.14 33/64] x86/entry/64: Remove the SYSCALL64 fast path Greg Kroah-Hartman
2018-02-05 18:22 ` [PATCH 4.14 34/64] x86/entry/64: Push extra regs right away Greg Kroah-Hartman
2018-02-05 18:22 ` [PATCH 4.14 35/64] x86/asm: Move status from thread_struct to thread_info Greg Kroah-Hartman
2018-02-05 18:22 ` [PATCH 4.14 36/64] Documentation: Document array_index_nospec Greg Kroah-Hartman
2018-02-05 18:22 ` [PATCH 4.14 37/64] array_index_nospec: Sanitize speculative array de-references Greg Kroah-Hartman
2018-02-05 18:22 ` [PATCH 4.14 38/64] x86: Implement array_index_mask_nospec Greg Kroah-Hartman
2018-02-05 18:22 ` [PATCH 4.14 39/64] x86: Introduce barrier_nospec Greg Kroah-Hartman
2018-02-05 18:22 ` [PATCH 4.14 40/64] x86: Introduce __uaccess_begin_nospec() and uaccess_try_nospec Greg Kroah-Hartman
2018-02-05 18:23 ` [PATCH 4.14 41/64] x86/usercopy: Replace open coded stac/clac with __uaccess_{begin, end} Greg Kroah-Hartman
2018-02-05 18:23 ` [PATCH 4.14 42/64] x86/uaccess: Use __uaccess_begin_nospec() and uaccess_try_nospec Greg Kroah-Hartman
2018-02-05 18:23 ` [PATCH 4.14 43/64] x86/get_user: Use pointer masking to limit speculation Greg Kroah-Hartman
2018-02-05 18:23 ` [PATCH 4.14 44/64] x86/syscall: Sanitize syscall table de-references under speculation Greg Kroah-Hartman
2018-02-05 18:23 ` [PATCH 4.14 45/64] vfs, fdtable: Prevent bounds-check bypass via speculative execution Greg Kroah-Hartman
2018-02-05 18:23 ` [PATCH 4.14 46/64] nl80211: Sanitize array index in parse_txq_params Greg Kroah-Hartman
2018-02-05 18:23 ` [PATCH 4.14 47/64] x86/spectre: Report get_user mitigation for spectre_v1 Greg Kroah-Hartman
2018-02-05 18:23 ` [PATCH 4.14 48/64] x86/spectre: Fix spelling mistake: "vunerable"-> "vulnerable" Greg Kroah-Hartman
2018-02-05 18:23   ` Greg Kroah-Hartman
2018-02-05 18:23 ` [PATCH 4.14 49/64] x86/cpuid: Fix up "virtual" IBRS/IBPB/STIBP feature bits on Intel Greg Kroah-Hartman
2018-02-05 18:23 ` [PATCH 4.14 50/64] x86/speculation: Use Indirect Branch Prediction Barrier in context switch Greg Kroah-Hartman
2018-02-05 18:23 ` [PATCH 4.14 51/64] x86/paravirt: Remove noreplace-paravirt cmdline option Greg Kroah-Hartman
2018-02-05 18:23 ` [PATCH 4.14 52/64] KVM: VMX: make MSR bitmaps per-VCPU Greg Kroah-Hartman
2018-02-05 18:23 ` [PATCH 4.14 53/64] x86/kvm: Update spectre-v1 mitigation Greg Kroah-Hartman
2018-02-05 18:23 ` [PATCH 4.14 54/64] x86/retpoline: Avoid retpolines for built-in __init functions Greg Kroah-Hartman
2018-02-05 18:23 ` [PATCH 4.14 55/64] x86/spectre: Simplify spectre_v2 command line parsing Greg Kroah-Hartman
2018-02-05 18:23 ` [PATCH 4.14 56/64] x86/pti: Mark constant arrays as __initconst Greg Kroah-Hartman
2018-02-05 18:23 ` [PATCH 4.14 57/64] x86/speculation: Fix typo IBRS_ATT, which should be IBRS_ALL Greg Kroah-Hartman
2018-02-05 18:23 ` [PATCH 4.14 58/64] KVM/x86: Update the reverse_cpuid list to include CPUID_7_EDX Greg Kroah-Hartman
2018-02-05 18:23 ` [PATCH 4.14 59/64] KVM/x86: Add IBPB support Greg Kroah-Hartman
2018-02-05 18:23   ` Greg Kroah-Hartman
2018-02-05 18:23 ` [PATCH 4.14 60/64] KVM/VMX: Emulate MSR_IA32_ARCH_CAPABILITIES Greg Kroah-Hartman
2018-02-05 18:23   ` Greg Kroah-Hartman
2018-02-05 18:23 ` [PATCH 4.14 61/64] KVM/VMX: Allow direct access to MSR_IA32_SPEC_CTRL Greg Kroah-Hartman
2018-02-05 18:23   ` Greg Kroah-Hartman
2018-02-05 18:23 ` [PATCH 4.14 62/64] KVM/SVM: " Greg Kroah-Hartman
2018-02-05 18:23   ` Greg Kroah-Hartman
2018-02-05 18:23 ` [PATCH 4.14 63/64] serial: core: mark port as initialized after successful IRQ change Greg Kroah-Hartman
2018-02-05 18:23 ` [PATCH 4.14 64/64] fpga: region: release of_parse_phandle nodes after use Greg Kroah-Hartman
2018-02-05 22:13 ` [PATCH 4.14 00/64] 4.14.18-stable review Shuah Khan
2018-02-05 23:55 ` Dan Rue
2018-02-06  0:36 ` kernelci.org bot
2018-02-06 14:30 ` Guenter Roeck

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=20180205182138.910331112@linuxfoundation.org \
    --to=gregkh@linuxfoundation.org \
    --cc=ak@linux.intel.com \
    --cc=arjan@linux.intel.com \
    --cc=ashok.raj@intel.com \
    --cc=bp@alien8.de \
    --cc=bp@suse.de \
    --cc=dave.hansen@intel.com \
    --cc=dwmw@amazon.co.uk \
    --cc=gnomes@lxorguk.ukuu.org.uk \
    --cc=gregkh@linux-foundation.org \
    --cc=karahmed@amazon.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=peterz@infradead.org \
    --cc=stable@vger.kernel.org \
    --cc=tglx@linutronix.de \
    --cc=tim.c.chen@linux.intel.com \
    --cc=torvalds@linux-foundation.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.