aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/lib/msr.c
diff options
context:
space:
mode:
authorBorislav Petkov <bp@alien8.de>2025-02-18 12:13:33 +0100
committerBorislav Petkov (AMD) <bp@alien8.de>2025-02-26 15:13:06 +0100
commit8442df2b49ed9bcd67833ad4f091d15ac91efd00 (patch)
tree35d28fc3a970567cb4325a9635f873eece88ace3 /arch/x86/lib/msr.c
parentLinux 6.14-rc4 (diff)
downloadlinux-8442df2b49ed9bcd67833ad4f091d15ac91efd00.tar.gz
linux-8442df2b49ed9bcd67833ad4f091d15ac91efd00.zip
x86/bugs: KVM: Add support for SRSO_MSR_FIX
Add support for CPUID Fn8000_0021_EAX[31] (SRSO_MSR_FIX). If this bit is 1, it indicates that software may use MSR BP_CFG[BpSpecReduce] to mitigate SRSO. Enable BpSpecReduce to mitigate SRSO across guest/host boundaries. Switch back to enabling the bit when virtualization is enabled and to clear the bit when virtualization is disabled because using a MSR slot would clear the bit when the guest is exited and any training the guest has done, would potentially influence the host kernel when execution enters the kernel and hasn't VMRUN the guest yet. More detail on the public thread in Link below. Co-developed-by: Sean Christopherson <seanjc@google.com> Signed-off-by: Sean Christopherson <seanjc@google.com> Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de> Link: https://lore.kernel.org/r/20241202120416.6054-1-bp@kernel.org
Diffstat (limited to 'arch/x86/lib/msr.c')
-rw-r--r--arch/x86/lib/msr.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/arch/x86/lib/msr.c b/arch/x86/lib/msr.c
index 4bf4fad5b148..5a18ecc04a6c 100644
--- a/arch/x86/lib/msr.c
+++ b/arch/x86/lib/msr.c
@@ -103,6 +103,7 @@ int msr_set_bit(u32 msr, u8 bit)
{
return __flip_bit(msr, bit, true);
}
+EXPORT_SYMBOL_GPL(msr_set_bit);
/**
* msr_clear_bit - Clear @bit in a MSR @msr.
@@ -118,6 +119,7 @@ int msr_clear_bit(u32 msr, u8 bit)
{
return __flip_bit(msr, bit, false);
}
+EXPORT_SYMBOL_GPL(msr_clear_bit);
#ifdef CONFIG_TRACEPOINTS
void do_trace_write_msr(unsigned int msr, u64 val, int failed)