From nobody Fri Dec 19 17:50:24 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1E82CC4332F for ; Mon, 14 Nov 2022 11:45:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236655AbiKNLpG (ORCPT ); Mon, 14 Nov 2022 06:45:06 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41078 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236642AbiKNLo3 (ORCPT ); Mon, 14 Nov 2022 06:44:29 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4A42FA443 for ; Mon, 14 Nov 2022 03:44:21 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id B278D61045 for ; Mon, 14 Nov 2022 11:44:20 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id F37ABC433D6; Mon, 14 Nov 2022 11:44:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1668426260; bh=IHoKQKrRrTt+P5k/IAfDdtfWsTsoL9pAz/rh5KwFgsA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fPJIeLVKEPphF5Jd/ZBtMLYLlwXq2jNC6yM/rnlSjD/oEDQPHp1ZE7kCqMJrdANgg OYx54IDoHISHcJxw3pc63Qs2tcOYxTtRHcTJ4W9F7HcoW5/trhw8vxeyyBHq+m/Pis eVp7HVYPXPjZu/8kvjDRf+wsLTPWpFOJXSIB9ygDzr+QGCKYC9YzaiJGp+oM9zBEML XaRGFyOztx/UxUgwt2iThXV+acWKlYmMWdcI+N5dtWuxNIMlKfJRSY9V6c/13B3Uj9 OBttxZPrsD3xy5aYX5kXeCwCk+/s7m658Lv3c+TMu6DYODrLIFZWoGZ5JMdKyP8xcJ WYpEU/+a4AW3w== From: "Jiri Slaby (SUSE)" To: linux-kernel@vger.kernel.org Cc: Andi Kleen , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , "H. Peter Anvin" , x86@kernel.org, Martin Liska , Jiri Slaby Subject: [PATCH 11/46] x86/alternative, lto: Mark int3_*() as global and __visible Date: Mon, 14 Nov 2022 12:43:09 +0100 Message-Id: <20221114114344.18650-12-jirislaby@kernel.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221114114344.18650-1-jirislaby@kernel.org> References: <20221114114344.18650-1-jirislaby@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Andi Kleen Symbols referenced from assembler (either directly or e.f. from DEFINE_STATIC_KEY()) need to be global and visible in gcc LTO because they could end up in a different object file than the assembler. This can lead to linker errors without this patch. So mark int3_magic() and int3_selftest_ip() as global and __visible. Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Borislav Petkov Cc: Dave Hansen Cc: "H. Peter Anvin" Cc: x86@kernel.org Signed-off-by: Andi Kleen Signed-off-by: Martin Liska Signed-off-by: Jiri Slaby --- arch/x86/kernel/alternative.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/arch/x86/kernel/alternative.c b/arch/x86/kernel/alternative.c index 5cadcea035e0..05e5eb9cbd51 100644 --- a/arch/x86/kernel/alternative.c +++ b/arch/x86/kernel/alternative.c @@ -823,11 +823,12 @@ extern struct paravirt_patch_site __start_parainstruc= tions[], * convention such that we can 'call' it from assembly. */ =20 -extern void int3_magic(unsigned int *ptr); /* defined in asm */ +extern __visible void int3_magic(unsigned int *ptr); /* defined in asm */ =20 asm ( " .pushsection .init.text, \"ax\", @progbits\n" " .type int3_magic, @function\n" +" .globl int3_magic\n" "int3_magic:\n" ANNOTATE_NOENDBR " movl $1, (%" _ASM_ARG1 ")\n" @@ -836,7 +837,7 @@ asm ( " .popsection\n" ); =20 -extern void int3_selftest_ip(void); /* defined in asm below */ +extern __visible void int3_selftest_ip(void); /* defined in asm below */ =20 static int __init int3_exception_notify(struct notifier_block *self, unsigned long val, void= *data) --=20 2.38.1