KVM: arm64: nv: Do not block when unmapping stage-2 if disallowed
authorOliver Upton <oliver.upton@linux.dev>
Mon, 7 Oct 2024 23:30:26 +0000 (23:30 +0000)
committerMarc Zyngier <maz@kernel.org>
Tue, 8 Oct 2024 09:40:27 +0000 (10:40 +0100)
commit3c164eb9464d39ba339c1487dcac0dc9508e03f0
tree9d2898b907c88e59b8c17a32d3f903c2c6f6cb89
parent6ded46b5a4fd7fc9c6104b770627043aaf996abf
KVM: arm64: nv: Do not block when unmapping stage-2 if disallowed

Right now the nested code allows unmap operations on a shadow stage-2 to
block unconditionally. This is wrong in a couple places, such as a
non-blocking MMU notifier or on the back of a sched_in() notifier as
part of shadow MMU recycling.

Carry through whether or not blocking is allowed to
kvm_pgtable_stage2_unmap(). This 'fixes' an issue where stage-2 MMU
reclaim would precipitate a stack overflow from a pile of kvm_sched_in()
callbacks, all trying to recycle a stage-2 MMU.

Signed-off-by: Oliver Upton <oliver.upton@linux.dev>
Link: https://lore.kernel.org/r/20241007233028.2236133-3-oliver.upton@linux.dev
Signed-off-by: Marc Zyngier <maz@kernel.org>
arch/arm64/include/asm/kvm_mmu.h
arch/arm64/include/asm/kvm_nested.h
arch/arm64/kvm/mmu.c
arch/arm64/kvm/nested.c
arch/arm64/kvm/sys_regs.c