summaryrefslogtreecommitdiff
path: root/include/linux/err.h
diff options
context:
space:
mode:
authorKarl Mehltretter <kmehltretter@gmail.com>2026-08-31 10:10:02 +0200
committerMarc Zyngier <maz@kernel.org>2026-10-04 09:43:54 +0100
commita32c01324eb494dda811912eb847b0e907cd7270 (patch)
tree0e7e4e68801c6d23a2b540245bd361e849ae888a /include/linux/err.h
parent8a88a46b86ca3dbbd24522760d29edfb3f24ac2a (diff)
KVM: arm64: vgic-v3: Roll back assignments from the new region
A failed REDIST_REGION write unregisters the redistributor iodevs of every vCPU processed before the failure. This includes vCPUs assigned to older regions. Their assignments remain cached, so a retry does not register the iodevs again. The vCPU whose registration fails has no assignment to roll back. For vCPUs processed earlier, limit rollback to those assigned to the new region. The region is removed on failure, so its free_index does not need restoring. Resetting assignments from older regions is unsafe because a vCPU can own one before kvm_for_each_vcpu() can see it. Rollback could then move free_index behind that live assignment. kvm_vgic_addr() holds slots_lock across the REDIST_REGION write. vCPU creation takes the same lock before assigning a redistributor. A concurrent vCPU cannot acquire an assignment from the new region before rollback completes. The lock also keeps rdreg valid across the config_lock drop required by MMIO-bus registration. Fixes: c011f4ea106b ("KVM: arm/arm64: Check vcpu redist base before registering an iodev") Cc: stable@vger.kernel.org Assisted-by: Codex:gpt-5.6-sol Signed-off-by: Karl Mehltretter <kmehltretter@gmail.com> Link: https://patch.msgid.link/20260831081005.41346-3-kmehltretter@gmail.com [maz: moved helper into the sole caller] Signed-off-by: Marc Zyngier <maz@kernel.org>
Diffstat (limited to 'include/linux/err.h')
0 files changed, 0 insertions, 0 deletions