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 KVM: arm64: Fix typos 2024-02-24 09:13:33 +00:00
arm.c KVM: arm64: Don't eagerly teardown the vgic on init error 2024-10-11 13:40:25 +01:00
at.c KVM: arm64: nv: Add support for FEAT_ATS1A 2024-08-30 12:04:20 +01:00
debug.c KVM: arm64: debug: fix kernel-doc warnings 2024-02-01 20:25:41 +00:00
emulate-nested.c Merge branch kvm-arm64/nv-at-pan into kvmarm-master/next 2024-09-12 08:37:47 +01:00
fpsimd.c KVM: arm64: Add save/restore support for FPMR 2024-08-27 07:59:27 +01:00
guest.c KVM: arm64: Disallow copying MTE to guest memory while KVM is dirty logging 2024-08-13 19:29:17 +01:00
handle_exit.c Merge branch kvm-arm64/nv-sve into kvmarm/next 2024-07-14 00:27:06 +00:00
hypercalls.c KVM: arm64: Use kvm_has_feat() to check if FEAT_SSBS is advertised to the guest 2024-08-25 17:48:44 +01:00
inject_fault.c KVM: arm64: Fix typos 2024-02-24 09:13:33 +00:00
Kconfig Merge branch kvm-arm64/s2-ptdump into kvmarm-master/next 2024-09-12 08:38:02 +01:00
Makefile Merge branch kvm-arm64/s2-ptdump into kvmarm-master/next 2024-09-12 08:38:02 +01:00
mmio.c KVM: arm64: Force injection of a data abort on NISV MMIO exit 2024-05-01 16:48:15 +01:00
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 KVM: arm64: nv: Work around lack of pauth support in old toolchains 2024-04-23 19:27:11 +01:00
pkvm.c KVM: arm64: Prevent kmemleak from accessing .hyp.data 2024-05-01 16:48:14 +01:00
pmu-emul.c KVM: arm64: Refine PMU defines for number of counters 2024-08-16 13:09:12 +01:00
pmu.c perf: arm_pmuv3: Add support for Armv9.4 PMU instruction counter 2024-08-16 13:09:12 +01:00
psci.c Merge branch kvm-arm64/smccc-filtering into kvmarm-master/next 2023-04-21 09:44:32 +01:00
ptdump.c KVM: arm64: Register ptdump with debugfs on guest creation 2024-09-10 21:32:51 +01:00
pvtime.c KVM: MMU: Make the definition of 'INVALID_GPA' common 2023-01-19 21:48:38 +00:00
reset.c KVM: arm64: nv: Support multiple nested Stage-2 mmu structures 2024-06-19 08:13:49 +00:00
stacktrace.c arm64: stacktrace: track hyp stacks in unwinder's address space 2022-09-09 12:30:08 +01:00
sys_regs.c KVM: arm64: Fix shift-out-of-bounds bug 2024-10-17 09:20:13 +01:00
sys_regs.h Merge branch kvm-arm64/visibility-cleanups into kvmarm-master/next 2024-09-12 08:38:17 +01:00
trace_arm.h KVM: arm64: Add tracepoint for MMIO accesses where ISV==0 2023-10-30 20:17:22 +00:00
trace_handle_exit.h
trace.h
trng.c
va_layout.c arm64: alternatives: kvm: prepare for cap changes 2022-09-16 17:15:02 +01:00
vgic-sys-reg-v3.c
vmid.c KVM: arm64: Reload stage-2 for VMID change on VHE 2023-10-20 17:52:01 +00:00