kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v5 3/3] kvm: vmx: handle_vmwrite: avoid checking for compatibility mode
@ 2019-06-07  6:04 Eugene Korenevsky
  2019-06-07 15:02 ` Sean Christopherson
  0 siblings, 1 reply; 2+ messages in thread
From: Eugene Korenevsky @ 2019-06-07  6:04 UTC (permalink / raw)
  To: kvm; +Cc: Paolo Bonzini, Sean Christopherson

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 <ekorenevsky@gmail.com>
---
 arch/x86/kvm/vmx/nested.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/kvm/vmx/nested.c b/arch/x86/kvm/vmx/nested.c
index a2d744427d66..b39fc075aead 100644
--- a/arch/x86/kvm/vmx/nested.c
+++ b/arch/x86/kvm/vmx/nested.c
@@ -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;
-- 
2.21.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v5 3/3] kvm: vmx: handle_vmwrite: avoid checking for compatibility mode
  2019-06-07  6:04 [PATCH v5 3/3] kvm: vmx: handle_vmwrite: avoid checking for compatibility mode Eugene Korenevsky
@ 2019-06-07 15:02 ` Sean Christopherson
  0 siblings, 0 replies; 2+ messages in thread
From: Sean Christopherson @ 2019-06-07 15:02 UTC (permalink / raw)
  To: Eugene Korenevsky, kvm, Paolo Bonzini

On Fri, Jun 07, 2019 at 09:04:04AM +0300, Eugene Korenevsky wrote:
> 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 <ekorenevsky@gmail.com>

Reviewed-by: Sean Christopherson <sean.j.christopherson@intel.com>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-06-07 15:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-06-07  6:04 [PATCH v5 3/3] kvm: vmx: handle_vmwrite: avoid checking for compatibility mode Eugene Korenevsky
2019-06-07 15:02 ` Sean Christopherson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).