Skip to content

KVM: VFIO: use mutex guards to simplify control flow

Carlos López kvm lkml oe-kbuild-all 1 version Applied

Status from this message: Applied to kvm-x86 vfio, with the minor fixup. Thanks!

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest4 patches 5 repliesApplied

Patches in v1 Applied

#Subject and filesSizeRepliesApplied
1/4KVM: VFIO: clean up control flow in kvm_vfio_file_add()virt/kvm/vfio.c+9 -200 replies
2/4KVM: VFIO: use mutex guard in kvm_vfio_file_set_spapr_tce()virt/kvm/vfio.c+6 -132 replies
3/4KVM: VFIO: deduplicate file release logicvirt/kvm/vfio.c+18 -210 replies
4/4KVM: VFIO: update coherency only if file was deletedvirt/kvm/vfio.c+4 -100 replies

Reviews trailers per patch

None of the 4 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchAlex Williamson
SeriesR-b
1/4
2/4
3/4
4/4

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/4] KVM: VFIO: use mutex guards to simplify control flow

Replace several uses of mutex_lock() / mutex_unlock() pairs with mutex guards, allowing removal of all gotos in virt/kvm/vfio.c.

In this series I also include a small refactor that allows greatly simplifying kvm_vfio_file_del(), and skipping an unnecessary call to kvm_vfio_update_coherency() if the list of files managed by the KVM VFIO device does not change.

Carlos López (4):
KVM: VFIO: clean up control flow in kvm_vfio_file_add()
KVM: VFIO: use mutex guard in kvm_vfio_file_set_spapr_tce()
KVM: VFIO: deduplicate file release logic
KVM: VFIO: update coherency only if file was deleted

 virt/kvm/vfio.c | 97 ++++++++++++++++++-------------------------------
 1 file changed, 35 insertions(+), 62 deletions(-)

base-commit: d2ea4ff1ce50787a98a3900b3fb1636f3620b7cf

Signature · 1 line
2.51.0