From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jike Song Subject: [v3 0/5] plumb kvm/vfio to allow getting kvm from vfio_group Date: Mon, 31 Oct 2016 14:35:01 +0800 Message-ID: <1477895706-22824-1-git-send-email-jike.song@intel.com> Cc: kwankhede@nvidia.com, cjia@nvidia.com, kevin.tian@intel.com, jike.song@intel.com, kvm@vger.kernel.org To: pbonzini@redhat.com, alex.williamson@redhat.com, guangrong.xiao@linux.intel.com Return-path: Received: from mga09.intel.com ([134.134.136.24]:46459 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1760668AbcJaGkY (ORCPT ); Mon, 31 Oct 2016 02:40:24 -0400 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. There is already a kvm_vfio device serving for similar purpose, this patchset extend it to allow external usrs like KVMGT to get KVM instance from the vfio_group. I picked one of Kirti's patchset from: https://lkml.org/lkml/2016/10/26/1119 for the function to get the vfio_group from a given device. 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 (4): vfio: export functions to get vfio_group from device and put it KVM: move kvm_get_kvm to kvm_host.h vfio: implement APIs to set/put kvm to/from vfio group KVM: set/clear kvm to/from vfio group during add/delete Kirti Wankhede (1): vfio: Rearrange functions to get vfio_group from dev drivers/vfio/vfio.c | 57 +++++++++++++++++++++++++++++++++++++++++------- include/linux/kvm_host.h | 5 ++++- include/linux/vfio.h | 7 ++++++ virt/kvm/kvm_main.c | 6 ----- virt/kvm/vfio.c | 33 ++++++++++++++++++++++++++++ 5 files changed, 93 insertions(+), 15 deletions(-) -- 1.9.1