From patchwork Wed Jul 14 15:38:58 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gleb Natapov X-Patchwork-Id: 112018 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.4/8.14.3) with ESMTP id o6EFd5un026798 for ; Wed, 14 Jul 2010 15:39:05 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757335Ab0GNPjB (ORCPT ); Wed, 14 Jul 2010 11:39:01 -0400 Received: from mx1.redhat.com ([209.132.183.28]:65350 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752975Ab0GNPjA (ORCPT ); Wed, 14 Jul 2010 11:39:00 -0400 Received: from int-mx03.intmail.prod.int.phx2.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o6EFd0jJ017731 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 14 Jul 2010 11:39:00 -0400 Received: from dhcp-1-237.tlv.redhat.com (dhcp-1-237.tlv.redhat.com [10.35.1.237]) by int-mx03.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o6EFcx2h005091; Wed, 14 Jul 2010 11:38:59 -0400 Received: by dhcp-1-237.tlv.redhat.com (Postfix, from userid 13519) id DF77818D3BA; Wed, 14 Jul 2010 18:38:58 +0300 (IDT) Date: Wed, 14 Jul 2010 18:38:58 +0300 From: Gleb Natapov To: mtosatti@redhat.com, avi@redhat.com Cc: kvm@vger.kernel.org Subject: [PATCH] do not call gva_to_gpa on physical address Message-ID: <20100714153858.GI4689@redhat.com> MIME-Version: 1.0 Content-Disposition: inline X-Scanned-By: MIMEDefang 2.67 on 10.5.11.16 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, 14 Jul 2010 15:39:05 +0000 (UTC) diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index fb08316..721bf0a 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -3944,10 +3944,13 @@ static bool reexecute_instruction(struct kvm_vcpu *vcpu, gva_t gva) if (kvm_mmu_unprotect_page_virt(vcpu, gva)) return true; - gpa = kvm_mmu_gva_to_gpa_system(vcpu, gva, NULL); + if (!tdp_enabled) { + gpa = kvm_mmu_gva_to_gpa_system(vcpu, gva, NULL); - if (gpa == UNMAPPED_GVA) - return true; /* let cpu generate fault */ + if (gpa == UNMAPPED_GVA) + return true; /* let cpu generate fault */ + } else + gpa = gva; if (!kvm_is_error_hva(gfn_to_hva(vcpu->kvm, gpa >> PAGE_SHIFT))) return true;