linux/arch/arm64/kvm/vgic
Marc Zyngier ac0899da0e KVM: arm64: Don't read a HW interrupt pending state in user context
commit 2cdea19a34 upstream.

Since 5bfa685e62 ("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: 5bfa685e62 ("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
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-06-22 14:22:05 +02:00
..
trace.h
vgic-debug.c KVM: arm64: vgic-debug: Convert to use DEFINE_SEQ_ATTRIBUTE macro 2020-09-18 16:17:27 +01:00
vgic-init.c KVM: arm64: vgic: Let an interrupt controller advertise lack of HW deactivation 2021-06-01 10:45:59 +01:00
vgic-irqfd.c KVM: arm64: Allow in-atomic injection of SPIs 2020-07-05 17:26:15 +01:00
vgic-its.c ARM: 2021-05-01 10:14:08 -07:00
vgic-kvm-device.c KVM: arm/arm64: Fix KVM_VGIC_V3_ADDR_TYPE_REDIST read 2021-04-13 15:04:50 +01:00
vgic-mmio-v2.c KVM: arm64: Don't read a HW interrupt pending state in user context 2022-06-22 14:22:05 +02:00
vgic-mmio-v3.c ARM: 2021-05-01 10:14:08 -07:00
vgic-mmio.c KVM: arm64: Don't read a HW interrupt pending state in user context 2022-06-22 14:22:05 +02:00
vgic-mmio.h KVM: arm64: Don't read a HW interrupt pending state in user context 2022-06-22 14:22:05 +02:00
vgic-v2.c KVM: arm64: vgic: Resample HW pending state on deactivation 2021-08-20 08:53:22 +01:00
vgic-v3.c KVM: arm64: vgic: Resample HW pending state on deactivation 2021-08-20 08:53:22 +01:00
vgic-v4.c KVM: arm64: GICv4.1: Restore VLPI pending state to physical side 2021-03-24 18:12:21 +00:00
vgic.c KVM: arm64: vgic: Resample HW pending state on deactivation 2021-08-20 08:53:22 +01:00
vgic.h KVM: arm64: vgic: Resample HW pending state on deactivation 2021-08-20 08:53:22 +01:00