From patchwork Wed Jul 25 14:34:09 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geert Uytterhoeven X-Patchwork-Id: 10544127 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 86B3D17FD for ; Wed, 25 Jul 2018 14:39:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7473F2A1C1 for ; Wed, 25 Jul 2018 14:39:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 682C32A1CC; Wed, 25 Jul 2018 14:39:20 +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=unavailable 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 EC89A2A1C1 for ; Wed, 25 Jul 2018 14:39:18 +0000 (UTC) Received: from localhost ([::1]:51620 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fiKwg-0005gK-6U for patchwork-qemu-devel@patchwork.kernel.org; Wed, 25 Jul 2018 10:39:18 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48548) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fiKrz-00018I-Ug for qemu-devel@nongnu.org; Wed, 25 Jul 2018 10:34:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fiKrw-00068z-VQ for qemu-devel@nongnu.org; Wed, 25 Jul 2018 10:34:27 -0400 Received: from xavier.telenet-ops.be ([2a02:1800:120:4::f00:14]:34208) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fiKrw-00067E-NX for qemu-devel@nongnu.org; Wed, 25 Jul 2018 10:34:24 -0400 Received: from ramsan.of.borg ([84.194.111.163]) by xavier.telenet-ops.be with bizsmtp id F2aJ1y0053XaVaC012aJ9b; Wed, 25 Jul 2018 16:34:22 +0200 Received: from rox.of.borg ([192.168.97.57]) by ramsan.of.borg with esmtp (Exim 4.86_2) (envelope-from ) id 1fiKrq-00051t-4m; Wed, 25 Jul 2018 16:34:18 +0200 Received: from geert by rox.of.borg with local (Exim 4.90_1) (envelope-from ) id 1fiKrq-0002Xk-2e; Wed, 25 Jul 2018 16:34:18 +0200 From: Geert Uytterhoeven To: Peter Maydell , Alex Williamson Date: Wed, 25 Jul 2018 16:34:09 +0200 Message-Id: <20180725143413.9728-1-geert+renesas@glider.be> X-Mailer: git-send-email 2.17.1 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 2a02:1800:120:4::f00:14 Subject: [Qemu-devel] [PATCH v3 0/4] hw/arm/sysbus-fdt: Generic DT Pass-Through 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: Laurent Pinchart , Geert Uytterhoeven , Wolfram Sang , Kieran Bingham , Magnus Damm , qemu-devel@nongnu.org, linux-renesas-soc@vger.kernel.org, Auger Eric , qemu-arm@nongnu.org Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Hi all, This patch series allows to export generic devices in DT using vfio-platform, providing direct access from a QEMU+KVM guest to the exported devices. - Patches 1-2 (submitted before by Eric Auger) make the vfio-platform device non-abstract, incl. matching using a compatible string. - Patch 3 allows dynamic sysbus devices again, without needing to create device-specific vfio types for each and every new device. - Patch 4 adds code to instantiate device nodes for generic DT devices, copying a set of generic properties from the host. This avoids having to write device-specific instantation methods for each and every "simple" device using only a set of generic properties. Devices that need more specialized handling can still provide their own instantation method. Changes compared to v2 (not submitted to the mailing list): - Use the compatible values from sysfs instead of user-supplied manufacturer and model options, - Replace "hw/arm/sysbus-fdt: Enable rcar-gen3-gpio dynamic instatiation" by generic "hw/arm/sysbus-fdt: Add support for instantiating generic devices", - Reword patch descriptions, - Drop RFC state, - Drop "vfio: No-IOMMU mode support". Changes compared to v1 ("R-Car Gen3 GPIO Pass-Through Prototype (QEMU)", https://lists.gnu.org/archive/html/qemu-devel/2018-02/msg02716.html): - Restrict dynamic sysbus devices to TYPE_VFIO_PLATFORM, as suggested by Eric Auger. For proper operation, this depends on "hw/arm/sysbus-fdt: Fix assertion in copy_properties_from_host()" (https://lists.gnu.org/archive/html/qemu-devel/2018-07/msg04922.html). Thanks! For testing, this patch series and all prerequisites are available in the topic/rcar3-virt-gpio-passthrough-v3 branch of my git repository at https://github.com/geertu/qemu.git. This has been tested on a Renesas Salvator-XS board with R-Car H3 ES2.0 with SATA: -device vfio-platform,host=ee300000.sata and GPIO (needs VFIO No-IOMMU support): -device vfio-platform,host=e6055400.gpio Thanks! Auger Eric (2): vfio/platform: Make the vfio-platform device non-abstract hw/arm/sysbus-fdt: Allow device matching with DT compatible value Geert Uytterhoeven (2): hw/arm/virt: Allow dynamic sysbus devices again hw/arm/sysbus-fdt: Add support for instantiating generic devices hw/arm/sysbus-fdt.c | 163 +++++++++++++++++++++++++++++--- hw/arm/virt.c | 1 + hw/vfio/amd-xgbe.c | 1 + hw/vfio/calxeda-xgmac.c | 1 + hw/vfio/platform.c | 22 ++++- include/hw/vfio/vfio-platform.h | 3 +- 6 files changed, 175 insertions(+), 16 deletions(-)