Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753378AbdGXUFZ (ORCPT ); Mon, 24 Jul 2017 16:05:25 -0400 Received: from mail-dm3nam03on0066.outbound.protection.outlook.com ([104.47.41.66]:3232 "EHLO NAM03-DM3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752261AbdGXUDc (ORCPT ); Mon, 24 Jul 2017 16:03:32 -0400 Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=brijesh.singh@amd.com; From: Brijesh Singh To: linux-kernel@vger.kernel.org, x86@kernel.org, kvm@vger.kernel.org Cc: Thomas Gleixner , Borislav Petkov , Joerg Roedel , "Michael S . Tsirkin" , Paolo Bonzini , =?UTF-8?q?=5C=22Radim=20Kr=C4=8Dm=C3=A1=C5=99=5C=22?= , Tom Lendacky , Brijesh Singh Subject: [RFC Part2 PATCH v3 04/26] KVM: SVM: Prepare to reserve asid for SEV guest Date: Mon, 24 Jul 2017 15:02:41 -0500 Message-Id: <20170724200303.12197-5-brijesh.singh@amd.com> X-Mailer: git-send-email 2.9.4 In-Reply-To: <20170724200303.12197-1-brijesh.singh@amd.com> References: <20170724200303.12197-1-brijesh.singh@amd.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [165.204.78.1] X-ClientProxiedBy: DM3PR12CA0049.namprd12.prod.outlook.com (10.161.151.17) To BY2PR12MB0145.namprd12.prod.outlook.com (10.162.82.18) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 314737f6-2f0c-4da9-7e0a-08d4d2cf0bc1 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(48565401081)(300000503095)(300135400095)(201703131423075)(201703031133081)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095);SRVR:BY2PR12MB0145; X-Microsoft-Exchange-Diagn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jsDBqaPlWNvJlrdXi/xbF05A0OHxmpXuSp9cHn4IsVXdgqIn8lnilpz5qMOhPRtzpcpwSA8PDhVdBSgMJx9KlGrCyCb5+SFxs5mH5ZH1oHde5gQf23kxTfk90+3r8CbGYSxtYKCA34/NFz3rXgVIH2ydtPqLlV2xUnQZ4YrsiR2QEDo4uqx0/3Ct2LpSGpPUeOue3PefDu0AOAMiSJAzaMk3TubDmxmqGv3lMf+UqfKKELAz1zn4nFw7LNWdkhH5sEOHW7/9LJWB5veAm7Z5KKdmFNRMRKPZG0qjI4wkMLQXqN8oAcrJqVca67izel6RGpbNG7dyCEQZtjDWeg4LW9Q367sqNpuRMic6WOtzVy+Uz7ZTVs8GUWlyCqpZTuLY5+uA4= X-Microsoft-Exchange-Diagnostics: 1;BY2PR12MB0145;20:S7v8MzjtHCKlCavvzLFCodtyxOlcijuQtW5+yyX5TjyVNIiVCS6mFFtRLMHB8R/cG74GNfHthdPy+d1hyB+gupHSdrK9+2WVXw4w3OsOHLr0TcAUrlpBNYdQwFH2tD03DyeDWgIyRw6js0W5OKK04E3WnoIFMpTSnTNrOmWcYr3ifBt8p8/fEmuqviTTRfyGOjZ3u2KZbd7OrR/FtcisGZSEnOXFDmZb8Ng0jxO7Bz2eM8jfn3ybT24x/JVZXRPKCIcnJuh7vJTETITi9dWkX05stxjHDvTjiOqKpTtdjUQ1woGwOLTWfBq0ISEFJfRUjyTTr9nq0QN7CabouhIsY+n3/QSg22I7Zfp+SU7CnCgVqCyVT9kgiGBNSEFcDswgUnM9UjskeRLshOj40LGCmvY72X0oxn+1MS/+WItVDK23tS5N9sxodzN2HJ7TmvmDekCMiI+YbMivaS3q/rAUS0FpLiW5w+UmmXtR3gIVhJI6RrLQn+2buMSlYQgthgFF X-Exchange-Antispam-Report-Test: UriScan:(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)(3002001)(93006095)(93001095)(100000703101)(100105400095)(10201501046)(6055026)(6041248)(20161123562025)(20161123558100)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123560025)(20161123564025)(20161123555025)(6072148)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:BY2PR12MB0145;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:BY2PR12MB0145; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;BY2PR12MB0145;4:07G22Kk/2xmm8REOX55TgcgjlTQGXXNYlecs192wpI?= =?us-ascii?Q?XhMLi9OUoAaEIMMJCWx0Gi5wKoglEtVvRZa2C9TEDVxYDgSeab3JXz/6L6UE?= =?us-ascii?Q?Uc+GKMq57H1kVmJ0XFhfgd0hw4n0+o7I4X6HvMzxgyeOiuaxHZ4aXCt0tZZq?= =?us-ascii?Q?2L9PKB229DppaWFTGclqCZz0CpCrgYGUUgAyEfVPUkGwBy0IYahbhDiXSGDy?= =?us-ascii?Q?/cM/2lx/m3Ml2IJd1sVJ8SVdH7cZtIXhDVvSu0LHFuwf6LThlJLURjpgNtCO?= =?us-ascii?Q?P13UMalQY4mfdNTy47s3CfWXqbuOAvibaC9MgTYhqobRVovHLYFZBUkkIScA?= =?us-ascii?Q?9D3sp4rAuNK/Wu0Gr1Mx0bPzg9TwvJPWEcJyav0l/qwVew4ClqV2Y0pKHa9l?= =?us-ascii?Q?d6uMBruzNJiG1zZY77lnDODsf2zu/vKs/dGQ6ijyyAU9j1UIliNXc8kTEFmZ?= =?us-ascii?Q?KeiZVqRwvT2aOTIJkJl1c2nSblpvjEgxL4IuF9cH+WDY8/QtnQYFX39+1YEj?= =?us-ascii?Q?So2u1HLw/MrDUht1tEmQqluczzEzoDu8+eb+lV2F/8y4NV27qbUdjGW/RTGp?= =?us-ascii?Q?Tbc1AZfCENTuHKvbBgS2PegNmzzw72no7wTM5oIBh+pBvZiO8kj1wE9nVAx2?= =?us-ascii?Q?A3AsrMKrij374X1rnarT7vzIruAoa/rheL9o18WLFjO75OEHw6bgXpfE0csf?= =?us-ascii?Q?Z9Tij318yRtoF+6QIRRbmkNj4Gg8njfxofvJp2/rRPdjr/BZS+RtvzRor3dF?= =?us-ascii?Q?/ah+gPO8bDKugtlizRTGzunEIhE/UaSMfjhSlfxbZx2yGVBLjl0EALWl0jWu?= =?us-ascii?Q?c4fEQ/YmB8Ka8ubMSZLLbCfzoxUkLqPMHKA1W0x/owrsRrjuawb0ir1qDqXm?= =?us-ascii?Q?kq8EnV2KASk43ebsw4E6dY9RK+HbF9opF3m/3ps6NomSw/oz1IPGWhmNR+MK?= =?us-ascii?Q?v4Yg9xhqZHZhmKF3ZdozUXsd1NFdcDkG6kWXKlPTqYkQXAyMy7r3P9UVLIcF?= =?us-ascii?Q?WtNiIsif0qGjPCBFYngH6pzworWTztjlUNjGTkLU3YI9foV6AZMu7fMlMoy7?= =?us-ascii?Q?ZEVXupp/EJ+dF5uRNw7c/TRWexvDWpgRfJ1dZv84i1FrOrkVdnuOFXkTRxQK?= =?us-ascii?Q?taIG73x8PxVDDEPghrokbtheGkez0LHH2+HnvDw60VESMCHBDq5chvojUQuE?= =?us-ascii?Q?+kmJOB9IvquDltuna1noYpDfOUc5rL4s9H?= X-Forefront-PRVS: 0378F1E47A X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(4630300001)(7370300001)(6009001)(39450400003)(39410400002)(39400400002)(39850400002)(39860400002)(39840400002)(189002)(199003)(7350300001)(68736007)(53416004)(105586002)(54906002)(97736004)(50466002)(6486002)(48376002)(2906002)(106356001)(33646002)(6116002)(1076002)(53936002)(3846002)(189998001)(101416001)(6666003)(2950100002)(478600001)(50986999)(76176999)(81156014)(50226002)(38730400002)(47776003)(5003940100001)(86362001)(25786009)(4326008)(36756003)(42186005)(8676002)(81166006)(110136004)(5660300001)(66066001)(7736002)(305945005);DIR:OUT;SFP:1101;SCL:1;SRVR:BY2PR12MB0145;H:ubuntu-010236106000.amd.com;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;BY2PR12MB0145;23:BWXMYxxbGAvzGTM/ymppGCPJGMHkBwUkVYWq04KV5?= =?us-ascii?Q?KyZ6TY063WLaWoWYF/dKUDC5tUkUCdYjlXaLm5r01ahZb5A25QUGEFIPSs3X?= =?us-ascii?Q?vnTeCG3zekwFlWiQWaN1dT02LH/e9ndfVcdflS0pAPV1VFXgVKnXg08FYC7H?= =?us-ascii?Q?diMJqeciLsgmad/keiLH18U9TpHEdUSiRh1w9QSHqVISHdjUxV8x4hi2fMIZ?= =?us-ascii?Q?rZVVqx5QYDgoiJknYUHV+s63Tb4YzLY8zR/lCkJLDqz4XQutUYezgkGaYmes?= =?us-ascii?Q?xG689Luivlsb7wqWvM2cDLoYSPHNyUmDDJVm575BtxlddBuYILUDLUSmMaZl?= =?us-ascii?Q?6I1PRHWbd/UYMTWtQJKTgSxHtFF9ptqNtY8deN1NLHxP2xomkSDHm4gWBZ+u?= =?us-ascii?Q?hwCmaruKutUB9UQisWGUDSb7cPzr7zn3J2rTv1MC2hmrl+fQzn53Yb5yJdI7?= =?us-ascii?Q?ZkS6iAqMXI19ePv/as3RuV2Dfk0h989lEZa+WeQB4+DySTJjHw97pLgikzxo?= =?us-ascii?Q?QedN+efs1GN6Q1ZL8Uq/oAZXJffGge5+/6uWgOjzJapfalmQq4b8y+x/Ocao?= =?us-ascii?Q?jFsCGuoOqj5JDIBF61Dgj6AGRkJgRO/BOcNEr65q2j6DnKvT1R9sE5DAY/aG?= =?us-ascii?Q?Y7Y98WSX6eKeR6D0/+gWEeubntmyCLdc94WC2LJR6deyJDtxu6pYYBKmF0/I?= =?us-ascii?Q?3oMJaWrgQ6TBk4Yu6BBc74IA2OlVmJtjwUJ+5k66EjTrmoxzaomdYOCjpn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+0LxD9ogH0J9/n9dphU0b6A6Y2DNdWpGDJGRUAJDkzixAD4o8waaSZi+rPMe4zqm9Vq4BoDy0vI/49iHK1QFwfrHFIjuXBCbB3Xjoqcm3MdjDaVGx6ydfDuBrVQZ/i/zRON+CjW0FQfmux/OWOhwSkHEv6S87aZ5EAh4lSpw4mu7bokP/UNwxL6qoWA1KQMP41fdib3DAdOGJ1bCDfcvDCOSj/1bDz3JgqyYNm19IEcdwZCfMS1uh1af5RaQo/xdk/gBGfLJGzOvbtkfmVdBj0k= X-Microsoft-Exchange-Diagnostics: 1;BY2PR12MB0145;20:9ZcLNDjXwQ2kWoo6od4z3OjsGpf0hMD8nCDMqDcMfHwCUyXh/vBFeH4XFLg4u8V8lGS1H7nMqo4lsX9kSHEdtTNOTw+We8kvqzGlAFTJxm5pPUPHDpz2BEZ3lQEs87JmB62orfcKmaKNuicwzZk7gvgbHi8Re8O0Nk6Nl4CPLE0tUfxSYvHyI3MLz0OHCjlVKRauHfGa5RUTFE7+uqmKu9KmB9fftDF/6l4EhyH6gboZZTPD4ikq+zZyfYmn6c+j X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Jul 2017 20:03:25.3844 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY2PR12MB0145 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1238 Lines: 41 In current implementation, asid allocation starts from 1, this patch adds a min_asid variable in svm_vcpu structure to allow starting asid from something other than 1. Signed-off-by: Brijesh Singh Reviewed-by: Paolo Bonzini --- arch/x86/kvm/svm.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c index 6af04dd..46f41bb 100644 --- a/arch/x86/kvm/svm.c +++ b/arch/x86/kvm/svm.c @@ -511,6 +511,7 @@ struct svm_cpu_data { u64 asid_generation; u32 max_asid; u32 next_asid; + u32 min_asid; struct kvm_ldttss_desc *tss_desc; struct page *save_area; @@ -768,6 +769,7 @@ static int svm_hardware_enable(void) sd->asid_generation = 1; sd->max_asid = cpuid_ebx(SVM_CPUID_FUNC) - 1; sd->next_asid = sd->max_asid + 1; + sd->min_asid = 1; gdt = get_current_gdt_rw(); sd->tss_desc = (struct kvm_ldttss_desc *)(gdt + GDT_ENTRY_TSS); @@ -2072,7 +2074,7 @@ static void new_asid(struct vcpu_svm *svm, struct svm_cpu_data *sd) { if (sd->next_asid > sd->max_asid) { ++sd->asid_generation; - sd->next_asid = 1; + sd->next_asid = sd->min_asid; svm->vmcb->control.tlb_ctl = TLB_CONTROL_FLUSH_ALL_ASID; } -- 2.9.4