From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-dl1-f51.google.com (mail-dl1-f51.google.com [74.125.82.51]) (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 B80CF3E8325 for ; Wed, 10 Jun 2026 15:54:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.82.51 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781106872; cv=none; b=k+/EZ1DW1IrMC1BDm2c7gQAlDlQQGrnFE1E7r7aggUEmqyNvDmgt1XUF+bDNm5glYB1EDWGD8jtRwZ/34bPU39TbJhnpkPLALVw7ldn422m1O6PFen9UZSIKClUSpkWW18+3/5nIXk+J48vEyoNaGJwUBS+VTID65TOOLn5hwso= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781106872; c=relaxed/simple; bh=rrmyPg6Ij2jUtreDMS9eitvBr9QlhZJRIEHXpf+L1nM=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=EKE0twV0Tc2RpkR2hiL/h3m5aHskKhQpUWJiVWEPA1YKow2BfuiwpKRPaNzHpT/O9HZ9mKlYqgSwD+N/221B0ASGybSpNwRm513n0tKziTyyUqvaMy+Q+x+5PZrYe4WDCCcy1J6wVqHJnM9mC2FIYVeKcZ4s2j7NsboILqJBPaI= 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=C4nHTi9Q; arc=none smtp.client-ip=74.125.82.51 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="C4nHTi9Q" Received: by mail-dl1-f51.google.com with SMTP id a92af1059eb24-138129a622dso5629952c88.0 for ; Wed, 10 Jun 2026 08:54:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wbinvd.org; s=wbinvd; t=1781106870; x=1781711670; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=GJ9UqhHiiWV4oEipSeYiilezbq4vfn8xHN5rEH3xYRk=; b=C4nHTi9Qa8YGD+qE7oQZ0w2ghpPVPHpOrx6RbjQ2NfuRxMdtrW7nbFs8SyytHiZCQy nVl3uBDteDtJpH79KGd2NBu2voMMVs5dZnrKXDYnCcOjREz1XPCBrkjt5wf4JreIVnT8 OgQQXq3f/LGhEOSdqMxmfcZPIVaXCDJ+FURfAeIlW219aIrQjX7d+vmOfto4MbhQPFvf y/6u6PnezGHXlS7htdb3+SHBTxejfxo4Dtn7PBVhZ3gg+bajbe15eISTrvUk6zaV7tot Q2vnFwiInuSYKF5LVrVijy86EtuTVXI+HO44mKLp370qYmFAfDBwYk0X2BMKqXYt+Mui lsCg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1781106870; x=1781711670; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=GJ9UqhHiiWV4oEipSeYiilezbq4vfn8xHN5rEH3xYRk=; b=T/7k1FbpQ+eG0YkoEm7Zhr0FMH2sADb/idRH17k6jhaoCwjCWo5fQAkMvI0qbyajI1 APOVVwt6KmT1aFbGl/nzpmUMr0EyZjxbkPMqk5F+JYQy+fC2tSbxfu14p1JxmAW4EKHg hbxsTB06fzsf9zix1+UYkVaUJoEAzK+YJ3eHvP6n3rjYrTAjdDYaJHbzJphzO7cuDs7Z Ew6RZ0bUM97xJUNOOfd8/CZI4LKojWHbWf5ccB8woT2Dab87j1DRWk/RHvgqMrtuCYJD adqaS2oUzppiOy86HK0MBZNz2IkDP2FlZqFVIYL8Se6N0bgcsVeBEUG24deFaN2Kl8M0 Iyew== X-Gm-Message-State: AOJu0Yyv0Y16LR0w8nultZY0QU+fha2O+ZzUhp0kbEiVyWHcgZkAKXMJ Hy3cqq6yqgf9aPxn9JxLkalrpjr88cT0gk2gZDP/6sVMHr3UQbcCy69o4Vif4bsbn9y5tqnDTcF ffh1w X-Gm-Gg: Acq92OFi++km+zSMFqy0ZFzwXb700WXYSqg/ffa4rXk/1SlqRJXTwuL6ynVQBLzjBct S+ine1HZVECqY9VlEpEt8gXd1RoNWwyvF6pqq5ma7zlETdQzYbe4vgffpKp/ZqCWzS/GWk30BHU jM4gL0KHN6e1FWdvDg3OMvOCzH2B7CofkQ7JQn55XzMz0FZpRWLaZ4OIw4ZPKsQRvImtBmGee5z 6cCKH92tYmtuYbvYkgotq/NlzUIWV/wVSJM5VZFLLF1LX6G2mfHYy0TNdkLez72Iut/w96na1P5 sVNy54oILkdZkgKlFuxU+jfZ9tesPAWw9J1W1Xt/YpbvHHianuAfBwk7bcs4RXV/UjrLzigdAXY q9fSXDfLVYvOHaXsxjyVF3JgyZjPIJFLq6XQQr7P+3H+NjoZFuhZQVEJRh2NjkaoN78+zFTOtRd 3c+t21dTu/5ymJnkpWh9OxwLZ856lJnZl1qSk= X-Received: by 2002:a05:7022:e24:b0:12d:c730:c7f with SMTP id a92af1059eb24-13831bd195cmr5435040c88.33.1781106869745; Wed, 10 Jun 2026 08:54:29 -0700 (PDT) Received: from mozart.vkv.me ([2001:5a8:468b:d015:375a:a215:7d4e:6ae]) by smtp.gmail.com with ESMTPSA id a92af1059eb24-137f5539432sm22420674c88.9.2026.06.10.08.54.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Jun 2026 08:54:29 -0700 (PDT) Date: Wed, 10 Jun 2026 08:54:26 -0700 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: Re: [PATCH] x86/cfi: add __init_or_module annotations for fineibt Message-ID: 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 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <1f50aecf23311dc5ffb965c5ccfb8b49208dbb3f.1779763849.git.calvin@wbinvd.org> On Monday 05/25 at 20:22 -0700, Calvin Owens wrote: > I'm seeing some benign section mismatch warnings with fineibt when > building kernels with CONFIG_MODULES=n: > > 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+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 Gentle ping. > --- > 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) != (_v), "FineIBT: " #_f " %ld != %d\n", _f, _v) > > -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; > > @@ -2088,8 +2088,8 @@ bool decode_fineibt_insn(struct pt_regs *regs, unsigned long *target, u32 *type) > > #else /* !CONFIG_FINEIBT: */ > > -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) { } > > #endif /* !CONFIG_FINEIBT */ > > -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, > -- > 2.47.3 >