From patchwork Fri Sep 10 15:30:38 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joerg Roedel X-Patchwork-Id: 169332 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id o8AFZa0e001900 for ; Fri, 10 Sep 2010 15:35:37 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754778Ab0IJPdC (ORCPT ); Fri, 10 Sep 2010 11:33:02 -0400 Received: from tx2ehsobe003.messaging.microsoft.com ([65.55.88.13]:36889 "EHLO TX2EHSOBE006.bigfish.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754754Ab0IJPc6 (ORCPT ); Fri, 10 Sep 2010 11:32:58 -0400 Received: from mail145-tx2-R.bigfish.com (10.9.14.236) by TX2EHSOBE006.bigfish.com (10.9.40.26) with Microsoft SMTP Server id 8.1.340.0; Fri, 10 Sep 2010 15:32:57 +0000 Received: from mail145-tx2 (localhost.localdomain [127.0.0.1]) by mail145-tx2-R.bigfish.com (Postfix) with ESMTP id A800A1181C5; Fri, 10 Sep 2010 15:32:57 +0000 (UTC) X-SpamScore: 1 X-BigFish: VS1(zzzz1202hzz8275bhz32i2a8h87h43h) X-FB-DOMAIN-IP-MATCH: fail Received: from mail145-tx2 (localhost.localdomain [127.0.0.1]) by mail145-tx2 (MessageSwitch) id 1284132761137095_3219; Fri, 10 Sep 2010 15:32:41 +0000 (UTC) Received: from TX2EHSMHS025.bigfish.com (unknown [10.9.14.248]) by mail145-tx2.bigfish.com (Postfix) with ESMTP id 8FE69138004F; Fri, 10 Sep 2010 15:32:39 +0000 (UTC) Received: from ausb3extmailp01.amd.com (163.181.251.8) by TX2EHSMHS025.bigfish.com (10.9.99.125) with Microsoft SMTP Server (TLS) id 14.0.482.44; Fri, 10 Sep 2010 15:32:26 +0000 Received: from ausb3twp01.amd.com ([163.181.250.37]) by ausb3extmailp01.amd.com (Switch-3.2.7/Switch-3.2.7) with SMTP id o8AFXxYp015387; Fri, 10 Sep 2010 10:34:37 -0500 X-WSS-ID: 0L8JF40-01-7OK-02 X-M-MSG: Received: from sausexhtp01.amd.com (sausexhtp01.amd.com [163.181.3.165]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) by ausb3twp01.amd.com (Tumbleweed MailGate 3.7.2) with ESMTP id 2A0C310284B8; Fri, 10 Sep 2010 10:31:11 -0500 (CDT) Received: from storexhtp02.amd.com (172.24.4.4) by sausexhtp01.amd.com (163.181.3.165) with Microsoft SMTP Server (TLS) id 8.3.83.0; Fri, 10 Sep 2010 10:31:14 -0500 Received: from gwo.osrc.amd.com (165.204.16.204) by storexhtp02.amd.com (172.24.4.4) with Microsoft SMTP Server id 8.3.83.0; Fri, 10 Sep 2010 11:31:13 -0400 Received: from lemmy.osrc.amd.com (lemmy.osrc.amd.com [165.204.15.93]) by gwo.osrc.amd.com (Postfix) with ESMTP id 31B9149C14A; Fri, 10 Sep 2010 16:31:13 +0100 (BST) Received: by lemmy.osrc.amd.com (Postfix, from userid 1000) id 2A0A8A00C1; Fri, 10 Sep 2010 17:31:31 +0200 (CEST) From: Joerg Roedel To: Avi Kivity , Marcelo Tosatti CC: , , Joerg Roedel Subject: [PATCH 01/29] KVM: MMU: Check for root_level instead of long mode Date: Fri, 10 Sep 2010 17:30:38 +0200 Message-ID: <1284132667-18620-2-git-send-email-joerg.roedel@amd.com> X-Mailer: git-send-email 1.7.0.4 In-Reply-To: <1284132667-18620-1-git-send-email-joerg.roedel@amd.com> References: <1284132667-18620-1-git-send-email-joerg.roedel@amd.com> MIME-Version: 1.0 X-Reverse-DNS: unknown 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 (demeter1.kernel.org [140.211.167.41]); Fri, 10 Sep 2010 15:35:37 +0000 (UTC) diff --git a/arch/x86/kvm/paging_tmpl.h b/arch/x86/kvm/paging_tmpl.h index debe770..e4ad3dc 100644 --- a/arch/x86/kvm/paging_tmpl.h +++ b/arch/x86/kvm/paging_tmpl.h @@ -132,7 +132,7 @@ walk: walker->level = vcpu->arch.mmu.root_level; pte = vcpu->arch.cr3; #if PTTYPE == 64 - if (!is_long_mode(vcpu)) { + if (vcpu->arch.mmu.root_level == PT32E_ROOT_LEVEL) { pte = kvm_pdptr_read(vcpu, (addr >> 30) & 3); trace_kvm_mmu_paging_element(pte, walker->level); if (!is_present_gpte(pte)) { @@ -205,7 +205,7 @@ walk: (PTTYPE == 64 || is_pse(vcpu))) || ((walker->level == PT_PDPE_LEVEL) && is_large_pte(pte) && - is_long_mode(vcpu))) { + vcpu->arch.mmu.root_level == PT64_ROOT_LEVEL)) { int lvl = walker->level; walker->gfn = gpte_to_gfn_lvl(pte, lvl);