Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753959AbdIDRrc (ORCPT ); Mon, 4 Sep 2017 13:47:32 -0400 Received: from mail-by2nam03on0050.outbound.protection.outlook.com ([104.47.42.50]:61408 "EHLO NAM03-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753912AbdIDRr3 (ORCPT ); Mon, 4 Sep 2017 13:47:29 -0400 Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=brijesh.singh@amd.com; Cc: brijesh.singh@amd.com, linux-kernel@vger.kernel.org, x86@kernel.org, linux-efi@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, kvm@vger.kernel.org, Thomas Gleixner , Ingo Molnar , "H . Peter Anvin" , Andy Lutomirski , Tony Luck , Piotr Luc , Tom Lendacky , Fenghua Yu , Reza Arbab , David Howells , Matt Fleming , "Kirill A . Shutemov" , Laura Abbott , Ard Biesheuvel , Andrew Morton , Eric Biederman , Benjamin Herrenschmidt , Paul Mackerras , Konrad Rzeszutek Wilk , Jonathan Corbet , Dave Airlie , Kees Cook , Paolo Bonzini , =?UTF-8?B?UmFkaW0gS3LEjW3DocWZ?= , Arnd Bergmann , Tejun Heo , Christoph Lameter Subject: Re: [RFC Part1 PATCH v3 16/17] X86/KVM: Provide support to create Guest and HV shared per-CPU variables To: Borislav Petkov References: <20170724190757.11278-1-brijesh.singh@amd.com> <20170724190757.11278-17-brijesh.singh@amd.com> <20170829102258.gxk227js4yw47qi3@pd.tnic> <0810a732-9c77-a543-ffeb-7fd2d8f46266@amd.com> <20170830174655.ehrnmynotmp7laka@pd.tnic> <8155b5b2-b2b3-bc8f-33ae-b81b661a2e38@amd.com> <20170904170525.toyulxwaevef42qe@pd.tnic> From: Brijesh Singh Message-ID: Date: Mon, 4 Sep 2017 12:47:15 -0500 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: <20170904170525.toyulxwaevef42qe@pd.tnic> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Content-Language: en-US X-Originating-IP: [70.112.153.56] X-ClientProxiedBy: DM5PR20CA0007.namprd20.prod.outlook.com (10.173.136.145) To SN1PR12MB0158.namprd12.prod.outlook.com (10.162.3.145) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 18a19079-ee40-47e7-9caf-08d4f3bcff24 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(2017030254152)(48565401081)(300000503095)(300135400095)(2017052603199)(201703131423075)(201703031133081)(201702281549075)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095);SRVR:SN1PR12MB0158; X-Microsoft-Exchange-Diagnostics: 1;SN1PR12MB0158;3:GFkAeiboGwSzqvBEA2Vev3WwJ5zilwhWb3LaWLACsK+ewJd43vrxBmEj4R3PW2spOJMT1Jy2x6I7H8cvdEYF4qCQ+GTk3Os0T+j/1MkPKMGkytYcJP7gy2bO2HDNGc1+7ucXu2UqE5P3CDExdgeEDkQFVx+JJpa0z7GLGt2ILhrkAJdZpikmGZmyUP6bCQIuv/VrAbXtjK7nO9FrVqNfOqDGj3YjKtABdMjQYYBWTcTYq5+kueAbv62lqWGp9Nfz;25:ObVdtSlcbrs230b9S6iGlHsw2jLHQiL4baHBwz/RzIuo7eh6dV1Iba5I2iJhSlS/NXH8NEkz4cOFcxriyzLQxpAvn91NMxWtQHJ4geic7pdLK1iyVCy5UL23tCOH0/s6Tko6ZDd8LisAeWWXX/3sSymAVDYH5yjIG6PTKRdOO4uzBdr/KNrveLV1ayqh/D/tvEYm2q85bXxO0KvFsZsSh7nFr8FKmOel9OQ737OZNj9mrfaPGqIkXlu6UEMCSGcB7NPBN9ZvvQNZ/5MitQS4pmmO26IcSO1RrQpBVILw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GHMgaf2MPjIcS5GWatqcBrON42iWVxyFWymK3EWEhRc7bW X-Exchange-Antispam-Report-Test: UriScan:; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(8121501046)(5005006)(10201501046)(3002001)(93006095)(93001095)(100000703101)(100105400095)(6055026)(6041248)(20161123558100)(20161123555025)(20161123560025)(20161123564025)(20161123562025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:SN1PR12MB0158;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:SN1PR12MB0158; X-Forefront-PRVS: 0420213CCD X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(6009001)(39860400002)(377454003)(189002)(24454002)(199003)(478600001)(229853002)(6486002)(6506006)(65826007)(6512007)(110136004)(6916009)(53936002)(33646002)(6246003)(31686004)(42186005)(2950100002)(6666003)(7736002)(3846002)(5660300001)(93886005)(53546010)(97736004)(4001350100001)(31696002)(86362001)(8676002)(81156014)(81166006)(83506001)(8936002)(7416002)(25786009)(305945005)(7406005)(6116002)(68736007)(189998001)(4326008)(50986999)(2906002)(106356001)(66066001)(76176999)(101416001)(54356999)(105586002)(65806001)(50466002)(65956001)(64126003)(23676002)(54906002)(47776003)(230700001)(36756003);DIR:OUT;SFP:1101;SCL:1;SRVR:SN1PR12MB0158;H:Brijeshs-MacBook-Pro.local;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtTTjFQUjEyTUIwMTU4OzIzOlYxTWtZTGYrR2x6NE03bTRuQVErenl3SnBL?= =?utf-8?B?RjlNRU5kVUdvaitEd0VRNHRaL2ppRzFvZV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fnWbMfslRiy0HV5QzU6Z3k35cAYNKZtDXxTu7qrFIK0RXoqZt3Cvd+/m2J96efLxk/opxZf5M5XtipmlSWLE9G1mzUMGSWYwFAFdCOX4ftn+yzaWTSErWINblTcIZRv5vGi2PYaQXo8D4gAR/pQ/bp3cb61Jkic1tZQ8NHPhxbIxUnIilU/E X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Sep 2017 17:47:20.1698 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1PR12MB0158 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 739 Lines: 20 On 9/4/17 12:05 PM, Borislav Petkov wrote: > On Fri, Sep 01, 2017 at 05:52:13PM -0500, Brijesh Singh wrote: >> So far, we have not seen the need for having such functions except >> this cases. The approach we have right now works just fine and not >> sure if its worth adding new functions. > Then put the call to kvm_map_hv_shared_decrypted() into > kvm_smp_prepare_boot_cpu() to denote that you're executing this whole > stuff only once during guest init. > > Now you're doing additional jumping-through-hoops with that once static > var just so you can force something which needs to execute only once but > gets called in a per-CPU path. > > See what I mean? Yes, I see your point. I will address this issue in next rev. -Brijesh