]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: arm64: Don't read a HW interrupt pending state in user context
authorMarc Zyngier <maz@kernel.org>
Tue, 7 Jun 2022 13:14:25 +0000 (14:14 +0100)
committerMarc Zyngier <maz@kernel.org>
Tue, 7 Jun 2022 15:28:19 +0000 (16:28 +0100)
commite06a357a6364b9e418f25731a3b09c07d5c06204
treeae4ae55425ea9fdc259f499bb94385916eabf17e
parent49ec27aa2351410ceccd6c459044562f5a9e4ec8
KVM: arm64: Don't read a HW interrupt pending state in user context

Since dc52194b0fa8 ("KVM: arm64: vgic: Read HW interrupt pending state
from the HW"), we're able to source the pending bit for an interrupt
that is stored either on the physical distributor or on a device.

However, this state is only available when the vcpu is loaded,
and is not intended to be accessed from userspace. Unfortunately,
the GICv2 emulation doesn't provide specific userspace accessors,
and we fallback with the ones that are intended for the guest,
with fatal consequences.

Add a new vgic_uaccess_read_pending() accessor for userspace
to use, build on top of the existing vgic_mmio_read_pending().

Reported-by: Eric Auger <eric.auger@redhat.com>
Reviewed-by: Eric Auger <eric.auger@redhat.com>
Tested-by: Eric Auger <eric.auger@redhat.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Fixes: dc52194b0fa8 ("KVM: arm64: vgic: Read HW interrupt pending state from the HW")
Link: https://lore.kernel.org/r/20220607131427.1164881-2-maz@kernel.org
Cc: stable@vger.kernel.org
arch/arm64/kvm/vgic/vgic-mmio-v2.c
arch/arm64/kvm/vgic/vgic-mmio.c
arch/arm64/kvm/vgic/vgic-mmio.h