Skip to content

Commit 78bd0f8

Browse files
committed
KVM/x86: Export RFDS_NO and RFDS_CLEAR to guests
JIRA: https://issues.redhat.com/browse/RHEL-31226 commit 2a01801 Author: Pawan Gupta <pawan.kumar.gupta@linux.intel.com> Date: Mon, 11 Mar 2024 12:29:43 -0700 KVM/x86: Export RFDS_NO and RFDS_CLEAR to guests 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 <pawan.kumar.gupta@linux.intel.com> Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com> Reviewed-by: Thomas Gleixner <tglx@linutronix.de> Acked-by: Josh Poimboeuf <jpoimboe@kernel.org> Signed-off-by: Waiman Long <longman@redhat.com>
1 parent 4fa8f6c commit 78bd0f8

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
@@ -1620,7 +1620,8 @@ static bool kvm_is_immutable_feature_msr(u32 msr)
16201620
ARCH_CAP_SKIP_VMENTRY_L1DFLUSH | ARCH_CAP_SSB_NO | ARCH_CAP_MDS_NO | \
16211621
ARCH_CAP_PSCHANGE_MC_NO | ARCH_CAP_TSX_CTRL_MSR | ARCH_CAP_TAA_NO | \
16221622
ARCH_CAP_SBDR_SSDP_NO | ARCH_CAP_FBSDP_NO | ARCH_CAP_PSDP_NO | \
1623-
ARCH_CAP_FB_CLEAR | ARCH_CAP_RRSBA | ARCH_CAP_PBRSB_NO | ARCH_CAP_GDS_NO)
1623+
ARCH_CAP_FB_CLEAR | ARCH_CAP_RRSBA | ARCH_CAP_PBRSB_NO | ARCH_CAP_GDS_NO | \
1624+
ARCH_CAP_RFDS_NO | ARCH_CAP_RFDS_CLEAR)
16241625

16251626
static u64 kvm_get_arch_capabilities(void)
16261627
{
@@ -1652,6 +1653,8 @@ static u64 kvm_get_arch_capabilities(void)
16521653
data |= ARCH_CAP_SSB_NO;
16531654
if (!boot_cpu_has_bug(X86_BUG_MDS))
16541655
data |= ARCH_CAP_MDS_NO;
1656+
if (!boot_cpu_has_bug(X86_BUG_RFDS))
1657+
data |= ARCH_CAP_RFDS_NO;
16551658

16561659
if (!boot_cpu_has(X86_FEATURE_RTM)) {
16571660
/*

0 commit comments

Comments
 (0)