From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A7D062F8EA3; Sun, 28 Jun 2026 22:24:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782685494; cv=none; b=JncUvhZGtl4kvmrlkuEDR9UkofRv+uryCvmXRrzXpgNODIEH3LD6an2sSSu/CVlrxQ75TZHdOKfWGKgyZAXafD/PcijHwxwOuMoOS9nVMa25HZnfTSynmo53gSJCIKjM6yGpXAiXEze7J2C54B5FHpvEM+Wb/9YbLFjD+lDvlbU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782685494; c=relaxed/simple; bh=Ob5wwAdbQlov3HUIX3unzRpfyxaUvFWV7NLsYJ5Bo7o=; h=Date:From:To:Subject:Cc:In-Reply-To:References:MIME-Version: Message-ID:Content-Type; b=tfCl08dn9xvTrFAN7H7umwyx2mqMxMeaWhLvFOY8iKF/W11SXzdgre/7sHPIueOccv86IioHcxVIpl3WOytwPOOYDavLjYIH+8nMyQDU+jQbMVLjJbzWltmK0uzmDe+4dlgSl3Cz27lBp2V2phpCMh7bwttIcxowvajicYnHjKI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=jEFKAtv8; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=mJ4Y9UjP; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="jEFKAtv8"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="mJ4Y9UjP" Date: Sun, 28 Jun 2026 22:24:43 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1782685484; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=2AAi5UMj16OLQTyfyVSiYUHED74/u47v+O+sWL6B510=; b=jEFKAtv8vh3DB+mmsbNtL1Z5pCoGrXmDASX00ug1a4/fuiPq/xeUP4njYOYcG/Ce1o53jg qNTO8f0FT+OyD6Lma5XmukOsz6FyEERPAJxQZDmi9UBWJJWsimMpQvcPqVn6Z+fmKKRWr8 nIjyrVs8oRBYfgiOKR/HtaRc6MVJFi8/aAxIz/Lkjus6gkHCkotUmMJiRdeMzcIZH0hr/7 eXHJfG1aJHeVDsSYs71HjQI3vYIoxjLMQxyHjSqyTnW0Au+zFx4tcuXVD5B2snDsdCfTw9 W+j/klpFH38Ydo2oLX1fxThBLltjGRctpR7MLtB0qFSKxKb0hnFLkEnoP3O9ag== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1782685484; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=2AAi5UMj16OLQTyfyVSiYUHED74/u47v+O+sWL6B510=; b=mJ4Y9UjPBseuMBK8ouSODv/L+cSPZZnLzgpUmlnhLcsrHkBSKyq50dAsy3MyyvnnC6wWZ6 psHYVEK0r8Ug/RBQ== From: "tip-bot2 for Calvin Owens" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: x86/cleanups] x86/cfi: Add __init_or_module annotations for fineibt Cc: Calvin Owens , "Borislav Petkov (AMD)" , Kees Cook , Juergen Gross , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <1f50aecf23311dc5ffb965c5ccfb8b49208dbb3f.1779763849.git.calvin@wbinvd.org> References: <1f50aecf23311dc5ffb965c5ccfb8b49208dbb3f.1779763849.git.calvin@wbinvd.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <178268548309.3843924.17648999225280966444.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Precedence: bulk Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable The following commit has been merged into the x86/cleanups branch of tip: Commit-ID: bed18bbbf9d9af55ccc01a6e2a8ec90d7e35cb11 Gitweb: https://git.kernel.org/tip/bed18bbbf9d9af55ccc01a6e2a8ec90d7e3= 5cb11 Author: Calvin Owens AuthorDate: Mon, 25 May 2026 20:22:53 -07:00 Committer: Borislav Petkov (AMD) CommitterDate: Sun, 28 Jun 2026 15:10:10 -07:00 x86/cfi: Add __init_or_module annotations for fineibt I'm seeing some benign section mismatch warnings with fineibt when building kernels with CONFIG_MODULES=3Dn: WARNING: modpost: vmlinux: section mismatch in reference: __apply_fineibt= +0x1db (section: .text) -> text_poke_early (section: .init.text) WARNING: modpost: vmlinux: section mismatch in reference: __apply_fineibt= +0x473 (section: .text) -> text_poke_early (section: .init.text) WARNING: modpost: vmlinux: section mismatch in reference: __apply_fineibt= +0x57c (section: .text) -> text_poke_early (section: .init.text) WARNING: modpost: vmlinux: section mismatch in reference: __apply_fineibt= +0x6d9 (section: .text) -> text_poke_early (section: .init.text) WARNING: modpost: vmlinux: section mismatch in reference: __apply_fineibt= +0xb57 (section: .text) -> text_poke_early (section: .init.text) WARNING: modpost: vmlinux: section mismatch in reference: __apply_fineibt= +0xb81 (section: .text) -> text_poke_early (section: .init.text) WARNING: modpost: vmlinux: section mismatch in reference: __apply_fineibt= +0xd00 (section: .text) -> poison_endbr (section: .init.text) WARNING: modpost: vmlinux: section mismatch in reference: __apply_fineibt= +0xdd3 (section: .text) -> text_poke_early (section: .init.text) WARNING: modpost: vmlinux: section mismatch in reference: __apply_fineibt= +0xe58 (section: .text) -> text_poke_early (section: .init.text) WARNING: modpost: vmlinux: section mismatch in reference: __apply_fineibt= +0xe85 (section: .text) -> text_poke_early (section: .init.text) WARNING: modpost: vmlinux: section mismatch in reference: apply_fineibt+0= x8 (section: .text.unlikely.) -> __apply_fineibt (section: .init.text) Add the missing __init_or_module section annotations to fix the warnings, and also free up a tiny bit of memory after boot. Signed-off-by: Calvin Owens Signed-off-by: Borislav Petkov (AMD) Reviewed-by: Kees Cook Reviewed-by: Juergen Gross Link: https://patch.msgid.link/1f50aecf23311dc5ffb965c5ccfb8b49208dbb3f.17797= 63849.git.calvin@wbinvd.org --- arch/x86/kernel/alternative.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/arch/x86/kernel/alternative.c b/arch/x86/kernel/alternative.c index 62936a3..400baff 100644 --- a/arch/x86/kernel/alternative.c +++ b/arch/x86/kernel/alternative.c @@ -1775,8 +1775,8 @@ static int cfi_rewrite_callers(s32 *start, s32 *end) #define FINEIBT_WARN(_f, _v) \ WARN_ONCE((_f) !=3D (_v), "FineIBT: " #_f " %ld !=3D %d\n", _f, _v) =20 -static void __apply_fineibt(s32 *start_retpoline, s32 *end_retpoline, - s32 *start_cfi, s32 *end_cfi, bool builtin) +static void __init_or_module __apply_fineibt(s32 *start_retpoline, s32 *end_= retpoline, + s32 *start_cfi, s32 *end_cfi, bool builtin) { int ret; =20 @@ -2088,8 +2088,8 @@ bool decode_fineibt_insn(struct pt_regs *regs, unsigned= long *target, u32 *type) =20 #else /* !CONFIG_FINEIBT: */ =20 -static void __apply_fineibt(s32 *start_retpoline, s32 *end_retpoline, - s32 *start_cfi, s32 *end_cfi, bool builtin) +static void __init_or_module __apply_fineibt(s32 *start_retpoline, s32 *end_= retpoline, + s32 *start_cfi, s32 *end_cfi, bool builtin) { if (IS_ENABLED(CONFIG_CFI) && builtin) pr_info("CFI: Using standard kCFI\n"); @@ -2101,8 +2101,8 @@ static void poison_cfi(void *addr) { } =20 #endif /* !CONFIG_FINEIBT */ =20 -void apply_fineibt(s32 *start_retpoline, s32 *end_retpoline, - s32 *start_cfi, s32 *end_cfi) +void __init_or_module apply_fineibt(s32 *start_retpoline, s32 *end_retpoline, + s32 *start_cfi, s32 *end_cfi) { return __apply_fineibt(start_retpoline, end_retpoline, start_cfi, end_cfi,