mbox series

[0/4] arm64: Fix save/restore with IRQ priority masking

Message ID 1555424556-46023-1-git-send-email-julien.thierry@arm.com (mailing list archive)
Headers show
Series arm64: Fix save/restore with IRQ priority masking | expand

Message

Julien Thierry April 16, 2019, 2:22 p.m. UTC
Hi,

As reported by Zenghui[1], there are some locations were a save restore
of the IRQ flags can end up masking more IRQs than it should. At the
very least, this can prevent the GIC driver from acknowledging some
IRQs, or prevent IRQs to be signaled to a VHE-host while a guest is
running.

We introduce some state-based logic on the values of PMR in order to fix
things without just adding more hacks.

* Patch 1-2 refactor exisint code
* Patch 3 is the actual fix
* Patch 4 adds some optionally built debug to shout if we break the
  assumptions made for PMR states where PSR.I is set

[1] https://www.spinics.net/lists/arm-kernel/msg716956.html

Cheers,

Julien

-->

Julien Thierry (4):
  arm64: Do not enable IRQs for ct_user_exit
  arm64: Always trace_hardirq_off when taking an IRQ
  arm64: Fix incorrect irqflag restore for priority masking
  arm64: irqflags: Introduce explicit debugging for IRQ priorities

 arch/arm64/Kconfig                  | 11 +++++++
 arch/arm64/include/asm/arch_gicv3.h |  4 ++-
 arch/arm64/include/asm/assembler.h  | 18 +++++++++++
 arch/arm64/include/asm/daifflags.h  | 25 ++++++++++++---
 arch/arm64/include/asm/irqflags.h   | 62 +++++++++++++++++++------------------
 arch/arm64/include/asm/kvm_host.h   |  4 ++-
 arch/arm64/include/asm/ptrace.h     | 24 ++++++++++++--
 arch/arm64/kernel/entry.S           | 42 +++++++++++++++----------
 arch/arm64/kernel/process.c         |  2 +-
 arch/arm64/kernel/smp.c             |  8 +++--
 arch/arm64/kvm/hyp/switch.c         |  2 +-
 11 files changed, 142 insertions(+), 60 deletions(-)

--
1.9.1