diff options
author | Kees Cook <keescook@chromium.org> | 2022-02-24 09:04:32 +0300 |
---|---|---|
committer | Thomas Bogendoerfer <tsbogend@alpha.franken.de> | 2022-03-01 18:57:55 +0300 |
commit | 200ed341b8646ea893d5466974d6e107c46237ba (patch) | |
tree | 2d383f792532c602e251a3316a141c9e3d4c563d /arch/mips/lib | |
parent | 455481fc9a807798eca05f6fb0918ab88109d845 (diff) | |
download | linux-200ed341b8646ea893d5466974d6e107c46237ba.tar.xz |
mips: Implement "current_stack_pointer"
To follow the existing per-arch conventions replace open-coded uses
of asm "sp" as "current_stack_pointer". This will let it be used in
non-arch places (like HARDENED_USERCOPY).
Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Cc: Marc Zyngier <maz@kernel.org>
Cc: Guenter Roeck <linux@roeck-us.net>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Yanteng Si <siyanteng01@gmail.com>
Cc: linux-mips@vger.kernel.org
Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Diffstat (limited to 'arch/mips/lib')
-rw-r--r-- | arch/mips/lib/uncached.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/arch/mips/lib/uncached.c b/arch/mips/lib/uncached.c index f80a67c092b6..f8d4ca046c3e 100644 --- a/arch/mips/lib/uncached.c +++ b/arch/mips/lib/uncached.c @@ -40,9 +40,7 @@ unsigned long run_uncached(void *func) register long ret __asm__("$2"); long lfunc = (long)func, ufunc; long usp; - long sp; - - __asm__("move %0, $sp" : "=r" (sp)); + long sp = current_stack_pointer; if (sp >= (long)CKSEG0 && sp < (long)CKSEG2) usp = CKSEG1ADDR(sp); |