Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934956AbcKOWCB (ORCPT ); Tue, 15 Nov 2016 17:02:01 -0500 Received: from mail-bl2nam02on0056.outbound.protection.outlook.com ([104.47.38.56]:45120 "EHLO NAM02-BL2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751749AbcKOWBz (ORCPT ); Tue, 15 Nov 2016 17:01:55 -0500 Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Thomas.Lendacky@amd.com; Subject: Re: [RFC PATCH v3 04/20] x86: Handle reduction in physical address size with SME To: Borislav Petkov References: <20161110003426.3280.2999.stgit@tlendack-t1.amdoffice.net> <20161110003513.3280.12104.stgit@tlendack-t1.amdoffice.net> <20161115121035.GD24857@8bytes.org> <20161115121456.f4slpk4i2jl3e2ke@pd.tnic> <39da89c3-b89f-1d93-6af3-ea93cb750c45@amd.com> <20161115213312.lrtejyv4x7nzvzsp@pd.tnic> CC: Joerg Roedel , , , , , , , , , , Rik van Riel , =?UTF-8?B?UmFkaW0gS3LEjW3DocWZ?= , Arnd Bergmann , Jonathan Corbet , Matt Fleming , Konrad Rzeszutek Wilk , Paolo Bonzini , Larry Woodman , Ingo Molnar , Andy Lutomirski , "H. Peter Anvin" , Andrey Ryabinin , Alexander Potapenko , Thomas Gleixner , Dmitry Vyukov From: Tom Lendacky Message-ID: <25496e6a-ddf0-231a-f83d-cdc2f61e6d96@amd.com> Date: Tue, 15 Nov 2016 16:01:45 -0600 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <20161115213312.lrtejyv4x7nzvzsp@pd.tnic> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Originating-IP: [165.204.77.1] X-ClientProxiedBy: CY1PR04CA0024.namprd04.prod.outlook.com (10.166.187.34) To CY4PR12MB1143.namprd12.prod.outlook.com (10.168.164.135) X-Microsoft-Exchange-Diagnostics: 1;CY4PR12MB1143;2:LI0Nt7LwejVZ+Uq5QxNVBMZL7neV2PdB165wVKOlhTvFIKAbx3EJM6xbLmwiqxNW03PIOHGzNHpU4ccfujNPiDZeWHhrEZTZg8jAS89D470mEIoDQGdjZKDnRQeRX866Fq6EGhSDI5N4zjqfQJ77XQSS4SnhjHg/xO1Ec4q0C34=;3:u9jVNm1fQirrhEXgaxH0PQ7gccKYRzRFXQfN/szJodVLZ+29J9zPfzf1C2CmLKdoMVnf7L6HunGuhRKgw3V4cBm+FIwJyoYVHKlY9zsS4th1QbAK8I8Zp/nyF+qD57jc7+xGxw8CT1D9D2AM6LRt1lfEQI5n4w6ulwP0ztxCSHc= X-MS-Office365-Filtering-Correlation-Id: a111610e-2638-4e48-a531-08d40da30073 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:CY4PR12MB1143; X-Microsoft-Exchange-Diagnostics: 1;CY4PR12MB1143;25:Lk5y+8rKho0Ywv1ihD/ytUfo8i4GeK/fkvVQ+QVidoMhyXKPSflzA/Ji7dPnHOhM+xQAUBglf+LwuE6e4rNf3R8nBEA5/ipvFUOkncwYKizLAwrEUg1CXaNQeLbupsAKIc2yO3ZW62KvaxNqdUZRwciuJrBG1UCNvePP93Fj3YZzS83S2mHLllg3NPN/z98o7864KsFAzxgh/n5XbjDFDr9cCBhKHzbHqnVCgiHAAIZIyaD4o1bwgtVwOGGPjRW0rgJmGtAzjEYBYeSJ8Wks+5OOmqSU1wkoRjbQQJoxNZ6Nj722Y3L/LFn786jEZaa+6olHbPmncUqJlMK6n4ByB6M0C1/BPcEKWoV6Ou9f06Wf2AJlnfh/WQYtTakkcrGUfeWmq89Py1qft4XwMLUBFJdb/AXCvU0rmNcFNj/PcYRPlpSFnHoR0T4DwkHHkLbLN2FtJ/Sw/UXpRMh0dmzKCDyBTkx612Y7xL73bH9Gtl1zYjuk1ul58lXI/2unZY3OT2v7R8ExVVnrr8t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sKl6k5LY60XkxQIBwdKxkLSaQlMheX0+rjBqo+Ki597qTYembIin X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6060326)(601004)(2401047)(5005006)(8121501046)(10201501046)(3002001)(6055026)(6061324);SRVR:CY4PR12MB1143;BCL:0;PCL:0;RULEID:;SRVR:CY4PR12MB1143; X-Microsoft-Exchange-Diagnostics: 1;CY4PR12MB1143;4:xaSIi1rZrO7vV5edoNptJeq4J+w0V/tUwKFge8HQPUyw0E9KPmEIr9WANvlSaYMtWh2fFrfdsYozR9uevJ/lmOKd18FUF3bQT8dJ2Bpl77soSIC+KaXbty5SMnHsHyAIze3Z8inzbAmQlBZQsW8lU2b4DO/h8sP1akk1Bc4XEj7AMSGYqEfcox7FVMrEw6FL4o9jzPRs3mMZ3lSHKszAQv0GzpNRnnXHkpkZKVvHQDwx/uy3Vzei18dVgB46YS4lJtBXLrjU0Ap3YBxUck13RokjmXJ/HdyEyHQnsbBwsgWHOBK2F0Lj++n3ZDF4HFHztWkIpl9f+n4mJlOoYj9wnt/I1YXi+30EFVfJhj6ce30Xh5TjekOT5j5inZirDQQE9BY7BxW49qNcqXwAvw/QpcEOumT0rW/stsvw8Eq6cnxy9aBs3gd0rYMRNI/GZUa3 X-Forefront-PRVS: 012792EC17 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(4630300001)(6049001)(6009001)(7916002)(377454003)(189002)(199003)(24454002)(68736007)(92566002)(77096005)(230700001)(4326007)(2906002)(65806001)(8676002)(86362001)(50466002)(105586002)(3846002)(81166006)(23676002)(81156014)(6116002)(42186005)(65956001)(66066001)(106356001)(31686004)(65826007)(6916009)(5660300001)(83506001)(31696002)(47776003)(36756003)(97736004)(2950100002)(229853002)(7736002)(4001350100001)(50986999)(33646002)(189998001)(76176999)(54356999)(7416002)(101416001)(7846002)(93886004)(64126003)(110136003)(6666003)(305945005)(217873001);DIR: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Y3NYWUhRNWdQMVZ0YW9acjRMQ0tsRGE0NVBzL1pzWXBWQjV3anA2NmdDR0tz?= =?utf-8?B?ei9Bc2Y0OFlYcmNoeHJnNEtrK01NeFdNVkgxMXZYaXFmQTZOQ3JhTnpJNk1v?= =?utf-8?Q?fkg43AiiiKczm?= X-Microsoft-Exchange-Diagnostics: 1;CY4PR12MB1143;6:IXe6CaguiVALE+qo0bgRjgxXiXqBdwwVztCj1uVIqJDijL2MEacNYeBF9ujl4RCbl5gxr56hMlq3nAvqmxqpGId2FbIIU1TepF3GjpmGi/l/srBOXS5MhFGRLKugyeFuB8iGhawHc7PS9i7Rtxd23ieCZoIvRX9zBJjePi4xw3bZ0x9z13CItSC25psfEf26F2dwKVmFKVVTVnIgOuTjHait0x3SWjcKUUqMoIw4IybgXBkiLO78Qr+8prESDgK0kF1T+hPl9kyCZa/kufcSNqsujRHxCmQ7dSLwlYzyFVV1GtDhkDYkvu5PeIESkP/UWasecCxAoKY9bSjLOJ25fVmNLdcJekm/uy6volzNjazFuV581BwMsdjqwM42j6zI;5:MLCPgK3fBgzOsihWtcjNTOty78Azn9N4Bp26a39HeAoBNHsUppJktQHk6qVhdL5Csu7oPdftsiH0lmQbR/5IzcuIub3OC8oMDrkQ/Gjz9ibx6jverbGW+DF2JXysUbdwLqB+KL/qnihuwA6DWbxl/g==;24:xuza98r/T9z7FByupq1YzcFPzhl80xBHUvxXbe5iLlVXTpknBbMEgR1nZQW8rPnIkCoZ3mguDLc9v0ql2/BphHap2AkjUajNlB8COTZyzYQ= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;CY4PR12MB1143;7:NxEX6RA48ceQj6lCUintS1eGo6+S6e04w4m3y3xGKiaT3v9v5G4e0IyIR7uTPZrQmTFqj1tQunr6LN2njlKNZUfhB9DY5Ts/6WmWkOmPODyobg0wtEnbpMUNKot37dGmohVROlEikbf2Ce7FyCDWSkOIEfX1BW/hSXG55fGu5c+91YAcaUHT6PqIwg0DV4qPf/BepfXtiSBcV/H/d1ltCOmNjOlGCpmSUNL4YgSf5P1QaUweqZSSHlGanKd2MudKm6sefv91cakldAPNejQixAkY3RcctB3UQs1Li3QEXnPxYvrf7Ddj20Gg7R1r3CysUQBsdx/ehuyVj/JhjZUIQbbNTksX840Wl8S5oJHSzN8=;20:8OAthSgHdfI7QCilKyVsRc0vkzQ1JvDEP01xOOgSNcp7bYQTnuRGntipUrPOopH8qbPAfBxWxs5zAr3irl+p3J8wFMkUKjhw05ikIvh+qpGFDEKOsHrH0RIeLWvKevzaaABTcIWpxlL2BDIO9Q0yBQvtikbCapY2+PEwoXoIdBy+KuFpA5sRRIMURpm86HuZH0id6bbLxOyUCmadDsgXjXM1nQgNXnx0BKXv2IlpIfgPoRu3GLqU9VABS6uE1S9N X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Nov 2016 22:01:49.0920 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR12MB1143 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 648 Lines: 21 On 11/15/2016 3:33 PM, Borislav Petkov wrote: > On Tue, Nov 15, 2016 at 03:22:45PM -0600, Tom Lendacky wrote: >> Hmmm... I still need the ebx value from the CPUID instruction to >> calculate the proper reduction in physical bits, so I'll still need >> to make the CPUID call. > > if (c->extended_cpuid_level >= 0x8000001f) { > cpuid(0x8000001f, &eax, &ebx, &ecx, &edx); > > ... > > just like the rest of get_cpu_cap() :) Right, which is what the code does now. I was looking at switching over to the cpu_has() function and eliminate the cpuid call, but I still need the cpuid call for the ebx value. Thanks, Tom >