1
linux/arch/arm64/kvm/vgic
Oliver Upton 78a0055555 KVM: arm64: Ensure vgic_ready() is ordered against MMIO registration
kvm_vgic_map_resources() prematurely marks the distributor as 'ready',
potentially allowing vCPUs to enter the guest before the distributor's
MMIO registration has been made visible.

Plug the race by marking the distributor as ready only after MMIO
registration is completed. Rely on the implied ordering of
synchronize_srcu() to ensure the MMIO registration is visible before
vgic_dist::ready. This also means that writers to vgic_dist::ready are
now serialized by the slots_lock, which was effectively the case already
as all writers held the slots_lock in addition to the config_lock.

Fixes: 59112e9c39 ("KVM: arm64: vgic: Fix a circular locking issue")
Signed-off-by: Oliver Upton <oliver.upton@linux.dev>
Link: https://lore.kernel.org/r/20241017001947.2707312-3-oliver.upton@linux.dev
Signed-off-by: Marc Zyngier <maz@kernel.org>
2024-10-17 09:20:48 +01:00
..
trace.h
vgic-debug.c KVM: arm64: vgic-debug: Don't put unmarked LPIs 2024-08-19 17:04:36 +00:00
vgic-init.c KVM: arm64: Ensure vgic_ready() is ordered against MMIO registration 2024-10-17 09:20:48 +01:00
vgic-irqfd.c KVM: arm64: fix kdoc warnings in W=1 builds 2024-08-02 18:58:03 +00:00
vgic-its.c KVM: arm64: fix kdoc warnings in W=1 builds 2024-08-02 18:58:03 +00:00
vgic-kvm-device.c KVM: arm64: vgic: Don't check for vgic_ready() when setting NR_IRQS 2024-10-17 09:20:48 +01:00
vgic-mmio-v2.c
vgic-mmio-v3.c KVM: arm64: Disassociate vcpus from redistributor region on teardown 2024-06-06 08:54:15 +01:00
vgic-mmio.c KVM: arm64: vgic: Use common accessor for writes to ICPENDR 2023-12-22 09:34:17 +00:00
vgic-mmio.h
vgic-v2.c KVM: arm64: Simplify vgic-v3 hypercalls 2024-05-01 16:48:14 +01:00
vgic-v3.c KVM: arm64: Force SRE traps when SRE access is not enabled 2024-08-27 18:32:55 +01:00
vgic-v4.c KVM: arm64: GICv4: Do not perform a map to a mapped vLPI 2023-11-20 19:13:32 +00:00
vgic.c KVM: arm64: Force GICv3 trap activation when no irqchip is configured on VHE 2024-08-27 18:32:55 +01:00
vgic.h KVM: arm64: Zero ID_AA64PFR0_EL1.GIC when no GICv3 is presented to the guest 2024-08-27 18:32:55 +01:00