Skip to content

Commit b2e92ab

Browse files
pa1guptaSasha Levin
authored andcommitted
KVM/x86: Export RFDS_NO and RFDS_CLEAR to guests
commit 2a01801 upstream. Mitigation for RFDS requires RFDS_CLEAR capability which is enumerated by MSR_IA32_ARCH_CAPABILITIES bit 27. If the host has it set, export it to guests so that they can deploy the mitigation. RFDS_NO indicates that the system is not vulnerable to RFDS, export it to guests so that they don't deploy the mitigation unnecessarily. When the host is not affected by X86_BUG_RFDS, but has RFDS_NO=0, synthesize RFDS_NO to the guest. Signed-off-by: Pawan Gupta <[email protected]> Signed-off-by: Dave Hansen <[email protected]> Reviewed-by: Thomas Gleixner <[email protected]> Acked-by: Josh Poimboeuf <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent d405b9c commit b2e92ab

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

arch/x86/kvm/x86.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1613,7 +1613,8 @@ static unsigned int num_msr_based_features;
16131613
ARCH_CAP_SKIP_VMENTRY_L1DFLUSH | ARCH_CAP_SSB_NO | ARCH_CAP_MDS_NO | \
16141614
ARCH_CAP_PSCHANGE_MC_NO | ARCH_CAP_TSX_CTRL_MSR | ARCH_CAP_TAA_NO | \
16151615
ARCH_CAP_SBDR_SSDP_NO | ARCH_CAP_FBSDP_NO | ARCH_CAP_PSDP_NO | \
1616-
ARCH_CAP_FB_CLEAR | ARCH_CAP_RRSBA | ARCH_CAP_PBRSB_NO | ARCH_CAP_GDS_NO)
1616+
ARCH_CAP_FB_CLEAR | ARCH_CAP_RRSBA | ARCH_CAP_PBRSB_NO | ARCH_CAP_GDS_NO | \
1617+
ARCH_CAP_RFDS_NO | ARCH_CAP_RFDS_CLEAR)
16171618

16181619
static u64 kvm_get_arch_capabilities(void)
16191620
{
@@ -1650,6 +1651,8 @@ static u64 kvm_get_arch_capabilities(void)
16501651
data |= ARCH_CAP_SSB_NO;
16511652
if (!boot_cpu_has_bug(X86_BUG_MDS))
16521653
data |= ARCH_CAP_MDS_NO;
1654+
if (!boot_cpu_has_bug(X86_BUG_RFDS))
1655+
data |= ARCH_CAP_RFDS_NO;
16531656

16541657
if (!boot_cpu_has(X86_FEATURE_RTM)) {
16551658
/*

0 commit comments

Comments
 (0)