]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: x86: Mask off unsupported and unknown bits of IA32_ARCH_CAPABILITIES
authorJim Mattson <jmattson@google.com>
Tue, 30 Aug 2022 17:49:47 +0000 (10:49 -0700)
committerPaolo Bonzini <pbonzini@redhat.com>
Thu, 1 Sep 2022 23:20:58 +0000 (19:20 -0400)
commit306e89fa6d2b192e3c4e5e699f4e5529fa9fee2d
tree80a8a656ba8049b46d50f9f19cd4081287a6557f
parent7019b87af0fe55f7091a04653a6c71f50b473ba3
KVM: x86: Mask off unsupported and unknown bits of IA32_ARCH_CAPABILITIES

KVM should not claim to virtualize unknown IA32_ARCH_CAPABILITIES
bits. When kvm_get_arch_capabilities() was originally written, there
were only a few bits defined in this MSR, and KVM could virtualize all
of them. However, over the years, several bits have been defined that
KVM cannot just blindly pass through to the guest without additional
work (such as virtualizing an MSR promised by the
IA32_ARCH_CAPABILITES feature bit).

Define a mask of supported IA32_ARCH_CAPABILITIES bits, and mask off
any other bits that are set in the hardware MSR.

Cc: Paolo Bonzini <pbonzini@redhat.com>
Fixes: 88f7bf583d0b ("KVM: VMX: Tell the nested hypervisor to skip L1D flush on vmentry")
Signed-off-by: Jim Mattson <jmattson@google.com>
Reviewed-by: Vipin Sharma <vipinsh@google.com>
Reviewed-by: Xiaoyao Li <xiaoyao.li@intel.com>
Message-Id: <20220830174947.2182144-1-jmattson@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/x86.c