From patchwork Thu Jan 17 02:51:12 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexey Kardashevskiy X-Patchwork-Id: 10767473 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 4159013B4 for ; Thu, 17 Jan 2019 03:03:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1D94A2A25A for ; Thu, 17 Jan 2019 03:03:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0B4792A2A0; Thu, 17 Jan 2019 03:03:51 +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 A73C12A25A for ; Thu, 17 Jan 2019 03:03:50 +0000 (UTC) Received: from localhost ([127.0.0.1]:58023 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gjxy9-0000oD-4E for patchwork-qemu-devel@patchwork.kernel.org; Wed, 16 Jan 2019 22:03:49 -0500 Received: from eggs.gnu.org ([209.51.188.92]:43282) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gjxwx-00088i-JF for qemu-devel@nongnu.org; Wed, 16 Jan 2019 22:02:36 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gjxm9-0004Xn-Kf for qemu-devel@nongnu.org; Wed, 16 Jan 2019 21:51:26 -0500 Received: from ozlabs.ru ([107.173.13.209]:45330) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gjxm9-0004NO-EQ; Wed, 16 Jan 2019 21:51:25 -0500 Received: from fstn1-p1.ozlabs.ibm.com (localhost [IPv6:::1]) by ozlabs.ru (Postfix) with ESMTP id 1CAC9AE80017; Wed, 16 Jan 2019 21:51:19 -0500 (EST) From: Alexey Kardashevskiy To: qemu-devel@nongnu.org Date: Thu, 17 Jan 2019 13:51:12 +1100 Message-Id: <20190117025115.81178-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 0/3] spapr_pci, vfio: NVIDIA V100 + P9 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 , Piotr Jaroszynski , qemu-ppc@nongnu.org, 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/3 is not strictly related but since new memory also needs to be mapped to the 64bit DMA window and it is located quite high in the address space, some adjustments are needed. This is based on dwg/ppc-for-4.0 sha1 a0a8bff and requires headers update from v5.0-rc1 staged by Paolo already. Please comment. Thanks. Alexey Kardashevskiy (3): vfio/spapr: Fix indirect levels calculation vfio: Make vfio_get_region_info_cap public spapr: Support NVIDIA V100 GPU with NVLink2 hw/vfio/pci.h | 2 + include/hw/pci-host/spapr.h | 9 + include/hw/ppc/spapr.h | 3 +- include/hw/vfio/vfio-common.h | 2 + hw/ppc/spapr.c | 25 ++- hw/ppc/spapr_pci.c | 333 +++++++++++++++++++++++++++++++++- hw/vfio/common.c | 2 +- hw/vfio/pci-quirks.c | 120 ++++++++++++ hw/vfio/pci.c | 14 ++ hw/vfio/spapr.c | 38 +++- hw/vfio/trace-events | 6 +- 11 files changed, 539 insertions(+), 15 deletions(-)