From patchwork Sat Jan 25 18:13:40 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: 13950486 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 4E1E6C0218F for ; Sat, 25 Jan 2025 18:14:29 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.877028.1287260 (Exim 4.92) (envelope-from ) id 1tbkfk-0006kx-Ds; Sat, 25 Jan 2025 18:14:20 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 877028.1287260; Sat, 25 Jan 2025 18:14:20 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1tbkfk-0006ko-9d; Sat, 25 Jan 2025 18:14:20 +0000 Received: by outflank-mailman (input) for mailman id 877028; Sat, 25 Jan 2025 18:14:19 +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 1tbkfj-000565-OA for xen-devel@lists.xenproject.org; Sat, 25 Jan 2025 18:14:19 +0000 Received: from mail-wm1-x32c.google.com (mail-wm1-x32c.google.com [2a00:1450:4864:20::32c]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 310dec10-db48-11ef-99a4-01e77a169b0f; Sat, 25 Jan 2025 19:14:18 +0100 (CET) Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-43621d27adeso20827385e9.2 for ; Sat, 25 Jan 2025 10:14:18 -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-438bd54c066sm67839795e9.29.2025.01.25.10.14.16 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 25 Jan 2025 10:14:17 -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: 310dec10-db48-11ef-99a4-01e77a169b0f DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737828857; x=1738433657; 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=w1nS9BzjJB0tn/0Fa9F2b1T3lbd2oKgl5iwd0JMSerQ=; b=eFBesdrMiTebZm1ezPYRTAvmBhUY8ufXa/xDBnjmUG+JoObKcl5SVBTtErKJ6Q5OZd NKGc7poeu4rMJZYvL8b9ZACIV/3jYYv4DNcXxlbTjg8bc8XPE6gIunmzXmetxMIxin1c P/gUe/7om8FeRyQ/uJV05QG+27iaZCWqSOztVXUFrvMVsQpYMTb2T0YogbLL/n8FUbef YEPOD71TZ4TyFgRVcg7LS8e8coqPPFoc8l7fi62dhwRLswqE12kUWhh+DkkRWdgESv2a ZxslaYQqLy4aNcvb0z/t7vaib6/loY40lhhfhf88MFcjhDDK/eOM3RetiBMfkZtut4na 8WVg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737828857; x=1738433657; 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=w1nS9BzjJB0tn/0Fa9F2b1T3lbd2oKgl5iwd0JMSerQ=; b=nzR1nYkO0O5SN9fnno2gLb/ASD4Br/YOcBXpOz+Adki+lJiiOQ+okjdTF84S8xKb/X ouckhldsy/W3+Zbp7eIPKQMqj8OUqFX6Q/dUNMteB//synICe3wQ5WOstyFoAIRTnv3i D/Ke08WSShT6JP9ZbPOmtpapD4+ISTGHXDHllAZ1PgvopB40Xy2g6s0cAjjSdwxCLI62 MfjHYhg4/H4H5tumrIs30QecZGkK5vVhmVjwwkFKDMIsYg8ibyDKv/24GgIqb+qvhIJz 5g/7cQmRiMpvSPoWFfTYtjBoPkqFQaDdM4KTbtNcx7XDgxHwOE8jbqQHxQ+RsOzFliT+ eqUw== X-Forwarded-Encrypted: i=1; AJvYcCWWgYJjpyk+aRgpdi1x4VB6xsGZgxIg4HY8adbX84KhjQBWeof2GzfbatHzac9Uu8bZcNzfReTpGTs=@lists.xenproject.org X-Gm-Message-State: AOJu0YztDwgM9J/NJHY4gzonZej7jMEUG8NxNuWcqIqoh9BC0OtmhClC 3noXXPXuD8giH6AzzLn+zSxGdDJuKM9ESZdTUTeetho00IK6U2cq0m6sRgCwV9Q= X-Gm-Gg: ASbGncs58a7Og6w6sxS8HupobpRQUF3PzFdwcpC9Aep1uEAW4mtBHMMqLZFdYEl/8es JOcKbLGOvZD/l62m+AYDOjZJAElqb+Sk4erUhaPM1pgPzQmPAAq+kjPUFvyA6HykrEgjmT3e9+G S24+1fiSHqa6lGyMwbf1xARLS9Lwcgwkxc25lLyUIblzDPapZbfvcjAyYnEIeTe0KnqFYqCPkMS VO+DjvKJN6C00t5yyEGDf74Fo1YG2ps7v0pyjelDtBREDv5EU9RHfYT0F4W3VmpXtixFxGMGq+d jQfGVU0trR4857vR9lnx66a/dG8iex8/7dKYRw/RpI4s4lQvFGaJr9ecMc26 X-Google-Smtp-Source: AGHT+IE5XUCSuHVVDMagGbiF8o/U1zOarBMIVGYFxMB07VQ6SArrPMMpgZuB4UE+b0bVMHzNNBLvMA== X-Received: by 2002:a7b:cc8f:0:b0:438:a214:52f4 with SMTP id 5b1f17b1804b1-438a2145332mr233337725e9.25.1737828857490; Sat, 25 Jan 2025 10:14:17 -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 6/9] hw/i386: Have X86_IOMMU devices inherit from DYNAMIC_SYS_BUS_DEVICE Date: Sat, 25 Jan 2025 19:13:40 +0100 Message-ID: <20250125181343.59151-7-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 _X86_IOMMU 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é Reviewed-by: Clément Mathieu--Drif --- hw/i386/amd_iommu.c | 2 -- hw/i386/intel_iommu.c | 2 -- hw/i386/x86-iommu.c | 2 +- 3 files changed, 1 insertion(+), 5 deletions(-) diff --git a/hw/i386/amd_iommu.c b/hw/i386/amd_iommu.c index 6b13ce894b1..e8e084c7cf8 100644 --- a/hw/i386/amd_iommu.c +++ b/hw/i386/amd_iommu.c @@ -1687,8 +1687,6 @@ static void amdvi_sysbus_class_init(ObjectClass *klass, void *data) dc->hotpluggable = false; dc_class->realize = amdvi_sysbus_realize; dc_class->int_remap = amdvi_int_remap; - /* Supported by the pc-q35-* machine types */ - dc->user_creatable = true; set_bit(DEVICE_CATEGORY_MISC, dc->categories); dc->desc = "AMD IOMMU (AMD-Vi) DMA Remapping device"; device_class_set_props(dc, amdvi_properties); diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.c index f366c223d0e..7fde0603bfe 100644 --- a/hw/i386/intel_iommu.c +++ b/hw/i386/intel_iommu.c @@ -4871,8 +4871,6 @@ static void vtd_class_init(ObjectClass *klass, void *data) dc->hotpluggable = false; x86_class->realize = vtd_realize; x86_class->int_remap = vtd_int_remap; - /* Supported by the pc-q35-* machine types */ - dc->user_creatable = true; set_bit(DEVICE_CATEGORY_MISC, dc->categories); dc->desc = "Intel IOMMU (VT-d) DMA Remapping device"; } diff --git a/hw/i386/x86-iommu.c b/hw/i386/x86-iommu.c index fed34b2fcfa..5cdd165af0d 100644 --- a/hw/i386/x86-iommu.c +++ b/hw/i386/x86-iommu.c @@ -146,7 +146,7 @@ bool x86_iommu_ir_supported(X86IOMMUState *s) static const TypeInfo x86_iommu_info = { .name = TYPE_X86_IOMMU_DEVICE, - .parent = TYPE_SYS_BUS_DEVICE, + .parent = TYPE_DYNAMIC_SYS_BUS_DEVICE, .instance_size = sizeof(X86IOMMUState), .class_init = x86_iommu_class_init, .class_size = sizeof(X86IOMMUClass),