linux/arch/alpha/mm
Matt Turner b39c748d9d alpha: read $gp and $sp explicitly for clang
clang honors a local `register unsigned long x __asm__("$N")` variable
only where it appears as an inline-asm operand; merely reading it does
not produce the contents of that register.  So trap_init() passed an
undefined global pointer to PAL_wrkgp, and load_PCB() stored an undefined
stack pointer into the PCB that swpctx then loaded.  Either one wedges an
early boot.

Read the registers explicitly instead: an inline mov for $gp in
trap_init(), and the file-scope current_stack_pointer for $sp in
load_PCB().  A file-scope register-asm variable is the form clang does
support.

Signed-off-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Maciej W. Rozycki <macro@orcam.me.uk>
Reviewed-by: Magnus Lindholm <linmag7@gmail.com>
Tested-by: Magnus Lindholm <linmag7@gmail.com>
Link: https://lore.kernel.org/r/20260803-alpha-clang-v1-2-1c4ba5ba7a64@gmail.com
Signed-off-by: Magnus Lindholm <linmag7@gmail.com>
2026-08-16 16:00:00 +02:00
..
fault.c alpha: align stack for page fault and user unaligned trap handlers 2025-02-14 14:06:04 -05:00
init.c alpha: read $gp and $sp explicitly for clang 2026-08-16 16:00:00 +02:00
Makefile alpha: fix user-space corruption during memory compaction 2026-01-24 10:35:52 +01:00
tlbflush.c alpha: fix user-space corruption during memory compaction 2026-01-24 10:35:52 +01:00