]> git.baikalelectronics.ru Git - kernel.git/commit
arm64: acpi: fix DAIF manipulation with pNMI
authorMark Rutland <mark.rutland@arm.com>
Wed, 22 Jan 2020 12:45:46 +0000 (12:45 +0000)
committerWill Deacon <will@kernel.org>
Wed, 22 Jan 2020 14:41:22 +0000 (14:41 +0000)
commitc124a1b384e2da7c64d4f1a215b6311a0e433997
tree7f8cb38dac83c3f72063fc091da4ac4edf4d1335
parentec3029a6be4015de40ecbf723486fe4f781d1786
arm64: acpi: fix DAIF manipulation with pNMI

Since commit:

  3c0da08e72b5e5b2 ("arm64: KVM/mm: Move SEA handling behind a single 'claim' interface")

... the top-level APEI SEA handler has the shape:

1. current_flags = arch_local_save_flags()
2. local_daif_restore(DAIF_ERRCTX)
3. <GHES handler>
4. local_daif_restore(current_flags)

However, since commit:

  1bb45791df7d82a5 ("arm64: irqflags: Use ICC_PMR_EL1 for interrupt masking")

... when pseudo-NMIs (pNMIs) are in use, arch_local_save_flags() will save
the PMR value rather than the DAIF flags.

The combination of these two commits means that the APEI SEA handler will
erroneously attempt to restore the PMR value into DAIF. Fix this by
factoring local_daif_save_flags() out of local_daif_save(), so that we
can consistently save DAIF in step #1, regardless of whether pNMIs are in
use.

Both commits were introduced concurrently in v5.0.

Cc: <stable@vger.kernel.org>
Fixes: 1bb45791df7d82a5 ("arm64: irqflags: Use ICC_PMR_EL1 for interrupt masking")
Fixes: 3c0da08e72b5e5b2 ("arm64: KVM/mm: Move SEA handling behind a single 'claim' interface")
Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: James Morse <james.morse@arm.com>
Cc: Julien Thierry <julien.thierry.kdev@gmail.com>
Cc: Will Deacon <will@kernel.org>
Signed-off-by: Will Deacon <will@kernel.org>
arch/arm64/include/asm/daifflags.h
arch/arm64/kernel/acpi.c