From patchwork Sat Jan 25 18:13:34 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: 859834 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:18c8:b0:385:e875:8a9e with SMTP id w8csp1361874wrq; Sat, 25 Jan 2025 10:14:28 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXTGlIyMPzbnpJzBHaBxOhEMYSkGpwSmg/cGc8O/XN7Cw28mlYV4CzepEEEKSWVdx9BcEGP4g==@linaro.org X-Google-Smtp-Source: AGHT+IGtjF1tLH3xtMphzpyqGmpd/EURhuInT1Ivj25c6m8iydaYFFZalnwJeAsvlNHGXm4TeRPj X-Received: by 2002:a05:620a:288c:b0:7b6:ebc6:181a with SMTP id af79cd13be357-7be6324cfb8mr5591199285a.41.1737828868106; Sat, 25 Jan 2025 10:14:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1737828868; cv=none; d=google.com; s=arc-20240605; b=JcHvTMuPi6l6zVdYm/1OKYSYGDevl/YL97rkfQPCTKO+yYXPRv/UyErllooIH+4dll 3xVuKwA/VT0qB1oC2i50imwd7TKLzUp8RVu9XNfht0vzNS82pLmjOtPxYWTUuXAFPtf1 CZaUd7gx2d3WYfQkboUeUZZqzicGUC3WCdz9JV6ivLWCh8XeKTu+ekzBcuhTUWwVxQkc lz41Z0jfSsu9m8tLlKttkfWvptG5F9Eho1a+vssUhobEMlN0zdn6u5aUX0GC6x1h9Om2 gTMGfJHiMauwX8atoWsMxbh9xBaZUSwuMJJXF2mlyAjGtWiPD2kp55Z/dWRNbS3IwNRP +63Q== 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:message-id:date:subject:cc:to:from:dkim-signature; bh=moGB9VY6BYgn3pI64/Eq1yuXgBP6nQhiwk+gTGBd7L0=; fh=lSgLdU5w+Z33tBlibju5IuVtgAS+LqY87YS2H9bpNqE=; b=IfwUhnx/6U2sGY9ZGCjHxQ9uhjQUc5h2wz07ABccG9Ihk/7pbO2g1g53gzbNRwrwCl pD37UtlVQM46NrvP9yVfA6kL0o2YFWE0VTRIFuDcnh22we/R9E3r1FyushpEzZ+M/YK9 Ulcc1G0gplIat0iOJ2jatx0PM/ehI/mfVsASonmqy6L15pu/dcNDaeOAMdprIrBtvSXd cNjfzgu2BS78t35C7zwZc1K3qC0t03+OoQrBkzs/uOQRLjo3wZepZtcPbHG0/TBFtjU4 tm4Ur62mAuDO+VTGEidiSZRkdIN5uKJSzC1igRe/dDZtXRH8Rro59rKZFrVI1TeoluFK hJsQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=rllLpTaP; 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-46e66b87b92si52458771cf.396.2025.01.25.10.14.27 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 25 Jan 2025 10:14:28 -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=rllLpTaP; 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 1tbkfH-00088O-R9; Sat, 25 Jan 2025 13:13:51 -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 1tbkfG-00087h-78 for qemu-devel@nongnu.org; Sat, 25 Jan 2025 13:13:50 -0500 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tbkfE-0004BI-I7 for qemu-devel@nongnu.org; Sat, 25 Jan 2025 13:13:49 -0500 Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-436326dcb1cso20959035e9.0 for ; Sat, 25 Jan 2025 10:13:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737828826; x=1738433626; darn=nongnu.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=moGB9VY6BYgn3pI64/Eq1yuXgBP6nQhiwk+gTGBd7L0=; b=rllLpTaPG2wOZZeTUZWpI6Mc3lTpgHM0IwgqBbn902DneqaVTOZFJ/cE23KwO+u6xT bjBkhmQo3DI44KWnLzsUbsvV5COfiZT+BmmjGqmQtfV896xNHxGT8vQERxgJGc9AVS7l AOdSA5je8dXKnp9hkpG1eK3DPQ3XOs36vNKCYmY+7SwtEQIO47+GGTRMUNV3Gz3VPi1S 05WsOJgXmMQ0AM9hptsLkqtIHqeCR++GhFdYGVxRJZzdsLaFaMs/kOj5vW+6cFz8Rm3o EZ6sI9viKAhd/HjmfINE8ZRlTYFL344k5UKPspEIDxz9LtCvpFvN60bWoohuUTBiMMMv 8ifQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737828826; x=1738433626; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=moGB9VY6BYgn3pI64/Eq1yuXgBP6nQhiwk+gTGBd7L0=; b=fLdpKcpHvn7/p+x0CCCw/vNcvj4rzvSqI63iUjTgWFcbPFSoQZijJVsAuRZvh4sCiB He2/C+1viR/D/pEh1DBQlmMwXptb7kt3pSsG+KUnfx0XY3TRy/dXwwgHKEc/KXd6HxPf 4iBWV7v2271QTVo3M/8BmC/8j4ZBoup7Il88kZIoQmdBsJeFF2Utr+o5BoIUPYOWMT91 0AFwfFKMvfOC2JkQ8lj/W50Ovmje/nmOK64ki/pThq97IO5p+Ux0+Mnw3fpsl8wYJwqM XVmxntZBi+k5IemnV2A1LLUSXypcX61X2LyUk6F146hEfeZD0NitX/Au+R5AFe16CCoc e/QQ== X-Gm-Message-State: AOJu0YziPfLpxTq161UORy4xoCqo0RbnfG1R5sditJapWRbgmeXNmKhP AfpDYk5LC2itsGOH72qDGwbrVeaqPfttW/ONGLAd1xHRdT4rCBFtzkZF77dQL+33HGc7lulQwdT rLeA= X-Gm-Gg: ASbGncsSF1DRed8WWvYDBrBf6ZitlOjBwinZ+iUa6Y3rytYOeM+Wxb+UhJlus0zSoFR PHrlCT2QiF26pB2XKtFYo07WO1UGzS40ZfeNuD3Vhw0LDsvKs8siKNW9fCcZbnHN0Z7BlUFLmHA nXwr5N9QtPoqZuPl/E9AsHa38TNfl7e1TlwQC7pfYD9zFWoGXJdTdb6fN/hGQPxJWkMz68oJ9It Oxj4VujVn+HKmW7XXUwnhXfcNGWcEYPzFULIolNRPcm6/VHOsmh57qFHEktRGNnuWJy4AvAicvH jxwXjwaCwJ0QT4paO8/AhX5RwgWSjQLGMVF2G0vNyIjtsVcGqyOGXDksZoYW X-Received: by 2002:a05:600c:1d07:b0:436:488f:50a with SMTP id 5b1f17b1804b1-438913ef4b7mr333870305e9.17.1737828825695; Sat, 25 Jan 2025 10:13:45 -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-438bd48b000sm70555435e9.20.2025.01.25.10.13.43 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 25 Jan 2025 10:13:44 -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 0/9] hw/sysbus/platform-bus: Introduce TYPE_DYNAMIC_SYS_BUS_DEVICE Date: Sat, 25 Jan 2025 19:13:34 +0100 Message-ID: <20250125181343.59151-1-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32d; envelope-from=philmd@linaro.org; helo=mail-wm1-x32d.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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable 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 Some SysBus devices can optionally be dynamically plugged onto the sysbus-platform-bus (then virtual guests are aware of mmio mapping and IRQs via device tree / ACPI rules). This series makes these devices explicit by having them implement the DYNAMIC_SYS_BUS_DEVICE class, which only sets 'user_creatable' flag to %true but makes the codebase a bit clearer (IMHO, at least now we can grep for DYNAMIC_SYS_BUS_DEVICE). Philippe Mathieu-Daudé (9): hw/sysbus: Use sizeof(BusState) in main_system_bus_create() hw/sysbus: Declare QOM types using DEFINE_TYPES() macro hw/sysbus: Introduce TYPE_DYNAMIC_SYS_BUS_DEVICE hw/vfio: Have VFIO_PLATFORM devices inherit from DYNAMIC_SYS_BUS_DEVICE hw/display: Have RAMFB device inherit from DYNAMIC_SYS_BUS_DEVICE hw/i386: Have X86_IOMMU devices inherit from DYNAMIC_SYS_BUS_DEVICE hw/net: Have eTSEC device inherit from DYNAMIC_SYS_BUS_DEVICE hw/tpm: Have TPM TIS sysbus device inherit from DYNAMIC_SYS_BUS_DEVICE hw/xen: Have legacy Xen backend inherit from DYNAMIC_SYS_BUS_DEVICE include/hw/sysbus.h | 2 ++ include/hw/xen/xen_pvdev.h | 3 +- hw/core/sysbus.c | 53 ++++++++++++++++++++--------------- hw/display/ramfb-standalone.c | 3 +- hw/i386/amd_iommu.c | 2 -- hw/i386/intel_iommu.c | 2 -- hw/i386/x86-iommu.c | 2 +- hw/net/fsl_etsec/etsec.c | 4 +-- hw/tpm/tpm_tis_sysbus.c | 3 +- hw/vfio/amd-xgbe.c | 2 -- hw/vfio/calxeda-xgmac.c | 2 -- hw/vfio/platform.c | 4 +-- hw/xen/xen-legacy-backend.c | 7 ++--- 13 files changed, 42 insertions(+), 47 deletions(-) Reviewed-by: Richard Henderson Reviewed-by: Richard Henderson Reviewed-by: Richard Henderson Reviewed-by: Richard Henderson Reviewed-by: Richard Henderson Reviewed-by: Richard Henderson Reviewed-by: Alexander Graf Reviewed-by: Clément Mathieu--Drif Reviewed-by: Clément Mathieu--Drif Reviewed-by: Clément Mathieu--Drif Reviewed-by: Clément Mathieu--Drif Reviewed-by: Clément Mathieu--Drif Tested-by: Bernhard Beschow Acked-by: Bernhard Beschow