Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751539AbdGQVck (ORCPT ); Mon, 17 Jul 2017 17:32:40 -0400 Received: from mail-sn1nam02on0072.outbound.protection.outlook.com ([104.47.36.72]:63828 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751317AbdGQVch (ORCPT ); Mon, 17 Jul 2017 17:32:37 -0400 Authentication-Results: amd.com; dkim=none (message not signed) header.d=none;amd.com; dmarc=none action=none header.from=amd.com; Cc: brijesh.singh@amd.com, tglx@linutronix.de, mingo@redhat.com, hpa@zytor.com, x86@kernel.org, Thomas.Lendacky@amd.com Subject: Re: [PATCH v2] KVM: x86: Avoid guest page table walk when gpa_available is set To: pbonzini@redhat.com, rkrcmar@redhat.com, joro@8bytes.org, kvm@vger.kernel.org, linux-kernel@vger.kernel.org References: <1495206749-25393-1-git-send-email-brijesh.singh@amd.com> From: Brijesh Singh Message-ID: Date: Mon, 17 Jul 2017 16:32:28 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.1 MIME-Version: 1.0 In-Reply-To: <1495206749-25393-1-git-send-email-brijesh.singh@amd.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [165.204.77.1] X-ClientProxiedBy: DM5PR19CA0013.namprd19.prod.outlook.com (10.175.226.151) To BY2PR12MB0146.namprd12.prod.outlook.com (10.162.82.19) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 59b25482-1973-476f-f7ef-08d4cd5b56b3 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(300000503095)(300135400095)(48565401081)(201703131423075)(201703031133081)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095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pVspdr7loiwNphrFvRSV7FbRm9phcIISg58wNwsJjR+AvOR6ylEFfDzxopK6JExjUwyPxxsJrnTc+iZVzNRF6x7LyCL/DcCRVyfdd5redMvpuLNmkh5qLouet31QeZy5sfc9rjKnMMUYhY0Ehh0jKPTRN2z8o3eGEjIQ46rtSa/eM/irw/V2ApcMQKtXI7TjlMuMvEBtkpd80c7LNxQRObkvQYJ0OKn6o932JwTWQDcEzxBzUQA0UnWibl+drvN/n4zoLRNRbZYSwYK0PiYmoo4jKaNxDDDP55IM29ojsLBrCEIQKKurjqJPmgkGMXUDo7EKM41ecK9bzqQGO3T95eWq6RdzH2C8DVhBukpRvrG50BC2Qyi4iOci6qqXD8bB3nSiMQbGG2sVheN1bnGHHhDRPLQI9YLvjMI289eE= X-Microsoft-Exchange-Diagnostics: 1;BY2PR12MB0146;20:qrCxqhBiujTyBWwzubCB3zooj9qiVsYwnC6WxAySpDcKMeIybHLYeiBXXR9bal7DBZsLlTcml0JZIwGpY5As98dYBehMnV0DtRJpvmiD+7QscJIQ6Aai2wwTomuFSzh5Vt5PObuCevSTmzB7H5ESNIYHgFf3Mr17LpMoQCpygdVfa9WNKjsCDQxCjmX9y4W8yHaQXeMK1zo3APj08MkIxdIL92OGcMPwT4ypay2oJtgWI+wTXC2LjAYAfFm17E7tA6YXKUzdtV+Y766nrrExaZdXS8OXbmGhacirXvukL3VDQx5r9l6WOsss8KjxJLWxAYRDkioNxb6maQp5C939wGsLFXvZUy6SWK3hI0lO058DRXenl7WG8HwNqb48d5+IXbkhi4P3G+kAKl6NBe1vA7Ux6I1tkL6MvMg9Gp7B7X4BlECEhBoZmnaFxJF/1D5KxGm7u68aBr58dt5ZWw9MEDA2WRTafEySAJsTXZVVcIB3yIlr8GSNQHVWHKhTsL2n X-Exchange-Antispam-Report-Test: UriScan:(236129657087228)(767451399110); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(5005006)(8121501046)(2017060910075)(3002001)(10201501046)(93006095)(93001095)(100000703101)(100105400095)(6055026)(6041248)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123562025)(20161123555025)(20161123564025)(20161123558100)(20161123560025)(6072148)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:BY2PR12MB0146;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:BY2PR12MB0146; X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtCWTJQUjEyTUIwMTQ2OzQ6QXNLMTBCd0ZJRThVZ2tZN2dEM2RoOHUvOVpn?= =?utf-8?B?U0FyUGhOMVgvT2FKQWhXam9GMzQvVnFDMzRDKy9PTFM4c2ZxNUtnbnArLzVw?= =?utf-8?B?M05DZE03OERQeDlXVUZodlU0T2hhYno3YURzWWlQbkFaMFpTSEdmYmdnamty?= =?utf-8?B?UnAxQ0NOdkJyMU9NRlE5N0VmbEVUR0dEZlNIMVFrTWFYRkRnWEU1bisvU3FK?= =?utf-8?B?QkNzM0VnUTJZUEpGWGpWenoxaGNPaE1qR1Z4dkZ2d2tldzJubjhnKzNQVFZD?= =?utf-8?B?T0tpMHA2T3BiRG9qcHlXUS9MeHoxdktKeFZvVmxQSlVvNlRjZXA5ZTZiQnZz?= =?utf-8?B?Q1VXUy9BSnI2TTZ2WXYwcTlmNWRER0dMdkpWNXljUk5qSWJwbUZ4dWNFT1BC?= =?utf-8?B?b1JLYjNRbFprdW43aGd3VHlOVDJGbWFnUktuMEFaRjh3cXRSdnl1dDd5VkFu?= =?utf-8?B?a2FxTE5lWnprY0tVWUszUS9MUFFrTEVuZE1KOEwvaVhucXUzYnpuTjhPZ0s1?= =?utf-8?B?akM0LzRnOVkwM01GbCtJQXNOYlkydzdHSUZTY282TVJIQzhkRkhZVUtZK2w1?= =?utf-8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jkx?= =?utf-8?B?YTJkSW55eE8xZytUYWN5elZEeVlxRDVuWHUxQkZ4WmszQ3NxdzdvNmltY25R?= =?utf-8?B?TVU0S3d4dmowY2NTRkNYUEk1QXJ1RkJhTExVSjdtWkVINEFvS3A5WVpzM0ND?= =?utf-8?B?dC9vSUk1Vm5lVnQ3WkUzelRTV2dtbGRCUWc0Q09iZUltTXBIT1ZpdjByQ3hn?= =?utf-8?Q?9ElAeoJROybTLIVtvruNd51UVQnvJ35Bbh317T?= X-Forefront-PRVS: 0371762FE7 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(4630300001)(7370300001)(6049001)(6009001)(39860400002)(39850400002)(39400400002)(39410400002)(39840400002)(39450400003)(209900001)(377454003)(24454002)(47776003)(66066001)(53936002)(2906002)(4001350100001)(4326008)(7350300001)(189998001)(64126003)(5660300001)(65826007)(83506001)(7736002)(86362001)(31696002)(305945005)(25786009)(50466002)(65806001)(50986999)(54356999)(3846002)(76176999)(6116002)(38730400002)(31686004)(966005)(53376002)(110136004)(23676002)(81166006)(90366009)(478600001)(77096006)(8676002)(229853002)(6486002)(230700001)(6306002)(36756003)(6666003)(2950100002)(33646002)(42186005)(6246003)(53546010)(6606295002);DIR:OUT;SFP:1101;SCL:1;SRVR:BY2PR12MB0146;H:[10.236.136.62];FPR:;SPF:None;MLV:sfv;LANG:en; X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtCWTJQUjEyTUIwMTQ2OzIzOlh6dGl0QnVWczNZdXJ0VW1jMVZMY3BPdjFV?= =?utf-8?B?bkUrSTR5NnFoUzhZNWIydEpHTUU4L3U2SFNUR0dpblM5MElGdVltUlVmT0lC?= =?utf-8?B?WTNnb0Z4S3doWmU4UkJXYjdDMkFRall6TG1UanR4VHlTMFBqeFZnaVFVS08z?= =?utf-8?B?T01WcHBjazk1ejdGUFU1ajhNWEt5cU91dDB2THFnb01Fd1hvU1dBa05JN2Q3?= =?utf-8?B?L3EzUEpNbGFXQUpOQWNERjJsN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p3ZJNkbKFXXcnikpBaWR3v2kU9O4oOo= X-Microsoft-Exchange-Diagnostics: 1;BY2PR12MB0146;20:tYp/llUfiAL1blTIr1iji3IMwdzf/pt1aRW988sPE8OUpXPQ92Y24hupb3BUyVT6zoY1UGRWveHhrkLCfZXUVaRTYpxjsPgU11O2R/e3v8xh+Sj0tguzZpIyt1Qo4w9TijdIPqWB/SD6eqruIZZexIdKS4l0IZynZjezKNbSkYARhTjZ9P2GXbQDLSL1bIn3g6JHZbRGjS75stYp3fi48S/yeaPLX/KvzBhVGa4GXel37UtGKElaeTT/q9yzMSHv X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Jul 2017 21:32:33.6435 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY2PR12MB0146 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3033 Lines: 92 Hi Paolo and Radim Any comments on this patch, I could not find it in 4.13-2 branch. Please let me know if you want to fix something, or want me to refresh and resend the patch. - Brijesh On 05/19/2017 10:12 AM, Brijesh Singh wrote: > From: Brijesh Singh > > On AMD hardware when a guest causes a NPF which requires emulation, > the vcpu->arch.gpa_available flag is set to indicate that cr2 contains > a valid GPA. > > Currently, emulator_read_write_onepage() makes use of gpa_available flag > to avoid a guest page walk for a known MMIO regions. Lets not limit > the gpa_available optimization to just MMIO region. The patch extends > the check to avoid page walk whenever gpa_available flag is set. > > Signed-off-by: Brijesh Singh > --- > v1: http://marc.info/?l=kvm&m=149304930814202&w=2 > > Changes in v2: > - move gpa_val setting in pf_interception > > arch/x86/include/asm/kvm_host.h | 1 + > arch/x86/kvm/svm.c | 4 ++++ > arch/x86/kvm/x86.c | 14 +++++++------- > 3 files changed, 12 insertions(+), 7 deletions(-) > > diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h > index 695605e..cc87e00 100644 > --- a/arch/x86/include/asm/kvm_host.h > +++ b/arch/x86/include/asm/kvm_host.h > @@ -678,6 +678,7 @@ struct kvm_vcpu_arch { > > /* GPA available (AMD only) */ > bool gpa_available; > + gpa_t gpa_val; > }; > > struct kvm_lpage_info { > diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c > index c27ac69..27fb563 100644 > --- a/arch/x86/kvm/svm.c > +++ b/arch/x86/kvm/svm.c > @@ -2070,9 +2070,13 @@ static void svm_set_dr7(struct kvm_vcpu *vcpu, unsigned long value) > static int pf_interception(struct vcpu_svm *svm) > { > u64 fault_address = svm->vmcb->control.exit_info_2; > + struct kvm_vcpu *vcpu = &svm->vcpu; > u64 error_code; > int r = 1; > > + /* On #NPF, exit_info_2 contains a valid GPA */ > + vcpu->arch.gpa_val = fault_address; > + > switch (svm->apf_reason) { > default: > error_code = svm->vmcb->control.exit_info_1; > diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c > index b54125b..d2d88ed 100644 > --- a/arch/x86/kvm/x86.c > +++ b/arch/x86/kvm/x86.c > @@ -4634,16 +4634,16 @@ static int emulator_read_write_onepage(unsigned long addr, void *val, > */ > if (vcpu->arch.gpa_available && > emulator_can_use_gpa(ctxt) && > - vcpu_is_mmio_gpa(vcpu, addr, exception->address, write) && > (addr & ~PAGE_MASK) == (exception->address & ~PAGE_MASK)) { > - gpa = exception->address; > - goto mmio; > - } > + gpa = vcpu->arch.gpa_val; > + ret = vcpu_is_mmio_gpa(vcpu, addr, gpa, write); > + } else { > > - ret = vcpu_mmio_gva_to_gpa(vcpu, addr, &gpa, exception, write); > + ret = vcpu_mmio_gva_to_gpa(vcpu, addr, &gpa, exception, write); > > - if (ret < 0) > - return X86EMUL_PROPAGATE_FAULT; > + if (ret < 0) > + return X86EMUL_PROPAGATE_FAULT; > + } > > /* For APIC access vmexit */ > if (ret) >