FROMLIST: arm64: entry: Explicitly pass exception level to kernel_ventry macro
authorWill Deacon <will.deacon@arm.com>
Tue, 14 Nov 2017 14:20:21 +0000 (14:20 +0000)
committerGreg Kroah-Hartman <gregkh@google.com>
Sat, 6 Jan 2018 10:14:01 +0000 (11:14 +0100)
We will need to treat exceptions from EL0 differently in kernel_ventry,
so rework the macro to take the exception level as an argument and
construct the branch target using that.

Reviewed-by: Mark Rutland <mark.rutland@arm.com>
Tested-by: Laura Abbott <labbott@redhat.com>
Tested-by: Shanker Donthineni <shankerd@codeaurora.org>
Signed-off-by: Will Deacon <will.deacon@arm.com>
(cherry picked from git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git
 commit 5b1f7fe41909cde40decad9f0e8ee585777a0538)

Change-Id: Iab10d2237e24c008d05856a4bd953504de6e10a8
[ghackmann@google.com: adjust context and kernel entry point names]
Signed-off-by: Greg Hackmann <ghackmann@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
arch/arm64/kernel/entry.S

index 08dc4b01d4da0411000e08eb4ba6bbdeb5f16013..7d178ffb1c1bffaf369798869fd4ac17dbd9069d 100644 (file)
 #define BAD_FIQ                2
 #define BAD_ERROR      3
 
-       .macro kernel_ventry    label
+       .macro kernel_ventry, el, label, regsize = 64
        .align 7
        sub     sp, sp, #S_FRAME_SIZE
-       b       \label
+       b       el\()\el\()_\label
        .endm
 
        .macro  kernel_entry, el, regsize = 64
@@ -351,31 +351,31 @@ tsk       .req    x28             // current thread_info
 
        .align  11
 ENTRY(vectors)
-       kernel_ventry   el1_sync_invalid                // Synchronous EL1t
-       kernel_ventry   el1_irq_invalid                 // IRQ EL1t
-       kernel_ventry   el1_fiq_invalid                 // FIQ EL1t
-       kernel_ventry   el1_error_invalid               // Error EL1t
+       kernel_ventry   1, sync_invalid                 // Synchronous EL1t
+       kernel_ventry   1, irq_invalid                  // IRQ EL1t
+       kernel_ventry   1, fiq_invalid                  // FIQ EL1t
+       kernel_ventry   1, error_invalid                // Error EL1t
 
-       kernel_ventry   el1_sync                        // Synchronous EL1h
-       kernel_ventry   el1_irq                         // IRQ EL1h
-       kernel_ventry   el1_fiq_invalid                 // FIQ EL1h
-       kernel_ventry   el1_error_invalid               // Error EL1h
+       kernel_ventry   1, sync                         // Synchronous EL1h
+       kernel_ventry   1, irq                          // IRQ EL1h
+       kernel_ventry   1, fiq_invalid                  // FIQ EL1h
+       kernel_ventry   1, error_invalid                // Error EL1h
 
-       kernel_ventry   el0_sync                        // Synchronous 64-bit EL0
-       kernel_ventry   el0_irq                         // IRQ 64-bit EL0
-       kernel_ventry   el0_fiq_invalid                 // FIQ 64-bit EL0
-       kernel_ventry   el0_error_invalid               // Error 64-bit EL0
+       kernel_ventry   0, sync                         // Synchronous 64-bit EL0
+       kernel_ventry   0, irq                          // IRQ 64-bit EL0
+       kernel_ventry   0, fiq_invalid                  // FIQ 64-bit EL0
+       kernel_ventry   0, error_invalid                // Error 64-bit EL0
 
 #ifdef CONFIG_COMPAT
-       kernel_ventry   el0_sync_compat                 // Synchronous 32-bit EL0
-       kernel_ventry   el0_irq_compat                  // IRQ 32-bit EL0
-       kernel_ventry   el0_fiq_invalid_compat          // FIQ 32-bit EL0
-       kernel_ventry   el0_error_invalid_compat        // Error 32-bit EL0
+       kernel_ventry   0, sync_compat, 32              // Synchronous 32-bit EL0
+       kernel_ventry   0, irq_compat, 32               // IRQ 32-bit EL0
+       kernel_ventry   0, fiq_invalid_compat, 32       // FIQ 32-bit EL0
+       kernel_ventry   0, error_invalid_compat, 32     // Error 32-bit EL0
 #else
-       kernel_ventry   el0_sync_invalid                // Synchronous 32-bit EL0
-       kernel_ventry   el0_irq_invalid                 // IRQ 32-bit EL0
-       kernel_ventry   el0_fiq_invalid                 // FIQ 32-bit EL0
-       kernel_ventry   el0_error_invalid               // Error 32-bit EL0
+       kernel_ventry   0, sync_invalid, 32             // Synchronous 32-bit EL0
+       kernel_ventry   0, irq_invalid, 32              // IRQ 32-bit EL0
+       kernel_ventry   0, fiq_invalid, 32              // FIQ 32-bit EL0
+       kernel_ventry   0, error_invalid, 32            // Error 32-bit EL0
 #endif
 END(vectors)