From nobody Sat Jul 25 20:47:10 2026 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 128943546C7; Mon, 13 Jul 2026 19:47:36 +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=1783972059; cv=none; b=XS7UYYMMLeUEVQzckrKXWxtJ2Q0y5w0nXVgJ31W8iQ4b3Mfq6XSFHhyBTq7by9h965tljGJEh8mIbPZB5iG8Ds8YmBGqB0ygn8+/C6MjO/m1AAD5MqhsjKz/E4HuJMe1Gg37ayrurLgxAnzoJlgUtYWikLIut88GaTRvv+zXpwI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783972059; c=relaxed/simple; bh=43bhhGYVxj/y8bgktt0E7Z3Zd+oZcqoeu7FbdO2KYl8=; h=Date:From:To:Subject:Cc:MIME-Version:Message-ID:Content-Type; b=Pl+gAE2QIa+wpZAuF0vLkn7HUhp5qLrigkth2KMTuhMteEEl/b5RFC7Mvxm0FGOQpqJj2eChQEaCGrNiPbHYcfir8pMoTpCcuiBb74xGXXU7OB+ScpyVaYT8okIJogGAyizbvBAHy2w8WnjcporCr4nD2hwXOPIHHfMuECWkFMU= 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=kq8nMLhp; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=7l4A9QYO; 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="kq8nMLhp"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="7l4A9QYO" Date: Mon, 13 Jul 2026 19:47:32 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1783972055; 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; bh=xW7qytDPH2AdQATtzjjxfA02fA48Cjm8VPiSO+wZsJE=; b=kq8nMLhpFo+H5hejtdYnmFgzMvi2P28ZceeTHwNaNp1tPgKCC2am5yggqkVr44P6Go0Aug 2OkcDKnwsNXKsAKxnW8YYkymO1a89PsxCLt1kGsxoRSDZTVwf8bvyfAOLUhunlXkiYhn00 czh3vOHal7LMKVV3B/UsO7CPFKTUI27fJcY5EQ8b9AXCYR75W5t8wu8PhDOTS84goZxIz6 Ra2g1FdAdYIzShqtLitAKs2egR2h+xZ1soOmpb/MuZr/pWsYxUoJ6uuCGpKlMaOw+EIbqF ZSJ0paXgoPv4I/zGcDUGWr1jLE4eYhQn1xu5gFkSz9n/mZ5vAHAO6bDZBTN7Vw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1783972055; 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; bh=xW7qytDPH2AdQATtzjjxfA02fA48Cjm8VPiSO+wZsJE=; b=7l4A9QYOx1dpmYgoO0+Ocq2kRDTOuBotMsM/tC5lKpe3cxN7LCYOEd0+V+buS5h24QlgXr hHHwCNaesywFRNAQ== From: "tip-bot2 for Borislav Petkov (AMD)" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: x86/alternatives] x86/alternative: Drop smp_locks glue Cc: "Borislav Petkov (AMD)" , "Peter Zijlstra (Intel)" , "Mike Rapoport (Microsoft)" , x86@kernel.org, linux-kernel@vger.kernel.org Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <178397205298.1844600.3172691787133781868.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/alternatives branch of ti= p: Commit-ID: 4a73b93ce489a58c9a2aac4a5f5cd8cfa58ced64 Gitweb: https://git.kernel.org/tip/4a73b93ce489a58c9a2aac4a5f5cd8cfa= 58ced64 Author: Borislav Petkov (AMD) AuthorDate: Mon, 29 Jun 2026 12:11:20 -07:00 Committer: Borislav Petkov (AMD) CommitterDate: Mon, 13 Jul 2026 09:23:36 -07:00 x86/alternative: Drop smp_locks glue This was there to be able to patch out locking instructions when running a SMP kernel build on a UP CPU. The times are long gone when single-CPU x86 machines were relevant so drop that machinery and simplify the code considerably. LOCK_PREFIX needs to stay for when one wants to do a UP build for whatever reason. That'll go away when CONFIG_SMP becomes unconditional. Kill a bunch of leftover, unused prototypes while at it. Signed-off-by: Borislav Petkov (AMD) Acked-by: Peter Zijlstra (Intel) Acked-by: Mike Rapoport (Microsoft) Link: https://lore.kernel.org/r/20260328081634.797552-1-rppt@kernel.org --- Documentation/admin-guide/kernel-parameters.txt | 3 +- arch/um/kernel/um_arch.c | 12 +- arch/x86/include/asm/alternative.h | 68 +----- arch/x86/include/asm/cmpxchg_32.h | 4 +- arch/x86/include/asm/cpufeatures.h | 2 +- arch/x86/kernel/alternative.c | 190 +--------------- arch/x86/kernel/kprobes/core.c | 3 +- arch/x86/kernel/kprobes/opt.c | 1 +- arch/x86/kernel/module.c | 13 +- arch/x86/kernel/smpboot.c | 3 +- arch/x86/kernel/vmlinux.lds.S | 12 +- arch/x86/tools/relocs.c | 2 +- tools/arch/x86/include/asm/cpufeatures.h | 2 +- tools/objtool/check.c | 1 +- tools/objtool/klp-diff.c | 1 +- 15 files changed, 11 insertions(+), 306 deletions(-) diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentatio= n/admin-guide/kernel-parameters.txt index b5493a7..9f454ab 100644 --- a/Documentation/admin-guide/kernel-parameters.txt +++ b/Documentation/admin-guide/kernel-parameters.txt @@ -4587,9 +4587,6 @@ Kernel parameters norandmaps Don't use address space randomization. Equivalent to echo 0 > /proc/sys/kernel/randomize_va_space =20 - noreplace-smp [X86-32,SMP] Don't replace SMP instructions - with UP alternatives - noresume [SWSUSP] Disables resume and restores original swap space. =20 diff --git a/arch/um/kernel/um_arch.c b/arch/um/kernel/um_arch.c index 2141f5f..e4ee693 100644 --- a/arch/um/kernel/um_arch.c +++ b/arch/um/kernel/um_arch.c @@ -451,18 +451,6 @@ void apply_alternatives(struct alt_instr *start, struc= t alt_instr *end) { } =20 -#if IS_ENABLED(CONFIG_SMP) -void alternatives_smp_module_add(struct module *mod, char *name, - void *locks, void *locks_end, - void *text, void *text_end) -{ -} - -void alternatives_smp_module_del(struct module *mod) -{ -} -#endif - void *text_poke(void *addr, const void *opcode, size_t len) { /* diff --git a/arch/x86/include/asm/alternative.h b/arch/x86/include/asm/alte= rnative.h index 0336451..08af86e 100644 --- a/arch/x86/include/asm/alternative.h +++ b/arch/x86/include/asm/alternative.h @@ -20,39 +20,9 @@ =20 #include =20 -/* - * Alternative inline assembly for SMP. - * - * The LOCK_PREFIX macro defined here replaces the LOCK and - * LOCK_PREFIX macros used everywhere in the source tree. - * - * SMP alternatives use the same data structures as the other - * alternatives and the X86_FEATURE_UP flag to indicate the case of a - * UP system running a SMP kernel. The existing apply_alternatives() - * works fine for patching a SMP kernel for UP. - * - * The SMP alternative tables can be kept after boot and contain both - * UP and SMP versions of the instructions to allow switching back to - * SMP at runtime, when hotplugging in a new CPU, which is especially - * useful in virtualized environments. - * - * The very common lock prefix is handled as special case in a - * separate table which is a pure address list without replacement ptr - * and size information. That keeps the table sizes small. - */ - #ifdef CONFIG_SMP -#define LOCK_PREFIX_HERE \ - ".pushsection .smp_locks,\"a\"\n" \ - ".balign 4\n" \ - ".long 671f - .\n" /* offset */ \ - ".popsection\n" \ - "671:" - -#define LOCK_PREFIX LOCK_PREFIX_HERE "\n\tlock " - -#else /* ! CONFIG_SMP */ -#define LOCK_PREFIX_HERE "" +#define LOCK_PREFIX "lock " +#else #define LOCK_PREFIX "" #endif =20 @@ -87,7 +57,6 @@ extern s32 __retpoline_sites[], __retpoline_sites_end[]; extern s32 __return_sites[], __return_sites_end[]; extern s32 __cfi_sites[], __cfi_sites_end[]; extern s32 __ibt_endbr_seal[], __ibt_endbr_seal_end[]; -extern s32 __smp_locks[], __smp_locks_end[]; =20 /* * Debug flag that can be tested to see whether alternative @@ -162,26 +131,6 @@ static __always_inline bool cpu_wants_rethunk_at(void = *addr) } #endif =20 -#ifdef CONFIG_SMP -extern void alternatives_smp_module_add(struct module *mod, char *name, - void *locks, void *locks_end, - void *text, void *text_end); -extern void alternatives_smp_module_del(struct module *mod); -extern void alternatives_enable_smp(void); -extern int alternatives_text_reserved(void *start, void *end); -extern bool skip_smp_alternatives; -#else -static inline void alternatives_smp_module_add(struct module *mod, char *n= ame, - void *locks, void *locks_end, - void *text, void *text_end) {} -static inline void alternatives_smp_module_del(struct module *mod) {} -static inline void alternatives_enable_smp(void) {} -static inline int alternatives_text_reserved(void *start, void *end) -{ - return 0; -} -#endif /* CONFIG_SMP */ - #define ALT_CALL_INSTR "call BUG_func" =20 #define alt_slen "772b-771b" @@ -319,18 +268,11 @@ void nop_func(void); =20 #else /* __ASSEMBLER__ */ =20 +.macro LOCK_PREFIX #ifdef CONFIG_SMP - .macro LOCK_PREFIX -672: lock - .pushsection .smp_locks,"a" - .balign 4 - .long 672b - . - .popsection - .endm -#else - .macro LOCK_PREFIX - .endm + lock #endif + .endm =20 /* * Issue one struct alt_instr descriptor entry (need to put it into diff --git a/arch/x86/include/asm/cmpxchg_32.h b/arch/x86/include/asm/cmpxc= hg_32.h index 1f80a62..e85c221 100644 --- a/arch/x86/include/asm/cmpxchg_32.h +++ b/arch/x86/include/asm/cmpxchg_32.h @@ -104,7 +104,7 @@ static __always_inline bool __try_cmpxchg64_local(volat= ile u64 *ptr, u64 *oldp,=20 =20 static __always_inline u64 arch_cmpxchg64(volatile u64 *ptr, u64 old, u64 = new) { - return __arch_cmpxchg64_emu(ptr, old, new, LOCK_PREFIX_HERE, "lock "); + return __arch_cmpxchg64_emu(ptr, old, new, , "lock "); } #define arch_cmpxchg64 arch_cmpxchg64 =20 @@ -138,7 +138,7 @@ static __always_inline u64 arch_cmpxchg64_local(volatil= e u64 *ptr, u64 old, u64=20 =20 static __always_inline bool arch_try_cmpxchg64(volatile u64 *ptr, u64 *old= p, u64 new) { - return __arch_try_cmpxchg64_emu(ptr, oldp, new, LOCK_PREFIX_HERE, "lock "= ); + return __arch_try_cmpxchg64_emu(ptr, oldp, new, , "lock "); } #define arch_try_cmpxchg64 arch_try_cmpxchg64 =20 diff --git a/arch/x86/include/asm/cpufeatures.h b/arch/x86/include/asm/cpuf= eatures.h index 1b4a48b..3d0940a 100644 --- a/arch/x86/include/asm/cpufeatures.h +++ b/arch/x86/include/asm/cpufeatures.h @@ -78,7 +78,7 @@ #define X86_FEATURE_ZEN6 ( 3*32+ 6) /* CPU based on Zen6 microarchitectur= e */ /* Free ( 3*32+ 7) */ #define X86_FEATURE_CONSTANT_TSC ( 3*32+ 8) /* "constant_tsc" TSC ticks at= a constant rate */ -#define X86_FEATURE_UP ( 3*32+ 9) /* "up" SMP kernel running on UP */ +/* free: was #define X86_FEATURE_UP ( 3*32+ 9) * "up" SMP kernel running o= n UP */ #define X86_FEATURE_ART ( 3*32+10) /* "art" Always running timer (ART) */ #define X86_FEATURE_ARCH_PERFMON ( 3*32+11) /* "arch_perfmon" Intel Archit= ectural PerfMon */ #define X86_FEATURE_PEBS ( 3*32+12) /* "pebs" Precise-Event Based Samplin= g */ diff --git a/arch/x86/kernel/alternative.c b/arch/x86/kernel/alternative.c index 62936a3..bf717b4 100644 --- a/arch/x86/kernel/alternative.c +++ b/arch/x86/kernel/alternative.c @@ -41,15 +41,6 @@ static int __init debug_alt(char *str) } __setup("debug-alternative", debug_alt); =20 -static int noreplace_smp; - -static int __init setup_noreplace_smp(char *str) -{ - noreplace_smp =3D 1; - return 1; -} -__setup("noreplace-smp", setup_noreplace_smp); - #define DPRINTK(type, fmt, args...) \ do { \ if (debug_alternative & DA_##type) \ @@ -2109,159 +2100,6 @@ void apply_fineibt(s32 *start_retpoline, s32 *end_r= etpoline, /* .builtin =3D */ false); } =20 -#ifdef CONFIG_SMP -static void alternatives_smp_lock(const s32 *start, const s32 *end, - u8 *text, u8 *text_end) -{ - const s32 *poff; - - for (poff =3D start; poff < end; poff++) { - u8 *ptr =3D (u8 *)poff + *poff; - - if (!*poff || ptr < text || ptr >=3D text_end) - continue; - /* turn DS segment override prefix into lock prefix */ - if (*ptr =3D=3D 0x3e) - text_poke(ptr, ((unsigned char []){0xf0}), 1); - } -} - -static void alternatives_smp_unlock(const s32 *start, const s32 *end, - u8 *text, u8 *text_end) -{ - const s32 *poff; - - for (poff =3D start; poff < end; poff++) { - u8 *ptr =3D (u8 *)poff + *poff; - - if (!*poff || ptr < text || ptr >=3D text_end) - continue; - /* turn lock prefix into DS segment override prefix */ - if (*ptr =3D=3D 0xf0) - text_poke(ptr, ((unsigned char []){0x3E}), 1); - } -} - -struct smp_alt_module { - /* what is this ??? */ - struct module *mod; - char *name; - - /* ptrs to lock prefixes */ - const s32 *locks; - const s32 *locks_end; - - /* .text segment, needed to avoid patching init code ;) */ - u8 *text; - u8 *text_end; - - struct list_head next; -}; -static LIST_HEAD(smp_alt_modules); -static bool uniproc_patched =3D false; /* protected by text_mutex */ - -void __init_or_module alternatives_smp_module_add(struct module *mod, - char *name, - void *locks, void *locks_end, - void *text, void *text_end) -{ - struct smp_alt_module *smp; - - mutex_lock(&text_mutex); - if (!uniproc_patched) - goto unlock; - - if (num_possible_cpus() =3D=3D 1) - /* Don't bother remembering, we'll never have to undo it. */ - goto smp_unlock; - - smp =3D kzalloc_obj(*smp); - if (NULL =3D=3D smp) - /* we'll run the (safe but slow) SMP code then ... */ - goto unlock; - - smp->mod =3D mod; - smp->name =3D name; - smp->locks =3D locks; - smp->locks_end =3D locks_end; - smp->text =3D text; - smp->text_end =3D text_end; - DPRINTK(SMP, "locks %p -> %p, text %p -> %p, name %s\n", - smp->locks, smp->locks_end, - smp->text, smp->text_end, smp->name); - - list_add_tail(&smp->next, &smp_alt_modules); -smp_unlock: - alternatives_smp_unlock(locks, locks_end, text, text_end); -unlock: - mutex_unlock(&text_mutex); -} - -void __init_or_module alternatives_smp_module_del(struct module *mod) -{ - struct smp_alt_module *item; - - mutex_lock(&text_mutex); - list_for_each_entry(item, &smp_alt_modules, next) { - if (mod !=3D item->mod) - continue; - list_del(&item->next); - kfree(item); - break; - } - mutex_unlock(&text_mutex); -} - -void alternatives_enable_smp(void) -{ - struct smp_alt_module *mod; - - /* Why bother if there are no other CPUs? */ - BUG_ON(num_possible_cpus() =3D=3D 1); - - mutex_lock(&text_mutex); - - if (uniproc_patched) { - pr_info("switching to SMP code\n"); - BUG_ON(num_online_cpus() !=3D 1); - clear_cpu_cap(&boot_cpu_data, X86_FEATURE_UP); - clear_cpu_cap(&cpu_data(0), X86_FEATURE_UP); - list_for_each_entry(mod, &smp_alt_modules, next) - alternatives_smp_lock(mod->locks, mod->locks_end, - mod->text, mod->text_end); - uniproc_patched =3D false; - } - mutex_unlock(&text_mutex); -} - -/* - * Return 1 if the address range is reserved for SMP-alternatives. - * Must hold text_mutex. - */ -int alternatives_text_reserved(void *start, void *end) -{ - struct smp_alt_module *mod; - const s32 *poff; - u8 *text_start =3D start; - u8 *text_end =3D end; - - lockdep_assert_held(&text_mutex); - - list_for_each_entry(mod, &smp_alt_modules, next) { - if (mod->text > text_end || mod->text_end < text_start) - continue; - for (poff =3D mod->locks; poff < mod->locks_end; poff++) { - const u8 *ptr =3D (const u8 *)poff + *poff; - - if (text_start <=3D ptr && text_end > ptr) - return 1; - } - } - - return 0; -} -#endif /* CONFIG_SMP */ - /* * Self-test for the INT3 based CALL emulation code. * @@ -2440,40 +2278,12 @@ void __init alternative_instructions(void) =20 ibt_restore(ibt); =20 -#ifdef CONFIG_SMP - /* Patch to UP if other cpus not imminent. */ - if (!noreplace_smp && (num_present_cpus() =3D=3D 1 || setup_max_cpus <=3D= 1)) { - uniproc_patched =3D true; - alternatives_smp_module_add(NULL, "core kernel", - __smp_locks, __smp_locks_end, - _text, _etext); - } -#endif - restart_nmi(); alternatives_patched =3D 1; =20 alt_reloc_selftest(); } =20 -#ifdef CONFIG_SMP -/* - * With CONFIG_DEFERRED_STRUCT_PAGE_INIT enabled we can free_init_pages() = only - * after the deferred initialization of the memory map is complete. - */ -static int __init free_smp_locks(void) -{ - if (!uniproc_patched || num_possible_cpus() =3D=3D 1) { - free_init_pages("SMP alternatives", - (unsigned long)__smp_locks, - (unsigned long)__smp_locks_end); - } - - return 0; -} -arch_initcall(free_smp_locks); -#endif - /** * text_poke_early - Update instructions on a live kernel at boot time * @addr: address to modify diff --git a/arch/x86/kernel/kprobes/core.c b/arch/x86/kernel/kprobes/core.c index c1fac3a..4e5f8c1 100644 --- a/arch/x86/kernel/kprobes/core.c +++ b/arch/x86/kernel/kprobes/core.c @@ -762,9 +762,6 @@ int arch_prepare_kprobe(struct kprobe *p) { int ret; =20 - if (alternatives_text_reserved(p->addr, p->addr)) - return -EINVAL; - if (!can_probe((unsigned long)p->addr)) return -EILSEQ; =20 diff --git a/arch/x86/kernel/kprobes/opt.c b/arch/x86/kernel/kprobes/opt.c index 6f826a0..6e5f1b8 100644 --- a/arch/x86/kernel/kprobes/opt.c +++ b/arch/x86/kernel/kprobes/opt.c @@ -213,7 +213,6 @@ static int copy_optimized_instructions(u8 *dest, u8 *sr= c, u8 *real) } /* Check whether the address range is reserved */ if (ftrace_text_reserved(src, src + len - 1) || - alternatives_text_reserved(src, src + len - 1) || jump_label_text_reserved(src, src + len - 1) || static_call_text_reserved(src, src + len - 1)) return -EBUSY; diff --git a/arch/x86/kernel/module.c b/arch/x86/kernel/module.c index b5b4de4..33080ad 100644 --- a/arch/x86/kernel/module.c +++ b/arch/x86/kernel/module.c @@ -227,7 +227,7 @@ int module_finalize(const Elf_Ehdr *hdr, const Elf_Shdr *sechdrs, struct module *me) { - const Elf_Shdr *s, *alt =3D NULL, *locks =3D NULL, + const Elf_Shdr *s, *alt =3D NULL, *orc =3D NULL, *orc_ip =3D NULL, *retpolines =3D NULL, *returns =3D NULL, *ibt_endbr =3D NULL, *calls =3D NULL, *cfi =3D NULL; @@ -236,8 +236,6 @@ int module_finalize(const Elf_Ehdr *hdr, for (s =3D sechdrs; s < sechdrs + hdr->e_shnum; s++) { if (!strcmp(".altinstructions", secstrings + s->sh_name)) alt =3D s; - if (!strcmp(".smp_locks", secstrings + s->sh_name)) - locks =3D s; if (!strcmp(".orc_unwind", secstrings + s->sh_name)) orc =3D s; if (!strcmp(".orc_unwind_ip", secstrings + s->sh_name)) @@ -300,14 +298,6 @@ int module_finalize(const Elf_Ehdr *hdr, void *iseg =3D (void *)ibt_endbr->sh_addr; apply_seal_endbr(iseg, iseg + ibt_endbr->sh_size); } - if (locks) { - void *lseg =3D (void *)locks->sh_addr; - void *text =3D me->mem[MOD_TEXT].base; - void *text_end =3D text + me->mem[MOD_TEXT].size; - alternatives_smp_module_add(me, me->name, - lseg, lseg + locks->sh_size, - text, text_end); - } =20 if (orc && orc_ip) unwind_module_init(me, (void *)orc_ip->sh_addr, orc_ip->sh_size, @@ -318,6 +308,5 @@ int module_finalize(const Elf_Ehdr *hdr, =20 void module_arch_cleanup(struct module *mod) { - alternatives_smp_module_del(mod); its_free_mod(mod); } diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c index cb999fe..ba01a9e 100644 --- a/arch/x86/kernel/smpboot.c +++ b/arch/x86/kernel/smpboot.c @@ -991,9 +991,6 @@ int common_cpu_up(unsigned int cpu, struct task_struct = *idle) { int ret; =20 - /* Just in case we booted with a single CPU. */ - alternatives_enable_smp(); - per_cpu(current_task, cpu) =3D idle; cpu_init_stack_canary(cpu, idle); =20 diff --git a/arch/x86/kernel/vmlinux.lds.S b/arch/x86/kernel/vmlinux.lds.S index 74e336d..fb31099 100644 --- a/arch/x86/kernel/vmlinux.lds.S +++ b/arch/x86/kernel/vmlinux.lds.S @@ -346,18 +346,6 @@ SECTIONS __init_end =3D .; } =20 - /* - * smp_locks might be freed after init - * start/end must be page aligned - */ - . =3D ALIGN(PAGE_SIZE); - .smp_locks : AT(ADDR(.smp_locks) - LOAD_OFFSET) { - __smp_locks =3D .; - *(.smp_locks) - . =3D ALIGN(PAGE_SIZE); - __smp_locks_end =3D .; - } - #ifdef CONFIG_X86_64 .data_nosave : AT(ADDR(.data_nosave) - LOAD_OFFSET) { NOSAVE_DATA diff --git a/arch/x86/tools/relocs.c b/arch/x86/tools/relocs.c index e5a2b9a..5ea9bc7 100644 --- a/arch/x86/tools/relocs.c +++ b/arch/x86/tools/relocs.c @@ -73,7 +73,7 @@ static const char * const sym_regex_kernel[S_NSYMTYPES] = =3D { "^(__init_(begin|end)|" "__x86_cpu_dev_(start|end)|" "__alt_instructions(_end)?|" - "(__iommu_table|__apicdrivers|__smp_locks)(_end)?|" + "(__iommu_table|__apicdrivers)(_end)?|" "__(start|end)_pci_.*|" #if CONFIG_FW_LOADER "__(start|end)_builtin_fw|" diff --git a/tools/arch/x86/include/asm/cpufeatures.h b/tools/arch/x86/incl= ude/asm/cpufeatures.h index 86d17b1..8860778 100644 --- a/tools/arch/x86/include/asm/cpufeatures.h +++ b/tools/arch/x86/include/asm/cpufeatures.h @@ -78,7 +78,7 @@ #define X86_FEATURE_ZEN6 ( 3*32+ 6) /* CPU based on Zen6 microarchitectur= e */ /* Free ( 3*32+ 7) */ #define X86_FEATURE_CONSTANT_TSC ( 3*32+ 8) /* "constant_tsc" TSC ticks at= a constant rate */ -#define X86_FEATURE_UP ( 3*32+ 9) /* "up" SMP kernel running on UP */ +/* free: was #define X86_FEATURE_UP ( 3*32+ 9) * "up" SMP kernel running o= n UP */ #define X86_FEATURE_ART ( 3*32+10) /* "art" Always running timer (ART) */ #define X86_FEATURE_ARCH_PERFMON ( 3*32+11) /* "arch_perfmon" Intel Archit= ectural PerfMon */ #define X86_FEATURE_PEBS ( 3*32+12) /* "pebs" Precise-Event Based Samplin= g */ diff --git a/tools/objtool/check.c b/tools/objtool/check.c index 10b18cf..5f714e8 100644 --- a/tools/objtool/check.c +++ b/tools/objtool/check.c @@ -4644,7 +4644,6 @@ static int validate_ibt(struct objtool_file *file) !strcmp(sec->name, ".kcfi_traps") || !strcmp(sec->name, ".orc_unwind_ip") || !strcmp(sec->name, ".retpoline_sites") || - !strcmp(sec->name, ".smp_locks") || !strcmp(sec->name, ".static_call_sites") || !strcmp(sec->name, "_error_injection_whitelist") || !strcmp(sec->name, "_kprobe_blacklist") || diff --git a/tools/objtool/klp-diff.c b/tools/objtool/klp-diff.c index f8787d7..07b7ef3 100644 --- a/tools/objtool/klp-diff.c +++ b/tools/objtool/klp-diff.c @@ -297,7 +297,6 @@ static bool is_special_section(struct section *sec) static const char * const specials[] =3D { ".altinstructions", ".kcfi_traps", - ".smp_locks", "__bug_table", "__ex_table", "__jump_table",