]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - arch/arm64/kernel/entry.S
arm64: reduce stack use in irq_handler
[karo-tx-linux.git] / arch / arm64 / kernel / entry.S
index 8f7e737949fec901c59b0dc7d3d22562026a8ae0..0667fb7d8bb1f3d8d5eaa0ec8778b9f8fe4bb5c3 100644 (file)
@@ -93,6 +93,8 @@
        and     tsk, tsk, #~(THREAD_SIZE - 1)   // Ensure MDSCR_EL1.SS is clear,
        ldr     x19, [tsk, #TI_FLAGS]           // since we can unmask debug
        disable_step_tsk x19, x20               // exceptions when scheduling.
+
+       mov     x29, xzr                        // fp pointed to user-space
        .else
        add     x21, sp, #S_FRAME_SIZE
        .endif
@@ -176,12 +178,10 @@ alternative_endif
        mrs     \rd, sp_el0
        .endm
 
-       .macro  irq_stack_entry, dummy_lr
+       .macro  irq_stack_entry
        mov     x19, sp                 // preserve the original sp
 
-       adr_l   x25, irq_stack
-       mrs     x26, tpidr_el1
-       add     x25, x25, x26
+       this_cpu_ptr irq_stack, x25, x26
 
        /*
         * Check the lowest address on irq_stack for the irq_count value,
@@ -196,10 +196,12 @@ alternative_endif
        add     x26, x25, x26
        mov     sp, x26
 
-       /* Add a dummy stack frame */
-       stp     x29, \dummy_lr, [sp, #-16]!           // dummy stack frame
+       /*
+        * Add a dummy stack frame, this non-standard format is fixed up
+        * by unwind_frame()
+        */
+       stp     x29, x19, [sp, #-16]!
        mov     x29, sp
-       stp     xzr, x19, [sp, #-16]!
 
 9998:
        .endm
@@ -229,7 +231,7 @@ tsk .req    x28             // current thread_info
        .macro  irq_handler
        ldr_l   x1, handle_arch_irq
        mov     x0, sp
-       irq_stack_entry x22
+       irq_stack_entry
        blr     x1
        irq_stack_exit
        .endm