From: Maxim Levitsky mlevitsk@redhat.com
This msr is only available when the host supports WAITPKG feature.
This breaks a nested guest, if the L1 hypervisor is set to ignore unknown msrs, because the only other safety check that the kernel does is that it attempts to read the msr and rejects it if it gets an exception.
Cc: stable@vger.kernel.org Fixes: 6e3ba4abce ("KVM: vmx: Emulate MSR IA32_UMWAIT_CONTROL") Signed-off-by: Maxim Levitsky mlevitsk@redhat.com Message-Id: 20200523161455.3940-3-mlevitsk@redhat.com Reviewed-by: Sean Christopherson sean.j.christopherson@intel.com Signed-off-by: Paolo Bonzini pbonzini@redhat.com (cherry picked from commit f4cfcd2d5aea4e96c5d483c476f3057b6b7baf6a use boot_cpu_has for checking the feature) Signed-off-by: Jack Wang jinpu.wang@cloud.ionos.com --- arch/x86/kvm/x86.c | 4 ++++ 1 file changed, 4 insertions(+)
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 708b37274cb5..4cacf4669235 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -5226,6 +5226,10 @@ static void kvm_init_msr_list(void) if (!kvm_x86_ops->rdtscp_supported()) continue; break; + case MSR_IA32_UMWAIT_CONTROL: + if (!boot_cpu_has(X86_FEATURE_WAITPKG)) + continue; + break; case MSR_IA32_RTIT_CTL: case MSR_IA32_RTIT_STATUS: if (!kvm_x86_ops->pt_supported())
On 11/11/20 14:20, Jack Wang wrote:
From: Maxim Levitsky mlevitsk@redhat.com
This msr is only available when the host supports WAITPKG feature.
This breaks a nested guest, if the L1 hypervisor is set to ignore unknown msrs, because the only other safety check that the kernel does is that it attempts to read the msr and rejects it if it gets an exception.
Cc: stable@vger.kernel.org Fixes: 6e3ba4abce ("KVM: vmx: Emulate MSR IA32_UMWAIT_CONTROL") Signed-off-by: Maxim Levitsky mlevitsk@redhat.com Message-Id: 20200523161455.3940-3-mlevitsk@redhat.com Reviewed-by: Sean Christopherson sean.j.christopherson@intel.com Signed-off-by: Paolo Bonzini pbonzini@redhat.com (cherry picked from commit f4cfcd2d5aea4e96c5d483c476f3057b6b7baf6a use boot_cpu_has for checking the feature) Signed-off-by: Jack Wang jinpu.wang@cloud.ionos.com
arch/x86/kvm/x86.c | 4 ++++ 1 file changed, 4 insertions(+)
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 708b37274cb5..4cacf4669235 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -5226,6 +5226,10 @@ static void kvm_init_msr_list(void) if (!kvm_x86_ops->rdtscp_supported()) continue; break;
case MSR_IA32_UMWAIT_CONTROL:
if (!boot_cpu_has(X86_FEATURE_WAITPKG))
continue;
case MSR_IA32_RTIT_CTL: case MSR_IA32_RTIT_STATUS: if (!kvm_x86_ops->pt_supported())break;
Acked-by: Paolo Bonzini pbonzini@redhat.com
Thanks,
Paolo
On Wed, Nov 11, 2020 at 02:51:12PM +0100, Paolo Bonzini wrote:
On 11/11/20 14:20, Jack Wang wrote:
From: Maxim Levitsky mlevitsk@redhat.com
This msr is only available when the host supports WAITPKG feature.
This breaks a nested guest, if the L1 hypervisor is set to ignore unknown msrs, because the only other safety check that the kernel does is that it attempts to read the msr and rejects it if it gets an exception.
Cc: stable@vger.kernel.org Fixes: 6e3ba4abce ("KVM: vmx: Emulate MSR IA32_UMWAIT_CONTROL") Signed-off-by: Maxim Levitsky mlevitsk@redhat.com Message-Id: 20200523161455.3940-3-mlevitsk@redhat.com Reviewed-by: Sean Christopherson sean.j.christopherson@intel.com Signed-off-by: Paolo Bonzini pbonzini@redhat.com (cherry picked from commit f4cfcd2d5aea4e96c5d483c476f3057b6b7baf6a use boot_cpu_has for checking the feature) Signed-off-by: Jack Wang jinpu.wang@cloud.ionos.com
arch/x86/kvm/x86.c | 4 ++++ 1 file changed, 4 insertions(+)
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 708b37274cb5..4cacf4669235 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -5226,6 +5226,10 @@ static void kvm_init_msr_list(void) if (!kvm_x86_ops->rdtscp_supported()) continue; break;
case MSR_IA32_UMWAIT_CONTROL:
if (!boot_cpu_has(X86_FEATURE_WAITPKG))
continue;
case MSR_IA32_RTIT_CTL: case MSR_IA32_RTIT_STATUS: if (!kvm_x86_ops->pt_supported())break;
Acked-by: Paolo Bonzini pbonzini@redhat.com
Queued up, thanks!
linux-stable-mirror@lists.linaro.org