From: Wei Wang <wei.w.wang@intel.com>
To: pbonzini@redhat.com, seanjc@google.com, mhal@rbox.co
Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org,
Wei Wang <wei.w.wang@intel.com>
Subject: [PATCH v2 0/2] kvm_io_bus_unregister_dev cleanup
Date: Tue, 7 Feb 2023 20:37:11 +0800 [thread overview]
Message-ID: <20230207123713.3905-1-wei.w.wang@intel.com> (raw)
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/20221229123302.4083-1-wei.w.wang@intel.com/
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(-)
--
2.27.0
next reply other threads:[~2023-02-07 12:37 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-07 12:37 Wei Wang [this message]
2023-02-07 12:37 ` [PATCH v2 1/2] KVM: destruct kvm_io_device while unregistering it from kvm_io_bus Wei Wang
2023-03-23 15:43 ` Sean Christopherson
2023-02-07 12:37 ` [PATCH v2 2/2] kvm/eventfd: use list_for_each_entry when deassign ioeventfd Wei Wang
2023-03-23 15:30 ` Sean Christopherson
2023-06-13 23:21 ` [PATCH v2 0/2] kvm_io_bus_unregister_dev cleanup Sean Christopherson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230207123713.3905-1-wei.w.wang@intel.com \
--to=wei.w.wang@intel.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mhal@rbox.co \
--cc=pbonzini@redhat.com \
--cc=seanjc@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).