]> git.baikalelectronics.ru Git - kernel.git/commit
arm64: entry: unmask IRQ in el0_sp()
authorMark Rutland <mark.rutland@arm.com>
Fri, 28 Feb 2020 14:59:42 +0000 (14:59 +0000)
committerCatalin Marinas <catalin.marinas@arm.com>
Wed, 11 Mar 2020 14:34:28 +0000 (14:34 +0000)
commitbb91b388828c8f751aebc53abd6ee3e1a603d6a8
tree77a43ee032b5aa7e8f6e02a12c3c28f24d7585b8
parente66c3593470d06848f6a3477ab52c577db14d0b0
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:

  7a1284874d0779fd ("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:

  643d9856af365575 ("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:

  c28ea519fe1cc015 ("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 <mark.rutland@arm.com>
Cc: Will Deacon <will@kernel.org>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Reviewed-by: James Morse <james.morse@arm.com>
arch/arm64/kernel/entry-common.c