Skip to content

Commit d80825e

Browse files
committed
Merge tag 'x86_bugs_for_v6.14_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull x86 CPU speculation update from Borislav Petkov: - Add support for AMD hardware which is not affected by SRSO on the user/kernel attack vector and advertise it to guest userspace * tag 'x86_bugs_for_v6.14_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: KVM: x86: Advertise SRSO_USER_KERNEL_NO to userspace x86/bugs: Add SRSO_USER_KERNEL_NO support
2 parents 0763dd8 + 716f86b commit d80825e

File tree

4 files changed

+7
-1
lines changed

4 files changed

+7
-1
lines changed

arch/x86/include/asm/cpufeatures.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -465,6 +465,7 @@
465465
#define X86_FEATURE_SBPB (20*32+27) /* Selective Branch Prediction Barrier */
466466
#define X86_FEATURE_IBPB_BRTYPE (20*32+28) /* MSR_PRED_CMD[IBPB] flushes all branch type predictions */
467467
#define X86_FEATURE_SRSO_NO (20*32+29) /* CPU is not affected by SRSO */
468+
#define X86_FEATURE_SRSO_USER_KERNEL_NO (20*32+30) /* CPU is not affected by SRSO across user/kernel boundaries */
468469

469470
/*
470471
* Extended auxiliary flags: Linux defined - for features scattered in various

arch/x86/kernel/cpu/bugs.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2615,6 +2615,9 @@ static void __init srso_select_mitigation(void)
26152615
break;
26162616

26172617
case SRSO_CMD_SAFE_RET:
2618+
if (boot_cpu_has(X86_FEATURE_SRSO_USER_KERNEL_NO))
2619+
goto ibpb_on_vmexit;
2620+
26182621
if (IS_ENABLED(CONFIG_MITIGATION_SRSO)) {
26192622
/*
26202623
* Enable the return thunk for generated code
@@ -2658,6 +2661,7 @@ static void __init srso_select_mitigation(void)
26582661
}
26592662
break;
26602663

2664+
ibpb_on_vmexit:
26612665
case SRSO_CMD_IBPB_ON_VMEXIT:
26622666
if (IS_ENABLED(CONFIG_MITIGATION_SRSO)) {
26632667
if (!boot_cpu_has(X86_FEATURE_ENTRY_IBPB) && has_microcode) {

arch/x86/kernel/cpu/common.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1270,6 +1270,7 @@ static const struct x86_cpu_id cpu_vuln_blacklist[] __initconst = {
12701270
VULNBL_AMD(0x17, RETBLEED | SMT_RSB | SRSO),
12711271
VULNBL_HYGON(0x18, RETBLEED | SMT_RSB | SRSO),
12721272
VULNBL_AMD(0x19, SRSO),
1273+
VULNBL_AMD(0x1a, SRSO),
12731274
{}
12741275
};
12751276

arch/x86/kvm/cpuid.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -821,7 +821,7 @@ void kvm_set_cpu_caps(void)
821821
kvm_cpu_cap_mask(CPUID_8000_0021_EAX,
822822
F(NO_NESTED_DATA_BP) | F(LFENCE_RDTSC) | 0 /* SmmPgCfgLock */ |
823823
F(NULL_SEL_CLR_BASE) | F(AUTOIBRS) | 0 /* PrefetchCtlMsr */ |
824-
F(WRMSR_XX_BASE_NS)
824+
F(WRMSR_XX_BASE_NS) | F(SRSO_USER_KERNEL_NO)
825825
);
826826

827827
kvm_cpu_cap_check_and_set(X86_FEATURE_SBPB);

0 commit comments

Comments
 (0)