kvm: vmx: handle_vmwrite: avoid checking for compatibility mode
PATCH v5 3/3 kvm: vmx: handle_vmwrite: avoid checking for compatibility mode
handle_vmwrite() should use is_long_mode() instead of is_64_bit_mode() because VMWRITE opcode is invalid in compatibility mode and there is no reason for extra checking CS.L.
Signed-off-by Eugene Korenevsky <[email protected]>
--- arch/x86/kvm/vmx/nested.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/kvm/vmx/nested.c +1 -1
@@ -4467,7 +4467,7 @@ static int handle_vmwrite(struct kvm_vcpu *vcpu) field_value =kvm_register_readl (vcpu, (((vmx_instruction_info) >>3 ) &0xf )); else { - len =is_64_bit_mode (vcpu) ?8 :4 ; + len =is_long_mode (vcpu) ?8 :4 ;if (get_vmx_mem_address (vcpu, exit_qualification, vmx_instruction_info, false, len, &gva))return 1 ;
Signature · 1 line
2.21.0
Quoted 5 lines · Eugene Korenevsky
handle_vmwrite()should useis_long_mode()instead ofis_64_bit_mode()because VMWRITE opcode is invalid in compatibility mode and there is no reason for extra checking CS.L.Signed-off-by Eugene Korenevsky <[email protected]>
Reviewed-by Sean Christopherson <[email protected]>