KVM: VMX: Heed the 'msr' argument in msr_write_intercepted()
PATCH 1/1 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.
--- arch/x86/kvm/vmx/vmx.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
arch/x86/kvm/vmx/vmx.c +1 -2
@@ -843,8 +843,7 @@ static bool msr_write_intercepted(struct vcpu_vmx *vmx, u32 msr)if (!(exec_controls_get (vmx) &CPU_BASED_USE_MSR_BITMAPS ))return true; -return vmx_test_msr_bitmap_write (vmx->loaded_vmcs->msr_bitmap, -MSR_IA32_SPEC_CTRL ); +return vmx_test_msr_bitmap_write (vmx->loaded_vmcs->msr_bitmap, msr); }unsigned int __vmx_vcpu_run_flags (struct vcpu_vmx *vmx)
Signature · 1 line
2.37.1.559.g78731f0fdb-goog
Quoted 5 lines · Jim Mattson
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.
Quoted 7 lines
Modify the function so that it checks to see if the provided 'msr' index is intercepted for write.
Fixes 67f4b9969c30 ("KVM: nVMX: Handle dynamic MSR intercept toggling")Cc Sean Christopherson <[email protected]>Signed-off-by Jim Mattson <[email protected]>---
I could have sworn this got fixed already. Or maybe Aaron just pointed it out off-list?
Queued, thanks.
Paolo