Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

x86/percpu/64: Remove INIT_PER_CPU macros

Now that the load and link addresses of percpu variables are the same,
these macros are no longer necessary.

Signed-off-by: Brian Gerst <brgerst@gmail.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
Reviewed-by: Uros Bizjak <ubizjak@gmail.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Link: https://lore.kernel.org/r/20250123190747.745588-12-brgerst@gmail.com

authored by

Brian Gerst and committed by
Ingo Molnar
38a4968b a8327be7

+1 -33
-1
arch/x86/include/asm/desc.h
··· 46 46 } __attribute__((aligned(PAGE_SIZE))); 47 47 48 48 DECLARE_PER_CPU_PAGE_ALIGNED(struct gdt_page, gdt_page); 49 - DECLARE_INIT_PER_CPU(gdt_page); 50 49 51 50 /* Provide the original GDT */ 52 51 static inline struct desc_struct *get_cpu_gdt_rw(unsigned int cpu)
-22
arch/x86/include/asm/percpu.h
··· 20 20 21 21 #define PER_CPU_VAR(var) __percpu(var)__percpu_rel 22 22 23 - #ifdef CONFIG_X86_64_SMP 24 - # define INIT_PER_CPU_VAR(var) init_per_cpu__##var 25 - #else 26 - # define INIT_PER_CPU_VAR(var) var 27 - #endif 28 - 29 23 #else /* !__ASSEMBLY__: */ 30 24 31 25 #include <linux/build_bug.h> ··· 90 96 #define __my_cpu_var(var) (*__my_cpu_ptr(&(var))) 91 97 #define __percpu_arg(x) __percpu_prefix "%" #x 92 98 #define __force_percpu_arg(x) __force_percpu_prefix "%" #x 93 - 94 - /* 95 - * Initialized pointers to per-CPU variables needed for the boot 96 - * processor need to use these macros to get the proper address 97 - * offset from __per_cpu_load on SMP. 98 - * 99 - * There also must be an entry in vmlinux_64.lds.S 100 - */ 101 - #define DECLARE_INIT_PER_CPU(var) \ 102 - extern typeof(var) init_per_cpu_var(var) 103 - 104 - #ifdef CONFIG_X86_64_SMP 105 - # define init_per_cpu_var(var) init_per_cpu__##var 106 - #else 107 - # define init_per_cpu_var(var) var 108 - #endif 109 99 110 100 /* 111 101 * For arch-specific code, we can use direct single-insn ops (they
+1 -1
arch/x86/kernel/head64.c
··· 567 567 */ 568 568 void __head startup_64_setup_gdt_idt(void) 569 569 { 570 - struct desc_struct *gdt = (void *)(__force unsigned long)init_per_cpu_var(gdt_page.gdt); 570 + struct desc_struct *gdt = (void *)(__force unsigned long)gdt_page.gdt; 571 571 void *handler = NULL; 572 572 573 573 struct desc_ptr startup_gdt_descr = {
-1
arch/x86/kernel/irq_64.c
··· 27 27 #include <asm/apic.h> 28 28 29 29 DEFINE_PER_CPU_PAGE_ALIGNED(struct irq_stack, irq_stack_backing_store) __visible; 30 - DECLARE_INIT_PER_CPU(irq_stack_backing_store); 31 30 32 31 #ifdef CONFIG_VMAP_STACK 33 32 /*
-7
arch/x86/kernel/vmlinux.lds.S
··· 471 471 PROVIDE(__ref_stack_chk_guard = __stack_chk_guard); 472 472 473 473 #ifdef CONFIG_X86_64 474 - /* 475 - * Per-cpu symbols which need to be offset from __per_cpu_load 476 - * for the boot processor. 477 - */ 478 - #define INIT_PER_CPU(x) init_per_cpu__##x = ABSOLUTE(x) 479 - INIT_PER_CPU(gdt_page); 480 - INIT_PER_CPU(irq_stack_backing_store); 481 474 482 475 #ifdef CONFIG_MITIGATION_UNRET_ENTRY 483 476 . = ASSERT((retbleed_return_thunk & 0x3f) == 0, "retbleed_return_thunk not cacheline-aligned");
-1
arch/x86/tools/relocs.c
··· 90 90 "__initramfs_start|" 91 91 "(jiffies|jiffies_64)|" 92 92 #if ELF_BITS == 64 93 - "init_per_cpu__.*|" 94 93 "__end_rodata_hpage_align|" 95 94 #endif 96 95 "_end)$"