From patchwork Mon Nov 14 22:16:02 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brijesh Singh X-Patchwork-Id: 9428515 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 4D39A60484 for ; Mon, 14 Nov 2016 22:16:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4EEA72874C for ; Mon, 14 Nov 2016 22:16:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4338F28AD3; Mon, 14 Nov 2016 22:16:45 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B76E62874C for ; Mon, 14 Nov 2016 22:16:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S938732AbcKNWQY (ORCPT ); Mon, 14 Nov 2016 17:16:24 -0500 Received: from mail-by2nam03on0040.outbound.protection.outlook.com ([104.47.42.40]:40280 "EHLO NAM03-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S933656AbcKNWQW (ORCPT ); Mon, 14 Nov 2016 17:16:22 -0500 X-Greylist: delayed 728 seconds by postgrey-1.27 at vger.kernel.org; Mon, 14 Nov 2016 17:16:22 EST DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector1-amd-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=tkathMM6cEbUCFBmeMUlranK0MpI6t086g7F/ZoxwEA=; b=iUxnwYlD3CeocJtVNr67JgHhAhgGKmGnrBihQQsbsDgX9ycJUVkwALy5vSA7BGrz3E8u3hiLi1qMA+xkpVnDIyqZ0/WceJzzG0C3eSkwMlXVxE+Xabxs2Y35Cvnqqh3OpkQ2VmhAdVKM4LQWwJbXtlJwBTo4UD0MNYEg17WYzeU= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=brijesh.singh@amd.com; Received: from [127.0.1.1] (165.204.77.1) by BLUPR12MB0657.namprd12.prod.outlook.com (10.163.217.27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.721.10; Mon, 14 Nov 2016 22:16:05 +0000 Subject: [PATCH v1 3/3] kvm: svm: Use the hardware provided GPA instead of page walk From: Brijesh Singh To: CC: , , , , , , , , , , Date: Mon, 14 Nov 2016 17:16:02 -0500 Message-ID: <147916176259.16347.7828367075943432152.stgit@brijesh-build-machine> In-Reply-To: <147916172660.16347.15695649975899246333.stgit@brijesh-build-machine> References: <147916172660.16347.15695649975899246333.stgit@brijesh-build-machine> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 X-Originating-IP: [165.204.77.1] X-ClientProxiedBy: DM5PR20CA0009.namprd20.prod.outlook.com (10.173.136.147) To BLUPR12MB0657.namprd12.prod.outlook.com (10.163.217.27) X-Microsoft-Exchange-Diagnostics: 1; BLUPR12MB0657; 2:Z+Vxh9JKOOetnY5QtXMnqD99bCyx019+EJMPI+76nStZS2sJx2HyTh5rtVP+xmopXIaz4Kzok6xYmOZEmoXNXU8PtBCGoFm+UfbKQ9IeXu4W4z2rsHg5L5VTIVkXKsVHpxrZhGzpaDOI5riIhZiWLZwl1H1enoTNCjIvPWDVZbA=; 3:XEqJJqQPSXAWJwU2CFZINJNEQyWuSu3RnX2xYBw7IAik8IxrPt4obC7ipvIgeXNj6ggR5o8G1GzTm7nCnjrOnCX5MB1Bxt4Cc9R8pPh6GTEqgxxjX92I/wehT6YRkMo1RWD/vNmNRyN3iGzEd0Sl2UVN6q2PNvBKNtBDXnqlbwA= X-MS-Office365-Filtering-Correlation-Id: ca85e9da-bfaa-4264-b035-08d40cdbd445 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:BLUPR12MB0657; X-Microsoft-Exchange-Diagnostics: 1; BLUPR12MB0657; 25:ykLD+95VRCYHnSfsT7bRR0v6wA+IFeCU6ZMzwaggXNbPQzBoOVkniFmNAVp7CnGok4Xqwj5TJP1hsOf9KoUEFexXFpJlzPZYZHzbUjRs4AAClZYDdDXLEDHbhFYaAFTqPdgbEEPlULIluD2nJ72iNN/qLytC15SlJnulsjecOYoWt3+5hm15JwyKot4R+8OG03wh8FMLt5v/+46lRquuglcQhnL9yCHp8t08OWeUPjSSlzw0+kCDtKW//xfapxc8LcgFK6HKFJO3ztqla82OIdSHfiDGvMNr+LAezXYZn8Obm9TvKfj3fGgFNHaPwcdkyxfjW5/zbuHCbBUTfGTydSOr2hboQu6I3Rk5ELb6e5gXQXFRDcLGTuIMLCixWFfeCajScoRmdwOzqSCxFRu/PiPALMmyexy9O3CW+kE3/g+cV1WoKizkw7X13Aju17HoM2ZniM1DT6MLP7Db8jSUlBR9JyP6GFO5YynE3GrJ1E5Ec+IJvPU/Ij0x47Mk1DbEUTxKPruL3oePn9s01neNEsqV1053EI9hH0G9F3DCknb94CTkfmAy3MJBR/pJkNSNqsNe4FInefHUBsK2zpw5GKwwLXwzxTI08KuQAO+eOkn3Q8/hajg4AL+hDt/73n1MmAenI0ZZAX1xL6HmG6g6bI+oAHNwU5txI+h2h5kjmnt0y8HsC4xVLOneQfwzZclNx2kPjltogmfToYU2i0HskQ== X-Microsoft-Exchange-Diagnostics: 1; BLUPR12MB0657; 31:FbdMiv63FlCuSfWpgkPcNG2a9z9VXQhOhgoajtVeH8CE/mpdTuaffiU7kwh+aYUkOfHpXaCSDrTViSqNYA2xkzl2LutAUtrFIus1DnD28HeEqAXwSeoob9DLaUTVb3IfA4RNhNsG79BdK++eqHNAhqWGgMV+yD7HpFkA+yLRmA3LCj79g7etVOP1bg4cti/CYl61ldiLxhxaT9WcBmS4Mj+xd9LGx7DkLwzxYwiBWTLga8Y9KgNh64BAlZlsd5bJs2uXYiqDq6JSPpb2WQQLlw==; 20:GLXTbVSiy3ArAPUaQQ8zg7pv/ERgAVnIaXfFz1eo1qDiQTMZrKXXos/fUqIKNpizog34SsvN0HQNA5BHjLXgGg+DemTG4CXO7qSIZNwvdSDYgAAlgqp072gF6ZzGaAqZqqQtBzWckjafmhKL+5MA6vchDqDqRjihEMBe21KhUrGFjIxYV8fwc2q2alN2F99Pqtdx9HWsCEP2z16yAJa3BPZRPGvHN8xL2Xiitavhc4kF4lT4yXZSq9GbMvYYSl88PMOfDrkUSB/NGu9BAB0Fw9EOebJYrPpQAiG9KVq4Mm0hLInr8gxxd7tanL1hqMDIy2u4Ms83klPhRxhX9mjvGTN692O2K0IbhsoGTVGQFCuo6kaD95RwiVYmz7iBTwr79x393qoe3j6CWE0XMe1SQlBqQQ7oeJ3KYqZ3xMqSSesAFXAaErtIsXR+RAoMyH8hAf1013kOKcd5gnTIjLkjCHPME07l49BQn4ecyvN9UPygMdlxUICR1M/08wDmd0hQ X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(767451399110); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6060326)(601004)(2401047)(8121501046)(5005006)(3002001)(10201501046)(6055026)(6061324); SRVR:BLUPR12MB0657; BCL:0; PCL:0; RULEID:; SRVR:BLUPR12MB0657; X-Microsoft-Exchange-Diagnostics: 1; BLUPR12MB0657; 4:oYRVR5byNA/05psWIVrmPsvzgRXAgSnxnHs6hhUm4DMJ4OlSTBKnuhLh9EvD+KTXHxQ/1vmFUCj5vAS4BNvwQgRN+kpr3CqfM9Ts5Z/2RCW85unjKNz0L5ktYxhYNNnRZH6DjYcq7wNDTVxsKrzV290m0bgHo6QWJLqFiyGAQkKzlC0ydqUq8NANPjowuDLaHZo/aruZqPhJBvvl3F3/7HFZX3eKBLBiGAdvBIB391kXj9n+tMLPsQ4mhlO/S9c1n3lTCEWSebEitJSuSB94DHmaSe2GxUwe6KHE9WPn9TI/4nnhKwxfQxhpYIUte+uKHFuyyWfJGcXiJVxdXi0zuklWb4N5ctFJ42OrRwIjUeV+Elgi7rCHJGcqIuC/uN5Cb/ZETJfm9FrIEWJB1DfhLQsqnmY0DSPBIndZinAfKm+lnelbQw3DdscSm5I74F5zvgGKeBOkKqBi71Qnd6OMH3RY6MoFkR9sLgsR533h1ZY= X-Forefront-PRVS: 0126A32F74 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(6049001)(7916002)(199003)(189002)(68736007)(106356001)(97736004)(7416002)(33716001)(47776003)(33646002)(5660300001)(66066001)(105586002)(76176999)(4001350100001)(2351001)(50466002)(86362001)(110136003)(9686002)(305945005)(92566002)(3846002)(77096005)(230700001)(6116002)(50986999)(23676002)(6666003)(81166006)(54356999)(81156014)(7846002)(7736002)(2906002)(4326007)(101416001)(42186005)(8676002)(83506001)(6916009)(2950100002)(189998001)(103116003); DIR:OUT; SFP:1101; SCL:1; SRVR:BLUPR12MB0657; H:[127.0.1.1]; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtCTFVQUjEyTUIwNjU3OzIzOnlXUmpaZEdiVHUzMEZYTkJGV3hBV2R1Q0Ux?= =?utf-8?B?aXFpMmlGNmZiVUgzYnhmWjZDSGZ3MVFmcDk2ai85WTlkajVaTWpFVElrVmw1?= =?utf-8?B?YnpGcVRkTzhGcWtlOXpjd3VjUWEwUWxFYVZRSC9MR29DU2FNRXFFaWFqNjhZ?= =?utf-8?B?VH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TBIRtJs10H9Ls+3OGpXa8tR2F9j770AIryUIE2Us4heVGB0/1gok+j4GGy5arilrfX5WTA0eCk7LKllsxIU5u6hJu31ZwYUx9rWDZpk+7nHe9EwhLEVTgPqmDVc9sW0r4IdNH3GA==; 24:Wjig9JCGzktC/WpeGm6XlozS3BHKGDxqgKcWh1VAHatdYIr/6AVFAmkPuuWgMneBwHg4acohNyZbO5Q2oRJsULn2Bhm6/INgXykB/UBWUyU= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BLUPR12MB0657; 7:c0MqVDmKZujnlMrEHwUyD41xBaCxfD2LVf1trObKvJh6xv0eukJzh+3PYkrPhe27EYABNl6/E6kYqc4oNJFmOqmn9QiTSem79zk4AZi+Mc2JJi7FyF3v2ZCCxKHuFcDLCirwJROIjG/dq/Fr1xOb8Dw/bBO3aFkGiR4gjdqkKrToAblI/28e1EKHxmsTv9UKDafSs+84lmU3MuysbjmLwGiUeNpESV++d/k44fxumz66tpDhuGm40jlAwB3EcRg9Wf5j4Hq0ucGfA3uPitSFSvHEeoEUtpS8ly232yANAU2llW+MLbdiAWK+OWAA5mJc3DAx2sKTSidZnKfKYYsFuF0eo43kvAPopAjupWvCfXM=; 20:l7k5npwiOJ7Yz91aUlH37V+gB2RXuWBcvNLiY3639oEKaD3DfBFsnkG+5UlxhI/Nym6JiUVT/kaGMBchGJMlOxt2i1m7V4g8ma4/vS0bwxFR5JEgu3taAGPAgcEI2ERsgC28Im5HA0fOAIBrO2YmdK40vtVqMnac7eppcqVbBT+/KnJh4ImDqEJj2EaVJQly+yYgibl+wUmzfxDr8AqVXUZdoLO8vnHwgENPXgUEsm9d/WRW1Yk39B60lhMvIW+E X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Nov 2016 22:16:05.7194 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR12MB0657 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Tom Lendacky When a guest causes a NPF which requires emulation, KVM sometimes walks the guest page tables to translate the GVA to a GPA. This is unnecessary most of the time on AMD hardware since the hardware provides the GPA in EXITINFO2. The only exception cases involve string operations involving rep or operations that use two memory locations. With rep, the GPA will only be the value of the initial NPF and with dual memory locations we won't know which memory address was translated into EXITINFO2. Signed-off-by: Tom Lendacky Reviewed-by: Borislav Petkov Signed-off-by: Brijesh Singh --- arch/x86/include/asm/kvm_emulate.h | 3 +++ arch/x86/include/asm/kvm_host.h | 3 +++ arch/x86/kvm/svm.c | 9 ++++++++- arch/x86/kvm/x86.c | 17 ++++++++++++++++- 4 files changed, 30 insertions(+), 2 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/arch/x86/include/asm/kvm_emulate.h b/arch/x86/include/asm/kvm_emulate.h index e9cd7be..2d1ac09 100644 --- a/arch/x86/include/asm/kvm_emulate.h +++ b/arch/x86/include/asm/kvm_emulate.h @@ -344,6 +344,9 @@ struct x86_emulate_ctxt { struct read_cache mem_read; }; +/* String operation identifier (matches the definition in emulate.c) */ +#define CTXT_STRING_OP (1 << 13) + /* Repeat String Operation Prefix */ #define REPE_PREFIX 0xf3 #define REPNE_PREFIX 0xf2 diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h index 77cb3f9..fd5b1c8 100644 --- a/arch/x86/include/asm/kvm_host.h +++ b/arch/x86/include/asm/kvm_host.h @@ -668,6 +668,9 @@ struct kvm_vcpu_arch { int pending_ioapic_eoi; int pending_external_vector; + + /* GPA available (AMD only) */ + bool gpa_available; }; struct kvm_lpage_info { diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c index 5e64e656..b442c5a 100644 --- a/arch/x86/kvm/svm.c +++ b/arch/x86/kvm/svm.c @@ -275,6 +275,9 @@ static int avic; module_param(avic, int, S_IRUGO); #endif +/* EXITINFO2 contains valid GPA */ +static bool gpa_avail = true; + /* AVIC VM ID bit masks and lock */ static DECLARE_BITMAP(avic_vm_id_bitmap, AVIC_VM_ID_NR); static DEFINE_SPINLOCK(avic_vm_id_lock); @@ -1055,8 +1058,10 @@ static __init int svm_hardware_setup(void) goto err; } - if (!boot_cpu_has(X86_FEATURE_NPT)) + if (!boot_cpu_has(X86_FEATURE_NPT)) { npt_enabled = false; + gpa_avail = false; + } if (npt_enabled && !npt) { printk(KERN_INFO "kvm: Nested Paging disabled\n"); @@ -4192,6 +4197,8 @@ static int handle_exit(struct kvm_vcpu *vcpu) vcpu->arch.cr0 = svm->vmcb->save.cr0; if (npt_enabled) vcpu->arch.cr3 = svm->vmcb->save.cr3; + if (gpa_avail) + vcpu->arch.gpa_available = (exit_code == SVM_EXIT_NPF); if (unlikely(svm->nested.exit_required)) { nested_svm_vmexit(svm); diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index d02aeff..c290794 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -4420,7 +4420,19 @@ static int vcpu_mmio_gva_to_gpa(struct kvm_vcpu *vcpu, unsigned long gva, return 1; } - *gpa = vcpu->arch.walk_mmu->gva_to_gpa(vcpu, gva, access, exception); + /* + * If the exit was due to a NPF we may already have a GPA. + * If the GPA is present, use it to avoid the GVA to GPA table + * walk. Note, this cannot be used on string operations since + * string operation using rep will only have the initial GPA + * from when the NPF occurred. + */ + if (vcpu->arch.gpa_available && + !(vcpu->arch.emulate_ctxt.d & CTXT_STRING_OP)) + *gpa = exception->address; + else + *gpa = vcpu->arch.walk_mmu->gva_to_gpa(vcpu, gva, access, + exception); if (*gpa == UNMAPPED_GVA) return -1; @@ -5542,6 +5554,9 @@ int x86_emulate_instruction(struct kvm_vcpu *vcpu, } restart: + /* Save the faulting GPA (cr2) in the address field */ + ctxt->exception.address = cr2; + r = x86_emulate_insn(ctxt); if (r == EMULATION_INTERCEPTED)