From patchwork Mon Jul 23 04:59:53 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tiwei Bie X-Patchwork-Id: 10539633 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 75860174A for ; Mon, 23 Jul 2018 05:03:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 61F282621E for ; Mon, 23 Jul 2018 05:03:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 562CF28518; Mon, 23 Jul 2018 05:03:45 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 054562621E for ; Mon, 23 Jul 2018 05:03:39 +0000 (UTC) Received: from localhost ([::1]:32790 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fhT0V-0005X9-4Y for patchwork-qemu-devel@patchwork.kernel.org; Mon, 23 Jul 2018 01:03:39 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43705) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fhSxM-0003fk-5U for qemu-devel@nongnu.org; Mon, 23 Jul 2018 01:00:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fhSxJ-0004n0-6h for qemu-devel@nongnu.org; Mon, 23 Jul 2018 01:00:24 -0400 Received: from mga03.intel.com ([134.134.136.65]:61813) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fhSxI-0004mO-Uc for qemu-devel@nongnu.org; Mon, 23 Jul 2018 01:00:21 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 22 Jul 2018 22:00:17 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,392,1526367600"; d="scan'208";a="59837256" Received: from debian.sh.intel.com ([10.67.104.228]) by orsmga006.jf.intel.com with ESMTP; 22 Jul 2018 22:00:16 -0700 From: Tiwei Bie To: mst@redhat.com, alex.williamson@redhat.com, jasowang@redhat.com, qemu-devel@nongnu.org Date: Mon, 23 Jul 2018 12:59:53 +0800 Message-Id: <20180723045956.27521-1-tiwei.bie@intel.com> X-Mailer: git-send-email 2.18.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 134.134.136.65 Subject: [Qemu-devel] [RFC 0/3] Supporting programming IOMMU in QEMU (vDPA/vhost-user) X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: tiwei.bie@intel.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP This patch set introduces a slave message in vhost-user to allow slave to share its VFIO group fd to master and do the IOMMU programming based on virtio device's DMA address space for this group in QEMU. For the vhost-user backends which support vDPA, they could leverage this message to ask master to do IOMMU programming in QEMU for the vDPA device in backend. This is helpful to support vIOMMU in vDPA. Tiwei Bie (3): vfio: split vfio_get_group() into small functions vfio: support getting VFIOGroup from groupfd vhost-user: support programming VFIO group in master docs/interop/vhost-user.txt | 16 +++++ hw/vfio/common.c | 127 +++++++++++++++++++++++++-------- hw/virtio/vhost-user.c | 40 +++++++++++ include/hw/vfio/vfio-common.h | 1 + include/hw/virtio/vhost-user.h | 2 + 5 files changed, 158 insertions(+), 28 deletions(-)