Skip to content

Commit f0c0d4b

Browse files
mrutland-armctmarinas
authored andcommitted
arm64: entry: unmask IRQ in el0_sp()
Currently, the EL0 SP alignment handler masks IRQs unnecessarily. It does so due to historic code sharing of the EL0 SP and PC alignment handlers, and branch predictor hardening applicable to the EL0 SP handler. We began masking IRQs in the EL0 SP alignment handler in commit: 5dfc6ed ("arm64: entry: Apply BP hardening for high-priority synchronous exception") ... as this shared code with the EL0 PC alignment handler, and branch predictor hardening made it necessary to disable IRQs for early parts of the EL0 PC alignment handler. It was not necessary to mask IRQs during EL0 SP alignment exceptions, but it was not considered harmful to do so. This masking was carried forward into C code in commit: 582f958 ("arm64: entry: convert el0_sync to C") ... where the SP/PC cases were split into separate handlers, and the masking duplicated. Subsequently the EL0 PC alignment handler was refactored to perform branch predictor hardening before unmasking IRQs, in commit: bfe2987 ("arm64: entry-common: don't touch daif before bp-hardening") ... but the redundant masking of IRQs was not removed from the EL0 SP alignment handler. Let's do so now, and make it interruptible as with most other synchronous exception handlers. Signed-off-by: Mark Rutland <[email protected]> Cc: Will Deacon <[email protected]> Signed-off-by: Catalin Marinas <[email protected]> Reviewed-by: James Morse <[email protected]>
1 parent b8f58ac commit f0c0d4b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/arm64/kernel/entry-common.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ NOKPROBE_SYMBOL(el0_pc);
175175
static void notrace el0_sp(struct pt_regs *regs, unsigned long esr)
176176
{
177177
user_exit_irqoff();
178-
local_daif_restore(DAIF_PROCCTX_NOIRQ);
178+
local_daif_restore(DAIF_PROCCTX);
179179
do_sp_pc_abort(regs->sp, esr, regs);
180180
}
181181
NOKPROBE_SYMBOL(el0_sp);

0 commit comments

Comments
 (0)