Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp4932595rdb; Tue, 12 Dec 2023 13:37:29 -0800 (PST) X-Google-Smtp-Source: AGHT+IFSHt9jhTFrJ/TLMAIR5jsnuTYAvRPGQzvxTwd3Ytm8P6zTK521srjpxzPAo6Pznp10ZMZk X-Received: by 2002:a05:6a20:3b89:b0:18f:a92:be2c with SMTP id b9-20020a056a203b8900b0018f0a92be2cmr7656027pzh.5.1702417048472; Tue, 12 Dec 2023 13:37:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702417048; cv=none; d=google.com; s=arc-20160816; b=S4jNj7Z81fU/EQcWX9Q+Z2OcaR7zVqH+sxSiRZiq8E4idfSid8kpEJtCi7Xl5vZdI/ 5YdrL6zFV359FjafHi4HU7hA8K00hJyoXElnR5qo9jeAR3KHpuhThal3byhEkjuXLxyo kAztpOwIgde+0hhmpJ0GWFDFNRTJo2U5uK6XtOSCi4spgumfnCPGRhKRuaP+sUYFzAgk svBxmxBTAqnXVeL3Xg4K2vkO4td1N38YyBaezcJm+l4mn8lMyjayrSw6y+VO9P4nUzaf 5pE2b2PsuB7kogvdz1cgyb/cb+bFRI/TGAt3b8CpOkfto/hWdAZZgMXWxTupgsm0fp8i hrzQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=rlIo9Yt8nH2+uRDC9d7zhHiAxPDIEcFqNz14+Jf8RzA=; fh=lZWoXAWJ4KqX154wPFt9xqK442U+TVXlVY8yheCfd8s=; b=IgJh5OM8efKZrWp+C84KHnjuV0PysPrdSdo8qaMW+elerHIRxqJGhYLLN6K5DSQvej yGasu4a++e7xNpo9FTc3Gy/CHBmz1O5cuhEPJmhASk77xlinnkgkKkOjNhY90su+3Rio 9RNa/Hj5L5C4xjVXVs7NAl6cc4qd5+Gs5sL1deJSvn3kYu0xUbjnCkxF5QwPMxdZxGX/ Rmes3nTx1158EOSakPBZWJCv4US3JFxUcf5CoIIpOtJj68s/P/CHITqvStzDYhL63gtK Pgtfwp2c3yK9qi5tUddWGacok6VtVCqsqdphrx7mmV+6ghTcYOAvjebMmFgSx8IFsenI 9wdQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=oBWPCFgl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id a9-20020a654189000000b005c6650f66bbsi8518617pgq.416.2023.12.12.13.37.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Dec 2023 13:37:28 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=oBWPCFgl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 445CE80ADEC7; Tue, 12 Dec 2023 13:37:26 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1377344AbjLLVhF (ORCPT + 99 others); Tue, 12 Dec 2023 16:37:05 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36210 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1377563AbjLLVhB (ORCPT ); Tue, 12 Dec 2023 16:37:01 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F15E4AF for ; Tue, 12 Dec 2023 13:37:07 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A6D06C433C9; Tue, 12 Dec 2023 21:37:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1702417027; bh=YG9YY9iEszGGckGfEsHdcd7GRr37WZ5+YKaXd/4SyBA=; h=From:To:Cc:Subject:Date:From; b=oBWPCFgld2/BjYDNaG8jaEnt7Cx9tpnd7KcYCtbnA5rD52Cy82NwBE9XJAGFsqCM3 U6utTvXQcKjl6EnuRdn5XM+B2DZOrua3ymFoTqGqxoCjxOrqurFzf5It6UbOfaXIUZ KkNa23uvx7WyLkk7RRt02tVKDrnAW7xXwbcQ48gvRps2teHFuNi8A3f9D0mjUvm6Je 0S2d4DZjkdycE2IpzxEdbrn5vVRnZlG14rsmR30Qgp7JjcyARWj3zyuoiVvnG8FYGA oEs1GshsyyENWFrnzZO+IC6VpHwflKZVK9pwKzW66VYsqqrAQkujmqJA3zZ4wjts5m yGrB/+QUyHozQ== From: Arnd Bergmann To: "Kirill A. Shutemov" , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, Yuan Yao , Kai Huang , Tony Luck Cc: Arnd Bergmann , "H. Peter Anvin" , Isaku Yamahata , linux-coco@lists.linux.dev, linux-kernel@vger.kernel.org Subject: [PATCH] x86: tdx: hide unused tdx_dump_mce_info() Date: Tue, 12 Dec 2023 22:36:50 +0100 Message-Id: <20231212213701.4174806-1-arnd@kernel.org> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Tue, 12 Dec 2023 13:37:26 -0800 (PST) From: Arnd Bergmann When TDX is enabled but MCE is not, the tdx_dump_mce_info() function fails to link: ld.lld: error: undefined symbol: mce_is_memory_error ld.lld: error: undefined symbol: mce_usable_address >>> referenced by usercopy_64.c >>> vmlinux.o:(tdx_dump_mce_info) In this configuration, there is also no caller for the function, so avoid the problem by enclosing it in an #ifdef block. Fixes: 45f31973967d ("x86/mce: Differentiate real hardware #MCs from TDX erratum ones") Signed-off-by: Arnd Bergmann --- arch/x86/virt/vmx/tdx/tdx.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/x86/virt/vmx/tdx/tdx.c b/arch/x86/virt/vmx/tdx/tdx.c index 13df68ef40b5..3af7a7e2d8d0 100644 --- a/arch/x86/virt/vmx/tdx/tdx.c +++ b/arch/x86/virt/vmx/tdx/tdx.c @@ -1245,6 +1245,7 @@ int tdx_enable(void) } EXPORT_SYMBOL_GPL(tdx_enable); +#ifdef CONFIG_X86_MCE static bool is_pamt_page(unsigned long phys) { struct tdmr_info_list *tdmr_list = &tdx_tdmr_list; @@ -1344,6 +1345,7 @@ const char *tdx_dump_mce_info(struct mce *m) return "TDX private memory error. Possible kernel bug."; } +#endif static __init int record_keyid_partitioning(u32 *tdx_keyid_start, u32 *nr_tdx_keyids) -- 2.39.2