From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jike Song Subject: [v4 0/3] plumb kvm/vfio to notify kvm:group attaching/detaching Date: Tue, 15 Nov 2016 19:35:44 +0800 Message-ID: <1479209747-5564-1-git-send-email-jike.song@intel.com> Cc: kwankhede@nvidia.com, cjia@nvidia.com, kevin.tian@intel.com, kvm@vger.kernel.org, jike.song@intel.com To: alex.williamson@redhat.com, pbonzini@redhat.com, guangrong.xiao@linux.intel.com Return-path: Received: from mga09.intel.com ([134.134.136.24]:6706 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752225AbcKOLm2 (ORCPT ); Tue, 15 Nov 2016 06:42:28 -0500 Sender: kvm-owner@vger.kernel.org List-ID: So far KVM and VFIO are mostly transparent to each other. However, there are users who would rely on them both. For example, KVMGT relies on VFIO to mediate device operations, and it also relies on KVM for features such as guest page tracking. To do that, it needs to know which KVM instance a vfio_group is attached to, when it will be detached. There is already a kvm_vfio device serving for similar purpose, this series extends it to allow users register notifiers on a vfio_group, and notify kvm:group attaching and detaching events to that. Based on Kirti: http://marc.info/?l=kvm&m=147913808504902 Changes v4: - use a notifier-based implementation in vfio_group - combine the notifier along with iommu notifier by Kirti Changes v3: - don't touch kvm_put_kvm, vfio won't need it - fix a race condition Changes v2: - As Paolo suggested, drop the type and get/put ops from vfio, assuming that the data will always be kvm. Jike Song (3): vfio: add vfio_group_notify support vfio_register_notifier: also register on the group notifier kvm: notify vfio on attaching and detaching drivers/vfio/vfio.c | 34 ++++++++++++++++++++++++++++++++++ include/linux/vfio.h | 4 ++++ virt/kvm/vfio.c | 31 +++++++++++++++++++++++++++++++ 3 files changed, 69 insertions(+) -- 1.9.1