Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932555AbdLOQUU (ORCPT ); Fri, 15 Dec 2017 11:20:20 -0500 Received: from mail-co1nam03on0058.outbound.protection.outlook.com ([104.47.40.58]:22848 "EHLO NAM03-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932359AbdLOQUS (ORCPT ); Fri, 15 Dec 2017 11:20:18 -0500 Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Thomas.Lendacky@amd.com; From: Tom Lendacky Subject: [PATCH] x86/mm: Unbreak modules that use the DMA API To: x86@kernel.org Cc: Brijesh Singh , linux-kernel@vger.kernel.org, Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , Thomas Gleixner Date: Fri, 15 Dec 2017 10:20:12 -0600 Message-ID: <20171215162011.14125.7113.stgit@tlendack-t1.amdoffice.net> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Originating-IP: [165.204.77.1] X-ClientProxiedBy: SN2PR01CA0029.prod.exchangelabs.com (10.167.12.167) To CY4PR12MB1141.namprd12.prod.outlook.com (10.168.163.149) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: eb4fc3a1-d5ca-4add-a996-08d543d7b9fe X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(5600026)(4604075)(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(48565401081)(2017052603307);SRVR:CY4PR12MB1141; X-Microsoft-Exchange-Diagnostics: 1;CY4PR12MB1141;3:VYtXuSDDfLC4OjJ6Ylzg4h7IbqIv+hA6gAtOf6Y1KFOV8QJW/pNlk9fhabl6f6sQ4E9O2BwxVlaQHI0JaWMqK2UrZQ/iBhczhoNk5aGgepc7oAz3jtXpUxB05Er+VqIYIzfMIxm/nDldDU01lImA0iwxEHvK4n5AVdzMfZKxUebKM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lj3huz3HDqFLFgFYdzmir2av+3W9x2SHhinlRomPMUXxFoj/1vcIInik1MM2KqghLzvkmy9tb33U+FklmjZDMDFT3NYIoeoVFR0vAyfHMTdaqApbS5ZnpKJ/uPUelJnZMSsA4WcaaONk9PdytXEfOzSPpkWFAh/7wOKeUR2AQXuoMsMoawnr1;4:onl+wiFxPloSohnFv+hMD7BnzQzbzHxZWFoqmBU8020e1ucDUsgy4Y40/UWeWR2QEJHd6lHRBFHV0zskvNCLpMm5owSsrQyUvEUUmR1mddJTvDByUojeVBDZ7Rqhq8pJL1vWGRZElzer/88BeQ2WNya9GGKL++VnJ+UExCRV9TqWtmQ5mI78SIaRjy2PudHXIt7wxzZ0zg/4u5pUIYgC0BEZvbozscgqHMOjbXSokmSw9sd9ZKwDwbMzaXT4IsGIatkPbjSKI1aNWgAMgIbJ0pHOa+n7mFpPOzG6JOoYUB4a84KoYc8dKyZg2nu/rWJM X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(767451399110); X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040450)(2401047)(5005006)(8121501046)(3231023)(93006095)(93001095)(10201501046)(3002001)(6055026)(6041248)(20161123562025)(20161123564025)(20161123560025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123558100)(20161123555025)(6072148)(201708071742011);SRVR:CY4PR12MB1141;BCL:0;PCL:0;RULEID:(100000803101)(100110400095);SRVR:CY4PR12MB1141; X-Forefront-PRVS: 05220145DE X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(376002)(396003)(39860400002)(366004)(346002)(189003)(199004)(66066001)(2906002)(8936002)(72206003)(103116003)(53416004)(50466002)(9686003)(25786009)(97746001)(55016002)(86362001)(106356001)(478600001)(83506002)(97736004)(105586002)(47776003)(59450400001)(4326008)(52116002)(7696005)(23676004)(2486003)(68736007)(53936002)(2351001)(2361001)(69596002)(5660300001)(81166006)(8676002)(81156014)(6916009)(6666003)(16526018)(305945005)(7736002)(1076002)(3846002)(316002)(230700001)(6506007)(6116002)(386003)(54906003)(58126008);DIR:OUT;SFP:1101;SCL:1;SRVR:CY4PR12MB1141;H:tlendack-t1.amdoffice.net;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtDWTRQUjEyTUIxMTQxOzIzOkRWKzh0T1BWdUE2RS9wRVJ5N1kxMzFQN09p?= =?utf-8?B?NGo3T2tDVVplZzVTcGttRVBFZWRJTGJsb1dnRjhjSGFrTkQ2Y3NGNlBGaUh4?= =?utf-8?B?WTB4R3hsWUtoUTRBdmx3T1BEWnBEaENFd0NaUDZiazRod0lEVFh4MXFsYkp4?= =?utf-8?B?bm41K1ZZNCtGR3lCcFBNeUxhdVcwVzZzc2J4U1RaWDhMM09NKzdYMDVnV0Ew?= =?utf-8?B?Tktzb3dLbDlDZ3lPVlNSczlBVjhqMXJMa3RrYlpzU0dYM3VXYkR4NHVtcEYz?= =?utf-8?B?L0hybHFIUi9wUytkMjYrdy92R2owK29vUmcweFhTK0JNdGdpTVZ2YWUvSkk5?= =?utf-8?B?a3Y1d1picllFOXRRSGxvUUd4TWJySmlWR0twNFRmUjN4emVKY1NXUkZ0UkJB?= =?utf-8?B?R1BVREp5K2pYWms0RUxHVTlGU2FOY3BvdmZrMU44T3VmdWFYak1tZVhSblMv?= =?utf-8?B?ZDVjMi9LN3pyUXNlUVFPS0ZuRHhmelFYbTV5eTZ5UC9LL3FCb2tFN0t5NkN4?= =?utf-8?B?Z3JnRmJIMFJrelU3MjU5T1pXRDRRaXNLK2hlaVRJb0ZUUWI0QzkxZ1F2aU9V?= =?utf-8?B?M2tpSk9FdTVJWHd4UmUvcWMrbGJJUDFSbnZZMzJCbFpjaEpLQktvalBmYTFm?= =?utf-8?B?M3VFMEtFSnlKcDh2WlZKUGhialUyQUo4a1hYbndQajd0RTYxYUlmb0NuaS8w?= =?utf-8?B?SkVZVzJFUHozMjhzMzE1U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WdXblludkdPTnU5ZGR2WU1GZG1Hck1tRnNWckoxTVRvSGVRPT0=?= X-Microsoft-Exchange-Diagnostics: 1;CY4PR12MB1141;6:FZCswVK8Hr6047l26TjP5ch1xpiXD/3ZemP7xXoKiDARNrVjz4nc5b19Tbynyj+QPZK+7bAseW//F1YNqPMZUzi74/qYUSjxiAN+dtZpvDXmRYYC6lxa7ya9qQLfhSCHOEDfbFRJT7Y9+xMYHZMbuelWo8T5jOMlxq7h6AdtJvrOeSSUUgAPRx2CC5iCl09pAxxuYedq6i1hHIiNljv6+ediQTrNNPX0nMW0y/0JET7cTgaFfD+r7qqsOCKURMRaUKv0tzV2n3DLnzjwBlEAPFw8a5HHLaGIl1Sibq3cSnOM72QGK0ku1BprB87KLK1dvlrO6r+FyhvX3TLhde0stTEP/DcZm5wTdQ5EpJmtw4s=;5:L/sJoMmVZX3qovzt/yMbE2UHP/xe8ery/EpuI8c6H5MxcXhNOKym9WPFschMlzxYmFBtyrEQV1dS5FdbxdoflmGaHqr/clLqriYWnaXo1mWytRD7N5vtyvJ93pNQYeOm9cQkjG8LT7IWVne49RrPUHVpxVCgECgG7JRTUMlCArE=;24:lvw7nlyyLuQpFWtry63dPmrZVhznfn7S6jIGjIjfpxARw/6/IuwOpi9nXzV5kaij9TFMv8iys1i5CZZKoIlV6lUaUHUPoSjdkgk24cIr1po=;7:6VtGmyGWOrJYFooGEVI/rO4/aSr/hGJU0T1dNvWrJUB/OWnEvXMAVB/lOyEfHoHHeL4OwvY5TqFlyv0Wu73tncZXaPRQvT+URHU6564jS7yAHvnKgTYda8H++jZYgpdnS11QSW8vW+tATvzkzdSAyEc+Crb74Zx1bjYWorURY6KScy8zARvKLKNqGvC4eioVYl92cMqnkFkXIuADgNWgNvQTACT/nGvD3PoHNh3/ISzO+3fVeUoAYsguejXGPB6V SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;CY4PR12MB1141;20:6+y7Q8q7fYSj2yNnzwZJ2BvhsOMG3yMM0rXb41Vm4564eZpyF+p/P75P8+SAO1KA0FjG3AK8O0B3saDSCNj4lkJ6bc+2kwLV4lBvFl/niqz3EkZ9hOIkxqg+EuJHTf5GMJr/zptBrvsBFR/tEq+C1X5j3M874T/259R1UvIUqXmjr9L2HvuysdZknSRSSBtU0hOWAzlINhZQWD2D25e2Vys8vwFcu9odAoSB8z0f1TrHfxkjdkDTXUKWAlaANHKZ X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Dec 2017 16:20:15.6234 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: eb4fc3a1-d5ca-4add-a996-08d543d7b9fe X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d 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: 1634 Lines: 43 Commit d8aa7eea78a1 ("x86/mm: Add Secure Encrypted Virtualization (SEV) support") changed sme_active() from an inline function that referenced sme_me_mask to a non-inlined function in order to make the sev_enabled variable a static variable. This function was marked EXPORT_SYMBOL_GPL because at the time the patch was submitted, sme_me_mask was marked EXPORT_SYMBOL_GPL. Commit 87df26175e67 ("x86/mm: Unbreak modules that rely on external PAGE_KERNEL availability") changed sme_me_mask variable from EXPORT_SYMBOL_GPL to EXPORT_SYMBOL, allowing external modules the ability to build with CONFIG_AMD_MEM_ENCRYPT=y. Now, however, with sev_active() no longer an inline function and marked as EXPORT_SYMBOL_GPL, external modules that use the DMA API are once again broken in 4.15. Since the DMA API is meant to be used by external modules, this needs to be changed. Change the sme_active() and sev_active() functions from EXPORT_SYMBOL_GPL to EXPORT_SYMBOL. Signed-off-by: Tom Lendacky --- arch/x86/mm/mem_encrypt.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/x86/mm/mem_encrypt.c b/arch/x86/mm/mem_encrypt.c index d9a9e9f..391b134 100644 --- a/arch/x86/mm/mem_encrypt.c +++ b/arch/x86/mm/mem_encrypt.c @@ -405,13 +405,13 @@ bool sme_active(void) { return sme_me_mask && !sev_enabled; } -EXPORT_SYMBOL_GPL(sme_active); +EXPORT_SYMBOL(sme_active); bool sev_active(void) { return sme_me_mask && sev_enabled; } -EXPORT_SYMBOL_GPL(sev_active); +EXPORT_SYMBOL(sev_active); static const struct dma_map_ops sev_dma_ops = { .alloc = sev_alloc,