Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932777AbcLHROF (ORCPT ); Thu, 8 Dec 2016 12:14:05 -0500 Received: from mail-sn1nam02on0087.outbound.protection.outlook.com ([104.47.36.87]:16305 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932707AbcLHROC (ORCPT ); Thu, 8 Dec 2016 12:14:02 -0500 Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=brijesh.singh@amd.com; Subject: Re: [PATCH v2 3/3] kvm: svm: Use the hardware provided GPA instead of page walk To: Paolo Bonzini , References: <147992048887.27638.17559991037474542240.stgit@brijesh-build-machine> <147992052008.27638.18095073174935903705.stgit@brijesh-build-machine> <65a10dd8-5fae-350f-b597-f8f0261da766@redhat.com> CC: , , , , , , , , , From: Brijesh Singh Message-ID: <9820037d-e3ca-0131-3b04-2e51f2abc883@amd.com> Date: Thu, 8 Dec 2016 09:39:59 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <65a10dd8-5fae-350f-b597-f8f0261da766@redhat.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [165.204.77.1] X-ClientProxiedBy: DM5PR20CA0006.namprd20.prod.outlook.com (10.173.136.144) To CY1PR12MB0665.namprd12.prod.outlook.com (10.163.238.150) X-MS-Office365-Filtering-Correlation-Id: 15c636f7-4a98-4f41-c2ff-08d41f807a5a X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:CY1PR12MB0665; X-Microsoft-Exchange-Diagnostics: 1;CY1PR12MB0665;3:gG+EbAak3CfOvTHNYccbZPjYDgSoffZaGg4N0s+T4rkEXUku8CPSrLJcFkJK5MMLYEpGUdqo1GZZLu2360uPDKxHUEyKwovuHCrznyTDZmavpujlgtNDMY6GyjrHSAaowk4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J/fKgVAPrDQUMYNgrZx29+Fb1DRRDGYLkdMBWCsBRGDOG0TMuGINi1YdqXPCdEY0YLHUrUkoMrSS87hRxfr9xwYRU2zkiLWh+p0Ziew9yokEhhUjTIfKbLs90i3CF/538vUAqBHsOTRFLkNfWIyZiRhDTb7ZR9jTiEcDgYdz80KPWJ5zQz4mLG1KJR/c/qDLfs1DTQzAQA9fzwh3MZwCujkRbgvUxrWjcMbWyyXHjNuqhPRieqla+BklylN4R9PTWRg8YpAorS5itULyc7WihsHc6KzlNZAd65RYwl8ZEAcztVqeay3tgQq+dRiIEjaNhRKYEsgI0myu7xdqutu X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(9452136761055)(767451399110); X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040375)(601004)(2401047)(5005006)(8121501046)(3002001)(10201501046)(6055026)(6041248)(20161123555025)(20161123562025)(20161123564025)(20161123560025)(6072148);SRVR:CY1PR12MB0665;BCL:0;PCL:0;RULEID:;SRVR:CY1PR12MB0665; X-Microsoft-Exchange-Diagnostics: 1;CY1PR12MB0665;4:wYBgMYdFQLP8hMVUahdYf9zIjF3ooWjwmipXHVBPX3Sn5pY8JjAKjOF38Qf/qAfczCI4osW8tReiSj9z0HN5l951LZX0k7wFZ4IMKp1asfqAP3Y6Y+iNC96g9XUrtDZKTlfzMO+BrBWRuRMkTjRkN9ddKxZweDxKOrehm+cxBLqOMdD0UNEcwbKd+9zvu3MrsECLvml881ppK2A3WrGzYvo9X0UOAe40tY3vUkiaA5sy7YZ91rJAXHhv2xACIGRnClbBN/rWYOVuk94ezaWglnwL5lg/hOcgN/L9m2f/XU/qu+XNsYp5ef7d8orxxfYL6yVzoFFWr5PjA2gEoKzTuKLfKh0oJJPozeNBgfNzWg5SzF/O7siSUzii1RokkGlTpYp6+zD+2g9IjF0db8T1Fzy2DyoL64PM9pL+2RfvTjTahNV96CxGO7Tiw1R4/9XaMicKvTgvobWCXjgVK5/tiKrR/oAyBcvRriDjB3bioZls4joDTNL8BEDrwnjUUeGQEyuffH7bWOHl4SyO3HCf9eojm2/7NAEYBacqt3QNMiazfeDnhu8CVV8oJ3FHmDW/auwgxW8nPTmXEAr7uKqUXbTTO++gyQRxogUsROWBWMT01lE9omuqrc3454xaEhZbm+SxWqIcQF+SgnciFBKGLkNYTKNLj11ULNChWXmGGqM= X-Forefront-PRVS: 0150F3F97D X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(4630300001)(6049001)(6009001)(7916002)(39410400002)(39860400002)(39850400002)(39450400003)(39840400002)(199003)(377454003)(24454002)(189002)(7416002)(65956001)(105586002)(81156014)(65806001)(230700001)(42186005)(31686004)(76176999)(54356999)(50986999)(6116002)(68736007)(50466002)(2950100002)(77096006)(733004)(101416001)(90366009)(6486002)(65826007)(305945005)(5660300001)(6666003)(81166006)(38730400001)(7846002)(106356001)(66066001)(3846002)(64126003)(7736002)(2906002)(36756003)(92566002)(33646002)(86362001)(31696002)(23676002)(4001350100001)(189998001)(4326007)(83506001)(5001770100001)(229853002)(97736004)(8676002)(47776003);DIR:OUT;SFP:1101;SCL:1;SRVR:CY1PR12MB0665;H:[10.236.136.62];FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtDWTFQUjEyTUIwNjY1OzIzOnRzd1o5SVRyVWdJNmZiT3JsTEtlaC8rRE9m?= =?utf-8?B?L0d4UWlqVnhRNDZFck1JNE9aZVJEa2E0bnU2eDJWOVdtMWtSOWFWZ1pOeDIx?= =?utf-8?B?TEcreitRT1ZZbUVuK2Z4ejVRQ2ZCd09YU1RIRm91VXBObG9DL2kxdVZ3bERq?= =?utf-8?B?cjlLcTFoSlc5OGtHM2JVMHh3bnlUM0FUdXBwcHhXcUFpOHpQVHpLMklpNjk5?= =?utf-8?B?NWxRZGY1QytheDNRS2hkSklCMjRscWRIdFlXUmFzM1BoSXpOM1crU1M1c1Fm?= =?ut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wJi66bHHVnjybtS6jaC2CRx3jiiHs+wD0m58Zn2OBE5ylMeEAYSS3ICDDUd0GdubXicYQY7Zvv1Wr+AS15p7CylFO2IGoHqB8zfU7gMIxsHKEEoPvwNba8n3i61KycXSFLo8Vw5PflIQYX5MoiO68R1R4d3MQ5DsYCtJ9kcavGmGIXSyiqzl2fqIU+wHSOTyD6qA==;20:2zhLkJXFXEBirevZ4hAj8MKe1pNFEms7LYxMJK9GHaINP0nGFOtD2Km1CRdQ+xY1UgWfmP58fH3hqFUltZifmR9CUVC8krCSLHV/q+J2m8pE1XUm4P/TjqvIknCPb4MvCE0xupISgI60aowtC2dFY9D00muhwiwvKw7mDtcg/AT1d54tYxt6MaTmVy3mHb9G4gj5/Vp/0VNlHkHGVw4qnfJqQf2zx2cc3sClrZdCWCSEhPA4v/A6kgecgmELIj2v X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Dec 2016 15:40:02.9791 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR12MB0665 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 5496 Lines: 163 Hi Paolo, On 12/08/2016 08:52 AM, Paolo Bonzini wrote: > > > On 23/11/2016 18:02, Brijesh Singh wrote: >> 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 > > Tom, Brijesh, > > I would like to confirm that you have run kvm-unit-tests with this patch? > I haven't yet tried AMD (will do before sending the pull request to Linus), > but a similar patch for Intel gives me these 4 failures on emulator.flat: > > FAIL: push mem > FAIL: pop mem > FAIL: cross-page mmio read > FAIL: cross-page mmio write > I did not ran kvm-unit-tests. However, I was able to boot Linux guest and run some stress test. I will run kvm-unit-tests and let you know soon. -Brijesh > The VMX patch to set gpa_available is just this: > > diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c > index 25d48380c312..5d7b60d4795b 100644 > --- a/arch/x86/kvm/vmx.c > +++ b/arch/x86/kvm/vmx.c > @@ -6393,6 +6393,7 @@ static int handle_ept_violation(struct kvm_vcpu *vcpu) > /* ept page table is present? */ > error_code |= (exit_qualification & 0x38) != 0; > > + vcpu->arch.gpa_available = true; > vcpu->arch.exit_qualification = exit_qualification; > > return kvm_mmu_page_fault(vcpu, gpa, error_code, NULL, 0); > @@ -6410,6 +6411,7 @@ static int handle_ept_misconfig(struct kvm_vcpu *vcpu) > } > > ret = handle_mmio_page_fault(vcpu, gpa, true); > + vcpu->arch.gpa_available = true; > if (likely(ret == RET_MMIO_PF_EMULATE)) > return x86_emulate_instruction(vcpu, gpa, 0, NULL, 0) == > EMULATE_DONE; > @@ -8524,6 +8526,7 @@ static int vmx_handle_exit(struct kvm_vcpu *vcpu) > u32 vectoring_info = vmx->idt_vectoring_info; > > trace_kvm_exit(exit_reason, vcpu, KVM_ISA_VMX); > + vcpu->arch.gpa_available = false; > > /* > * Flush logged GPAs PML buffer, this will make dirty_bitmap more > > Thanks, > > Paolo > >> --- >> arch/x86/include/asm/kvm_emulate.h | 3 +++ >> arch/x86/include/asm/kvm_host.h | 3 +++ >> arch/x86/kvm/svm.c | 2 ++ >> arch/x86/kvm/x86.c | 17 ++++++++++++++++- >> 4 files changed, 24 insertions(+), 1 deletion(-) >> >> 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..1bbd04c 100644 >> --- a/arch/x86/kvm/svm.c >> +++ b/arch/x86/kvm/svm.c >> @@ -4246,6 +4246,8 @@ static int handle_exit(struct kvm_vcpu *vcpu) >> return 1; >> } >> >> + vcpu->arch.gpa_available = (exit_code == SVM_EXIT_NPF); >> + >> return svm_exit_handlers[exit_code](svm); >> } >> >> diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c >> index c30f62dc..5002eea 100644 >> --- a/arch/x86/kvm/x86.c >> +++ b/arch/x86/kvm/x86.c >> @@ -4441,7 +4441,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; >> @@ -5563,6 +5575,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) >> >> -- >> 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 >>