mirror of
https://github.com/xen-project/xen.git
synced 2026-10-30 03:00:05 +01:00
xen/arm32: entry: Consolidate DEFINE_TRAP_ENTRY_* macros
The only difference between all the DEFINE_TRAP_ENTRY_* macros are the
interrupts (Asynchronous Abort, IRQ, FIQ) unmasked.
Rather than duplicating the code, introduce __DEFINE_TRAP_ENTRY macro
that will take the list of interrupts to unmask.
This is part of XSA-254.
Signed-off-by: Julien Grall <julien.grall@linaro.org>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
(cherry picked from commit 3bd8fd751e)
This commit is contained in:
1 parent
6f6786ef0d
commit
6082e3ba89
1 file changed
+11
-11
+11
-11
@@ -102,26 +102,26 @@ abort_guest_exit_end:
|
||||
|
||||
mov pc, lr
|
||||
|
||||
#define DEFINE_TRAP_ENTRY(trap) \
|
||||
/*
|
||||
* Macro to define trap entry. The iflags corresponds to the list of
|
||||
* interrupts (Asynchronous Abort, IRQ, FIQ) to unmask.
|
||||
*/
|
||||
#define __DEFINE_TRAP_ENTRY(trap, iflags) \
|
||||
ALIGN; \
|
||||
trap_##trap: \
|
||||
SAVE_ALL; \
|
||||
cpsie i; /* local_irq_enable */ \
|
||||
cpsie iflags; \
|
||||
adr lr, return_from_trap; \
|
||||
mov r0, sp; \
|
||||
mov r11, sp; \
|
||||
bic sp, #7; /* Align the stack pointer (noop on guest trap) */ \
|
||||
b do_trap_##trap
|
||||
|
||||
#define DEFINE_TRAP_ENTRY_NOIRQ(trap) \
|
||||
ALIGN; \
|
||||
trap_##trap: \
|
||||
SAVE_ALL; \
|
||||
adr lr, return_from_trap; \
|
||||
mov r0, sp; \
|
||||
mov r11, sp; \
|
||||
bic sp, #7; /* Align the stack pointer (noop on guest trap) */ \
|
||||
b do_trap_##trap
|
||||
/* Trap handler which unmask IRQ/Abort, keep FIQ masked */
|
||||
#define DEFINE_TRAP_ENTRY(trap) __DEFINE_TRAP_ENTRY(trap, ai)
|
||||
|
||||
/* Trap handler which unmask Abort, keep IRQ/FIQ masked */
|
||||
#define DEFINE_TRAP_ENTRY_NOIRQ(trap) __DEFINE_TRAP_ENTRY(trap, a)
|
||||
|
||||
.align 5
|
||||
GLOBAL(hyp_traps_vector)
|
||||
|
||||