From nobody Mon Jun 8 22:54:21 2026 Received: from mail-dl1-f50.google.com (mail-dl1-f50.google.com [74.125.82.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 457EE481B1 for ; Tue, 26 May 2026 03:23:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.82.50 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779765797; cv=none; b=uZKToIP4o1f/V+L2pCb85WoEAENH6Lj6+Xi8LxH4scsNAbQ19OV2ZW65iwYuw1lgvoTJ7eei7+pUxOUpOppUX9O3voak1/t5ZNgsktACvqFlIzqS8OKRqLMpPkFNWJzJ6BbsaalnoUqjl+/AVJq7KJbHc0zCITrBKl6KwumvTzM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779765797; c=relaxed/simple; bh=k7BfBfFMxCrTJlPtF8ITt6WHp5tm7bsoSlIINWsaWTE=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=uEZ8fZDA2XONMiYLstiKkQupuR6sSlqAI1ugjAJpIDw7hljMQEk25uumgukoKUMYdcsea0aRwYegcKkEIF76MAXOH0+ItU/AtXpX8TO0QS9odx+KIddVBVfjjHtPHGnOpVkiTsAQrGDKuo2mD5TLlIXA7YDtlApsc7jnief6TXs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=wbinvd.org; spf=pass smtp.mailfrom=wbinvd.org; dkim=pass (2048-bit key) header.d=wbinvd.org header.i=@wbinvd.org header.b=Rv9RRfD4; arc=none smtp.client-ip=74.125.82.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=wbinvd.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=wbinvd.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=wbinvd.org header.i=@wbinvd.org header.b="Rv9RRfD4" Received: by mail-dl1-f50.google.com with SMTP id a92af1059eb24-1329fc4bf77so8520201c88.1 for ; Mon, 25 May 2026 20:23:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wbinvd.org; s=wbinvd; t=1779765795; x=1780370595; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=rq326EKAtoFa94DwOLVHQN7cRF8bllCTsHX9wnVXiSY=; b=Rv9RRfD4lpxgXu7DMz9AnAQAJG/7B2CqGix/N70O1vaNsrQAyeGCCrRtch0KdZgzKJ pi+BxdQYHXs0dslnT+XIbrisOGbhFR3VkpfzOPZMpIvszLsCNpOI/YEOdxUdmZ4Bdazh vp+d5e/beeD9JChCIIi1z1A3pvJwqAZyAdg19Dc/dTzptycsG4pW7O9PYw4s+KieJuUY xdtZsCDOVtIZkcYY3LxTC6JDg27NjoG+UMz773wj69/0MdEdZVaApTGtYM9mv7Nwan41 ttva1UufVJc8yxkomkOhxJqe18wc+JAUsxDdZIV0gvRkJ9HI6H28IfO2UyiRq7Wzuz54 bcUA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1779765795; x=1780370595; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=rq326EKAtoFa94DwOLVHQN7cRF8bllCTsHX9wnVXiSY=; b=QJc0nQ12Vswzxg0gxIqF0MW4U0ZwPpJgjAm7U2DdARU64pscjjV0G/3dJaeu6+wMHp sFidkOlw57HT2QGxOev3IBRByB3/s4WSQK9tMensgi16AdiLsLNJFTt6K89u16DTtQIe LZyjHOQJfzN3yOmmFvWBOYH1WI3UYQvnlrwstZAqTZZsjpWSuIHZ/rr3LgjevRC2TVQl zh46bQoSPqVQckFbxDpk/jQhb+eXOPIyzf2gPIHrQ8prbaslQyyF/neAaJjufRxqobXO Ung78UGzCt+H3QdKgTtPbwaElICZPjElAa8/w2InZPY9vNj7E6Uv0OthFyEfOmeCVPQ9 oeWw== X-Gm-Message-State: AOJu0YzwHGV4/zGkUZRgwybe99QTIYhNKIHvgHYHp54cXdTjQXATJki5 rNCMiisB0CpRCaZpygLQFQBzYM0CFxc9CK3WhfKn+rbeKrui7VOGtOum17BASzPe1uE2p2pphGV hvQwd3Sw= X-Gm-Gg: Acq92OFLb+ch8z85iX4L15+4V+JI2EUxl/0t2I3Lrmnq37LA+ZvsbPQA39YmBE3+pUP hC1tLSnbYlDoxyFfBgDEH+7WL6vUm5MB19hQdS0f9sbYg/n5+q47MP/kzLzrB1m9C+G95YGlcHV T70DSfhKu9uydez6RL9UCz20NZn+vv7TY+D4FEkzMh8v3HotuyxVB9ttnu/Xp2ffrRWA5n/S3Fq +B/5iYS+NNSu0RxezeP1zfxM8uzwsVSqeuXaTDNXMnjFoxZTD+52C3CMCleg0e3UwwaHPsn+SmW DJxyBkV32Kfj1Std5fKncxjRvnVXD8bcB8JryEadJLVdfrKqrB8VHO3+jsJcBYwF3oiDQnwGkUe kYvfePcNNULTJUWcIuSlta17hKGkyMtseFRb4OtszuX6brJ4gG4xrVEFratLMwLzn9rRkD+7dsA Jx1ZCWJZyxscenvhBsi+Mq8WzmPs+qQmGj4IwB X-Received: by 2002:a05:7022:41a8:b0:134:df7f:910d with SMTP id a92af1059eb24-1365f812d88mr6029994c88.7.1779765795264; Mon, 25 May 2026 20:23:15 -0700 (PDT) Received: from mozart.vkv.me ([2001:5a8:468b:d015:ad06:62a0:f8d1:4ee8]) by smtp.gmail.com with ESMTPSA id a92af1059eb24-1366aa88cffsm6827696c88.11.2026.05.25.20.23.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 May 2026 20:23:14 -0700 (PDT) From: Calvin Owens To: linux-kernel@vger.kernel.org Cc: Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , Peter Zijlstra , "Mike Rapoport (Microsoft)" , Kees Cook , Juergen Gross , Josh Poimboeuf , Mark Rutland Subject: [PATCH] x86/cfi: add __init_or_module annotations for fineibt Date: Mon, 25 May 2026 20:22:53 -0700 Message-ID: <1f50aecf23311dc5ffb965c5ccfb8b49208dbb3f.1779763849.git.calvin@wbinvd.org> X-Mailer: git-send-email 2.47.3 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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_finei= bt+0x1db (section: .text) -> text_poke_early (section: .init.text) WARNING: modpost: vmlinux: section mismatch in reference: __apply_finei= bt+0x473 (section: .text) -> text_poke_early (section: .init.text) WARNING: modpost: vmlinux: section mismatch in reference: __apply_finei= bt+0x57c (section: .text) -> text_poke_early (section: .init.text) WARNING: modpost: vmlinux: section mismatch in reference: __apply_finei= bt+0x6d9 (section: .text) -> text_poke_early (section: .init.text) WARNING: modpost: vmlinux: section mismatch in reference: __apply_finei= bt+0xb57 (section: .text) -> text_poke_early (section: .init.text) WARNING: modpost: vmlinux: section mismatch in reference: __apply_finei= bt+0xb81 (section: .text) -> text_poke_early (section: .init.text) WARNING: modpost: vmlinux: section mismatch in reference: __apply_finei= bt+0xd00 (section: .text) -> poison_endbr (section: .init.text) WARNING: modpost: vmlinux: section mismatch in reference: __apply_finei= bt+0xdd3 (section: .text) -> text_poke_early (section: .init.text) WARNING: modpost: vmlinux: section mismatch in reference: __apply_finei= bt+0xe58 (section: .text) -> text_poke_early (section: .init.text) WARNING: modpost: vmlinux: section mismatch in reference: __apply_finei= bt+0xe85 (section: .text) -> text_poke_early (section: .init.text) WARNING: modpost: vmlinux: section mismatch in reference: apply_fineibt= +0x8 (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 Reviewed-by: Juergen Gross --- 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 62936a3bde19..400baffcd609 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 *en= d_retpoline, + s32 *start_cfi, s32 *end_cfi, bool builtin) { int ret; =20 @@ -2088,8 +2088,8 @@ bool decode_fineibt_insn(struct pt_regs *regs, unsign= ed 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 *en= d_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_retpoli= ne, + s32 *start_cfi, s32 *end_cfi) { return __apply_fineibt(start_retpoline, end_retpoline, start_cfi, end_cfi, --=20 2.47.3