From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paolo Bonzini Subject: Re: [PATCH 2/2] KVM: nVMX: VM_ENTRY/EXIT_LOAD_IA32_EFER overrides EFER.LMA settings Date: Mon, 15 Apr 2013 13:09:30 +0200 Message-ID: <516BDFEA.4040006@redhat.com> References: <516A8879.6050202@web.de> <516A88A6.9050806@web.de> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Cc: Gleb Natapov , Marcelo Tosatti , kvm , "Nadav Har'El" To: Jan Kiszka Return-path: Received: from mx1.redhat.com ([209.132.183.28]:21045 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754001Ab3DOLJl (ORCPT ); Mon, 15 Apr 2013 07:09:41 -0400 In-Reply-To: <516A88A6.9050806@web.de> Sender: kvm-owner@vger.kernel.org List-ID: Il 14/04/2013 12:44, Jan Kiszka ha scritto: > From: Jan Kiszka > > If we load the complete EFER MSR on entry or exit, EFER.LMA (and LME) > loading is skipped. Their consistency is already checked now before > starting the transition. > > Signed-off-by: Jan Kiszka > --- > arch/x86/kvm/vmx.c | 4 ++-- > 1 files changed, 2 insertions(+), 2 deletions(-) > > diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c > index 0d13b29..1df3b6f 100644 > --- a/arch/x86/kvm/vmx.c > +++ b/arch/x86/kvm/vmx.c > @@ -7135,7 +7135,7 @@ static void prepare_vmcs02(struct kvm_vcpu *vcpu, struct vmcs12 *vmcs12) > > if (vmcs12->vm_entry_controls & VM_ENTRY_LOAD_IA32_EFER) > vcpu->arch.efer = vmcs12->guest_ia32_efer; > - if (vmcs12->vm_entry_controls & VM_ENTRY_IA32E_MODE) > + else if (vmcs12->vm_entry_controls & VM_ENTRY_IA32E_MODE) > vcpu->arch.efer |= (EFER_LMA | EFER_LME); > else > vcpu->arch.efer &= ~(EFER_LMA | EFER_LME); > @@ -7536,7 +7536,7 @@ static void load_vmcs12_host_state(struct kvm_vcpu *vcpu, > { > if (vmcs12->vm_exit_controls & VM_EXIT_LOAD_IA32_EFER) > vcpu->arch.efer = vmcs12->host_ia32_efer; > - if (vmcs12->vm_exit_controls & VM_EXIT_HOST_ADDR_SPACE_SIZE) > + else if (vmcs12->vm_exit_controls & VM_EXIT_HOST_ADDR_SPACE_SIZE) > vcpu->arch.efer |= (EFER_LMA | EFER_LME); > else > vcpu->arch.efer &= ~(EFER_LMA | EFER_LME); > Reviewed-by: Paolo Bonzini