From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marcelo Tosatti Subject: Re: [PATCH 3/4] KVM: x86: Remove kvm_mmu_reset_context() in kvm_set_efer() Date: Tue, 11 May 2010 16:33:06 -0300 Message-ID: <20100511193306.GF9712@amt.cnet> References: <1273555807-11534-1-git-send-email-sheng@linux.intel.com> <1273555807-11534-3-git-send-email-sheng@linux.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Avi Kivity , kvm@vger.kernel.org To: Sheng Yang Return-path: Received: from mx1.redhat.com ([209.132.183.28]:53001 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751664Ab0EKTg5 (ORCPT ); Tue, 11 May 2010 15:36:57 -0400 Content-Disposition: inline In-Reply-To: <1273555807-11534-3-git-send-email-sheng@linux.intel.com> Sender: kvm-owner@vger.kernel.org List-ID: On Tue, May 11, 2010 at 01:30:06PM +0800, Sheng Yang wrote: > Modify EFER won't result in mode switch directly. After EFER.LME set, the > following set CR0.PG would result in mode switch to IA32e. And the later > action already covered by kvm_set_cr0(). > > Signed-off-by: Sheng Yang > --- > arch/x86/kvm/x86.c | 1 - > 1 files changed, 0 insertions(+), 1 deletions(-) > > diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c > index 764f89b..b59fc67 100644 > --- a/arch/x86/kvm/x86.c > +++ b/arch/x86/kvm/x86.c > @@ -721,7 +721,6 @@ static int set_efer(struct kvm_vcpu *vcpu, u64 efer) > kvm_x86_ops->set_efer(vcpu, efer); > > vcpu->arch.mmu.base_role.nxe = (efer & EFER_NX) && !tdp_enabled; > - kvm_mmu_reset_context(vcpu); But there are different sets of shadow pagetables for NXE on/off. See commit 9645bb56b31a1b. Without the reset, after NXE 1->0 transition, a spte retains the NXE validity check, and subsequent use of such gpte with bit 63 set does not cause a fault.