From patchwork Wed Feb 27 08:51:43 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexey Kardashevskiy X-Patchwork-Id: 10831413 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 B5B7A1390 for ; Wed, 27 Feb 2019 08:53:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A12AA2CD7D for ; Wed, 27 Feb 2019 08:53:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 950FE2CD88; Wed, 27 Feb 2019 08:53:24 +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=-2.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 84D7B2CD7D for ; Wed, 27 Feb 2019 08:53:23 +0000 (UTC) Received: from localhost ([127.0.0.1]:40370 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gyuxu-00056Q-GD for patchwork-qemu-devel@patchwork.kernel.org; Wed, 27 Feb 2019 03:53:22 -0500 Received: from eggs.gnu.org ([209.51.188.92]:36298) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gyuwe-00044X-Dv for qemu-devel@nongnu.org; Wed, 27 Feb 2019 03:52:05 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gyuwc-0004B5-MN for qemu-devel@nongnu.org; Wed, 27 Feb 2019 03:52:04 -0500 Received: from ozlabs.ru ([107.173.13.209]:35260) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gyuwY-00046p-N7; Wed, 27 Feb 2019 03:52:00 -0500 Received: from fstn1-p1.ozlabs.ibm.com (localhost [IPv6:::1]) by ozlabs.ru (Postfix) with ESMTP id 4C8B0AE80054; Wed, 27 Feb 2019 03:51:51 -0500 (EST) From: Alexey Kardashevskiy To: qemu-devel@nongnu.org Date: Wed, 27 Feb 2019 19:51:43 +1100 Message-Id: <20190227085149.38596-1-aik@ozlabs.ru> X-Mailer: git-send-email 2.17.1 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 107.173.13.209 Subject: [Qemu-devel] [PATCH qemu v3 0/6] spapr_pci, vfio: NVIDIA V100 + POWER9 passthrough 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: Jose Ricardo Ziviani , Alexey Kardashevskiy , Daniel Henrique Barboza , Alex Williamson , Sam Bobroff , Piotr Jaroszynski , qemu-ppc@nongnu.org, =?utf-8?q?Leonardo_Augusto_Guimar=C3=A3es_Garcia?= , David Gibson Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP This is for passing through NVIDIA V100 GPUs on POWER9 systems. This implements a subdriver for NVIDIA V100 GPU with coherent memory and NPU/ATS support available in the POWER9 CPU. 1/6 went via PCI tree, here for the reference only. Since 6/6 moves GPU RAM to much higher addresses than before, I added 4/6 to mitigate RCU stall warnings in the guest. Here is the kernel driver: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/drivers/vfio/pci?h=v5.0-rc6&id=7f92891778dff62303c070ac81de7b7d80de331a SLOF changes already went in. This is based on dwg/ppc-for-4.0 sha1 a12da2e Murilo Opsfelder Araujo "ppc/pnv: use IEC binary prefixes to represent sizes". Please comment. Thanks. Alexey Kardashevskiy (6): pci: Move NVIDIA vendor id to the rest of ids vfio/spapr: Fix indirect levels calculation vfio/spapr: Rename local systempagesize variable spapr_iommu: Do not replay mappings from just created DMA window vfio: Make vfio_get_region_info_cap public spapr: Support NVIDIA V100 GPU with NVLink2 hw/ppc/Makefile.objs | 2 +- hw/vfio/pci.h | 2 + include/hw/pci-host/spapr.h | 41 ++++ include/hw/pci/pci_ids.h | 2 + include/hw/ppc/spapr.h | 4 +- include/hw/vfio/vfio-common.h | 2 + hw/ppc/spapr.c | 29 ++- hw/ppc/spapr_iommu.c | 31 +++ hw/ppc/spapr_pci.c | 8 + hw/ppc/spapr_pci_nvlink2.c | 419 ++++++++++++++++++++++++++++++++++ hw/ppc/spapr_rtas_ddw.c | 7 + hw/vfio/common.c | 2 +- hw/vfio/pci-quirks.c | 122 +++++++++- hw/vfio/pci.c | 14 ++ hw/vfio/spapr.c | 49 ++-- hw/vfio/trace-events | 6 +- 16 files changed, 718 insertions(+), 22 deletions(-) create mode 100644 hw/ppc/spapr_pci_nvlink2.c