diff mbox

[1/1] kvm: x86: Move IA32_ARCH_CAPABILITIES to emulated_msrs

Message ID 20180627160353.44728-1-jmattson@google.com (mailing list archive)
State New, archived
Headers show

Commit Message

Jim Mattson June 27, 2018, 4:03 p.m. UTC
The msrs_to_save array is filtered to remove any MSRs not supported by
the hardware. Since IA32_ARCH_CAPABILITIES must, in some cases, be
emulated by kvm, it should be in the emulated_msr array
instead. Otherwise, it won't appear in KVM_GET_MSR_INDEX_LIST on hosts
where it isn't supported.

Fixes: 1eaafe91a0df ("kvm: x86: IA32_ARCH_CAPABILITIES is always supported")
Signed-off-by: Jim Mattson <jmattson@google.com>
---
 arch/x86/kvm/x86.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff mbox

Patch

diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 66cf73e29518..14a026b18cf7 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -1041,7 +1041,7 @@  static u32 msrs_to_save[] = {
 #endif
 	MSR_IA32_TSC, MSR_IA32_CR_PAT, MSR_VM_HSAVE_PA,
 	MSR_IA32_FEATURE_CONTROL, MSR_IA32_BNDCFGS, MSR_TSC_AUX,
-	MSR_IA32_SPEC_CTRL, MSR_IA32_ARCH_CAPABILITIES
+	MSR_IA32_SPEC_CTRL
 };
 
 static unsigned num_msrs_to_save;
@@ -1076,6 +1076,7 @@  static u32 emulated_msrs[] = {
 	MSR_PLATFORM_INFO,
 	MSR_MISC_FEATURES_ENABLES,
 	MSR_AMD64_VIRT_SPEC_CTRL,
+	MSR_IA32_ARCH_CAPABILITIES,
 };
 
 static unsigned num_emulated_msrs;