[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20251015225604.3860409-1-samuel.holland@sifive.com>
Date: Wed, 15 Oct 2025 15:56:00 -0700
From: Samuel Holland <samuel.holland@...ive.com>
To: Palmer Dabbelt <palmer@...belt.com>,
Paul Walmsley <pjw@...nel.org>
Cc: linux-riscv@...ts.infradead.org,
Samuel Holland <samuel.holland@...ive.com>,
Albert Ou <aou@...s.berkeley.edu>,
Alexandre Ghiti <alex@...ti.fr>,
Charlie Jenkins <charlie@...osinc.com>,
Radim Krčmář <rkrcmar@...tanamicro.com>,
Thomas Huth <thuth@...hat.com>,
linux-kernel@...r.kernel.org
Subject: [PATCH] riscv: Remove the PER_CPU_OFFSET_SHIFT macro
__per_cpu_offset is an array of unsigned long, so we can reuse the
existing RISCV_LGPTR macro.
Signed-off-by: Samuel Holland <samuel.holland@...ive.com>
---
arch/riscv/include/asm/asm.h | 8 +-------
1 file changed, 1 insertion(+), 7 deletions(-)
diff --git a/arch/riscv/include/asm/asm.h b/arch/riscv/include/asm/asm.h
index 8bd2a11382a3..ac28066bb564 100644
--- a/arch/riscv/include/asm/asm.h
+++ b/arch/riscv/include/asm/asm.h
@@ -84,15 +84,9 @@
.endm
#ifdef CONFIG_SMP
-#ifdef CONFIG_32BIT
-#define PER_CPU_OFFSET_SHIFT 2
-#else
-#define PER_CPU_OFFSET_SHIFT 3
-#endif
-
.macro asm_per_cpu dst sym tmp
lw \tmp, TASK_TI_CPU_NUM(tp)
- slli \tmp, \tmp, PER_CPU_OFFSET_SHIFT
+ slli \tmp, \tmp, RISCV_LGPTR
la \dst, __per_cpu_offset
add \dst, \dst, \tmp
REG_L \tmp, 0(\dst)
--
2.47.2
base-commit: 5a6f65d1502551f84c158789e5d89299c78907c7
branch: up/percpu-shift
Powered by blists - more mailing lists