From patchwork Thu Mar 5 12:12:30 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joerg Roedel X-Patchwork-Id: 10029 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n25CEggY021810 for ; Thu, 5 Mar 2009 12:14:42 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755300AbZCEMNg (ORCPT ); Thu, 5 Mar 2009 07:13:36 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1755286AbZCEMNg (ORCPT ); Thu, 5 Mar 2009 07:13:36 -0500 Received: from tx2ehsobe004.messaging.microsoft.com ([65.55.88.14]:4313 "EHLO TX2EHSOBE007.bigfish.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1755250AbZCEMNe (ORCPT ); Thu, 5 Mar 2009 07:13:34 -0500 Received: from mail6-tx2-R.bigfish.com (10.9.14.244) by TX2EHSOBE007.bigfish.com (10.9.40.27) with Microsoft SMTP Server id 8.1.340.0; Thu, 5 Mar 2009 12:13:31 +0000 Received: from mail6-tx2 (localhost.localdomain [127.0.0.1]) by mail6-tx2-R.bigfish.com (Postfix) with ESMTP id 9E3906404A6; Thu, 5 Mar 2009 12:13:31 +0000 (UTC) X-BigFish: VPS1(zzzzzzz32i66h) X-Spam-TCS-SCL: 5:0 Received: by mail6-tx2 (MessageSwitch) id 1236255194574684_25249; Thu, 5 Mar 2009 12:13:14 +0000 (UCT) Received: from ausb3extmailp02.amd.com (ausb3extmailp02.amd.com [163.181.251.22]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail6-tx2.bigfish.com (Postfix) with ESMTP id 76BEB10F00B2; Thu, 5 Mar 2009 12:12:49 +0000 (UTC) Received: from ausb3twp01.amd.com (ausb3twp01.amd.com [163.181.250.37]) by ausb3extmailp02.amd.com (Switch-3.2.7/Switch-3.2.7) with ESMTP id n25CCi2D005583; Thu, 5 Mar 2009 06:12:47 -0600 X-WSS-ID: 0KG18L4-01-8SG-01 Received: from sausexbh1.amd.com (sausexbh1.amd.com [163.181.22.101]) by ausb3twp01.amd.com (Tumbleweed MailGate 3.5.1) with ESMTP id 2FB1B1943C4; Thu, 5 Mar 2009 06:12:39 -0600 (CST) Received: from sausexmb2.amd.com ([163.181.3.157]) by sausexbh1.amd.com with Microsoft SMTPSVC(6.0.3790.3959); Thu, 5 Mar 2009 06:12:44 -0600 Received: from SDRSEXMB1.amd.com ([172.20.3.116]) by sausexmb2.amd.com with Microsoft SMTPSVC(6.0.3790.3959); Thu, 5 Mar 2009 06:12:43 -0600 Received: from seurexmb1.amd.com ([165.204.82.130]) by SDRSEXMB1.amd.com with Microsoft SMTPSVC(6.0.3790.3959); Thu, 5 Mar 2009 13:12:34 +0100 Received: from lemmy.amd.com ([165.204.85.93]) by seurexmb1.amd.com with Microsoft SMTPSVC(6.0.3790.3959); Thu, 5 Mar 2009 13:12:33 +0100 Received: by lemmy.amd.com (Postfix, from userid 41430) id A8B0353936; Thu, 5 Mar 2009 13:12:33 +0100 (CET) From: Joerg Roedel To: Avi Kivity , Marcelo Tosatti CC: kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Joerg Roedel Subject: [PATCH 3/6] kvm/x86/mmu: don't unnecessarily recalculate table_gfn in *fetch Date: Thu, 5 Mar 2009 13:12:30 +0100 Message-ID: <1236255153-4432-4-git-send-email-joerg.roedel@amd.com> X-Mailer: git-send-email 1.5.6.4 In-Reply-To: <1236255153-4432-1-git-send-email-joerg.roedel@amd.com> References: <1236255153-4432-1-git-send-email-joerg.roedel@amd.com> X-OriginalArrivalTime: 05 Mar 2009 12:12:33.0796 (UTC) FILETIME=[AA2E8440:01C99D8B] MIME-Version: 1.0 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org Signed-off-by: Joerg Roedel --- arch/x86/kvm/paging_tmpl.h | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/arch/x86/kvm/paging_tmpl.h b/arch/x86/kvm/paging_tmpl.h index a0c11ea..79668ba 100644 --- a/arch/x86/kvm/paging_tmpl.h +++ b/arch/x86/kvm/paging_tmpl.h @@ -315,7 +315,7 @@ static u64 *FNAME(fetch)(struct kvm_vcpu *vcpu, gva_t addr, direct = 1; if (!is_dirty_pte(gw->ptes[level - 1])) access &= ~ACC_WRITE_MASK; - table_gfn = gpte_to_gfn(gw->ptes[level - 1]); + table_gfn = gw->table_gfn[level - delta]; } else { direct = 0; table_gfn = gw->table_gfn[level - 2];