From patchwork Tue Aug 29 22:05:24 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Williamson X-Patchwork-Id: 807330 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3xhjQP4v6xz9s8w for ; Wed, 30 Aug 2017 08:06:21 +1000 (AEST) Received: from localhost ([::1]:47229 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dmoeJ-0007qW-Ix for incoming@patchwork.ozlabs.org; Tue, 29 Aug 2017 18:06:19 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39102) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dmodZ-0007pr-Ma for qemu-devel@nongnu.org; Tue, 29 Aug 2017 18:05:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dmodU-0001LJ-Jp for qemu-devel@nongnu.org; Tue, 29 Aug 2017 18:05:33 -0400 Received: from mx1.redhat.com ([209.132.183.28]:40486) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dmodU-0001L3-DE for qemu-devel@nongnu.org; Tue, 29 Aug 2017 18:05:28 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6C25285540; Tue, 29 Aug 2017 22:05:27 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 6C25285540 Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=alex.williamson@redhat.com Received: from gimli.home (ovpn-116-27.phx2.redhat.com [10.3.116.27]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2BB266933B; Tue, 29 Aug 2017 22:05:24 +0000 (UTC) From: Alex Williamson To: qemu-devel@nongnu.org Date: Tue, 29 Aug 2017 16:05:24 -0600 Message-ID: <20170829214929.31136.21144.stgit@gimli.home> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Tue, 29 Aug 2017 22:05:27 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 0/3] vfio/pci: Add NVIDIA GPUDirect P2P clique support 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: a175818323@gmail.com Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" NVIDIA has a specification for exposing a virtual vendor capability which provides a hint to guest drivers as to which sets of GPUs can support direct peer-to-peer DMA. Devices with the same clique ID are expected to support this. The user can specify a clique ID for an NVIDIA graphics device using the new vfio-pci x-nv-gpudirect-clique= option, where valid clique IDs are a 4-bit integer. It's entirely the user's responsibility to specify sets of devices for which P2P works correctly and provides some benefit. This is only useful for DMA between NVIDIA GPUs, therefore it's only useful to specify cliques comprised of more than one GPU. Furthermore, this does not enable DMA between VMs, there is no change to VM DMA mapping, this only exposes hints about existing DMA paths to the guest driver. Thanks, Alex --- Alex Williamson (3): vfio/pci: Do not unwind on error vfio/pci: Add virtual capabilities quirk infrastructure vfio/pci: Add NVIDIA GPUDirect Cliques support hw/vfio/pci-quirks.c | 114 ++++++++++++++++++++++++++++++++++++++++++++++++++ hw/vfio/pci.c | 17 +++++++ hw/vfio/pci.h | 4 ++ 3 files changed, 133 insertions(+), 2 deletions(-)