Skip to content

Commit 020dac4

Browse files
jsmattsonjrbonzini
authored andcommitted
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: 67f4b99 ("KVM: nVMX: Handle dynamic MSR intercept toggling") Cc: Sean Christopherson <[email protected]> Signed-off-by: Jim Mattson <[email protected]> Reviewed-by: Sean Christopherson <[email protected]> Message-Id: <[email protected]> Signed-off-by: Paolo Bonzini <[email protected]>
1 parent b64d740 commit 020dac4

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

arch/x86/kvm/vmx/vmx.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -843,8 +843,7 @@ static bool msr_write_intercepted(struct vcpu_vmx *vmx, u32 msr)
843843
if (!(exec_controls_get(vmx) & CPU_BASED_USE_MSR_BITMAPS))
844844
return true;
845845

846-
return vmx_test_msr_bitmap_write(vmx->loaded_vmcs->msr_bitmap,
847-
MSR_IA32_SPEC_CTRL);
846+
return vmx_test_msr_bitmap_write(vmx->loaded_vmcs->msr_bitmap, msr);
848847
}
849848

850849
unsigned int __vmx_vcpu_run_flags(struct vcpu_vmx *vmx)

0 commit comments

Comments
 (0)