From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47097) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ekAtI-0005Bk-P5 for qemu-devel@nongnu.org; Fri, 09 Feb 2018 10:47:09 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ekAtH-0004hD-TN for qemu-devel@nongnu.org; Fri, 09 Feb 2018 10:47:08 -0500 Received: from mail-oi0-x243.google.com ([2607:f8b0:4003:c06::243]:32960) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ekAtH-0004h3-OD for qemu-devel@nongnu.org; Fri, 09 Feb 2018 10:47:07 -0500 Received: by mail-oi0-x243.google.com with SMTP id l8so6419227oig.0 for ; Fri, 09 Feb 2018 07:47:07 -0800 (PST) MIME-Version: 1.0 In-Reply-To: References: <1518189456-2873-1-git-send-email-geert+renesas@glider.be> <1518189456-2873-4-git-send-email-geert+renesas@glider.be> From: Peter Maydell Date: Fri, 9 Feb 2018 15:46:46 +0000 Message-ID: Content-Type: text/plain; charset="UTF-8" Subject: Re: [Qemu-devel] [PATCH/RFC 3/5] hw/arm/virt: Allow dynamic sysbus devices again List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Geert Uytterhoeven Cc: Geert Uytterhoeven , Alex Williamson , Auger Eric , Xiao Feng Ren , Arnd Bergmann , Alexander Graf , Magnus Damm , Laurent Pinchart , Wolfram Sang , qemu-arm , QEMU Developers , Linux-Renesas On 9 February 2018 at 15:37, Geert Uytterhoeven wrote: > Hi Peter, > > On Fri, Feb 9, 2018 at 4:27 PM, Peter Maydell wrote: >> On 9 February 2018 at 15:17, Geert Uytterhoeven wrote: >>> Allow the instantation of generic dynamic sysbus devices again, without >>> the need to create a new device-specific vfio type. >>> >>> This is a partial revert of commit 6f2062b9758ebc64 ("hw/arm/virt: >>> Allow only supported dynamic sysbus devices"). >>> >>> Not-Yet-Signed-off-by: Geert Uytterhoeven >>> --- >>> hw/arm/virt.c | 1 + >>> 1 file changed, 1 insertion(+) >>> >>> diff --git a/hw/arm/virt.c b/hw/arm/virt.c >>> index b334c82edae9fb1f..fa83784fc08ed076 100644 >>> --- a/hw/arm/virt.c >>> +++ b/hw/arm/virt.c >>> @@ -1596,6 +1596,7 @@ static void virt_machine_class_init(ObjectClass *oc, void *data) >>> mc->max_cpus = 255; >>> machine_class_allow_dynamic_sysbus_dev(mc, TYPE_VFIO_CALXEDA_XGMAC); >>> machine_class_allow_dynamic_sysbus_dev(mc, TYPE_VFIO_AMD_XGBE); >>> + machine_class_allow_dynamic_sysbus_dev(mc, TYPE_SYS_BUS_DEVICE); >>> mc->block_default_type = IF_VIRTIO; >>> mc->no_cdrom = 1; >>> mc->pci_allow_0_address = true; >> >> This needs a lot of justification. Dynamic sysbus is not supposed >> to be for plugging any random sysbus device in, it's for vfio, >> which needs special casing anyway to work right. (Overall it's > > Sure. Is there a way to limit this to vfio devices? That would be the code here which implements the whitelist of "only allow this for the vfio devices which we have support for mangling the device tree for and know will work". >> a terrible hack -- in an ideal world all vfio would use pci >> or another probeable bus.) > > What about vfio-platform, which is my use case? > On DT-based systems, platform devices are described very well in DT (even > better than what's provided by probing PCI IDs and BARs ;-) The TYPE_VFIO_* devices in the whitelist all use DT, yes: the code to handle creating/mangling the dt nodes for the passed-through device is in hw/arm/sysbus-fdt.c. thanks -- PMM