linux/arch/arm64/kvm
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
..
hyp KVM: arm64: Shave a few bytes from the EL2 idmap code 2024-10-17 09:17:56 +01:00
vgic KVM: arm64: Ensure vgic_ready() is ordered against MMIO registration 2024-10-17 09:20:48 +01:00
.gitignore
arch_timer.c
arm.c KVM: arm64: Don't eagerly teardown the vgic on init error 2024-10-11 13:40:25 +01:00
at.c
debug.c
emulate-nested.c
fpsimd.c
guest.c
handle_exit.c
hypercalls.c
inject_fault.c
Kconfig
Makefile
mmio.c
mmu.c KVM: arm64: nv: Do not block when unmapping stage-2 if disallowed 2024-10-08 10:40:27 +01:00
nested.c KVM: arm64: nv: Punt stage-2 recycling to a vCPU request 2024-10-08 10:40:27 +01:00
pauth.c
pkvm.c
pmu-emul.c
pmu.c
psci.c
ptdump.c
pvtime.c
reset.c
stacktrace.c
sys_regs.c KVM: arm64: Fix shift-out-of-bounds bug 2024-10-17 09:20:13 +01:00
sys_regs.h
trace.h
trace_arm.h
trace_handle_exit.h
trng.c
va_layout.c
vgic-sys-reg-v3.c
vmid.c