KVM: arm64: Unmap vLPIs affected by changes to GSI routing information
authorOliver Upton <oliver.upton@linux.dev>
Fri, 23 May 2025 19:47:21 +0000 (12:47 -0700)
committerMarc Zyngier <maz@kernel.org>
Fri, 30 May 2025 08:11:29 +0000 (09:11 +0100)
commit4bf3693d36af9768c9bcc1df3a12d00ad6ea8083
tree3cec9aa699780c776435ca8f6ca115e9df023c73
parent05b9405f2fa1848e984f231708fa1e5d385e4d27
KVM: arm64: Unmap vLPIs affected by changes to GSI routing information

KVM's interrupt infrastructure is dodgy at best, allowing for some ugly
'off label' usage of the various UAPIs. In one example, userspace can
change the routing entry of a particular "GSI" after configuring
irqbypass with KVM_IRQFD. KVM/arm64 is oblivious to this, and winds up
preserving the stale translation in cases where vLPIs are configured.

Honor userspace's intentions and tear down the vLPI mapping if affected
by a "GSI" routing change. Make no attempt to reconstruct vLPIs if the
new target is an MSI and just fall back to software injection.

Tested-by: Sweet Tea Dorminy <sweettea-kernel@dorminy.me>
Signed-off-by: Oliver Upton <oliver.upton@linux.dev>
Link: https://lore.kernel.org/r/20250523194722.4066715-5-oliver.upton@linux.dev
Signed-off-by: Marc Zyngier <maz@kernel.org>
arch/arm64/kvm/arm.c