Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933285AbdGKPOw (ORCPT ); Tue, 11 Jul 2017 11:14:52 -0400 Received: from mail-dm3nam03on0066.outbound.protection.outlook.com ([104.47.41.66]:17776 "EHLO NAM03-DM3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1755296AbdGKPOr (ORCPT ); Tue, 11 Jul 2017 11:14:47 -0400 Authentication-Results: redhat.com; dkim=none (message not signed) header.d=none;redhat.com; dmarc=none action=none header.from=amd.com; Subject: Re: [PATCH v9 04/38] x86/CPU/AMD: Add the Secure Memory Encryption CPU feature To: Borislav Petkov , Brian Gerst Cc: linux-arch , linux-efi@vger.kernel.org, kvm@vger.kernel.org, linux-doc@vger.kernel.org, the arch/x86 maintainers , kexec@lists.infradead.org, Linux Kernel Mailing List , kasan-dev@googlegroups.com, xen-devel@lists.xen.org, Linux-MM , iommu@lists.linux-foundation.org, Brijesh Singh , Toshimitsu Kani , =?UTF-8?B?UmFkaW0gS3LEjW3DocWZ?= , Matt Fleming , Alexander Potapenko , "H. Peter Anvin" , Larry Woodman , Jonathan Corbet , Joerg Roedel , "Michael S. Tsirkin" , Ingo Molnar , Andrey Ryabinin , Dave Young , Rik van Riel , Arnd Bergmann , Konrad Rzeszutek Wilk , Andy Lutomirski , Boris Ostrovsky , Dmitry Vyukov , Juergen Gross , Thomas Gleixner , Paolo Bonzini References: <20170707133804.29711.1616.stgit@tlendack-t1.amdoffice.net> <20170707133850.29711.29549.stgit@tlendack-t1.amdoffice.net> <20170711055659.GA4554@nazgul.tnic> From: Tom Lendacky Message-ID: Date: Tue, 11 Jul 2017 10:14:34 -0500 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: <20170711055659.GA4554@nazgul.tnic> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [165.204.78.1] X-ClientProxiedBy: BN6PR1001CA0019.namprd10.prod.outlook.com (10.174.84.32) To CY4PR12MB1141.namprd12.prod.outlook.com (10.168.163.149) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 738daa78-b34a-4235-db55-08d4c86f8e66 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(300000503095)(300135400095)(48565401081)(201703131423075)(201703031133081)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095);SRVR:CY4PR12MB1141; X-Microsoft-Exchange-Diagnostics: 1;CY4PR12MB1141;3:pfrIlYrqIvoGu5RpLNdvXQQA/k7XYKnsNybHhLt/eRbw09D/J0mXs8h+PGKonSA7DZueq5jAMpAdDwpZbBcyND/WzynGckk2wFR0uqNy4hjxYwqe2G3Qp0JL7M4MI68edQFpA/s1IGaB7A02k+saD55HGFSxVGLlbKaRps+S63ODfI42Cic6A21avehtcDxg7J8RLwYmWzIXeUZnW38NUDv6Kx4ssAwHaBOxw3zjPrwN8BQBqjB6VlhAGLYDf0yyVfUWdmDVvLdY5Nt52PrPsduKnCh1csZrTrOOgRN6itJZIOQ9ZD70EwkidFADYqyazyyxIB1kiBoivDP/jImw5Hj0CTxOpBn6Wn35Ec88qeaYdUyE9Nfq5tbKnRyDVOPCiPdlOa5DgD3mb3lPhrXLk/edSyqX8W4S9eCNm6qCDGh0qM2t5TNiyufbkOpdXVGker5VoNzi5KnZOZdqxhY92Z1MUatVxX4p1Lp0V7hz+6CjjjOAcaxBO6VDGZePP+8JJzT1RZ7PflKUuEKHUaHzd5j+3yISsS5TFVejA2nisHBs0pvCgjjVvp00OyuGOIw/KSbeOILWWhQNDMsDSqa1xRwO4fIjiZkb5nk8KIPvXV2Du2J/+MF/9rDyBYs6rOjyS7dPX/I3ShXtRwlZOmOeoM9jKxTzTYzemzM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ogQ2ildonR/7K+NrweLTMw+9SocrWhd22NXm0kT8wviqb/kW9uZYcoPMddWoNb+EKHwxJGA1UCTkprbHTpUVhOyTb3DNxY6e0fKseQ4f6Unf/p0De1nOKlR+zjOMgDUraP22dR5Y3yhtf5GvG0UTrK8vExO2Hsk6FNXXeNdN5y714DYGGpkhnO8Dqv9CV6XXoAM2/r8/jy1MXmGQ55trWN8 X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(125551606395959)(133145235818549)(236129657087228); X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(5005006)(8121501046)(2017060910075)(100000703101)(100105400095)(93006095)(93001095)(10201501046)(3002001)(6055026)(6041248)(20161123562025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123564025)(20161123558100)(20161123560025)(20161123555025)(6072148)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:CY4PR12MB1141;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:CY4PR12MB1141; X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtDWTRQUjEyTUIxMTQxOzQ6azdYOHRlQm5zcXRDSWE0YXQrZk5idFh2amZC?= =?utf-8?B?S21ZSE9HZUtGVHZHUUF3TWZWZVRQTDZobmtKMllieFVoMGNmbTF5VENKMTE3?= =?utf-8?B?TS9PUVg0K1pZeGNZbjFlbXlmVXBEdTBFaEoxL29MdHBnNHF3ekxlUWl0RkdH?= =?utf-8?B?Q0J4NTcyNkZ3dzRjbmMzOVcwVkh3S1l1Rk1JYU1tV3VoOWVLdFhBZWtidXpu?= =?utf-8?B?eG5ucmxlN3loTmlQeHQvS21lVFJZZkhuSHl5ZUZMM2NQVldwcC8yYkhIWDlN?= =?utf-8?B?NUlKTU5JT2VlZXA4V2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-8?B?YUVTeEFVRVpXRVJoVE1vMTBNQ1BKNFE0aUdsNGlvM1drajIya3NsWEVNRWEr?= =?utf-8?B?YWhuTm9xaFRTM0w2UjJETC93eHNDekRjN0JxYnhzUENUcnZRN0ZEYVUrb0ll?= =?utf-8?B?RllUMEFTYzNyWGkzSHcwR2xCcDhGaFlNMHhPanJWbVk4Q2EvTUlHUGNYTmlS?= =?utf-8?B?UVdDYWdLNFJya2VSKzZJakNVdmwzb1BUTTREMi9HU29vcW85eG1GRzluTlBM?= =?utf-8?B?V2s1M2ZwWkVIUUpPTEV6bjR4SWZldkNTbUtMb3RHUDhGL1FWQ2FvNVQ5ZmZ4?= =?utf-8?B?dnFSaXR1QXQ0UnFBWWJ1Yjkyb0g1NjlTaWUyanRYZVNYV2cyQ0d4MGhvZFNW?= =?utf-8?B?bDBZSzJNcGNFRVE1aEFGRmlNQUhEL29RTG83QzZvMWFVZ0JLSkE2ekgwWHZO?= =?utf-8?B?L1RpQWRsM3lEZWgwb0JZVDMwMVhHN1RPdnZRSlZxQUtWNHA3STBQcWNibElU?= =?utf-8?B?a2U2c2ZhQ0ZDWHRGaTBqbTB2YmoyY01qOVBRd2tEcW5PMDdycnU2Rlo5ck5P?= =?utf-8?Q?B9pzOAtU0B6oTA3uiNDkEg3hmIvnY/hN6biQ=3D?= X-Forefront-PRVS: 0365C0E14B X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(4630300001)(7370300001)(6009001)(6049001)(39860400002)(39410400002)(39850400002)(39400400002)(39840400002)(39450400003)(377454003)(24454002)(65806001)(54356999)(31686004)(72206003)(83506001)(6486002)(50466002)(77096006)(64126003)(4001350100001)(33646002)(7406005)(230700001)(7350300001)(3846002)(478600001)(65826007)(53546010)(5660300001)(7416002)(6116002)(54906002)(6666003)(36756003)(4326008)(2950100002)(81166006)(189998001)(76176999)(38730400002)(42186005)(7736002)(31696002)(86362001)(3260700006)(2906002)(53936002)(25786009)(47776003)(305945005)(50986999)(23676002)(6246003)(229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Q?5r78+6u?= X-Microsoft-Exchange-Diagnostics: 1;CY4PR12MB1141;5:sEyUCTkgPTfKZ0SekOx5ijC7aZDVqvYL6VWV4a9pkBZcoUyoOlNPKder5amr177lmOsF5pf65RHUVHvGiEoAJzVIjLQRXRHtOqynXG/M4Qc7SiT9ucEmHDUiY92Sd15RxzZdbohNgMMj+P0Do20V/4egDoWKTxXjqW3RAfG6zPNQmrTvpMl2pt385/Xc2MvEljtFkqZgxeoeH87hCFPdpOSVtGXqnFobosL/XjpI9A9PzkQzqYjydTPxXPBYP4XH7pJEfUZCGPfSO0Xa+Kaq36UsxDqey5B0zVXnEs3/aEocgmx84jJFm/qeIqNcnWrrh+aw5d1eBd2q9FaOllNLtz99sidqG1C7AjWtHEG5sIoC5TVT9iP+EHQMPEVo5qg++F7VChpjUfj3MsB4EmhurdzYGeka8jwHfdrq+OsQyX24IzVgt4mtdlMH0YW19e30xjxn8R54+ziNM9W1305m2HSUQp3Ar3FqhTlOD3JJ0uCYjw+2w2BDjKRN4GmgwEkQ;24:LxX4qzKHWSD4VKeb3cIl9dQPMyE+qqcYGLCkRN4NkHcpzqRImmC25NEq1D9QCdx9d6DC1ExL6iMPnTdLRvp/4Yv1FSM94LE3S+mJL54+doA= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;CY4PR12MB1141;7:K08L+vED40hLLEDpXXg8RjgE7FR9viDCaxyKpSmmyeKwwS4Gdqiztd5Dk9D0shlENy67cV4N827Awa118gG5wRdflmCdRtOgbIdervQdzHq0sNBPATPqTWkzcBuTGRnpYs8KNoDZrQxuUsUd31IQj0q8I4Tb6WHFTzLImIXOSlkPBXPdld09ADOLOgx0hl4W0+r1IzGWHB0gBOrTd0Xffuwwlr1zB6cvtdMpRlbhXq7P/LHWss3Ciha3J4G5xvWkNNfzl/GMZSCWKdvlrCSQ656HB9uSV/cTss1t/bBXmXcU10a1UBKW7ES/o28L59pZEE6GY26bDUtpe1WPm1+vfYH/gLZkgXQTNo+N90MZG50fGeQ94Yyv9GrOZVwJ62GeGGM8TWoJ3K4tFfbfxPeks/CCYoUx/1hhjJzou4Lqs7b19hi2kNe0iPuDJeoc7smGWgXNX25BgWEnH16Zae8ey9iHbIY2UISTdgFboO6hxRZ7Yk5d4aH2KrMmn7ar8tCM3nK0PMWDdhFI5zstOj8/KXlj+wQYv6RyLfzDSOwBn8zM/SQvW3QNP2Ac7UDgQ7bHW7zBuv5GUvxO3EMN6JyGhOyh3yGxCRHWh3Yuzo/er6yPQiUCPm5oWGRZdVp3KsgvrDQ07h4ANXD1AkGopF1ZBrVYulj/MgqcnQWzEp+bYWQmPVTG8NGC0phMByrLrzxK9K4+uui9HT17EE3o7w53nhPY48R5VNJKgsuQ3SIMicLAj3Lh1TXV8qGx+5PTfC4IuNae/UK0LWGlDHcdd0cD4/v/kVQYxmpRA+zV826frCI= X-Microsoft-Exchange-Diagnostics: 1;CY4PR12MB1141;20:zHD1h4G9uf19fG6oTsGzqqtocsiVC79soRMVMHuUQuRrjegUq0mvvFcXycnrtRkxBTOsmYNSmgfn1cxK7YfzzvbpSGXvKX9nnKTQL3rweEs0GTX+uzT0q/2Oh7TWkoTWcyUf4E+vdAAncjWoTIQLnOigI84eEUi02+/WzYo9VPtJItQSs/its1RbRffNZOxPwJYlYTxsoAyMD/mv77ez5TJSadfmgI249z9OATlXmVXTz/Lb57mNvxW9nyqsA7JZ X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Jul 2017 15:14:38.3831 (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: 1103 Lines: 36 On 7/11/2017 12:56 AM, Borislav Petkov wrote: > On Tue, Jul 11, 2017 at 01:07:46AM -0400, Brian Gerst wrote: >>> If I make the scattered feature support conditional on CONFIG_X86_64 >>> (based on comment below) then cpu_has() will always be false unless >>> CONFIG_X86_64 is enabled. So this won't need to be wrapped by the >>> #ifdef. >> >> If you change it to use cpu_feature_enabled(), gcc will see that it is >> disabled and eliminate the dead code at compile time. > > Just do this: > > if (cpu_has(c, X86_FEATURE_SME)) { > if (IS_ENABLED(CONFIG_X86_32)) { > clear_cpu_cap(c, X86_FEATURE_SME); > } else { > u64 msr; > > /* Check if SME is enabled */ > rdmsrl(MSR_K8_SYSCFG, msr); > if (!(msr & MSR_K8_SYSCFG_MEM_ENCRYPT)) > clear_cpu_cap(c, X86_FEATURE_SME); > } > } > > so that it is explicit that we disable it on 32-bit and we can save us > the ifdeffery elsewhere. I'll use this method for the change and avoid the #ifdefs. Thanks, Tom > > Thanks. >