Skip to content

Commit

Permalink
arm64/syscall: (Re-)enable interrupts only if they were previously en…
Browse files Browse the repository at this point in the history
…abled

Don't change the CPU state unexpectedly
  • Loading branch information
pussuw committed Sep 6, 2024
1 parent 584718b commit 2a62ea2
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions arch/arm64/src/common/arm64_vectors.S
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,13 @@ SECTION_FUNC(text, arm64_sync_exc)

/* Call dispatch_syscall() on the kernel stack with interrupts enabled */

mrs x10, spsr_el1
and x10, x10, #IRQ_SPSR_MASK
cmp x10, xzr
bne 1f
msr daifclr, #IRQ_DAIF_MASK /* Re-enable interrupts */

1:
bl dispatch_syscall
msr daifset, #IRQ_DAIF_MASK /* Disable interrupts */

Expand Down

0 comments on commit 2a62ea2

Please sign in to comment.