From patchwork Wed Oct 7 18:24:32 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Williams X-Patchwork-Id: 11821703 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id DF774139F for ; Wed, 7 Oct 2020 20:00:09 +0000 (UTC) Received: from ml01.01.org (ml01.01.org [198.145.21.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 82386207EA for ; Wed, 7 Oct 2020 20:00:09 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 82386207EA Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-nvdimm-bounces@lists.01.org Received: from ml01.vlan13.01.org (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id E51DA156A2E92; Wed, 7 Oct 2020 13:00:08 -0700 (PDT) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=134.134.136.20; helo=mga02.intel.com; envelope-from=dan.j.williams@intel.com; receiver= Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 1B5AE156A2E81 for ; Wed, 7 Oct 2020 13:00:01 -0700 (PDT) IronPort-SDR: UU1FqxODGZbBYEf46yN7VueQveiqEe2W89Rv2WxDOfV/Vs2+UusSaguCb3irOwLKp+tfRzvsky MUzjoMlJcxjQ== X-IronPort-AV: E=McAfee;i="6000,8403,9767"; a="151995080" X-IronPort-AV: E=Sophos;i="5.77,348,1596524400"; d="scan'208";a="151995080" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Oct 2020 11:43:04 -0700 IronPort-SDR: 28VHoGOndfRnWTasoHT1hQdzfg/1H2hWmZA8KwIuABiy+4waKFUCmBCW10nvcxycazrmxxsp0F uzTinV6I+Ylg== X-IronPort-AV: E=Sophos;i="5.77,347,1596524400"; d="scan'208";a="297604799" Received: from dwillia2-desk3.jf.intel.com (HELO dwillia2-desk3.amr.corp.intel.com) ([10.54.39.25]) by fmsmga007-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Oct 2020 11:43:02 -0700 Subject: [PATCH] x86/mce: Gate copy_mc_fragile() export by CONFIG_COPY_MC_TEST=y From: Dan Williams To: bp@alien8.de Date: Wed, 07 Oct 2020 11:24:32 -0700 Message-ID: <160209507277.2768223.9933672492157583642.stgit@dwillia2-desk3.amr.corp.intel.com> In-Reply-To: <20201007111447.GA23257@zn.tnic> References: <20201007111447.GA23257@zn.tnic> User-Agent: StGit/0.18-3-g996c MIME-Version: 1.0 Message-ID-Hash: ULM2VJ44YFXKTCV2RCEPOPAEG7FXMDXB X-Message-ID-Hash: ULM2VJ44YFXKTCV2RCEPOPAEG7FXMDXB X-MailFrom: dan.j.williams@intel.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header CC: Borislav Petkov , Thomas Gleixner , Ingo Molnar , x86@kernel.org, "H. Peter Anvin" , Tony Luck , linux-kernel@vger.kernel.org, linux-nvdimm@lists.01.org X-Mailman-Version: 3.1.1 Precedence: list List-Id: "Linux-nvdimm developer list." Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: It appears that modpost is not happy about exporting assembly symbols that are not consumed in the same build. As Boris reports: WARNING: modpost: EXPORT symbol "copy_mc_fragile" [vmlinux] version generation failed, symbol will not be versioned. The export is only consumed in the CONFIG_COPY_MC_TEST=y case, and even then not in a way that modpost could see. CONFIG_COPY_MC_TEST uses a module built in tools/testing/nvdimm/ to exercise the copy_mc_fragile() corner cases. Given the test already requires manually editing the config entry for CONFIG_COPY_MC_TEST to make it "def_bool y" the additional dependency to require is CONFIG_MODVERSIONS=n is not too onerous. Alternatively, COPY_MC_TEST and its related infrastructure could just be ripped out because it has served its purpose. For now, just stop exporting the symbol by default, and add the MODVERSIONS dependency to the test. Fixes: ec6347bb4339 ("x86, powerpc: Rename memcpy_mcsafe() to copy_mc_to_{user, kernel}()") Reported-by: Borislav Petkov Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Borislav Petkov Cc: x86@kernel.org Cc: "H. Peter Anvin" Cc: Tony Luck Signed-off-by: Dan Williams --- arch/x86/Kconfig.debug | 1 + arch/x86/lib/copy_mc_64.S | 2 ++ 2 files changed, 3 insertions(+) diff --git a/arch/x86/Kconfig.debug b/arch/x86/Kconfig.debug index 27b5e2bc6a01..6f0f5d8ac62e 100644 --- a/arch/x86/Kconfig.debug +++ b/arch/x86/Kconfig.debug @@ -63,6 +63,7 @@ config EARLY_PRINTK_USB_XDBC crashes or need a very simple printk logging facility. config COPY_MC_TEST + depends on !MODVERSIONS def_bool n config EFI_PGT_DUMP diff --git a/arch/x86/lib/copy_mc_64.S b/arch/x86/lib/copy_mc_64.S index 892d8915f609..50fb05256751 100644 --- a/arch/x86/lib/copy_mc_64.S +++ b/arch/x86/lib/copy_mc_64.S @@ -88,7 +88,9 @@ SYM_FUNC_START(copy_mc_fragile) .L_done: ret SYM_FUNC_END(copy_mc_fragile) +#ifdef CONFIG_COPY_MC_TEST EXPORT_SYMBOL_GPL(copy_mc_fragile) +#endif .section .fixup, "ax" /*