From patchwork Mon Feb 10 20:41:47 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: 863848 Delivered-To: patch@linaro.org Received: by 2002:a5d:4e42:0:b0:385:e875:8a9e with SMTP id r2csp1792861wrt; Mon, 10 Feb 2025 12:48:09 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWdo9Y3tUE/tOtYYkOu9LrSw1IEiXONf6nr2Qwkl2KMOmbO1HOWtZC6il3k4h//KeqlC9wxYg==@linaro.org X-Google-Smtp-Source: AGHT+IFqBQkqM+f4bnrAPyqs0ma2zIDMHk/OZ/w9AlLxW0Qu7dOCjHF6uXjKMTGURdQ+qGnot3Zr X-Received: by 2002:a05:622a:d3:b0:46c:77a2:5f6e with SMTP id d75a77b69052e-47167a09af6mr233125691cf.18.1739220489078; Mon, 10 Feb 2025 12:48:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1739220489; cv=none; d=google.com; s=arc-20240605; b=bdeBbjBuHF58SzYPahC000ReZCGJlmAptF/sTmVRUlLWNUgWB94ADIzILFl5ToLfR5 c2TQmO8u0jy68mtO9mOrHxAtJVu3AKCyZBPco8P/j5k4y0CPloWbHlG0Xi6KgHrV6zbi pBnGv9rUfp40e10TMaA39dWie5oGyb/8iUsYFZmD2be7i4mJZd1ueUn8iimXCRyQ1xYS R9c/Zm/WWQLhi0nB9cfzNO4zY+iuBLvUjCVID2QkpwoGJGuLVdVtT8ZswKUPzJXKMR3l 5NxbiDWE634pL9QTfGJ3vlWjgA4E7wU9LySvPaotMaRWRYGOrAFL6S/lXbkbwSPhiKFg 9RNA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=AZC1HEaPoraYEpey1ubDRQ5Kf2104vV3xZFjDQTDihc=; fh=brSo76fyPvhtbCe44w+kpwbe2Yhys79ZGQu8l5lsO38=; b=b+uHiMaqKkoSnjTF8giy6VfyRP2TlnZdDMf2SWzbjdSL3J6VcorZRKjXHgsDPk7oix LQTTWxEHhquqHDh2ExIXc601mu/c+4fzIhqYoRQgydYmuKQDwaccNpnHAQntHmF1mnlN VP4hfm9u6SGarFtVKH20AAMxz+NjYJKG8PBAtALHs17qYTRaGhKIYoRvrsolF+j87Pj3 vt9pYuPB+lB14jjv2RrnBpogWBgYF1qz1Rf0Pi2v+Rc5sD0ZSSHP7z7lphR8omLE097I KgpgK5RlcSI8UZWv0eCmSVvJS4iTvfS/Muoeq0Y+zgLUiCt6V6hi3wAruYFqF5BeLlCt ZNbw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=faj4W1oq; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-4718cc6542fsi35077371cf.229.2025.02.10.12.48.08 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 10 Feb 2025 12:48:09 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=faj4W1oq; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1thacv-0007qF-9l; Mon, 10 Feb 2025 15:43:33 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1thacr-0007eY-6P for qemu-devel@nongnu.org; Mon, 10 Feb 2025 15:43:29 -0500 Received: from mail-wr1-x429.google.com ([2a00:1450:4864:20::429]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1thaco-0003hD-S1 for qemu-devel@nongnu.org; Mon, 10 Feb 2025 15:43:28 -0500 Received: by mail-wr1-x429.google.com with SMTP id ffacd0b85a97d-38dd011ff8bso2651776f8f.0 for ; Mon, 10 Feb 2025 12:43:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1739220204; x=1739825004; darn=nongnu.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=AZC1HEaPoraYEpey1ubDRQ5Kf2104vV3xZFjDQTDihc=; b=faj4W1oqgzBP2ZKpi+yrlBS5oo0aaiIXeOW9t0fwh718naNnYnZEILv1JxtuvUS+jl PZjUJfWd0RJWfu+Wfpi36Zox6QbZjTAvze4vv+60XPQ85FmxblkCnmlNXHHZxTVR3CBC kIANNGfcljHMynPlnugWiJ6YOVCA/pcsJjTdWaB+IqxP3s0FSgn6j3Nt3n2HH93oAksX enWgGe2TcswGrC+UgSHabVfeLHsxi/XcxXudBzm6RdapaqexLTVQXEV0+pADjjTbinRy d6w4WagHSePX5RMGd5erlLNpAfkvOJXp9wh8EpTz+kVHrI50QZ7K/QTdEC1xiDnxMJFa lXTA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739220204; x=1739825004; 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=AZC1HEaPoraYEpey1ubDRQ5Kf2104vV3xZFjDQTDihc=; b=aWg1mfwlPPMF5kZJ8MdDKGFAsSCPAMPIuf/LOZLL3I31FfNG4e35BjozZ82jEiIjvp oJpCzTAUfhLtkzgSF8+g3GzEaNlwzmDNrunkVDhivErttbG6toGDJsTxzB1UGdncrIvi Arz6tthgWwmYzpJUM26X5QdVUqYn+9GSqGL4CNBZn+SsiQzH/a2FTZpXsOLPtiiJnKeg II+Vrt6jN3hhBj+lgA8DW1h1dnVxzUJm7ydMpmInlr+kvLt5fCDwsNN4i6iDw7ZboWZg cFDFXHxCU2yGw6/yxy9CT12MPIYon6DFLsZTvNcE2x8yuxvCLTna9O6OUG4GxbET7Pqg mdYw== X-Gm-Message-State: AOJu0YzHljqDDSSIGMiKmRXQvf0gN3Pjke1NWKzg3vZM32IZNUwrAbcK Kz6D1UyWkh59XblyYgqIsYDiG28WZ1Z5CVuSu7z3+5kx2HHGOxPKxUEiQXLOrcy70LFykEdrqq2 sKiE= X-Gm-Gg: ASbGncs5lp9VhUBv5NcJ1oyRfD8Dq7OOC6UZkDRuQtHKquPyTcHphzQYAmRUHqFTTZ3 2lwsxvcgPVz1dfuk0Dz77s7vf+lY119pkfjH1rtLVD0K3NqhkOsXfPHOzkvDQ8pFOvHr7d76ueV hqR5HuZQsfSngznT5NDYsZqdbtvvEYJaAgtLFnuG2lfpkBrYFUMRfWGgIkmyC8JYy8n2/U+QjyP z+//YrihO6/5DG/tG8hdfKshGEa5G6GHFONy6fr9zLE/+9YrGpPdSTN/qsNiATFzeSjjFKtoxKr 6DtUQIfyfzcpavxiWGXVgHd6yEQipBVxCVnh4ZQSO3qKLjoAZQ/esDMdyWJqI4RpSg== X-Received: by 2002:a05:6000:400f:b0:38d:c9f2:c57e with SMTP id ffacd0b85a97d-38dc9f2ccf2mr10364671f8f.32.1739220204046; Mon, 10 Feb 2025 12:43:24 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38dd2ef7efesm8173837f8f.52.2025.02.10.12.43.22 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 10 Feb 2025 12:43:23 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Richard Henderson , Alexander Graf , =?utf-8?q?Cl=C3=A9ment_Mathieu--Drif?= Subject: [PULL 15/32] hw/i386: Have X86_IOMMU devices inherit from DYNAMIC_SYS_BUS_DEVICE Date: Mon, 10 Feb 2025 21:41:47 +0100 Message-ID: <20250210204204.54407-16-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250210204204.54407-1-philmd@linaro.org> References: <20250210204204.54407-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::429; envelope-from=philmd@linaro.org; helo=mail-wr1-x429.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org 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: Richard Henderson Reviewed-by: Alexander Graf Reviewed-by: Clément Mathieu--Drif Message-Id: <20250125181343.59151-7-philmd@linaro.org> --- 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),