KVM: arm64: vgic-v4: Restore pending state on host userspace write
authorMarc Zyngier <maz@kernel.org>
Sun, 17 Dec 2023 11:15:09 +0000 (11:15 +0000)
committerMarc Zyngier <maz@kernel.org>
Fri, 22 Dec 2023 09:27:36 +0000 (09:27 +0000)
commit7b95382f965133ef61ce44aaabc518c16eb46909
tree635bd72e22a34a824ce566f6528c07a2f4087a01
parent2cc14f52aeb78ce3f29677c2de1f06c0e91471ab
KVM: arm64: vgic-v4: Restore pending state on host userspace write

When the VMM writes to ISPENDR0 to set the state pending state of
an SGI, we fail to convey this to the HW if this SGI is already
backed by a GICv4.1 vSGI.

This is a bit of a corner case, as this would only occur if the
vgic state is changed on an already running VM, but this can
apparently happen across a guest reset driven by the VMM.

Fix this by always writing out the pending_latch value to the
HW, and reseting it to false.

Reported-by: Kunkun Jiang <jiangkunkun@huawei.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Reviewed-by: Zenghui Yu <yuzenghui@huawei.com>
Cc: stable@vger.kernel.org # 5.10+
Link: https://lore.kernel.org/r/7e7f2c0c-448b-10a9-8929-4b8f4f6e2a32@huawei.com
arch/arm64/kvm/vgic/vgic-mmio-v3.c