aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/arch/riscv/kernel/suspend_entry.S
diff options
context:
space:
mode:
authorSami Tolvanen <samitolvanen@google.com>2023-09-27 22:48:01 +0000
committerPalmer Dabbelt <palmer@rivosinc.com>2023-10-27 14:43:07 -0700
commite609b4f4252a2ad2454736078693571b9fbff019 (patch)
tree3d7a377db07e312efe5275e80d9119b84a1b7b99 /arch/riscv/kernel/suspend_entry.S
parentriscv: Deduplicate IRQ stack switching (diff)
downloadwireguard-linux-e609b4f4252a2ad2454736078693571b9fbff019.tar.xz
wireguard-linux-e609b4f4252a2ad2454736078693571b9fbff019.zip
riscv: Move global pointer loading to a macro
In Clang 17, -fsanitize=shadow-call-stack uses the newly declared platform register gp for storing shadow call stack pointers. As this is obviously incompatible with gp relaxation, in preparation for CONFIG_SHADOW_CALL_STACK support, move global pointer loading to a single macro, which we can cleanly disable when SCS is used instead. Link: https://reviews.llvm.org/rGaa1d2693c256 Link: https://github.com/riscv-non-isa/riscv-elf-psabi-doc/commit/a484e843e6eeb51f0cb7b8819e50da6d2444d769 Signed-off-by: Sami Tolvanen <samitolvanen@google.com> Tested-by: Nathan Chancellor <nathan@kernel.org> Link: https://lore.kernel.org/r/20230927224757.1154247-11-samitolvanen@google.com Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
Diffstat (limited to 'arch/riscv/kernel/suspend_entry.S')
-rw-r--r--arch/riscv/kernel/suspend_entry.S5
1 files changed, 1 insertions, 4 deletions
diff --git a/arch/riscv/kernel/suspend_entry.S b/arch/riscv/kernel/suspend_entry.S
index f7960c7c5f9e..d5cf8b575777 100644
--- a/arch/riscv/kernel/suspend_entry.S
+++ b/arch/riscv/kernel/suspend_entry.S
@@ -61,10 +61,7 @@ END(__cpu_suspend_enter)
SYM_TYPED_FUNC_START(__cpu_resume_enter)
/* Load the global pointer */
- .option push
- .option norelax
- la gp, __global_pointer$
- .option pop
+ load_global_pointer
#ifdef CONFIG_MMU
/* Save A0 and A1 */