Skip to contentSkip to conversation

kvm: vmx: handle_vmwrite: avoid checking for compatibility mode

PATCH In review Eugene Korenevsky 2 participants 2 messages Jun 7, 2019

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

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.

---
 arch/x86/kvm/vmx/nested.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/kvm/vmx/nested.c +1 -1
index a2d744427d66..b39fc075aead 100644
@@ -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