From nobody Wed Nov 27 14:33:47 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1697721457; cv=none; d=zohomail.com; s=zohoarc; b=UI3Hc+ohWLDgnBL9/TPQzgzIOZMSzce7uCy6fcywFm25yaC84gjj4w1TBzMhNJpYDQTEOP4o1DzVsLu5mC3cG6eJ9EGVXiYSvwMgRCPjngAIXdwYfikQhqTz4YQZG7GsYwkZCpqOzYqhDtBo3QDOuMcDEkWB6Fdgz7ziCkbcrW8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1697721457; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=8v7QjsFI/UQ66aMELorogiH5Qo/GKGcFOriZN36zvBM=; b=dWPpResUS4OLNGgHGnubyLRR+jAmjkqQ35ys350/jR8z0PCJgBuRUuSGPra/gP8xSDHHJGRwO0539Rq4Ii/z/vxbEVZRvJvI1uYdv+8lAM2Rdhg9Mz0RbU2b9nrgDsOJsIloECkbStD8PEwmbDEOBtst8BWiIJe50ZYMcykpShQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1697721457077513.4760186046478; Thu, 19 Oct 2023 06:17:37 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qtStd-00006o-0U; Thu, 19 Oct 2023 09:17:05 -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 1qtStb-00004s-1c for qemu-devel@nongnu.org; Thu, 19 Oct 2023 09:17:03 -0400 Received: from mail-ej1-x631.google.com ([2a00:1450:4864:20::631]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtStZ-0003kY-BJ for qemu-devel@nongnu.org; Thu, 19 Oct 2023 09:17:02 -0400 Received: by mail-ej1-x631.google.com with SMTP id a640c23a62f3a-9c603e2354fso168511966b.1 for ; Thu, 19 Oct 2023 06:17:00 -0700 (PDT) Received: from m1x-phil.lan (176-131-216-177.abo.bbox.fr. [176.131.216.177]) by smtp.gmail.com with ESMTPSA id gx17-20020a1709068a5100b00992e94bcfabsm3463588ejc.167.2023.10.19.06.16.56 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 19 Oct 2023 06:16:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697721418; x=1698326218; 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=8v7QjsFI/UQ66aMELorogiH5Qo/GKGcFOriZN36zvBM=; b=JNwsx9LVnZcvc1k2iMugIvXUUvr8KTzegk/9Luilhca+0b/LUnoymgZtXcQy5FP5DS hz8sWO1laYSnekYSuglSZtOuaeHoDFw5P27Z4eQeml7rVho5n68Z69kxRlUGFud0Ls4E TBBzdtQrS2WPZBsEgMwAasEpYsQ0v4lskBf2GAMHT9WPPeQBR2/vvlDqjU2kVN5liglu YUaz+vwQj/x0uXA9FxvtzZKejuPaKzKdUKB4T7EqLLNbjYEy1IiqpgCzXdVqEq9tfsNg K9Y5g0+YcP39CJxyP9beAvAqaec8woT7RLuIzA6m1F3IDpYYBJ+I6mrFhhKKicwJFPSL Mx9Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697721418; x=1698326218; 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=8v7QjsFI/UQ66aMELorogiH5Qo/GKGcFOriZN36zvBM=; b=SSe7RZ8eeDCdXSBsZ7Z2XM7NQB4PH9Git2DcYC2kVmuigD12hRzcZRdfL9gX2tdW6n JrLcdwHCiB3zqLPPFkEAfsb1Fl3AvRJlTcvQvX5vBEw9xwlIxJKAZh9uR7BQaXk+yZGV fiSV9ZMKITutvYmqhzzXBxHWFTFGnTpgV3Uup9VBQKlFROV7KTw4JSXIAGNB2LbHj2c6 3oYrpDQEwihiI/TfVSFUWKH8qTQfrqvPRs8IucLLbN11CEYeGgC1UBQ2h++eFardSyf3 B/DnmLCiXRUmVkxPM0rWRDGo/kMKEoorCu91JdS72uxuAqV+2Txwqartxek2nD500lph lADg== X-Gm-Message-State: AOJu0YwmFywo9PzUdJ2DiY5hUAsbIGfjBEc2ZxFkD2jzVKv6RVPldozR xVOoK2CwUVMb7tTY1t6XUBkct7V23e7G+OFUKEbytA== X-Google-Smtp-Source: AGHT+IGUQ1O50AWq59MWxV9+yzXQWKxNwOCCAgZ2MluUPleF12o2dyGbCwOrp8IujdMbZeBu3AJHVA== X-Received: by 2002:a17:907:2d0f:b0:9ba:8ed:ea58 with SMTP id gs15-20020a1709072d0f00b009ba08edea58mr1744308ejc.30.1697721418141; Thu, 19 Oct 2023 06:16:58 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Richard Henderson , LIU Zhiwei , Nicholas Piggin , qemu-ppc@nongnu.org, David Gibson , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Daniel Henrique Barboza , Harsh Prateek Bora , Thomas Huth , =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Barrat?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v3 1/7] hw/ppc/spapr_vio: Realize SPAPR_VIO_BRIDGE device before accessing it Date: Thu, 19 Oct 2023 15:16:41 +0200 Message-ID: <20231019131647.19690-2-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231019131647.19690-1-philmd@linaro.org> References: <20231019131647.19690-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::631; envelope-from=philmd@linaro.org; helo=mail-ej1-x631.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=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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1697721459128100003 qbus_new() should not be called on unrealized device. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: C=C3=A9dric Le Goater Reviewed-by: Thomas Huth --- hw/ppc/spapr_vio.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/ppc/spapr_vio.c b/hw/ppc/spapr_vio.c index 9d4fec2c04..f8ef2b6fa8 100644 --- a/hw/ppc/spapr_vio.c +++ b/hw/ppc/spapr_vio.c @@ -574,13 +574,14 @@ SpaprVioBus *spapr_vio_bus_init(void) =20 /* Create bridge device */ dev =3D qdev_new(TYPE_SPAPR_VIO_BRIDGE); - sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal); =20 /* Create bus on bridge device */ qbus =3D qbus_new(TYPE_SPAPR_VIO_BUS, dev, "spapr-vio"); bus =3D SPAPR_VIO_BUS(qbus); bus->next_reg =3D SPAPR_VIO_REG_BASE; =20 + sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal); + /* hcall-vio */ spapr_register_hypercall(H_VIO_SIGNAL, h_vio_signal); =20 --=20 2.41.0 From nobody Wed Nov 27 14:33:47 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1697721487; cv=none; d=zohomail.com; s=zohoarc; b=RZth5u4PzyrCRXpoPuWwEyMg7sr1eAdTWqvP8Ne2mBpPNHbotv/XxFVsZiI8pKH1+z2I4CvabZwNMyqUaw5JIR71kPKg8Bp/psLI92iK+69gw3gnK0P+FuJW4fTqRHCffnAsmbadIus24wyyKdiU87z0h7nBJlHU/qLtq1FjGJM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1697721487; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=ldJFXb9fdD2sfJu6FP/y4XyBQnTwT0OjDzwlspACaHE=; b=EgNL1q5Imz6YtKj+jzthLZe972MCva6JLGiCrSDL1HIpD/9ghL5NHXmVJYAz2M3HBs8DskvpGWh6MCTxN0IFAl0Fipb59G1qlVGgC6dwT9OUjR3Q9xaonhNq4O0ogz3qAkakG1tEbfLPZG4GBx0eQrlXuD3zJwGnxh64NoVycSw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 16977214875965.381244998877946; Thu, 19 Oct 2023 06:18:07 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qtSuJ-0000P4-4D; Thu, 19 Oct 2023 09:17:47 -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 1qtSti-00009f-KQ for qemu-devel@nongnu.org; Thu, 19 Oct 2023 09:17:18 -0400 Received: from mail-ej1-x633.google.com ([2a00:1450:4864:20::633]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtStg-0003m0-GR for qemu-devel@nongnu.org; Thu, 19 Oct 2023 09:17:10 -0400 Received: by mail-ej1-x633.google.com with SMTP id a640c23a62f3a-9be02fcf268so948163366b.3 for ; Thu, 19 Oct 2023 06:17:08 -0700 (PDT) Received: from m1x-phil.lan (176-131-216-177.abo.bbox.fr. [176.131.216.177]) by smtp.gmail.com with ESMTPSA id qq20-20020a17090720d400b00997e99a662bsm3544760ejb.20.2023.10.19.06.17.02 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 19 Oct 2023 06:17:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697721425; x=1698326225; 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=ldJFXb9fdD2sfJu6FP/y4XyBQnTwT0OjDzwlspACaHE=; b=c/BBzh4oXBRMC0TDq4XMv9aSSM1ZadqILTg8dgf80riug5WNh/GC4OQ48g4DNjNATB oSB1ZUTTZ+zg42TJSXdOCKuVxifmoCRjAp+KvdhI0n4Bg4fyFdHlXaNeNxdgizwhEoEX DgrIi5J0GB1jFvEIzbBBi0F8kjSD3QVWxHD97NQ9/soMw7cQbS+iSoXeeGMaU+KHedRg yekYTWEf6+PLr/yg5mw3BH8BQ593oxwV0XXCyAnxZ+HGhHma5hjDToM8Cu/7N+Q0SKT9 CqnG7abEuATJ+399paqO6R/CMr33xv2jc94u/JPL28pLq2uOcm/iyKqAlmx+dq6UaMCf B2sw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697721425; x=1698326225; 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=ldJFXb9fdD2sfJu6FP/y4XyBQnTwT0OjDzwlspACaHE=; b=kW57UiYx5AUCKJqpKkJ8lx6bJlYMkN/LQxZ3FhsNC6CAQpnJqf/b+azNSkxvVeJBoP h+hwFgqIAtFaSCXp8hw1x+hQ2Rr0JrJKQRjRjpNIuDK1WUa8BzwFYeHxYjVPhI1OfLch HNE13RlEHK9xdCTPRFi1vlvMrMJmHPvqsHgsqftwmKBVoKqT9gICmGVR3d2Nc+/LYcCz n3q/wHZD8CuqpYz+8j3rD5MI/R6qE05apGE+ut6Gr3l3PvZEeWEoRVv3Pu45yxGT4GLb 7kd9vkrqHpI+QA2L/5xUYV6hAFGa75p2RUcLRh5g5jgN4r/U94o2GRlaRUvNT1bW9fvT SvoQ== X-Gm-Message-State: AOJu0Yw4OPYIoSATmKPZHj3wfM3mWr5LRb5CTjSQjlrowgHSXgJQXeCL 41VuGS4HnkAnmwkoYnGQSLp/XAqPlL0y3Ml9LrCrLQ== X-Google-Smtp-Source: AGHT+IHRF8ty9YL0dEqLoLr3yIJIHhp0JGV+nxVe/fi5DQ7WoUmpsRLU7iSbm+t79cCCwqudiaYTxQ== X-Received: by 2002:a17:907:2d10:b0:9b2:cf77:a105 with SMTP id gs16-20020a1709072d1000b009b2cf77a105mr1544701ejc.15.1697721424881; Thu, 19 Oct 2023 06:17:04 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Richard Henderson , LIU Zhiwei , Nicholas Piggin , qemu-ppc@nongnu.org, David Gibson , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Daniel Henrique Barboza , Harsh Prateek Bora , Thomas Huth , =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Barrat?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v3 2/7] hw/ppc/pnv_xscom: Rename pnv_xscom_realize(Error **) -> pnv_xscom_init() Date: Thu, 19 Oct 2023 15:16:42 +0200 Message-ID: <20231019131647.19690-3-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231019131647.19690-1-philmd@linaro.org> References: <20231019131647.19690-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::633; envelope-from=philmd@linaro.org; helo=mail-ej1-x633.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=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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1697721489172100003 pnv_xscom_realize() is not used to *realize* QDev object, rename it as pnv_xscom_init(). The Error** argument is unused: remove it. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Reviewed-by: Thomas Huth Reviewed-by: LIU Zhiwei Reviewed-by: C=C3=A9dric Le Goater --- include/hw/ppc/pnv_xscom.h | 2 +- hw/ppc/pnv.c | 18 +++--------------- hw/ppc/pnv_xscom.c | 2 +- 3 files changed, 5 insertions(+), 17 deletions(-) diff --git a/include/hw/ppc/pnv_xscom.h b/include/hw/ppc/pnv_xscom.h index 9bc6463547..41671001da 100644 --- a/include/hw/ppc/pnv_xscom.h +++ b/include/hw/ppc/pnv_xscom.h @@ -170,7 +170,7 @@ struct PnvXScomInterfaceClass { #define PNV10_XSCOM_PEC_PCI_BASE 0x8010800 /* index goes upwards ... */ #define PNV10_XSCOM_PEC_PCI_SIZE 0x200 =20 -void pnv_xscom_realize(PnvChip *chip, uint64_t size, Error **errp); +void pnv_xscom_init(PnvChip *chip, uint64_t size); int pnv_dt_xscom(PnvChip *chip, void *fdt, int root_offset, uint64_t xscom_base, uint64_t xscom_size, const char *compat, int compat_size); diff --git a/hw/ppc/pnv.c b/hw/ppc/pnv.c index eb54f93986..456631c9dc 100644 --- a/hw/ppc/pnv.c +++ b/hw/ppc/pnv.c @@ -1249,11 +1249,7 @@ static void pnv_chip_power8_realize(DeviceState *dev= , Error **errp) assert(chip8->xics); =20 /* XSCOM bridge is first */ - pnv_xscom_realize(chip, PNV_XSCOM_SIZE, &local_err); - if (local_err) { - error_propagate(errp, local_err); - return; - } + pnv_xscom_init(chip, PNV_XSCOM_SIZE); sysbus_mmio_map(SYS_BUS_DEVICE(chip), 0, PNV_XSCOM_BASE(chip)); =20 pcc->parent_realize(dev, &local_err); @@ -1512,11 +1508,7 @@ static void pnv_chip_power9_realize(DeviceState *dev= , Error **errp) Error *local_err =3D NULL; =20 /* XSCOM bridge is first */ - pnv_xscom_realize(chip, PNV9_XSCOM_SIZE, &local_err); - if (local_err) { - error_propagate(errp, local_err); - return; - } + pnv_xscom_init(chip, PNV9_XSCOM_SIZE); sysbus_mmio_map(SYS_BUS_DEVICE(chip), 0, PNV9_XSCOM_BASE(chip)); =20 pcc->parent_realize(dev, &local_err); @@ -1727,11 +1719,7 @@ static void pnv_chip_power10_realize(DeviceState *de= v, Error **errp) Error *local_err =3D NULL; =20 /* XSCOM bridge is first */ - pnv_xscom_realize(chip, PNV10_XSCOM_SIZE, &local_err); - if (local_err) { - error_propagate(errp, local_err); - return; - } + pnv_xscom_init(chip, PNV10_XSCOM_SIZE); sysbus_mmio_map(SYS_BUS_DEVICE(chip), 0, PNV10_XSCOM_BASE(chip)); =20 pcc->parent_realize(dev, &local_err); diff --git a/hw/ppc/pnv_xscom.c b/hw/ppc/pnv_xscom.c index d820e05e40..af57b55863 100644 --- a/hw/ppc/pnv_xscom.c +++ b/hw/ppc/pnv_xscom.c @@ -221,7 +221,7 @@ const MemoryRegionOps pnv_xscom_ops =3D { .endianness =3D DEVICE_BIG_ENDIAN, }; =20 -void pnv_xscom_realize(PnvChip *chip, uint64_t size, Error **errp) +void pnv_xscom_init(PnvChip *chip, uint64_t size) { SysBusDevice *sbd =3D SYS_BUS_DEVICE(chip); char *name; --=20 2.41.0 From nobody Wed Nov 27 14:33:47 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1697721537; cv=none; d=zohomail.com; s=zohoarc; b=AkvLgtf5MIn9VSTGBQszlZs7ylbU0su4OppA8BIgeUalDMfLeNVPSveiazAKQOrkzDFIhMjxscued6zMMUj476o4XxdU+QNI2jBzoq/DFdLACCKoFG6il2mtfHVH/zCjJ0AIu7qfgvH94BG1UPO5mNmvHtUlonny9BBEi8s1P+4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1697721537; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=wFvi5lmNEMObBf6omDuTraTBDs9CBVzxTa3XSY9GsF4=; b=lkXh8H/jCWLIk8zYabSGZuX/ljMgRYLhpzDb2VHolAd2Cmb3m9JvSbxzxakhwAWfXdpqqhZMY7uoS3wEYgrR/QsjgWwzPCyIrAyZzJnyOybzQ1NXJyVXqpWDxQcyUYiuaKA3kV/Afg9wBMBpvMabs2qHvqgEA1MYKiwHSiLp8q8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 16977215371951002.2468915323279; Thu, 19 Oct 2023 06:18:57 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qtSuK-0000ad-L2; Thu, 19 Oct 2023 09:17:48 -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 1qtStn-0000AO-P9 for qemu-devel@nongnu.org; Thu, 19 Oct 2023 09:17:19 -0400 Received: from mail-ed1-x52c.google.com ([2a00:1450:4864:20::52c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtStl-0003mb-P7 for qemu-devel@nongnu.org; Thu, 19 Oct 2023 09:17:15 -0400 Received: by mail-ed1-x52c.google.com with SMTP id 4fb4d7f45d1cf-5384975e34cso13920460a12.0 for ; Thu, 19 Oct 2023 06:17:13 -0700 (PDT) Received: from m1x-phil.lan (176-131-216-177.abo.bbox.fr. [176.131.216.177]) by smtp.gmail.com with ESMTPSA id d29-20020a50f69d000000b0053daf92f0easm4480571edn.97.2023.10.19.06.17.09 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 19 Oct 2023 06:17:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697721431; x=1698326231; 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=wFvi5lmNEMObBf6omDuTraTBDs9CBVzxTa3XSY9GsF4=; b=X2m9uf0erXWKjJzPNU1m88B8FFQVaNGpU3apvVCakuoHKpuXZ3ebyL1LG9l/0fCfh3 kx2Ik2By9EA2gHeTSeVj2Zi5Q+KkOeTBG7mYnfn9kmy77aEJenb79Dbez/VWETSq0POm 3a+Np4AJ2Eb4FM+eSa4e3i2MEBoC4n3NeuWZIyVXIQDNtPwCLel+n/1lUaE4ORTc0N69 jGym20hAk32qFE9MYJ3Yix9wbmnDJJYIt9ny3wUoGwE+QbxDLy4Mvoi/ndwHk9FbtUDo QafNS4A0TND4co/i1DhzdudUcPG5wcyAlLGbkAiQDkNbxOcjJmj34x9uWNor/SKuHqad mPLw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697721431; x=1698326231; 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=wFvi5lmNEMObBf6omDuTraTBDs9CBVzxTa3XSY9GsF4=; b=rJ8+9rk6Znn+UiFsdMq7O5ETJptzINbnbS4NiQTJmEUBQQLXCIoW012o+0OOyo2tiD SknaKPJ8XirCA58RgQ4J2nEgEJGmd0TDnjgW3s58dZfyM9m8pj3HocpufAhwgzwLnY8w 4WoQTlIJmL0oM4q0RXB8Pg3wR+g2LM+DxbP/piCv5N392t7DCCormZQB0tONzjLtbTuw 4IhbjXExP8kGEhuYrCDkcfuolXKPRRkpNAu0UuS/N6JBVx7npZ7ioxtW1igCsiVq9UP4 XscivCi0LgKbnKtne22Px2LJ9XkWDvd4E3zpiWSnBfZ5iQqhz75lUwYkOzj64NjUyHVk Cfkw== X-Gm-Message-State: AOJu0Yx1OAdSCu8bNnxiWvTKu+eC6r7KswuKzrQ5hG6vHSwqkxzYqKat +6DsvMMcn7s3g/JJR2/XLdtJBdW2KjnlGroC0SWQ0w== X-Google-Smtp-Source: AGHT+IFeBnfZ8oy4rptlH2XfXHQ+bwPIqW2tam7CxMBSvhTD0M7AWD5taehvU3+aEMB5p6nO1wTaWg== X-Received: by 2002:a05:6402:2155:b0:53d:fba2:24be with SMTP id bq21-20020a056402215500b0053dfba224bemr1348963edb.15.1697721431540; Thu, 19 Oct 2023 06:17:11 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Richard Henderson , LIU Zhiwei , Nicholas Piggin , qemu-ppc@nongnu.org, David Gibson , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Daniel Henrique Barboza , Harsh Prateek Bora , Thomas Huth , =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Barrat?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v3 3/7] hw/ppc/pnv_xscom: Move sysbus_mmio_map() call within pnv_xscom_init() Date: Thu, 19 Oct 2023 15:16:43 +0200 Message-ID: <20231019131647.19690-4-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231019131647.19690-1-philmd@linaro.org> References: <20231019131647.19690-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::52c; envelope-from=philmd@linaro.org; helo=mail-ed1-x52c.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=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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1697721539389100001 In order to make the next commit trivial, move sysbus_init_mmio() calls just before the corresponding sysbus_mmio_map() calls. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Reviewed-by: Thomas Huth Reviewed-by: LIU Zhiwei Reviewed-by: C=C3=A9dric Le Goater --- include/hw/ppc/pnv_xscom.h | 2 +- hw/ppc/pnv.c | 9 +++------ hw/ppc/pnv_xscom.c | 3 ++- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/include/hw/ppc/pnv_xscom.h b/include/hw/ppc/pnv_xscom.h index 41671001da..35b19610f7 100644 --- a/include/hw/ppc/pnv_xscom.h +++ b/include/hw/ppc/pnv_xscom.h @@ -170,7 +170,7 @@ struct PnvXScomInterfaceClass { #define PNV10_XSCOM_PEC_PCI_BASE 0x8010800 /* index goes upwards ... */ #define PNV10_XSCOM_PEC_PCI_SIZE 0x200 =20 -void pnv_xscom_init(PnvChip *chip, uint64_t size); +void pnv_xscom_init(PnvChip *chip, uint64_t size, hwaddr addr); int pnv_dt_xscom(PnvChip *chip, void *fdt, int root_offset, uint64_t xscom_base, uint64_t xscom_size, const char *compat, int compat_size); diff --git a/hw/ppc/pnv.c b/hw/ppc/pnv.c index 456631c9dc..10158f7684 100644 --- a/hw/ppc/pnv.c +++ b/hw/ppc/pnv.c @@ -1249,8 +1249,7 @@ static void pnv_chip_power8_realize(DeviceState *dev,= Error **errp) assert(chip8->xics); =20 /* XSCOM bridge is first */ - pnv_xscom_init(chip, PNV_XSCOM_SIZE); - sysbus_mmio_map(SYS_BUS_DEVICE(chip), 0, PNV_XSCOM_BASE(chip)); + pnv_xscom_init(chip, PNV_XSCOM_SIZE, PNV_XSCOM_BASE(chip)); =20 pcc->parent_realize(dev, &local_err); if (local_err) { @@ -1508,8 +1507,7 @@ static void pnv_chip_power9_realize(DeviceState *dev,= Error **errp) Error *local_err =3D NULL; =20 /* XSCOM bridge is first */ - pnv_xscom_init(chip, PNV9_XSCOM_SIZE); - sysbus_mmio_map(SYS_BUS_DEVICE(chip), 0, PNV9_XSCOM_BASE(chip)); + pnv_xscom_init(chip, PNV9_XSCOM_SIZE, PNV9_XSCOM_BASE(chip)); =20 pcc->parent_realize(dev, &local_err); if (local_err) { @@ -1719,8 +1717,7 @@ static void pnv_chip_power10_realize(DeviceState *dev= , Error **errp) Error *local_err =3D NULL; =20 /* XSCOM bridge is first */ - pnv_xscom_init(chip, PNV10_XSCOM_SIZE); - sysbus_mmio_map(SYS_BUS_DEVICE(chip), 0, PNV10_XSCOM_BASE(chip)); + pnv_xscom_init(chip, PNV10_XSCOM_SIZE, PNV10_XSCOM_BASE(chip)); =20 pcc->parent_realize(dev, &local_err); if (local_err) { diff --git a/hw/ppc/pnv_xscom.c b/hw/ppc/pnv_xscom.c index af57b55863..cf892c9fe8 100644 --- a/hw/ppc/pnv_xscom.c +++ b/hw/ppc/pnv_xscom.c @@ -221,7 +221,7 @@ const MemoryRegionOps pnv_xscom_ops =3D { .endianness =3D DEVICE_BIG_ENDIAN, }; =20 -void pnv_xscom_init(PnvChip *chip, uint64_t size) +void pnv_xscom_init(PnvChip *chip, uint64_t size, hwaddr addr) { SysBusDevice *sbd =3D SYS_BUS_DEVICE(chip); char *name; @@ -230,6 +230,7 @@ void pnv_xscom_init(PnvChip *chip, uint64_t size) memory_region_init_io(&chip->xscom_mmio, OBJECT(chip), &pnv_xscom_ops, chip, name, size); sysbus_init_mmio(sbd, &chip->xscom_mmio); + sysbus_mmio_map(sbd, 0, addr); =20 memory_region_init(&chip->xscom, OBJECT(chip), name, size); address_space_init(&chip->xscom_as, &chip->xscom, name); --=20 2.41.0 From nobody Wed Nov 27 14:33:47 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1697721496; cv=none; d=zohomail.com; s=zohoarc; b=iV0CBdXmB7IYpXU9tFEwmHxjj4t+M+6njtDqSi9g00wNs9EnlpOy+LFrV3kuEw6yWZJjiUen4taUKpeIBhS1hXcLdmeORfS3EMSQmV+LCG+BniP31/fh0kS7Mf3BHGYIFXe0dzmUu38cjG5xiEc2+b8ovZDJVzfOGw84jLxHAwo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1697721496; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=pRgAKCtq8bs3zdxIMikNghO5SYRHJ/8vyzXAPjSdrHo=; b=UHm2Q4MTINRBel748xVPt3HsnMfQQrI4jUki69aUVg3FZdBs4wDhb4X0ecgPRTcyDO5OIJ0EPgutaU5J6yRnMn2SL9W7luwBGVB/wlyK9aIVqy5BRSHLGbKzTLDXcadEbXYWJSlBnwKmjQt71ZYiiMhtoJFUVbmohZfJCrb8sQo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1697721496404375.17749148914936; Thu, 19 Oct 2023 06:18:16 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qtSuM-0000ms-AJ; Thu, 19 Oct 2023 09:17:50 -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 1qtStt-0000Dp-W6 for qemu-devel@nongnu.org; Thu, 19 Oct 2023 09:17:29 -0400 Received: from mail-ed1-x532.google.com ([2a00:1450:4864:20::532]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtSts-0003nq-A9 for qemu-devel@nongnu.org; Thu, 19 Oct 2023 09:17:21 -0400 Received: by mail-ed1-x532.google.com with SMTP id 4fb4d7f45d1cf-5384975e34cso13920672a12.0 for ; Thu, 19 Oct 2023 06:17:19 -0700 (PDT) Received: from m1x-phil.lan (176-131-216-177.abo.bbox.fr. [176.131.216.177]) by smtp.gmail.com with ESMTPSA id z22-20020a50cd16000000b00536ad96f867sm4489928edi.11.2023.10.19.06.17.16 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 19 Oct 2023 06:17:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697721438; x=1698326238; 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=pRgAKCtq8bs3zdxIMikNghO5SYRHJ/8vyzXAPjSdrHo=; b=mZevWkHWEBeYT7H9I8PIiSLyUE5pb3x8y+2YNZv5qwuY2OLKNfUYZ9ySrjUSfQBBJS iV3RQKrCn2awbSNut69Vdj5dEimdZDo9cj6rkz363oOjAsSFL67+2MdzJ6y5Z16SHnCd bO0IR+EuGwqkb/2MgxgjhsDYyjpwnyEQ0OoTQcECmsdZ6z44hwNM0LQ9Y+rS8jhVBd9F RP9goknSi2rs4lNT0siAxmv2BTER0mgzJSrnW7Q6DrJniKsqZb4sNw5OTW8vkf4oZlYv atnl22JUkqy+KbJlOR9FRq8+ij6SLtYgb1F59YZyU4iTWsF88tc+VvoVw1TyVJkwqFRD SHHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697721438; x=1698326238; 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=pRgAKCtq8bs3zdxIMikNghO5SYRHJ/8vyzXAPjSdrHo=; b=k0BCEoKvJF2jEm4VRAFS1XzJsnYgkuS2i929+zRt7H8YAnwms8CfiLAMNCpFGCLzZy P4/NC7h2QL8M9LYki7ILeR5GxIo/6lH0JMdD5JdoKgBBODJf3NfDsmml/jN74jvtZ44D 7EkFaf45G9Fdy8UMGFkv+96oycRlYNJOe1DqsCdEkHqjYO5zMLDeACW93R7Wju4b0yJI ljbdBZlZv7HUr4Sc4CiCsISTHB1gUoO5ht/XxFD4PHPOhkoKSaltX7kTXG1owVDR1XzG 7TmfzWP5XnnRm8HER6ZQMXuLrm+sDqyvPemihd7/KGYGAfDmF480y9sjblpi+WP/wJNp ydeg== X-Gm-Message-State: AOJu0Yy18uT/tCcvGpuxEZR8fgnOGdh2uU6IT+PuGTeEwR541YiwcXil RUTDK/OyiQ057njt6aN9y7iz7cDvJJ+bZjFv02l+Fw== X-Google-Smtp-Source: AGHT+IGHBsTQn8chnZ05vBAm8OA+DgjZE6BXmfM0cTspS3pAJSQ5u9fe+gVrjSPBnwFcTDlw7tcSBw== X-Received: by 2002:a17:907:745:b0:9bf:1477:ad82 with SMTP id xc5-20020a170907074500b009bf1477ad82mr1960583ejb.76.1697721438491; Thu, 19 Oct 2023 06:17:18 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Richard Henderson , LIU Zhiwei , Nicholas Piggin , qemu-ppc@nongnu.org, David Gibson , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Daniel Henrique Barboza , Harsh Prateek Bora , Thomas Huth , =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Barrat?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v3 4/7] hw/ppc/pnv_xscom: Do not use SysBus API to map local MMIO region Date: Thu, 19 Oct 2023 15:16:44 +0200 Message-ID: <20231019131647.19690-5-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231019131647.19690-1-philmd@linaro.org> References: <20231019131647.19690-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::532; envelope-from=philmd@linaro.org; helo=mail-ed1-x532.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1697721497243100001 There is no point in exposing an internal MMIO region via SysBus and directly mapping it in the very same device. Just map it without using the SysBus API. Transformation done using the following coccinelle script: @@ expression sbdev; expression index; expression addr; expression subregion; @@ - sysbus_init_mmio(sbdev, subregion); ... when !=3D sbdev - sysbus_mmio_map(sbdev, index, addr); + memory_region_add_subregion(get_system_memory(), addr, subregion); Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Reviewed-by: Thomas Huth Reviewed-by: LIU Zhiwei Reviewed-by: C=C3=A9dric Le Goater --- hw/ppc/pnv_xscom.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/hw/ppc/pnv_xscom.c b/hw/ppc/pnv_xscom.c index cf892c9fe8..805b1d0c87 100644 --- a/hw/ppc/pnv_xscom.c +++ b/hw/ppc/pnv_xscom.c @@ -223,14 +223,12 @@ const MemoryRegionOps pnv_xscom_ops =3D { =20 void pnv_xscom_init(PnvChip *chip, uint64_t size, hwaddr addr) { - SysBusDevice *sbd =3D SYS_BUS_DEVICE(chip); char *name; =20 name =3D g_strdup_printf("xscom-%x", chip->chip_id); memory_region_init_io(&chip->xscom_mmio, OBJECT(chip), &pnv_xscom_ops, chip, name, size); - sysbus_init_mmio(sbd, &chip->xscom_mmio); - sysbus_mmio_map(sbd, 0, addr); + memory_region_add_subregion(get_system_memory(), addr, &chip->xscom_mm= io); =20 memory_region_init(&chip->xscom, OBJECT(chip), name, size); address_space_init(&chip->xscom_as, &chip->xscom, name); --=20 2.41.0 From nobody Wed Nov 27 14:33:47 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1697721514; cv=none; d=zohomail.com; s=zohoarc; b=iJGf1I81JAgxXkwSgA3kw3WgNTmsdV39AbhKaca0X+owxGLv1jmse9vXEOiKEOSJKTvOdAxGZtEF1UWIIauwks6a9qkE2RRhzRFhGBPxsDYFjwm5EQPQJrJQfFt/GAR13s1E5kVvH+/Tz1tzycT4os9kdxXjmdQl64YIr3oQ7Q4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1697721514; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=JX2lUXAyh6ZsGrvkFyzvjDLVRX8aZs36JFh58t9E+n0=; b=nKbYfe/gCCKC99fwAr8orm2bchq+nF7n8aAW5eF42eodszW2KYIahG8jv4YrsRBPHjo8XHCociihKyIz52E5ZRi7sSeDblw67KLxLLrDxWKxRGyqE8t7dcCKmrHKNfDsbiH5Klb13a47XZPDla4u0B30LHotX31MfsgK0FQRfDg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1697721514812179.81274654445986; Thu, 19 Oct 2023 06:18:34 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qtSuO-0000sh-4E; Thu, 19 Oct 2023 09:17:52 -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 1qtSu9-0000MZ-1j for qemu-devel@nongnu.org; Thu, 19 Oct 2023 09:17:39 -0400 Received: from mail-ed1-x52e.google.com ([2a00:1450:4864:20::52e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtSu1-0003oj-8e for qemu-devel@nongnu.org; Thu, 19 Oct 2023 09:17:34 -0400 Received: by mail-ed1-x52e.google.com with SMTP id 4fb4d7f45d1cf-53e3e7e478bso10551179a12.0 for ; Thu, 19 Oct 2023 06:17:27 -0700 (PDT) Received: from m1x-phil.lan (176-131-216-177.abo.bbox.fr. [176.131.216.177]) by smtp.gmail.com with ESMTPSA id v16-20020a50a450000000b0053635409213sm4561534edb.34.2023.10.19.06.17.23 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 19 Oct 2023 06:17:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697721445; x=1698326245; 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=JX2lUXAyh6ZsGrvkFyzvjDLVRX8aZs36JFh58t9E+n0=; b=MII+XHSHBxeMjXaJFVjZCHdTTof1TqDYQZfHaeR3ANcCmzpbWIkE6IpXYHFvpGNssS hfv8G3dlfP3/U5nCgw+hjec1tlfgp6pOPYeBAXTQ5ITKk5DqZkepwpaOX7HAfZf4rGaQ wbpW0kWTByo4QbzggfFpmBIyvJB1KHtCmrytvvRcYiT/tfTwOhNfXLFGY/1vW6lIQ8Kq T5C7GPcko2bFleASNSIg21qk8+BMws6uRuYRZnlq2BuzIauhNBOBSoivrOr6+vzFONGj aneGiG8x+hHZ+lHtqSs4EW67hvrsDYRkfaz2B3NXFXUi04dtinZbNn7/UZ3SLGzQRXqL YpZw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697721445; x=1698326245; 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=JX2lUXAyh6ZsGrvkFyzvjDLVRX8aZs36JFh58t9E+n0=; b=Dg5p7MY5GLoKawMywcFAAAZbT20iMFS54KQoGrp4ZKET6gvjWMBb7m6Enz1oQr/NhM mY3qQQ3oylCYUPetfTS62uIKJMASfCHsm7smaAHrXKUyFNPEfuJ1XkOXkACXRdVP3KZE RxqXBDOMx8Zv+isqLqvc/m3RiJtuU2nfqh2QrN6SwG5GChzgkhDwQZXh/VmqQ0bMjMZO OGsOK/qHUQPN4P3IrkHBT0qZZVlwIs7KbG2z5Wxd9W7blK0kTEWBYLC5X58VBeXHgJnG ywpby1xa5yB1Gmj8CFxKkGZwd1AfvUA3lDs3eYOAztVShfnKKBb85SYPCT7EhaWzZzWP jYpg== X-Gm-Message-State: AOJu0YyjuCXF7ufyhqIDlyQDOCmbSD6N/0GT8l93cYqlBBXR0QP9Cda6 qFL7jH7pgITYcERIo1z/VU7h4LlNITSAXjWJFkPIVw== X-Google-Smtp-Source: AGHT+IGO7/CJRHAmnT6b8nNG8N9RIoTAtLevp1mw5u5+fr5eQ06a9vIiruvOFPu+zpKQ+cgd+Xcseg== X-Received: by 2002:a05:6402:11c8:b0:53d:f4f5:7ab0 with SMTP id j8-20020a05640211c800b0053df4f57ab0mr1471516edw.40.1697721445322; Thu, 19 Oct 2023 06:17:25 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Richard Henderson , LIU Zhiwei , Nicholas Piggin , qemu-ppc@nongnu.org, David Gibson , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Daniel Henrique Barboza , Harsh Prateek Bora , Thomas Huth , =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Barrat?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v3 5/7] hw/ppc/pnv: Do not use SysBus API to map local MMIO region Date: Thu, 19 Oct 2023 15:16:45 +0200 Message-ID: <20231019131647.19690-6-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231019131647.19690-1-philmd@linaro.org> References: <20231019131647.19690-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::52e; envelope-from=philmd@linaro.org; helo=mail-ed1-x52e.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=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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1697721515279100001 There is no point in exposing an internal MMIO region via SysBus and directly mapping it in the very same device. Just map it without using the SysBus API. Transformation done using the following coccinelle script: @@ expression sbdev; expression index; expression addr; expression subregion; @@ - sysbus_init_mmio(sbdev, subregion); ... when !=3D sbdev - sysbus_mmio_map(sbdev, index, addr); + memory_region_add_subregion(get_system_memory(), addr, subregion); Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Reviewed-by: Thomas Huth Reviewed-by: LIU Zhiwei Reviewed-by: C=C3=A9dric Le Goater --- hw/ppc/pnv.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/hw/ppc/pnv.c b/hw/ppc/pnv.c index 10158f7684..c0e34fffbc 100644 --- a/hw/ppc/pnv.c +++ b/hw/ppc/pnv.c @@ -1217,10 +1217,9 @@ static void pnv_chip_icp_realize(Pnv8Chip *chip8, Er= ror **errp) =20 name =3D g_strdup_printf("icp-%x", chip->chip_id); memory_region_init(&chip8->icp_mmio, OBJECT(chip), name, PNV_ICP_SIZE); - sysbus_init_mmio(SYS_BUS_DEVICE(chip), &chip8->icp_mmio); g_free(name); - - sysbus_mmio_map(SYS_BUS_DEVICE(chip), 1, PNV_ICP_BASE(chip)); + memory_region_add_subregion(get_system_memory(), PNV_ICP_BASE(chip), + &chip8->icp_mmio); =20 /* Map the ICP registers for each thread */ for (i =3D 0; i < chip->nr_cores; i++) { --=20 2.41.0 From nobody Wed Nov 27 14:33:47 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1697721529; cv=none; d=zohomail.com; s=zohoarc; b=JDNLMZT4r3Lq4pTxFU4/dMxW/CZVQ6Bww53ET2uPlY4doHfOREqLAbqFblUbKTEFGJZOh0FzP0WbY2/9oN9PEJTchqqJRcS33JT/LZaQAAMKjK2vHMMmv19K/lYocEDCtX0Evb6YR9/WBr+qZd9cZ8itlWOmB75nyMiMBsl7Lgc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1697721529; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=MvrIYZ1SHVtY4jy7jskbyHF3SwQhysiF+69uIEKUTD0=; b=Xsi3gGDNwNM/YNEjv4n6xmLkWdi5oxtAwqfuJAHTZm2kjjttutOa0mnPfBIR70TOJJYArZo7UwgGTiDaO+qZJDVntPQzQHG5SehnX6oRRMI8m5cvPRH3ITLIy4MJipv+ciTzBPEAxY2TDhmbxD27vtbi59lU2vltM2Tqg35M0jw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1697721529753448.10456467927884; Thu, 19 Oct 2023 06:18:49 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qtSuM-0000lW-66; Thu, 19 Oct 2023 09:17:50 -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 1qtSuB-0000Nk-4l for qemu-devel@nongnu.org; Thu, 19 Oct 2023 09:17:40 -0400 Received: from mail-lf1-x130.google.com ([2a00:1450:4864:20::130]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtSu6-0003pV-VF for qemu-devel@nongnu.org; Thu, 19 Oct 2023 09:17:38 -0400 Received: by mail-lf1-x130.google.com with SMTP id 2adb3069b0e04-504a7f9204eso10651483e87.3 for ; Thu, 19 Oct 2023 06:17:33 -0700 (PDT) Received: from m1x-phil.lan (176-131-216-177.abo.bbox.fr. [176.131.216.177]) by smtp.gmail.com with ESMTPSA id bt6-20020a0564020a4600b0053e3839fc79sm4359878edb.96.2023.10.19.06.17.30 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 19 Oct 2023 06:17:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697721452; x=1698326252; 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=MvrIYZ1SHVtY4jy7jskbyHF3SwQhysiF+69uIEKUTD0=; b=XpjDc0mcnutTh+jA7QGjo+csB14uTgnW2FpOTyWMRnA2xuGlbZfhnb9GaNeEc5G6+Y pCz0/WtyuHxQDQz0SFJvZTo+oBAVH0bCayuWqEGmdH1LeZMLV2OaHQGcpFeMeIB0fls4 RF6e0P47JOLrxQ6ZmLxkMYrMhc9U+RSDtdFhtXN/kDpuQiVnCT14rHdTGPD6eU7eu0xk cc9xKzHuRGosPwY1fxF6WqpGrlikJRT1SQP0C4tbelPWIEY97865jp2yZT54/FH92t1N Y5ZBwEYj/elT+TzhdJoZ1+zh5RrioEWboV+OcXoOkuyVK7e7uOqtM6CuoqRH9XxxApcn ZfUg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697721452; x=1698326252; 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=MvrIYZ1SHVtY4jy7jskbyHF3SwQhysiF+69uIEKUTD0=; b=GmSzIVq31pplNB9mVn049tKzPZEUWm+int3f06iBKyA4nIHOMLBzi7UvRySRy9ILIF +iWeTMIusNWh5cOam6K8GzxXFhYC22K5avW3oXNm1e2gAFHJIT22011bBISiweT0/lSe vuHcj5KmpK5O1W5mkIl7K+q5Ylp4GJqZPi6Fw6FKSvd38A7kiH26nVKXw0+Pdhn/7Jx6 i2yOtkDSy263RAGUc6FLI0un+jWKPqfDnOYg5tc5BAMuewCBv4b3cv9oAwuuNRl7ogIk Ko0Ukrb2SIAaTfuHNiIjaK1BprgFXWuD8q1C+xrrNKc2e0MU0UfZzJTXZltALlNvFos9 C65A== X-Gm-Message-State: AOJu0YxxrgPYdNN0MNvGuxvpMPqIhj8+/e8M9sttkQDsdhtMdd0VtUdB ZRhfp1cg3wnHR5iaB0EMSLkjXzuwCMLkegsS3UNRWQ== X-Google-Smtp-Source: AGHT+IGOsdnA7Ew/2fjx5ZlDmAqAzc0hBWvmX1qTKThHijrKohIJwepl7gLr7Sq6nSP6QHo6LwfZKg== X-Received: by 2002:a05:6512:32ac:b0:502:f2a8:d391 with SMTP id q12-20020a05651232ac00b00502f2a8d391mr1450014lfe.45.1697721452136; Thu, 19 Oct 2023 06:17:32 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Richard Henderson , LIU Zhiwei , Nicholas Piggin , qemu-ppc@nongnu.org, David Gibson , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Daniel Henrique Barboza , Harsh Prateek Bora , Thomas Huth , =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Barrat?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v3 6/7] hw/intc/spapr_xive: Move sysbus_init_mmio() calls around Date: Thu, 19 Oct 2023 15:16:46 +0200 Message-ID: <20231019131647.19690-7-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231019131647.19690-1-philmd@linaro.org> References: <20231019131647.19690-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::130; envelope-from=philmd@linaro.org; helo=mail-lf1-x130.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1697721531363100003 In order to make the next commit trivial, move sysbus_init_mmio() calls just before the corresponding sysbus_mmio_map() calls. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Reviewed-by: Thomas Huth Reviewed-by: LIU Zhiwei Reviewed-by: C=C3=A9dric Le Goater --- hw/intc/spapr_xive.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/intc/spapr_xive.c b/hw/intc/spapr_xive.c index 7f701d414b..12057ffe5b 100644 --- a/hw/intc/spapr_xive.c +++ b/hw/intc/spapr_xive.c @@ -316,7 +316,6 @@ static void spapr_xive_realize(DeviceState *dev, Error = **errp) if (!qdev_realize(DEVICE(xsrc), NULL, errp)) { return; } - sysbus_init_mmio(SYS_BUS_DEVICE(xive), &xsrc->esb_mmio); =20 /* * Initialize the END ESB source @@ -328,7 +327,6 @@ static void spapr_xive_realize(DeviceState *dev, Error = **errp) if (!qdev_realize(DEVICE(end_xsrc), NULL, errp)) { return; } - sysbus_init_mmio(SYS_BUS_DEVICE(xive), &end_xsrc->esb_mmio); =20 /* Set the mapping address of the END ESB pages after the source ESBs = */ xive->end_base =3D xive->vc_base + xive_source_esb_len(xsrc); @@ -347,14 +345,16 @@ static void spapr_xive_realize(DeviceState *dev, Erro= r **errp) /* TIMA initialization */ memory_region_init_io(&xive->tm_mmio, OBJECT(xive), &spapr_xive_tm_ops, xive, "xive.tima", 4ull << TM_SHIFT); - sysbus_init_mmio(SYS_BUS_DEVICE(xive), &xive->tm_mmio); =20 /* * Map all regions. These will be enabled or disabled at reset and * can also be overridden by KVM memory regions if active */ + sysbus_init_mmio(SYS_BUS_DEVICE(xive), &xsrc->esb_mmio); sysbus_mmio_map(SYS_BUS_DEVICE(xive), 0, xive->vc_base); + sysbus_init_mmio(SYS_BUS_DEVICE(xive), &end_xsrc->esb_mmio); sysbus_mmio_map(SYS_BUS_DEVICE(xive), 1, xive->end_base); + sysbus_init_mmio(SYS_BUS_DEVICE(xive), &xive->tm_mmio); sysbus_mmio_map(SYS_BUS_DEVICE(xive), 2, xive->tm_base); } =20 --=20 2.41.0 From nobody Wed Nov 27 14:33:47 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1697721533; cv=none; d=zohomail.com; s=zohoarc; b=AqA6wOvb0jINt+1MtycU7EQXKimlpyR7nVQxLzo9PhxsQjq5mhMi4Fj9LQzx88XEXgU2EAlPNcu+0jJ+2o+sanDRcirad4gx66dSPHzqz+E5jGOFTeX/f+aEJH7ZGuyHEVcFzSARCvxMOVdsR52NH9NUw0qdLPNmI7LyqoOoM4I= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1697721533; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=BzC6A86Bk95Jd4e/EkJIpq30sS9wgbKZ9q/zKo1ZK3Y=; b=IzkDn19qgvtizpwdvrFem4cRSnjjx1pS/HY5c1dde5RVNLvqYMrS4RxxgGgENTMtgmft4xB8MuXCJJ6zBKXzi8YhsYJc+ZA1Enpl9Y94eChrvRFwZkHTV7jJ5aGrNTt6KNsmKmBXq3jNossH0GEJ/+x9O22aJZfjlnMk4jH1N18= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1697721533400610.0782938131881; Thu, 19 Oct 2023 06:18:53 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qtSuQ-0000yH-6q; Thu, 19 Oct 2023 09:17:54 -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 1qtSuI-0000Pc-S9 for qemu-devel@nongnu.org; Thu, 19 Oct 2023 09:17:47 -0400 Received: from mail-ej1-x632.google.com ([2a00:1450:4864:20::632]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtSuE-0003sC-OF for qemu-devel@nongnu.org; Thu, 19 Oct 2023 09:17:46 -0400 Received: by mail-ej1-x632.google.com with SMTP id a640c23a62f3a-9becde9ea7bso170981766b.0 for ; Thu, 19 Oct 2023 06:17:40 -0700 (PDT) Received: from m1x-phil.lan (176-131-216-177.abo.bbox.fr. [176.131.216.177]) by smtp.gmail.com with ESMTPSA id u9-20020a170906068900b009875a6d28b0sm3524508ejb.51.2023.10.19.06.17.36 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 19 Oct 2023 06:17:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697721459; x=1698326259; 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=BzC6A86Bk95Jd4e/EkJIpq30sS9wgbKZ9q/zKo1ZK3Y=; b=p9PDFDBaJGTmNPJGxOAgLjeXyTLaO3N0pZfsI6v95DdiZx/lz59oDVv7a7HoVIauzB CHTKxxMGczdiNbhz8huGhTX7t20FfEmw55iIHDfyJDpV/STEBF/+82LjTmKw7WDAeepR DsEBfFza2/G3z+EMEwAWLeHV2rX0I0KsttSyFm6khCT7JsmRFb5K7+LkqtK+dbrceBZB Gzs5aLD1l8R0osZAOqU1xenhgRJCozg3Qa36YnvnPbygH42i3l3ZV455CT5v4N2tylwO +KjLP+ECtLOBDjvtSAeEHdqi6rAb9sS+0MW90hVRSwYPKzBKxM4Nq905g+yA3fawKkck 72Mw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697721459; x=1698326259; 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=BzC6A86Bk95Jd4e/EkJIpq30sS9wgbKZ9q/zKo1ZK3Y=; b=WOCIAPfZYOkj5ejhehBLt/2/Xq8jL7UfRzA8pIp0TNl8jXCfUs24Jv6vY3ce4CODgq 9fCC2CfIC/TXkxLG5HFhhVDi0ZNXaCGhZ2Qjq2CmoR77+Gze4el71zamBLa04sSEkQs9 cB4Uhi2lLlFvaVElMWLYyOOlcAWNVCnp+qPyYv80rY3gUrNOnNM1oTTXrdA1DbL1SPCS C1q04qKuYGy2QvUHpwP5OhlGbjP7U68BLCvuGU6J+FEmqGaEPYJtUVXaoio6ZNbnW0D5 G4aGo4JSAaHhTQc5ZwiNwEOTWC4XrkS5vHnPOC+8aYa1Vh1JO1kTuCpM0H4nvxMs3Jnd dB5A== X-Gm-Message-State: AOJu0YwEuM/6BhOwWaZEafPyS6j5c0hsiGnrWoi+Eq7hyclciaQxudIJ Pd0as+Tbi/y4exdpuYL9D3j9fyhBSW6Kf3fFaxJpaA== X-Google-Smtp-Source: AGHT+IFcaaKlHQjmNWgGDlPiKwFC6ylQFxH4ghP8TNXFL6rbvoJbNEItuM8dX8kveVJAgJL4zpeycQ== X-Received: by 2002:a17:907:1ca4:b0:9aa:206d:b052 with SMTP id nb36-20020a1709071ca400b009aa206db052mr1462695ejc.27.1697721459077; Thu, 19 Oct 2023 06:17:39 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Richard Henderson , LIU Zhiwei , Nicholas Piggin , qemu-ppc@nongnu.org, David Gibson , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Daniel Henrique Barboza , Harsh Prateek Bora , Thomas Huth , =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Barrat?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v3 7/7] hw/intc/spapr_xive: Do not use SysBus API to map local MMIO region Date: Thu, 19 Oct 2023 15:16:47 +0200 Message-ID: <20231019131647.19690-8-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231019131647.19690-1-philmd@linaro.org> References: <20231019131647.19690-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::632; envelope-from=philmd@linaro.org; helo=mail-ej1-x632.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=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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1697721535380100003 There is no point in exposing an internal MMIO region via SysBus and directly mapping it in the very same device. Just map it without using the SysBus API. Transformation done using the following coccinelle script: @@ expression sbdev; expression index; expression addr; expression subregion; @@ - sysbus_init_mmio(sbdev, subregion); ... when !=3D sbdev - sysbus_mmio_map(sbdev, index, addr); + memory_region_add_subregion(get_system_memory(), addr, subregion); Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Reviewed-by: Thomas Huth Reviewed-by: LIU Zhiwei Reviewed-by: C=C3=A9dric Le Goater --- hw/intc/spapr_xive.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/hw/intc/spapr_xive.c b/hw/intc/spapr_xive.c index 12057ffe5b..199c261b07 100644 --- a/hw/intc/spapr_xive.c +++ b/hw/intc/spapr_xive.c @@ -350,12 +350,12 @@ static void spapr_xive_realize(DeviceState *dev, Erro= r **errp) * Map all regions. These will be enabled or disabled at reset and * can also be overridden by KVM memory regions if active */ - sysbus_init_mmio(SYS_BUS_DEVICE(xive), &xsrc->esb_mmio); - sysbus_mmio_map(SYS_BUS_DEVICE(xive), 0, xive->vc_base); - sysbus_init_mmio(SYS_BUS_DEVICE(xive), &end_xsrc->esb_mmio); - sysbus_mmio_map(SYS_BUS_DEVICE(xive), 1, xive->end_base); - sysbus_init_mmio(SYS_BUS_DEVICE(xive), &xive->tm_mmio); - sysbus_mmio_map(SYS_BUS_DEVICE(xive), 2, xive->tm_base); + memory_region_add_subregion(get_system_memory(), xive->vc_base, + &xsrc->esb_mmio); + memory_region_add_subregion(get_system_memory(), xive->end_base, + &end_xsrc->esb_mmio); + memory_region_add_subregion(get_system_memory(), xive->tm_base, + &xive->tm_mmio); } =20 static int spapr_xive_get_eas(XiveRouter *xrtr, uint8_t eas_blk, --=20 2.41.0