Skip to content

kvm_io_bus_unregister_dev cleanup

Wei Wang kvm lkml 2 versions – Applied

Status from this message: Applied to kvm-x86 generic, thanks!

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest2 patches 3 repliesApplied
  2. v11 patch 5 repliesSuperseded

Changes in v2 from the cover letter

- keep kfree(bus) when the new bus is successfully allocated
- add patch 2

Patches in v2 Applied

#Subject and filesSizeRepliesApplied
1/2KVM: destruct kvm_io_device while unregistering it from kvm_io_businclude/kvm/iodev.h virt/kvm/coalesced_mmio.c virt/kvm/eventfd.c +1 more+17 -221 reply
2/2kvm/eventfd: use list_for_each_entry when deassign ioeventfdvirt/kvm/eventfd.c+2 -31 reply

Reviews trailers per patch

All 2 patches have a Reviewed-by or Acked-by.

PatchSean Christopherson
1/2R-b
2/2R-b

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

Read the v2 thread

Cover letter [PATCH v2 0/2] kvm_io_bus_unregister_dev cleanup

This patchset moves kvm io_device destruction into kvm_io_bus_unregister_dev. This reduces LOCs a bit for users and can avoid the leakage of destructing the device explicitly. Accordingly, below cleanups are included:
- remove the exposure of kvm_iodevice_destructor and the invocation in the users as kvm_iodevice_destructor is now invoked in kvm_io_bus_unregister_dev;
- Change kvm_deassign_ioeventfd_idx to use list_for_each_entry as the loop ends at the entry that's founded and deleted.

The patches are rebased to
https://github.com/kvm-x86/linux/commit/b1cb1fac22ab

Changelog:
v1->v2:
- keep kfree(bus) when the new bus is successfully allocated
- add patch 2

Previous version:
https://lore.kernel.org/lkml/[email protected]/

Wei Wang (2):
KVM: destruct kvm_io_device while unregistering it from kvm_io_bus kvm/eventfd: use list_for_each_entry when deassign ioeventfd

 include/kvm/iodev.h       |  6 ------
 virt/kvm/coalesced_mmio.c |  9 ++-------
 virt/kvm/eventfd.c        |  6 ++----
 virt/kvm/kvm_main.c       | 23 +++++++++++++++--------
 4 files changed, 19 insertions(+), 25 deletions(-)
Signature · 1 line
2.27.0