From patchwork Thu Oct 19 07:15:58 2023 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: 735518 Delivered-To: patch@linaro.org Received: by 2002:adf:f0cd:0:b0:32d:baff:b0ca with SMTP id x13csp1378309wro; Thu, 19 Oct 2023 00:18:59 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFyOziepGYrgLIgIH8z0q1iwBfpDA97Ikty4RY32jie/Xo/RSSnpoHfxsHJnouH/PUfoB9u X-Received: by 2002:a67:e009:0:b0:457:4645:a339 with SMTP id c9-20020a67e009000000b004574645a339mr1121709vsl.1.1697699939576; Thu, 19 Oct 2023 00:18:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697699939; cv=none; d=google.com; s=arc-20160816; b=ObAYjEMVW+d3b+3wSOf9M9JIfU/X3DB9PTz+O5Modjcn90o1qyp0y6obenOSIFtuc1 l0yQ8BHK9iOjWQv83bRCuzIN3bUh3jEX6tzhhuOgXJ6y9tyr7A3odwyBYnxcknJ/jrHa 3neYdLf2B+plJu5Q5biUhMTQpBtNSTOy024betwCiEEhjeIdzU5eFdqTh2DPampcJoi7 JJxZNGUAtaJAI/lcnY7x7T7Qmrghy4bX5bAGWuSD900iWzKlw0ubbGI3rEYLJjOUZJIz OQKhDpDJo+nRKYPPyLsPHbReHjIzsvb7ENK/Lu085/ysJYVCkgj9b4hr+iaM1n7WyEoP FKlg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; 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=+EoZC8QJYohplZssBUca1igR4l0fxuTHI687dh8zUaA=; fh=6jYKO1R8PvzdW4tN+W/XYlQifBf+lht0eG+bQc5OUAg=; b=BFJhDFHNJHt+4Onr/BXQiFncieJI/5DaTnUUm9azkF2oL9lnA5Gh+tm6QhkvDQJruH 5eFIv2lho2HywErGKgyWWnM8teViqR4UZksFWotlGfqFPx7G+WmGzAcM61ghCQVB+HlK XS8a8s11X2h7ZVmPYqiNpZOP7+SswdFZlSsCOCpC+dm5CIqW3OX6SK16OWvcz+BP3eXb ps3gfExC4PqsXftIelSrdfhag/bUm8jlssrNlolttK/ZQQc98qznSU1sFmOzDczlJDnL u+eY8CNbr6wsFrOY5FTJFs2k+JuVOEP5e/FV7Ohj6hHqurXbMSvq0kvu+//aK42dF4UR FRzA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=nzjFG+hA; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id e1-20020a0562140d8100b0065aea855463si1225376qve.81.2023.10.19.00.18.59 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 19 Oct 2023 00:18:59 -0700 (PDT) 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=nzjFG+hA; 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 Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qtNGe-0004nw-GY; Thu, 19 Oct 2023 03:16:28 -0400 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 1qtNGZ-0004n4-8q for qemu-devel@nongnu.org; Thu, 19 Oct 2023 03:16:23 -0400 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtNGX-00038i-BZ for qemu-devel@nongnu.org; Thu, 19 Oct 2023 03:16:23 -0400 Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-40651a726acso66550385e9.1 for ; Thu, 19 Oct 2023 00:16:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697699778; x=1698304578; 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=+EoZC8QJYohplZssBUca1igR4l0fxuTHI687dh8zUaA=; b=nzjFG+hA/e77ESZnnCjeiEBKAItftXlWew6k/3xW8BoBAO+pN6ApLbAHY2Zl58V5nW yaxOnG3vKnoZ1LqiRSTx5hi2iW5Xojof+p/35NvL7vFQfOKPb4mOiOkQAZ5MjMIs5vIO rIvECmMus9y/EJ0IoKr1FtvDB0fqCGcPnuYwdPya8GvVuIiBG+9etvBeWGXLaAK7vZT2 gsXzLfeRzEjhw+c0iRiMq6mi7Uw7/OlJA7avd3pcaJZrF6YDd2mTr6k2NAfuzBpMumdZ yd7r4wJW2/XElbfLleYVMPwrAtGDDRd8Ae+nUAcCCZWCbB5blFemoHmX0zGkx0ceIZat X/PA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697699778; x=1698304578; 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=+EoZC8QJYohplZssBUca1igR4l0fxuTHI687dh8zUaA=; b=YPoc/nNtq2lJD55HXBU1p1e1ZAc8UkyS/vyDAu3maTi5zHoTStN/uYfeO/eqyygfHz O2xjYJc33iBGCS/MwmwKzbUXwy6NWmJKBu27GLSU6CQRkFh7n89iw7vARJEJTUFCI3oG jyETWNmQW45n+3bZ6z3i2kzXFo2S3rUzFeYreDZGE294lNOSWy7BIQVpCUsNb3P/+3GX zXspOK4phEVt3PVDHLPyVf++YYY+gQ734cdXPMvhX1j8E9SAUK6VY7UZyU4VgKo3EUGk DqUzreplaRIxka3DX4T6Mtw9mkOpoGMQKqm0G58fNqJuh0zCn94NOG6ZjNLnJRaHSWjB vlAA== X-Gm-Message-State: AOJu0Yy6GAHIiQBuTYJgLJfaGy1yiG+pfnLKMIp3RdClSaYaEf9lNKd0 bCU/IFN4o1pJXfd+40KcNjIbhoF4sCRDipnRFiuJTQ== X-Received: by 2002:adf:e8ca:0:b0:32d:9395:dec6 with SMTP id k10-20020adfe8ca000000b0032d9395dec6mr915133wrn.67.1697699778520; Thu, 19 Oct 2023 00:16:18 -0700 (PDT) Received: from localhost.localdomain (92.red-88-28-12.dynamicip.rima-tde.net. [88.28.12.92]) by smtp.gmail.com with ESMTPSA id n15-20020a5d4c4f000000b0032dc24ae625sm3763417wrt.12.2023.10.19.00.16.13 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 19 Oct 2023 00:16:18 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Ilya Leoshkevich , Halil Pasic , Huacai Chen , Beniamino Galvani , Thomas Huth , Jiaxun Yang , Marcel Apfelbaum , qemu-arm@nongnu.org, Mark Cave-Ayland , Eric Farman , Paolo Bonzini , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , qemu-s390x@nongnu.org, Strahinja Jankovic , Richard Henderson , Markus Armbruster , Song Gao , Eduardo Habkost , Peter Xu , Sergio Lopez , Christian Borntraeger , David Hildenbrand , Peter Maydell , "Michael S. Tsirkin" , Jason Wang Subject: [PATCH v2 00/12] hw: Strengthen SysBus & QBus API Date: Thu, 19 Oct 2023 09:15:58 +0200 Message-ID: <20231019071611.98885-1-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::334; envelope-from=philmd@linaro.org; helo=mail-wm1-x334.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 Hi, This series ensure: - qbus_new() and sysbus_init_mmio() are called *before* a device is realized, - sysbus_mmio_map() is called *after* it is realized. First we fix some abuse, then we enforce in qdev/sysbus core code. There is still a failure in PXA2xx: qemu-system-aarch64: sysbus_init_mmio(type:pxa2xx_pic) but object is realized Apparently it cames from commit 3f6c925f37 ("Use i2c_slave_init() to allocate the PXA (dummy) I2C slave"), which I presume was how to model slave<->master transactions *before* I2C bus modelling. Based-on: <20231018133059.85765-1-philmd@linaro.org> "hw/ppc: SysBus simplifications" [1] Based-on: <20231018131220.84380-1-philmd@linaro.org> "hw/arm/pxa2xx: SysBus/QDev fixes" [2] v1: https://lore.kernel.org/qemu-devel/20231018141151.87466-1-philmd@linaro.org/ [1] https://lore.kernel.org/qemu-devel/20231018133059.85765-1-philmd@linaro.org/ [2] https://lore.kernel.org/qemu-devel/20231018131220.84380-1-philmd@linaro.org/ Philippe Mathieu-Daudé (12): hw/i386/amd_iommu: Do not use SysBus API to map local MMIO region hw/i386/intel_iommu: Do not use SysBus API to map local MMIO region hw/misc/allwinner-dramc: Move sysbus_mmio_map call from init -> realize hw/misc/allwinner-dramc: Do not use SysBus API to map local MMIO region hw/pci-host/bonito: Do not use SysBus API to map local MMIO region hw/acpi: Realize ACPI_GED sysbus device before accessing it hw/arm/virt: Realize ARM_GICV2M sysbus device before accessing it hw/isa: Realize ISA BUS sysbus device before accessing it hw/s390x/css-bridge: Realize sysbus device before accessing it hw/qdev: Ensure parent device is not realized before adding bus hw/sysbus: Ensure device is not realized before adding MMIO region hw/sysbus: Ensure device is realized before mapping it hw/arm/virt.c | 5 ++--- hw/core/bus.c | 7 +++++++ hw/core/sysbus.c | 13 +++++++++++++ hw/i386/amd_iommu.c | 5 ++--- hw/i386/intel_iommu.c | 5 ++--- hw/i386/microvm.c | 2 +- hw/isa/isa-bus.c | 11 +++++++++-- hw/loongarch/virt.c | 2 +- hw/misc/allwinner-r40-dramc.c | 20 +++++++++----------- hw/pci-host/bonito.c | 32 ++++++++++++++++---------------- hw/s390x/css-bridge.c | 7 +++---- 11 files changed, 65 insertions(+), 44 deletions(-)