]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: VMX: Heed the 'msr' argument in msr_write_intercepted()
authorJim Mattson <jmattson@google.com>
Wed, 10 Aug 2022 21:30:50 +0000 (14:30 -0700)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 19 Aug 2022 11:38:04 +0000 (07:38 -0400)
commit2f14573693198bce6fdfb27a1488887e92ecb669
tree78e1c0bdda5bc168482b4cb906127fc5b62c2849
parent599bc67087dd349445b8be214c0ca868837160d5
KVM: VMX: Heed the 'msr' argument in msr_write_intercepted()

Regardless of the 'msr' argument passed to the VMX version of
msr_write_intercepted(), the function always checks to see if a
specific MSR (IA32_SPEC_CTRL) is intercepted for write.  This behavior
seems unintentional and unexpected.

Modify the function so that it checks to see if the provided 'msr'
index is intercepted for write.

Fixes: 70651aabe3b5 ("KVM: nVMX: Handle dynamic MSR intercept toggling")
Cc: Sean Christopherson <seanjc@google.com>
Signed-off-by: Jim Mattson <jmattson@google.com>
Reviewed-by: Sean Christopherson <seanjc@google.com>
Message-Id: <20220810213050.2655000-1-jmattson@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/vmx/vmx.c