]> exis.tech > repos - linux.git/blobdiff - arch/riscv/kernel/entry.S
Merge tag 'hwmon-for-v7.2-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/groec...
[linux.git] / arch / riscv / kernel / entry.S
index c6988983cdf7d70315b7a900f11b9765d3e85a02..d799c4e56f8049a0c695d913f8bf021a64440bad 100644 (file)
@@ -137,7 +137,7 @@ SYM_CODE_START(handle_exception)
 .Lrestore_kernel_tpsp:
        csrr tp, CSR_SCRATCH
 
-#ifdef CONFIG_64BIT
+#if defined(CONFIG_64BIT) && defined(CONFIG_MMU)
        /*
         * The RISC-V kernel does not flush TLBs on all CPUS after each new
         * vmalloc mapping or kfence_unprotect(), which may result in
@@ -386,8 +386,8 @@ SYM_CODE_END(ret_from_fork_user_asm)
 SYM_FUNC_START(call_on_irq_stack)
        /* Create a frame record to save ra and s0 (fp) */
        addi    sp, sp, -STACKFRAME_SIZE_ON_STACK
-       REG_S   ra, STACKFRAME_RA(sp)
-       REG_S   s0, STACKFRAME_FP(sp)
+       REG_S   ra, (STACKFRAME_SIZE_ON_STACK + STACKFRAME_RA)(sp)
+       REG_S   s0, (STACKFRAME_SIZE_ON_STACK + STACKFRAME_FP)(sp)
        addi    s0, sp, STACKFRAME_SIZE_ON_STACK
 
        /* Switch to the per-CPU shadow call stack */
@@ -405,8 +405,8 @@ SYM_FUNC_START(call_on_irq_stack)
 
        /* Switch back to the thread stack and restore ra and s0 */
        addi    sp, s0, -STACKFRAME_SIZE_ON_STACK
-       REG_L   ra, STACKFRAME_RA(sp)
-       REG_L   s0, STACKFRAME_FP(sp)
+       REG_L   ra, (STACKFRAME_SIZE_ON_STACK + STACKFRAME_RA)(sp)
+       REG_L   s0, (STACKFRAME_SIZE_ON_STACK + STACKFRAME_FP)(sp)
        addi    sp, sp, STACKFRAME_SIZE_ON_STACK
 
        ret