From patchwork Sat Jan 25 18:13:38 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 13950484 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8652FC0218C for ; Sat, 25 Jan 2025 18:14:19 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.877012.1287240 (Exim 4.92) (envelope-from ) id 1tbkfa-0005ri-TD; Sat, 25 Jan 2025 18:14:10 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 877012.1287240; Sat, 25 Jan 2025 18:14:10 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1tbkfa-0005rb-Pt; Sat, 25 Jan 2025 18:14:10 +0000 Received: by outflank-mailman (input) for mailman id 877012; Sat, 25 Jan 2025 18:14:08 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1tbkfY-000565-Th for xen-devel@lists.xenproject.org; Sat, 25 Jan 2025 18:14:08 +0000 Received: from mail-wm1-x335.google.com (mail-wm1-x335.google.com [2a00:1450:4864:20::335]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 2abdfab3-db48-11ef-99a4-01e77a169b0f; Sat, 25 Jan 2025 19:14:07 +0100 (CET) Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-43622267b2eso32316685e9.0 for ; Sat, 25 Jan 2025 10:14:07 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-438bd4857c3sm68307685e9.10.2025.01.25.10.14.05 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 25 Jan 2025 10:14:06 -0800 (PST) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 2abdfab3-db48-11ef-99a4-01e77a169b0f DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737828847; x=1738433647; darn=lists.xenproject.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=dyOkRsNGVEWSIU/g0zj3C7+UfvVjzQgLwIYDoErjrzY=; b=E3O265wl8yaUU469AX64Lx2fHgrT11jgPvGuwnNbs2wApqv2zuUVgkd+ZrCcHWzbM9 nuyw1pl9S3/SGydU1n4FEQkHTZsiIn2G47jTsnv1ckFrstQHyVBvQMz97zeIBRnDcGGv fBNp9dx2OkOGMJej9nItABW5MVvQJ4hy1DsdkT6Lr+NUi5/PNLq7lrg4GvgL4o3gqqql yz6Fec8OtOElEzfzMHdqt3qWT9vYR4bAlQOWnV/ZZhiqOw09spIhL8HtdlwISu32SCXG 3VERGi0PMk8dIp/1dB5kCAZWYUeMeeMRw2WSpnmoXsj7PST+0dz58etulVZHCfR+5T7G jMHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737828847; x=1738433647; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=dyOkRsNGVEWSIU/g0zj3C7+UfvVjzQgLwIYDoErjrzY=; b=h4LxTu31Svs5wse0ClHatCNPvzJjf2/ylBctYZwijYPYY3si4YYbL/PtW30ZRntQ9W ZZAPR2QDHL/usRKB26UlzJ6r14gjghKAhe51BERYPhsdvpIb3Lra7T11YZ2A7tanyDjo wII+1DHMGwmmmK2bDtmKU/FC9j3hZF+9NRFf15b+5Kq4TpdRlPglJUp/plkDoDL3HJwM VSP2dvvSSDE8UamZsgltB9AKm3XWtZgU+cLR8gBXihaFzn1Y4/q0J+mrSOsNxv+q5ojt /T1m7XZtkYmJN8gVPPNn11bH2uyLUMncQlo1FgbF6A5CxUEYCV5J1pmfva4E0QpReDhy LqOA== X-Forwarded-Encrypted: i=1; AJvYcCWvH5oNEE6kesSQPUmc8gwMEAsOb0ByRbnRM4+OGHF4Q70glcTw4AkGFi0QuMbHa+2Ayl7JMF1jo68=@lists.xenproject.org X-Gm-Message-State: AOJu0YyHTLGjFrv+XELr7wZKoXqGUOHp68I0a5rBIKnvEHoHYGhUyCEU +Nt45C0J8dhzBteka9c/cZgoD2qNleD/7bai5ht/UCD44QyGjxsmkrV2QAnzYOk= X-Gm-Gg: ASbGncueZI9WCvpTZEWH6bRl7tPNeZ9YERv2TxwhJXJb5ljXkSZhViWAa5EdlLcDbbi X2A9rDoFdiXBNHg6XyCiWCU320hrUi4C18xlogxUB1py73TC4n77dZr//2SjFG1DT5+ecbUWNlR X7dZ4wbPapr0wqnJm7U6aMuO2CHeXMqYgK0JP2wizTYrPljzCUdAdWVfEyMN5JpmtppfKqO6YFC /qn4rEc5bTkv4LNnZveFzogViDkkPzJ07cR408jjI92vSRsS/ODiyGJojh4aFdKyC60985/21i3 M4Y6/uybwhirkxOTK5jMURmdG3vwxFv8rIMdqb5vW0Q4KuytN2ysErF+xaWm X-Google-Smtp-Source: AGHT+IEr2qoA1rRQRSxzBRg9AaVRyh1DsB0c2e066JVheh7W35FZo8o118MnJ47nSIRaQRkoz3MpFg== X-Received: by 2002:a05:600c:468d:b0:436:4708:9fb6 with SMTP id 5b1f17b1804b1-43891437546mr293523335e9.20.1737828846888; Sat, 25 Jan 2025 10:14:06 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Yi Liu , Markus Armbruster , Eduardo Habkost , Anthony PERARD , Gustavo Romero , Jason Wang , qemu-ppc@nongnu.org, "Michael S. Tsirkin" , Paolo Bonzini , Alexander Graf , Richard Henderson , Stefan Berger , Bernhard Beschow , Stefano Stabellini , Gerd Hoffmann , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , "Edgar E. Iglesias" , xen-devel@lists.xenproject.org, Marcel Apfelbaum , Alex Williamson , Paul Durrant , =?utf-8?q?Cl=C3=A9ment_Mathieu--Drif?= , =?utf-8?q?C=C3=A9dric_Le_Goater?= , =?utf-8?q?Philippe_Math?= =?utf-8?q?ieu-Daud=C3=A9?= Subject: [PATCH 4/9] hw/vfio: Have VFIO_PLATFORM devices inherit from DYNAMIC_SYS_BUS_DEVICE Date: Sat, 25 Jan 2025 19:13:38 +0100 Message-ID: <20250125181343.59151-5-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250125181343.59151-1-philmd@linaro.org> References: <20250125181343.59151-1-philmd@linaro.org> MIME-Version: 1.0 Do not explain why VFIO_PLATFORM devices are user_creatable, have them inherit TYPE_DYNAMIC_SYS_BUS_DEVICE, to explicit they can optionally be plugged on TYPE_PLATFORM_BUS_DEVICE. Signed-off-by: Philippe Mathieu-Daudé --- hw/vfio/amd-xgbe.c | 2 -- hw/vfio/calxeda-xgmac.c | 2 -- hw/vfio/platform.c | 4 +--- 3 files changed, 1 insertion(+), 7 deletions(-) diff --git a/hw/vfio/amd-xgbe.c b/hw/vfio/amd-xgbe.c index 96bd608b8dd..aaa96903db0 100644 --- a/hw/vfio/amd-xgbe.c +++ b/hw/vfio/amd-xgbe.c @@ -41,8 +41,6 @@ static void vfio_amd_xgbe_class_init(ObjectClass *klass, void *data) &vcxc->parent_realize); dc->desc = "VFIO AMD XGBE"; dc->vmsd = &vfio_platform_amd_xgbe_vmstate; - /* Supported by TYPE_VIRT_MACHINE */ - dc->user_creatable = true; } static const TypeInfo vfio_amd_xgbe_dev_info = { diff --git a/hw/vfio/calxeda-xgmac.c b/hw/vfio/calxeda-xgmac.c index 87c382e7361..b016d42b496 100644 --- a/hw/vfio/calxeda-xgmac.c +++ b/hw/vfio/calxeda-xgmac.c @@ -41,8 +41,6 @@ static void vfio_calxeda_xgmac_class_init(ObjectClass *klass, void *data) &vcxc->parent_realize); dc->desc = "VFIO Calxeda XGMAC"; dc->vmsd = &vfio_platform_calxeda_xgmac_vmstate; - /* Supported by TYPE_VIRT_MACHINE */ - dc->user_creatable = true; } static const TypeInfo vfio_calxeda_xgmac_dev_info = { diff --git a/hw/vfio/platform.c b/hw/vfio/platform.c index 1070a2113a1..f491f4dc954 100644 --- a/hw/vfio/platform.c +++ b/hw/vfio/platform.c @@ -672,13 +672,11 @@ static void vfio_platform_class_init(ObjectClass *klass, void *data) dc->desc = "VFIO-based platform device assignment"; sbc->connect_irq_notifier = vfio_start_irqfd_injection; set_bit(DEVICE_CATEGORY_MISC, dc->categories); - /* Supported by TYPE_VIRT_MACHINE */ - dc->user_creatable = true; } static const TypeInfo vfio_platform_dev_info = { .name = TYPE_VFIO_PLATFORM, - .parent = TYPE_SYS_BUS_DEVICE, + .parent = TYPE_DYNAMIC_SYS_BUS_DEVICE, .instance_size = sizeof(VFIOPlatformDevice), .instance_init = vfio_platform_instance_init, .class_init = vfio_platform_class_init,