diff options
author | Oliver Upton <oliver.upton@linux.dev> | 2024-04-22 22:01:44 +0200 |
---|---|---|
committer | Marc Zyngier <maz@kernel.org> | 2024-04-25 14:19:55 +0200 |
commit | 85d3ccc8b75bb5a443edb3c42fa22e97da2e60ec (patch) | |
tree | 1ae242b983b57d69e9116a95aca3da10e3084f40 /include/kvm | |
parent | KVM: arm64: vgic-its: Walk LPI xarray in vgic_its_cmd_handle_movall() (diff) | |
download | linux-85d3ccc8b75bb5a443edb3c42fa22e97da2e60ec.tar.xz linux-85d3ccc8b75bb5a443edb3c42fa22e97da2e60ec.zip |
KVM: arm64: vgic-debug: Use an xarray mark for debug iterator
The vgic debug iterator is the final user of vgic_copy_lpi_list(), but
is a bit more complicated to transition to something else. Use a mark
in the LPI xarray to record the indices 'known' to the debug iterator.
Protect against the LPIs from being freed by associating an additional
reference with the xarray mark.
Rework iter_next() to let the xarray walk 'drive' the iteration after
visiting all of the SGIs, PPIs, and SPIs.
Signed-off-by: Oliver Upton <oliver.upton@linux.dev>
Link: https://lore.kernel.org/r/20240422200158.2606761-6-oliver.upton@linux.dev
Signed-off-by: Marc Zyngier <maz@kernel.org>
Diffstat (limited to 'include/kvm')
-rw-r--r-- | include/kvm/arm_vgic.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/kvm/arm_vgic.h b/include/kvm/arm_vgic.h index 47035946648e..8eb72721dac1 100644 --- a/include/kvm/arm_vgic.h +++ b/include/kvm/arm_vgic.h @@ -276,6 +276,8 @@ struct vgic_dist { /* Protects the lpi_list. */ raw_spinlock_t lpi_list_lock; + +#define LPI_XA_MARK_DEBUG_ITER XA_MARK_0 struct xarray lpi_xa; atomic_t lpi_count; |