From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qt1-f173.google.com (mail-qt1-f173.google.com [209.85.160.173]) (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 09FFA2139B6 for ; Thu, 23 Jan 2025 19:08:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.173 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737659295; cv=none; b=MIUiTEN3CREbihAEcdN5Fcvag62g8x2JpZaz80PbvUgPzPaiNLeox7lDA9P0oqHCjB459CgXRy8DcS6V+SmoySNj1+estkut26/q97fv8TyVtunIY5lMZgaBT7yaP5nPc77O23/apkAoivUl4Gjy9cPOnBDrvPDLZcG+RLgt3bY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737659295; c=relaxed/simple; bh=GqqiKN9ry7OW7W1QQdszws3Y0i49SwJdC1nA3tZdveE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=NsdfuRgtwdy4TTNYZ1pYQJ3S0YxjKS6arTc1lv+HlcKBCnmFDWilIVgblA4Wz1OSOkG184WXpuXR1silVXc9qx98VA1KX0jzkh3ZyEqud8WcXSa2hMmN3OY0+nJov1wAL7Xuxg3Bc54Ed6Rlusjq7oM5V0UUjf+RTNG+s94zRJY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=SEVFF8PX; arc=none smtp.client-ip=209.85.160.173 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="SEVFF8PX" Received: by mail-qt1-f173.google.com with SMTP id d75a77b69052e-46b1d40abbdso13191151cf.2 for ; Thu, 23 Jan 2025 11:08:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737659292; x=1738264092; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=fzRFJC57j6C4PHDj6UKs7NhJ6sOmiSf/M/lgYJifJ1E=; b=SEVFF8PX1HbE4TT8IZF2ulTZbwS8AuFDXBcTgq/+1lvtEk9l/nugHeqt4sy2jIai9Y zYq6ySyr9xcWyEfcmdwv+Mi4Nv1NArxLTD4UQFwvC7PjMTwTdw19MtTFn7cLeqnKrRZS tHy55U160Dwk1V233IRS2Mw7EsBTG9cEYsSq6g7sOi3koZIyVkFaVmytSyxMC/ym5HTj PkXygSQQFkmHcUmiyqJBen1aauk5n0I1UFgY5M91QEWUUer61yeLHczZX1rcovJcMONK UgQx9K78Et+/kReBO99WGf88Q0ciNwCYFkJP8j8IEUETw7KuU8oJgTfoujBo8keXrRtz 5Dwg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737659292; x=1738264092; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=fzRFJC57j6C4PHDj6UKs7NhJ6sOmiSf/M/lgYJifJ1E=; b=lw40BShW7BpvTzHlrxz0P+9Ch0S6ZVW1YfSbPDJ5vrBOt38OCdRuTZxQ0n11GIkg/3 Y748v8aQuSLSwROfWN5O68o6p8ReFEG+0jtstG1FrBv7bIyYB1LvwytINLBegWbuGw/y I8bw6FdKMbjp5LfTD3dP/+yTcG/RjboVwmeMEGY5Jg0cpA4nLU514oFUnpOVCeQezbvN VMS/qVLES1s2RWhjzhaANspNVnNX0fUnoC/2s/ONMaxzXkCmR7IXegslxmZTMr14Dqav pLfKrCzjLuEVyX33PJpsCFTGT4dRvHaXnXhs8PbYhembvMrrNhN/HQ6EWeF3wCAUBcRd G/iw== X-Gm-Message-State: AOJu0YytxliflQkXWISoaiapUBAdh9I6wpSlr20uXv0n9C981rMq1Sr7 ZWGuThrRmaO0tSdEvEUirW1pEvOGJI97cVJuFGuXFNr+yeJadAirBI6O X-Gm-Gg: ASbGncsAzHi8UEUv9r0Ui/GmSlDJpicsOaajC+6GJNKzQa/on5919UlD8tcvHl53pHl VL7qZ/kugtPhkeCTmAhE8Ln462Rj5LKe1HoOF/9LC359KLbtN7yXkBcZxCBgeyQk7MrU3bwScTc EhHTQFKVQraa9XGR2Cep4JcqPHLcEsm+cP3WxYheFQ8Rb2bw/NdmKg0M4upFfGeKRbu9epVa1uH I6EsmmzwFzXuCM60owRl/6MSGGNcPBCMhvDD4tKdpGaVYEigGZ1XlWnTtyLFA== X-Google-Smtp-Source: AGHT+IHhQIeKs2EeJIpa+LqUvlfpn07hdpic1Xxjp8WnpLLIPPJbx2OVYjD1pFws8I6E10itT5nm+w== X-Received: by 2002:a05:622a:1a83:b0:460:aa51:8411 with SMTP id d75a77b69052e-46e12a9a0dbmr349290911cf.24.1737659292058; Thu, 23 Jan 2025 11:08:12 -0800 (PST) Received: from citadel.lan ([2600:6c4a:4d3f:6d5c::1019]) by smtp.gmail.com with ESMTPSA id d75a77b69052e-46e66b880b6sm1768021cf.69.2025.01.23.11.08.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Jan 2025 11:08:11 -0800 (PST) From: Brian Gerst To: linux-kernel@vger.kernel.org, x86@kernel.org Cc: Ingo Molnar , "H . Peter Anvin" , Thomas Gleixner , Borislav Petkov , Ard Biesheuvel , Uros Bizjak , Brian Gerst Subject: [PATCH v6 11/15] x86/percpu/64: Remove INIT_PER_CPU macros Date: Thu, 23 Jan 2025 14:07:43 -0500 Message-ID: <20250123190747.745588-12-brgerst@gmail.com> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250123190747.745588-1-brgerst@gmail.com> References: <20250123190747.745588-1-brgerst@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Now that the load and link addresses of percpu variables are the same, these macros are no longer necessary. Signed-off-by: Brian Gerst Reviewed-by: Ard Biesheuvel Reviewed-by: Uros Bizjak --- arch/x86/include/asm/desc.h | 1 - arch/x86/include/asm/percpu.h | 22 ---------------------- arch/x86/kernel/head64.c | 2 +- arch/x86/kernel/irq_64.c | 1 - arch/x86/kernel/vmlinux.lds.S | 7 ------- arch/x86/tools/relocs.c | 1 - 6 files changed, 1 insertion(+), 33 deletions(-) diff --git a/arch/x86/include/asm/desc.h b/arch/x86/include/asm/desc.h index 62dc9f59ea76..ec95fe44fa3a 100644 --- a/arch/x86/include/asm/desc.h +++ b/arch/x86/include/asm/desc.h @@ -46,7 +46,6 @@ struct gdt_page { } __attribute__((aligned(PAGE_SIZE))); DECLARE_PER_CPU_PAGE_ALIGNED(struct gdt_page, gdt_page); -DECLARE_INIT_PER_CPU(gdt_page); /* Provide the original GDT */ static inline struct desc_struct *get_cpu_gdt_rw(unsigned int cpu) diff --git a/arch/x86/include/asm/percpu.h b/arch/x86/include/asm/percpu.h index e525cd85f999..1a76eb87c5d8 100644 --- a/arch/x86/include/asm/percpu.h +++ b/arch/x86/include/asm/percpu.h @@ -20,12 +20,6 @@ #define PER_CPU_VAR(var) __percpu(var)__percpu_rel -#ifdef CONFIG_X86_64_SMP -# define INIT_PER_CPU_VAR(var) init_per_cpu__##var -#else -# define INIT_PER_CPU_VAR(var) var -#endif - #else /* !__ASSEMBLY__: */ #include @@ -97,22 +91,6 @@ #define __percpu_arg(x) __percpu_prefix "%" #x #define __force_percpu_arg(x) __force_percpu_prefix "%" #x -/* - * Initialized pointers to per-CPU variables needed for the boot - * processor need to use these macros to get the proper address - * offset from __per_cpu_load on SMP. - * - * There also must be an entry in vmlinux_64.lds.S - */ -#define DECLARE_INIT_PER_CPU(var) \ - extern typeof(var) init_per_cpu_var(var) - -#ifdef CONFIG_X86_64_SMP -# define init_per_cpu_var(var) init_per_cpu__##var -#else -# define init_per_cpu_var(var) var -#endif - /* * For arch-specific code, we can use direct single-insn ops (they * don't give an lvalue though). diff --git a/arch/x86/kernel/head64.c b/arch/x86/kernel/head64.c index 22c9ba305ac1..05f8b8acf784 100644 --- a/arch/x86/kernel/head64.c +++ b/arch/x86/kernel/head64.c @@ -567,7 +567,7 @@ void early_setup_idt(void) */ void __head startup_64_setup_gdt_idt(void) { - struct desc_struct *gdt = (void *)(__force unsigned long)init_per_cpu_var(gdt_page.gdt); + struct desc_struct *gdt = (void *)(__force unsigned long)gdt_page.gdt; void *handler = NULL; struct desc_ptr startup_gdt_descr = { diff --git a/arch/x86/kernel/irq_64.c b/arch/x86/kernel/irq_64.c index ade0043ce56e..56bdeecd8ee0 100644 --- a/arch/x86/kernel/irq_64.c +++ b/arch/x86/kernel/irq_64.c @@ -27,7 +27,6 @@ #include DEFINE_PER_CPU_PAGE_ALIGNED(struct irq_stack, irq_stack_backing_store) __visible; -DECLARE_INIT_PER_CPU(irq_stack_backing_store); #ifdef CONFIG_VMAP_STACK /* diff --git a/arch/x86/kernel/vmlinux.lds.S b/arch/x86/kernel/vmlinux.lds.S index 93c2fa8a7522..1769a7126224 100644 --- a/arch/x86/kernel/vmlinux.lds.S +++ b/arch/x86/kernel/vmlinux.lds.S @@ -471,13 +471,6 @@ SECTIONS PROVIDE(__ref_stack_chk_guard = __stack_chk_guard); #ifdef CONFIG_X86_64 -/* - * Per-cpu symbols which need to be offset from __per_cpu_load - * for the boot processor. - */ -#define INIT_PER_CPU(x) init_per_cpu__##x = ABSOLUTE(x) -INIT_PER_CPU(gdt_page); -INIT_PER_CPU(irq_stack_backing_store); #ifdef CONFIG_MITIGATION_UNRET_ENTRY . = ASSERT((retbleed_return_thunk & 0x3f) == 0, "retbleed_return_thunk not cacheline-aligned"); diff --git a/arch/x86/tools/relocs.c b/arch/x86/tools/relocs.c index 9e8d5a62ff50..199ab867da7f 100644 --- a/arch/x86/tools/relocs.c +++ b/arch/x86/tools/relocs.c @@ -90,7 +90,6 @@ static const char * const sym_regex_kernel[S_NSYMTYPES] = { "__initramfs_start|" "(jiffies|jiffies_64)|" #if ELF_BITS == 64 - "init_per_cpu__.*|" "__end_rodata_hpage_align|" #endif "_end)$" -- 2.47.1