From patchwork Wed May 12 08:40:40 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sheng Yang X-Patchwork-Id: 98953 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o4C8gAgI031556 for ; Wed, 12 May 2010 08:42:11 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755096Ab0ELIlg (ORCPT ); Wed, 12 May 2010 04:41:36 -0400 Received: from mga02.intel.com ([134.134.136.20]:31372 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755000Ab0ELIle (ORCPT ); Wed, 12 May 2010 04:41:34 -0400 Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga101.jf.intel.com with ESMTP; 12 May 2010 01:39:11 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.53,213,1272870000"; d="scan'208";a="517219171" Received: from syang10-desktop.sh.intel.com (HELO syang10-desktop) ([10.239.36.64]) by orsmga002.jf.intel.com with ESMTP; 12 May 2010 01:40:59 -0700 Received: from yasker by syang10-desktop with local (Exim 4.71) (envelope-from ) id 1OC7Ui-00061b-0p; Wed, 12 May 2010 16:40:44 +0800 From: Sheng Yang To: Avi Kivity , Marcelo Tosatti Cc: kvm@vger.kernel.org, Sheng Yang Subject: [PATCH][v2 1/3] KVM: x86: Check LMA bit before set_efer Date: Wed, 12 May 2010 16:40:40 +0800 Message-Id: <1273653642-23132-2-git-send-email-sheng@linux.intel.com> X-Mailer: git-send-email 1.7.0.4 In-Reply-To: <1273653642-23132-1-git-send-email-sheng@linux.intel.com> References: <1273653642-23132-1-git-send-email-sheng@linux.intel.com> Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Wed, 12 May 2010 08:42:11 +0000 (UTC) diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index cd8a606..2cae460 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -715,11 +715,11 @@ static int set_efer(struct kvm_vcpu *vcpu, u64 efer) return 1; } - kvm_x86_ops->set_efer(vcpu, efer); - efer &= ~EFER_LMA; efer |= vcpu->arch.efer & EFER_LMA; + kvm_x86_ops->set_efer(vcpu, efer); + vcpu->arch.efer = efer; vcpu->arch.mmu.base_role.nxe = (efer & EFER_NX) && !tdp_enabled;