Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933791AbcKOVXB (ORCPT ); Tue, 15 Nov 2016 16:23:01 -0500 Received: from mail-by2nam01on0076.outbound.protection.outlook.com ([104.47.34.76]:36278 "EHLO NAM01-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752308AbcKOVW5 (ORCPT ); Tue, 15 Nov 2016 16:22:57 -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 , Joerg Roedel 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> CC: , , , , , , , , , 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: <39da89c3-b89f-1d93-6af3-ea93cb750c45@amd.com> Date: Tue, 15 Nov 2016 15:22: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: <20161115121456.f4slpk4i2jl3e2ke@pd.tnic> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Originating-IP: [165.204.77.1] X-ClientProxiedBy: MWHPR07CA0015.namprd07.prod.outlook.com (10.172.94.25) To CY4PR12MB1141.namprd12.prod.outlook.com (10.168.163.149) X-Microsoft-Exchange-Diagnostics: 1;CY4PR12MB1141;2:hlK4dZeoff5x4FnyFmhlRaDc2DyybDTCE0QSojme41eh/MbqICisJzUHlE7ngdmjs6ySL4ND2MOTJlYQXJnQBYyS6z6kCH7vJCORkxtQ1U0DnKr8wfWd8Fj4xqjLOlkCzV/SvTTXxlNnpVeOcUgQm3KfMQ5/dWf8OCCUEcHsy1o=;3:FePOSTXIc8FatpTNj1lOBFsSitzD61ZfDxEAzmQH6ZEkb6+UX2SfJaSaFOhPjIFS373nmj4epwwQPm4NLACB1Kp642XK7o39fO9iDVxibYKWwHnMD6jMZNcOsBpRXjyZirt6RzBrvrh4J+pQBAj2NPyOSq0y8Xrx46mldlZZaNE=;25:Ln0NK3j+TswhOHTW3B7yTEityoxIf0kdYvx3srgC03d7VaRNZyseCuOXPIGMQHwY2TWmVFbpOZryABuxOUnp/7qoBtq+Z1R00ryHeZSdrepnjArv5hG4tza4Gz4vD68pNaSdMnIqSlC0cYlGN95vVqg0a6g9Sk/+QVzqrm4I9NWaP4uyeX0v4WMEd/psKwYxHTWc+b6yCIJFIEj1xhdXLMGioMMqZxsHyUt8AiSpfZHMleD9F5D7cCif1P/lSnGtyH4hbZt5qU2uuOUyq02OVH6uK6HA52H0U8SdVSwbmAu7Ah1lYZ/uHb4dCdBk3rL3jxJj4swQmnJYaM9vukqFvHkhCv6p8BxjrtUd917knKE91WOsdErj1t424q45faokY1YJn7eLE8Xy8kX0ar3Nc2OjAdfNBevJq113VRI3dX818TD6RKS2zGWAcUNVDELOdzMClpjB+kTqcEMYfGeO4Q== X-MS-Office365-Filtering-Correlation-Id: 5826345a-1881-4ce5-e106-08d40d9d8ee3 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:CY4PR12MB1141; X-Microsoft-Exchange-Diagnostics: 1;CY4PR12MB1141;31:QUbiSAQWFp535wPbqJYe1fIniJ1AIZtCiBJUTavn7HSxsE2mI5UxzW7+MjCJKNXU+zLYD0EwaAgwA4FkxkOHyY8z874q3WbG4dlknf8hoyyrDqrbhGo+yhC1Hl22Hx/4TL9YrCqzm4Qh9p5/FtDthGYTrESoFnWeMhQuM6nYD5/3gMtRp0yWjR6PKEJi+mowseFeekv2yVwopA11xwLEHfYxtTDrBzaC0pP+LYPZKA5bzJhB+ERDOPqbFU9lxP9yThtKYtIyZNAzE44FG1uAbvMRKbdvIOEA5KDY/oBk4i8=;20:6h/6ztV2REW8I45N3sHK5Iv0ohguxx7UmBSHPiUAbtOh5ExeOOLiMjf3AZfaS5FhTYaHIyrppkhvdbQn8jVlGWFLXPNhcRg5k4y6uEdEzBn6xljb0XW2BoRYKzCs2Y0J0n7/Jp3niAqUHxfvOM25nFDqz3mlML4MbAu/jdbbJd8cZFLHU1ZYpPXIn7FbZXMEy1JCpmvx/sag7JPS7DOlnb/iz1+uzxG8nZwzZX7abUTnEq9EpnwtAU9kWuNycRpf3aKuWpJAS0vqJyNSnOuOP94MyT0gyERsCYrIZ8bp870nrmrCP74nx5hX2EsWe3QKvXXo5P9MSRkzAiHDeIEwh+9jJnxhMOQeHMyjShSLAnqwxl6IrItTrPQqgYPeHSv3IcJeC1E3lHFBfaF4WXPeKzj/SJIKqXawj+VV+OuyElMROFS34NPdoOsw3rxrAoTmyEu5OuXyc90T9i1afupSM5oJw2NoGTbDbd1itN9zQaXmEfFTPWBb7quFnhs7ZPJj X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6060326)(601004)(2401047)(8121501046)(5005006)(10201501046)(3002001)(6055026)(6061324);SRVR:CY4PR12MB1141;BCL:0;PCL:0;RULEID:;SRVR:CY4PR12MB1141; X-Microsoft-Exchange-Diagnostics: 1;CY4PR12MB1141;4:IjcHmKm1t56khsZUkQ4DA0oKg0MNak00bvYjLl+KG005oCIWLND6g9SJQZa4YhJQvPMXhpMK7VUmUtmUA6ZTik6tTwyvnQdcL+VYAQSBIZb2bDIDaulitPjd51R3DdCzm1YXlip1DnBf14xyPf0okfVJCsLCQUdvnTpgegZlIVUlNW4b7JBrq8FdLiVotumRzMK0EIp8LDk0hqZSs+jxpYpjN20OHBkifPcgxyY7dNDIdbuz0ZZhucvqnnw5Rbz3f5CvQFP4KJoDfHBQ/H5U9iJcpTfSCtY4RjwgL+XYXGBYtFV8vdUlixIwIx1CWp/8fKVi+pLKYk26LAX0aKURmAVlV9jKiPpU8khkewYXGolZABwNj3iRiRrzJoDFkei6bgD+vSNha6GSxesSGr86JRLKWEQB5yVP5e5Tp8lG0oSBHioWyjsX7yFqaL/SOAd2 X-Forefront-PRVS: 012792EC17 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(4630300001)(6009001)(6049001)(7916002)(189002)(199003)(377454003)(24454002)(5660300001)(106356001)(50986999)(4001350100001)(7736002)(2906002)(230700001)(76176999)(81156014)(101416001)(305945005)(31696002)(54356999)(50466002)(77096005)(36756003)(64126003)(7416002)(86362001)(4326007)(6666003)(229853002)(8676002)(97736004)(7846002)(105586002)(5001770100001)(31686004)(83506001)(92566002)(68736007)(65806001)(65826007)(2950100002)(65956001)(81166006)(189998001)(47776003)(66066001)(33646002)(93886004)(42186005)(3846002)(6116002)(23676002)(217873001);DIR:OUT;SFP:1101;SCL:1;SRVR:CY4PR12MB1141;H:[10.236.64.222];FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtDWTRQUjEyTUIxMTQxOzIzOjV3THhOS2x4ejVCZHJrK2N3Y0ZDNkZlVm1N?= =?utf-8?B?M0g2Y0ZYWDRwKzJhOUNpK1prYzZFYk5wTEZiR1ZvNmd2WjJ2SkowZzdsWW1h?= =?utf-8?B?R3pvdFFvQ0NwcTZCUCtGaFFEMjd0RjRidGZVNDAwVk9uTit5WFNoMEpiZ1FJ?= =?utf-8?B?Vmp2QXdubE9qa0R5VlBVWUY5RGZjNWl2c2pBbVBTaUJKSTBsVFlHemorNGlS?= =?utf-8?B?NHJ0UE9FaC9YQnlVbVZBT1dqUW1MQ1F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NJBBVl772gqe6CAOIwmMzLD09d X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Nov 2016 21:22:50.2149 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR12MB1141 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 627 Lines: 18 On 11/15/2016 6:14 AM, Borislav Petkov wrote: > On Tue, Nov 15, 2016 at 01:10:35PM +0100, Joerg Roedel wrote: >> Maybe add a comment here why you can't use cpu_has (yet). > > So that could be alleviated by moving this function *after* > init_scattered_cpuid_features(). Then you can simply do *cpu_has(). > 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. Thanks, Tom > Also, I'm not sure why we're checking CPUID for the SME feature when we > have sme_get_me_mask() et al which have been setup much earlier... >