[PATCH 09/17] arm64: entry: organise handler stubs consistently

Mark Rutland mark.rutland at arm.com
Wed Jan 8 10:56:26 PST 2020


The exception handler stubs are laid out in a random order, violating
the EL1/EL0 split described by the comments. In an attempt to get more
optimal cache usage for commonly-invoked handlers, some handlers are
given special alignment while others are not.

To make things less surprising, This patch reorganises the hander stubs
so they're in a consistent order, with the EL1 sync/irq/error stubs
first, followed by the EL0 sync/irq/error stubs, then the EL0 compat
sync/irq/error stubs. All the stubs are given the same alignment.

There should be no functional change as a result of this patch.

Signed-off-by: Mark Rutland <mark.rutland at arm.com>
Cc: Catalin Marinas <catalin.marinas at arm.com>
Cc: James Morse <james.morse at arm.com>
Cc: Will Deacon <will at kernel.org>
---
 arch/arm64/kernel/entry.S | 48 +++++++++++++++++++++++++----------------------
 1 file changed, 26 insertions(+), 22 deletions(-)

diff --git a/arch/arm64/kernel/entry.S b/arch/arm64/kernel/entry.S
index 2c3de577f720..35a8c56b0582 100644
--- a/arch/arm64/kernel/entry.S
+++ b/arch/arm64/kernel/entry.S
@@ -530,6 +530,14 @@ el1_irq:
 	kernel_exit 1
 ENDPROC(el1_irq)
 
+	.align	6
+el1_error:
+	kernel_entry 1
+	mov	x0, sp
+	bl	el1_error_handler
+	kernel_exit 1
+ENDPROC(el1_error)
+
 /*
  * EL0 mode handlers.
  */
@@ -541,6 +549,23 @@ el0_sync:
 	b	ret_to_user
 ENDPROC(el0_sync)
 
+	.align	6
+el0_irq:
+	kernel_entry 0
+	mov	x0, sp
+	bl	el0_irq_handler
+	b	ret_to_user
+ENDPROC(el0_irq)
+
+	.align	6
+el0_error:
+	kernel_entry 0
+	mov	x0, sp
+	bl	el0_error_handler
+	b	ret_to_user
+ENDPROC(el0_error)
+
+
 #ifdef CONFIG_COMPAT
 	.align	6
 el0_sync_compat:
@@ -558,6 +583,7 @@ el0_irq_compat:
 	b	ret_to_user
 ENDPROC(el0_irq_compat)
 
+	.align	6
 el0_error_compat:
 	kernel_entry 0, 32
 	mov	x0, sp
@@ -566,28 +592,6 @@ el0_error_compat:
 ENDPROC(el0_error_compat)
 #endif
 
-	.align	6
-el0_irq:
-	kernel_entry 0
-	mov	x0, sp
-	bl	el0_irq_handler
-	b	ret_to_user
-ENDPROC(el0_irq)
-
-el1_error:
-	kernel_entry 1
-	mov	x0, sp
-	bl	el1_error_handler
-	kernel_exit 1
-ENDPROC(el1_error)
-
-el0_error:
-	kernel_entry 0
-	mov	x0, sp
-	bl	el0_error_handler
-	b	ret_to_user
-ENDPROC(el0_error)
-
 /*
  * Ok, we need to do extra processing, enter the slow path.
  */
-- 
2.11.0




More information about the linux-arm-kernel mailing list