Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752051AbdIMPOe (ORCPT ); Wed, 13 Sep 2017 11:14:34 -0400 Received: from mail-bn3nam01on0086.outbound.protection.outlook.com ([104.47.33.86]:58501 "EHLO NAM01-BN3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751084AbdIMPOa (ORCPT ); Wed, 13 Sep 2017 11:14:30 -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, kvm@vger.kernel.org, Thomas Gleixner , Joerg Roedel , "Michael S . Tsirkin" , Paolo Bonzini , =?UTF-8?B?XCJSYWRpbSBLcsSNbcOhxZlcIg==?= , Tom Lendacky Subject: Re: [RFC Part2 PATCH v3 11/26] KVM: X86: Extend struct kvm_arch to include SEV information To: Borislav Petkov References: <20170724200303.12197-1-brijesh.singh@amd.com> <20170724200303.12197-12-brijesh.singh@amd.com> <20170913133729.dtae2a3kidoigri5@pd.tnic> From: Brijesh Singh Message-ID: <2a5702c8-a60a-7836-6eec-891a3c3e8ace@amd.com> Date: Wed, 13 Sep 2017 10:14:20 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: <20170913133729.dtae2a3kidoigri5@pd.tnic> 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: MWHPR15CA0035.namprd15.prod.outlook.com (10.173.226.149) To SN1PR12MB0157.namprd12.prod.outlook.com (10.162.3.144) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: ff58c83f-ff4f-42a7-4443-08d4faba203c X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(300000502095)(300135100095)(22001)(2017030254152)(48565401081)(300000503095)(300135400095)(2017052603199)(201703131423075)(201703031133081)(201702281549075)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095);SRVR:SN1PR12MB0157; X-Microsoft-Exchange-Diagnostics: 1;SN1PR12MB0157;3:hB+Favi5XuBfPfptmlb06+PcyCRkoyonl0Zl2biTtciAuZVof3Z9iQMOangDVno8Re5iH7XBXYhp1NewysZ7RMqxAm9J2zW84JpUrpY6d3iDIVXxEYcPTiBUxSH+iMMD4HHcVZAASpWHR0EWaW3IERjn4v5n9YyXkpQmt1NT1I5WvI43wQGzlpDJR1ymFpuhCtZfljLtvVbWynwFVzs1A4EOADLBLKeTJenyh2dLwfaqemDfhf+YKHZ+ao25GbzU;25:k1D2MZpFOEL7EaOiiWcXBxzvgVUnZ9FP6auxqkBu/jm6iFz3rOqmkfUoqp4QL1Y4k6s4W3VNVzpWcbHakczRK0BESpWoYm70NR5Ck/ef2a2bQcOypRcSN+D3x5vAigCNxzl8ptPooXb60ohbvR5gOfLkEO9QUaTfR5vKeb8BkM5XHxiViQiMX35RKWzorSxiHeZNkwfz9c6PBP052xb3epCpnmfQefEEtBRvUMfm9MiY4LDtso4hr7roL461JmydqQFjSp5hRNpgDmqawfG57cUu6nMDTJyqZZN8JKtezWcP2pjXOK/kGu7GUzXtfAgCDxxzjJwP9Qm/vpqAJg7pag==;31:GHieRsvY1Zky+U1k0zknP/zMiGvzhAww54G5nxNiU5IPWOr9SIvCJjkh9ShugV47woIdVLQPSkZMeANBjWvFo70LZQXUBM7NNnivFHLmC/jg5oL4eEuvomHjnsawMovFNh80lw9Gi32nAakiLraP3b5tQUqnGRs46G05OTF6ETDzya4nJrSVKneQSGJFIoMWhjN3c+S/14/McOz+JrFzazDT5P7d5jRoM+tI/czssSM= X-MS-TrafficTypeDiagnostic: SN1PR12MB0157: X-Microsoft-Exchange-Diagnostics: 1;SN1PR12MB0157;20:4aq+0GiDwJS51CQuQjSJaLRFBE+pin/u7Ggyp4i9BbNBtND1DZ4JRy3vPYrND3Oh6nX1eGzlOajJBxuD/aonXtNauIo4NP5eFaF1/ubdmjnGLwCIw7dBED36V9DWOlbINtidRDaOpsoqTMd9xzPxMA4JqMxE6RWWAJ6MHeh7SM5ivwEX4it72J6LnE2LXyNFeUrKwNSebEwKyhG4fyA//9LwmXndUPch76cDfA4XfbOcY/4z1Ht23moZ0EUwtJb21TBRa5efhpgOjWfZgeRwdyhLaIk5HWZXzhaG1vbk3P8nIl/Y0qx0L77fGPxSpf0za79udNlAGCQMet5AikJloDIBABRqlRlQTdDkChL8NBBo9snCgUxXrzSTrp4O6Fu573XaRWLmnY9k6EFSxZdv7zR5tvcTGjnV9Jsydtc0yRvg9PTI7vgB1uDmqgRT5MhixlXBePc9d2nac7BIxiRqb2zxx1kSAFEkhLlZvcFmWTfGEY8pHz5b/oIL7X0b8FiE;4:jguT5ID9FLvotS5zia/Ql7yaMugb7nif3gsP3hqjlWbi0B8udMP8ZDDsazlQt46ZXIjAZ2MdcGxuoPv/GKr4hWr4ScBUgt8zAZUtqmaY6/WNcws93VJYjHMyOdh99hLbDBXKrAVcqaYmqKTC0MBG8ZpfYksdfEEmIZ8k+skqrKU+WMnN0RpWduM+LjS2irox0op/mMfty3CDqHnxiXRFMK2YQ+HTXp4nmIRwRZ/mL+wNS8RNv3Hl9SpL3ThoB9WK 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)(93006095)(93001095)(100000703101)(100105400095)(3002001)(10201501046)(6055026)(6041248)(20161123555025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123558100)(20161123564025)(20161123562025)(20161123560025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:SN1PR12MB0157;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:SN1PR12MB0157; X-Forefront-PRVS: 042957ACD7 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(6009001)(6049001)(376002)(366002)(346002)(39860400002)(377454003)(24454002)(199003)(189002)(189998001)(68736007)(2950100002)(54906002)(50986999)(90366009)(6916009)(6666003)(105586002)(54356999)(76176999)(77096006)(6486002)(8936002)(229853002)(53546010)(86362001)(31696002)(33646002)(31686004)(25786009)(81156014)(36756003)(101416001)(2906002)(106356001)(81166006)(8676002)(5660300001)(7736002)(83506001)(305945005)(47776003)(65826007)(50466002)(3846002)(316002)(230700001)(4326008)(6116002)(6246003)(53936002)(66066001)(110136004)(64126003)(16576012)(23676002)(16526017)(65806001)(65956001)(4001350100001)(97736004)(478600001);DIR:OUT;SFP:1101;SCL:1;SRVR:SN1PR12MB0157;H:[10.236.136.62];FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtTTjFQUjEyTUIwMTU3OzIzOk92QlJJc2ZXR0hjRnE3a1B1M1NUUkI0Q0Na?= =?utf-8?B?dG5ZZ1pSKzJwUkdHTzZhOTVkZURUM3RwVUcvQVBEbkpDOU9PTTA1UHkxZGFq?= =?utf-8?B?NTJLcXNYblVwUHdTSVZ0WDVuZm5jeVV6UitDb1VCOE8xaTQrQWxoZTd1MndJ?= =?utf-8?B?bnk2bWVmVWRqTEpWSm9CRDlFdUtycGpDL0U0Qi95UU1vbkxGSFNpMTBpMC9W?= =?utf-8?B?a0UrOTdWNEgvSFdybmNvbVZWOSt4YXBZRjZWSWZGVVJCTUU2L0VqaWFST0Z1?= =?utf-8?B?MHU3RmtmVktub1NiTmt4dkpNZEhvdHpiZ2hiY01WWW16T2w5cWNqb1lIaUht?= =?utf-8?B?eWVZK2tVSEFOWW01VTNpO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llXXiJW+wSSyRm+Ar46UP2oMajQ2SbzixPDxDP8Fm95Q18kRM10J2gbK5WP9YNvEdK1rYcHCbh+0dVvqoyd/krO/lVSYQzmKP1+LM82HxSXpWP0hROKzaF1JozdzOKv/zo5qZZ3r2y3Fbf2k93YNkSbM1Py+g9GjBvyLZBKR8XCXew+LeQ3g==;5:xSwwS1ZAsYNdq4sbVDudm1jeDxvqt+Dfaa0ASSA2iAH1yXzpAIdMLyj+aXo0z7u4JPrLY0OAshuR8/OnI/IJRvox0BZ0vk92m1r4/gEbpm6A6x++HpS4E6jwpWoF/B2m87aIHz1m5SHA2fz8vi8V7A==;24:SK8jb/cFBpXbhv4RU99dnXJdqKuFjDaLQQ0YI2BK1YyUeapoOYVCae2CyeWbBHdU+5n5CPo3shOjNHLQi4HnidTU26ixTX50PY6/Kz3AjPA=;7:NFcsPnCL6T8/ylP6MFGHO+nx1pC7WQalyYyxgjrr2bSDoxumHWqEBPMY/L4NZE1JVcVZTLEyajZx3ufl/Se3fU7SBW7XlaRCMpb0vsC2vPammlkRSWywRc2oRGFgTbPxfB0v3VePdqOgdqPkQZpoCFz6OoItK4vifdJjZd+jtDNtdnW5Cep5hcj2wwqNqKsfOisH33tNkIwIPvel5IxOBbiknwiAoj8hN9gOrIbwazQ= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;SN1PR12MB0157;20:Zcs7BAWuAgjWHigm2MkJtYpmoYEQwQ4cf9JKitLPCu3v0dT1rjKyySMD61anuuY5b1yguTb+Qa0Emk9rbZBoJUb7TPcbr2VJ/4UyhBwXWqDH8P9oedLhzRWdhaYtP8FIIIjbGD80WQ/9Ow8eGGvv+9pgV5Jem1+3L3lT5XYUPAFIBXeicA0jOkD8ir7wz8RoZdnevIgvecK6fOMV2eL2fi0hfauZ4KNRE2j/SoYL+HL+2gin0yqceefe2h6Kx0dM X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Sep 2017 15:14:25.7920 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1PR12MB0157 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 517 Lines: 25 On 09/13/2017 08:37 AM, Borislav Petkov wrote: ... >> + return &kvm->arch.sev_info; >> +} >> + >> +static inline void sev_set_active(struct kvm *kvm) >> +{ >> + to_sev_info(kvm)->active = true; >> +} > > Is this the accepted way to do this in KVM land or can you simply access > all members directly: > > kvm->arch.sev_info. > > Because I see stuff like that: > Actually, I see both approaches used in svm.c but I am flexible to go with either ways. lets wait for Paolo and Radim comments. -Brijesh