From patchwork Wed May 12 06:33:03 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sheng Yang X-Patchwork-Id: 98919 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 o4C6YeNf002302 for ; Wed, 12 May 2010 06:34:40 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753261Ab0ELGd5 (ORCPT ); Wed, 12 May 2010 02:33:57 -0400 Received: from mga11.intel.com ([192.55.52.93]:52248 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753126Ab0ELGdz (ORCPT ); Wed, 12 May 2010 02:33:55 -0400 Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga102.fm.intel.com with ESMTP; 11 May 2010 23:31:51 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.53,212,1272870000"; d="scan'208";a="797665755" Received: from syang10-desktop.sh.intel.com (HELO syang10-desktop) ([10.239.36.64]) by fmsmga001.fm.intel.com with ESMTP; 11 May 2010 23:33:41 -0700 Received: from yasker by syang10-desktop with local (Exim 4.71) (envelope-from ) id 1OC5VD-0005bf-4b; Wed, 12 May 2010 14:33:07 +0800 From: Sheng Yang To: Avi Kivity , Marcelo Tosatti Cc: kvm@vger.kernel.org, Sheng Yang Subject: [PATCH 1/4] KVM: x86: Check LMA bit before set_efer Date: Wed, 12 May 2010 14:33:03 +0800 Message-Id: <1273645986-21526-1-git-send-email-sheng@linux.intel.com> X-Mailer: git-send-email 1.7.0.4 In-Reply-To: <4BEA4B2A.9060907@redhat.com> References: <4BEA4B2A.9060907@redhat.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 06:34:40 +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;