KVM/x86: Export RFDS_NO and RFDS_CLEAR to guests
authorPawan Gupta <pawan.kumar.gupta@linux.intel.com>
Mon, 11 Mar 2024 19:29:43 +0000 (12:29 -0700)
committerDave Hansen <dave.hansen@linux.intel.com>
Mon, 11 Mar 2024 20:13:50 +0000 (13:13 -0700)
commit2a0180129d726a4b953232175857d442651b55a0
tree5ea4ad5ba07c2966d49d4c00d4c2ca0798b37214
parent8076fcde016c9c0e0660543e67bff86cb48a7c9c
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>
arch/x86/kvm/x86.c