Skip to content

Commit 2480986

Browse files
konradwilkKAGA-KOKO
authored andcommitted
x86/bugs: Add AMD's variant of SSB_NO
The AMD document outlining the SSBD handling 124441_AMD64_SpeculativeStoreBypassDisable_Whitepaper_final.pdf mentions that the CPUID 8000_0008.EBX[26] will mean that the speculative store bypass disable is no longer needed. A copy of this document is available at: https://bugzilla.kernel.org/show_bug.cgi?id=199889 Signed-off-by: Konrad Rzeszutek Wilk <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Cc: Tom Lendacky <[email protected]> Cc: Janakarajan Natarajan <[email protected]> Cc: [email protected] Cc: [email protected] Cc: Andy Lutomirski <[email protected]> Cc: "H. Peter Anvin" <[email protected]> Cc: Borislav Petkov <[email protected]> Cc: David Woodhouse <[email protected]> Link: https://lkml.kernel.org/r/[email protected]
1 parent 716a685 commit 2480986

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

arch/x86/include/asm/cpufeatures.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,7 @@
283283
#define X86_FEATURE_AMD_IBRS (13*32+14) /* "" Indirect Branch Restricted Speculation */
284284
#define X86_FEATURE_AMD_STIBP (13*32+15) /* "" Single Thread Indirect Branch Predictors */
285285
#define X86_FEATURE_VIRT_SSBD (13*32+25) /* Virtualized Speculative Store Bypass Disable */
286+
#define X86_FEATURE_AMD_SSB_NO (13*32+26) /* "" Speculative Store Bypass is fixed in hardware. */
286287

287288
/* Thermal and Power Management Leaf, CPUID level 0x00000006 (EAX), word 14 */
288289
#define X86_FEATURE_DTHERM (14*32+ 0) /* Digital Thermal Sensor */

arch/x86/kernel/cpu/common.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -992,7 +992,8 @@ static void __init cpu_set_bug_bits(struct cpuinfo_x86 *c)
992992
rdmsrl(MSR_IA32_ARCH_CAPABILITIES, ia32_cap);
993993

994994
if (!x86_match_cpu(cpu_no_spec_store_bypass) &&
995-
!(ia32_cap & ARCH_CAP_SSB_NO))
995+
!(ia32_cap & ARCH_CAP_SSB_NO) &&
996+
!cpu_has(c, X86_FEATURE_AMD_SSB_NO))
996997
setup_force_cpu_bug(X86_BUG_SPEC_STORE_BYPASS);
997998

998999
if (x86_match_cpu(cpu_no_meltdown))

arch/x86/kvm/cpuid.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,7 @@ static inline int __do_cpuid_ent(struct kvm_cpuid_entry2 *entry, u32 function,
379379

380380
/* cpuid 0x80000008.ebx */
381381
const u32 kvm_cpuid_8000_0008_ebx_x86_features =
382-
F(AMD_IBPB) | F(AMD_IBRS) | F(VIRT_SSBD);
382+
F(AMD_IBPB) | F(AMD_IBRS) | F(VIRT_SSBD) | F(AMD_SSB_NO);
383383

384384
/* cpuid 0xC0000001.edx */
385385
const u32 kvm_cpuid_C000_0001_edx_x86_features =

0 commit comments

Comments
 (0)