From nobody Wed Nov 27 17:48:59 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=1697635896; cv=none; d=zohomail.com; s=zohoarc; b=n6uYLZl4cfvx861WXllCSMmPWv22/W1sB/wZx5jvKwn9cDeD+hprcbvJwEiqNlDC3uTCrb14Vta5qxM0ZRDUy9GM8K5OvBbP3xZhM3AtYtQ81uGxduPP6hbwY3+iYsi19FUpL4YeFyFDb5/T8M4laJxxRGPrR0KRh3gMgjSplPg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1697635896; 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=R88+Z+VGYIDcvDUiZgRkTIEWNSTtdo2zUBsOwzRZMmc=; b=dKuVzP0aH0g6nnqMzV0PC1fE5dejk2004N4NFv0Vf3jn+HKhQ0t/ng7nIGXcqdar0++lFgfCs1AUD86PL+EqZspb/PqIttoQ8u5NjftEY63PeQCgtLipcbC1pNaJu68pUFGtQhYgi0mHOSr2S2C71LsrCPNPuUFjn96VzQ15Nd8= 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 1697635896852458.9271095597371; Wed, 18 Oct 2023 06:31:36 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qt6e3-0007gy-SZ; Wed, 18 Oct 2023 09:31:31 -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 1qt6dl-0007f5-Lv for qemu-devel@nongnu.org; Wed, 18 Oct 2023 09:31:14 -0400 Received: from mail-lf1-x12a.google.com ([2a00:1450:4864:20::12a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qt6dj-0004hS-Ov for qemu-devel@nongnu.org; Wed, 18 Oct 2023 09:31:13 -0400 Received: by mail-lf1-x12a.google.com with SMTP id 2adb3069b0e04-507a29c7eefso5717610e87.1 for ; Wed, 18 Oct 2023 06:31:11 -0700 (PDT) Received: from m1x-phil.lan (gyl59-h01-176-171-218-149.dsl.sta.abo.bbox.fr. [176.171.218.149]) by smtp.gmail.com with ESMTPSA id r13-20020a5d498d000000b0032da40fd7bdsm2139621wrq.24.2023.10.18.06.31.07 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 18 Oct 2023 06:31:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697635869; x=1698240669; 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=R88+Z+VGYIDcvDUiZgRkTIEWNSTtdo2zUBsOwzRZMmc=; b=TdqlEWr6rzRpsbUxD3h21MmktH5yi26TbzzBOdYrmiC2kz0Mys8jL3nykzBvHdEMPV vtdAqXVP1JMucNuq/LXB/LXNl3FY1IEE9eUA9U31nDK/fmrL2qZAeNi3Ut5sd5vDHIcS qIpdaISyIqZvdIxAoQwkJYHdUvaCMP0V+WLRriPcK+YKftlhIFXJb2UfZq1mWagzGThQ JVyxaVAmocJIp5BXvozEyigk7rHwTsI9Ch6qd17wizuDZmz0954EWKylP9qXAZArKwbK HgwFW78OjX4L5/6ZRcmdkFRG6RDVclwHA2CAv1CLSwRvsiDkyZmG00SVyEqDlfSJnIfZ SZkg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697635869; x=1698240669; 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=R88+Z+VGYIDcvDUiZgRkTIEWNSTtdo2zUBsOwzRZMmc=; b=GUXOkq9c+Y7C+wMi0N1jubRtZxnsF7Ioof0BVUWY325Nq7s5q6p1zOaAMiplH/bzvy NtwBEW04jcRD6SZKfVqTXzx4DnseIEWlO3zG2/OIV9rbLgQWJ3ukAVaJ7fRK36uahauU wQH+cM2lFj6wCri1nkekZ+/JMzlFSRJrMWDbzotNnxeZe6wCR6i0oiYWD4mNdmEBRU5a 4qKjacDAyBMmDWdj8ruw5qbsqi+Hhdx6rdNeIiYJbwqC66y0HkL3l8jqYpJe1y+QYGI+ FAUYanBcDQUIXcTucV2wX1/0EKAwkiukdlx5z3tMEGpNGhDgnFDHdVSkZoH0WMIXkJ3h Oj0g== X-Gm-Message-State: AOJu0YyIDXRBI1Ztik99GqMAy5bwQ/aGDM8HYUpeefkzyvNjd5DN/KBa wsXF1Q3GSVl7QZDQLW7WDiFaVYg1U1EHb2/tQtg= X-Google-Smtp-Source: AGHT+IFxcFaHh/Bj1G95qsKg2cCrSGzutk9+zbqEQ5GaPVW3cYv+8JtnhKA4ZSKWqAoAiyVj7sUHFw== X-Received: by 2002:ac2:4315:0:b0:500:d8d6:fc5a with SMTP id l21-20020ac24315000000b00500d8d6fc5amr3887487lfh.37.1697635869405; Wed, 18 Oct 2023 06:31:09 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: David Gibson , =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Barrat?= , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Harsh Prateek Bora , Nicholas Piggin , Daniel Henrique Barboza , qemu-ppc@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH 1/6] hw/ppc/pnv_xscom: Rename pnv_xscom_realize(Error **) -> pnv_xscom_init() Date: Wed, 18 Oct 2023 15:30:54 +0200 Message-ID: <20231018133059.85765-2-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231018133059.85765-1-philmd@linaro.org> References: <20231018133059.85765-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::12a; envelope-from=philmd@linaro.org; helo=mail-lf1-x12a.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: 1697635897745100001 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: LIU Zhiwei Reviewed-by: Richard Henderson Reviewed-by: Thomas Huth --- 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 17:48:59 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=1697635912; cv=none; d=zohomail.com; s=zohoarc; b=hThhVM197AQvEOrD+3AkIgh677VrGF1TNRYvPhIKp0OtGoVt4Rq2AQrxmsDdHcedhPaeHGZIPPvo8ko/+LaOh8d4KFN9/mQKh7ckIgiL6DbM5lMxp12QM81FnuB25nznWFJv3yGLjp0CsQWginDfkcOHVnZL6ZrrZQEhlYo2PCk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1697635912; 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=4JzNT1BOnEa9xt/v/nMXe1GFFvZS33OkSi1pdN0E7RE=; b=LvujhAW9ky9VFCO9Hg4HQjJfnhuAw142Hqp5D4JGylA+krAtHUlpDim/FoSkMtv7qqomdUkbi09phyXTg2LL965k+upTITF9IcP9g9zvt/OrYqVuNEH1qno77W+lkEUQvkXcnAWqdeQl9xhtf/0hwqi23Zs6bfz9/ch+aGZCu78= 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 169763591245169.04372105283187; Wed, 18 Oct 2023 06:31:52 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qt6e6-0007vg-KP; Wed, 18 Oct 2023 09:31:34 -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 1qt6ds-0007hO-Tl for qemu-devel@nongnu.org; Wed, 18 Oct 2023 09:31:27 -0400 Received: from mail-lf1-x135.google.com ([2a00:1450:4864:20::135]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qt6dp-0004i8-Df for qemu-devel@nongnu.org; Wed, 18 Oct 2023 09:31:20 -0400 Received: by mail-lf1-x135.google.com with SMTP id 2adb3069b0e04-50435ad51bbso9073325e87.2 for ; Wed, 18 Oct 2023 06:31:17 -0700 (PDT) Received: from m1x-phil.lan (gyl59-h01-176-171-218-149.dsl.sta.abo.bbox.fr. [176.171.218.149]) by smtp.gmail.com with ESMTPSA id z3-20020a5d6403000000b0032db430fb9bsm2114410wru.68.2023.10.18.06.31.14 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 18 Oct 2023 06:31:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697635875; x=1698240675; 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=4JzNT1BOnEa9xt/v/nMXe1GFFvZS33OkSi1pdN0E7RE=; b=iqiTj8zu8CT367PAtB1vzD+K/+MTlHCDhyNSy9nLLMxRYnDj517dXjp4r3nJ8eCeI6 IZ/Y6zXpil4iv8+0JXRLy0vTw3+i03ZE8wc2EqYj3KF20PE04tGpR/sdcQa8ichPxnS4 wQk27XpNRN6BTFTTjqKNYS6YFLZE3tkk/R0+TnnP/V52luqs5cqH2mETZCXlN9FVXWWm s8ErfAFX+HK+IOnNJ2hvCDvTEK9hufZkOpTOWj2oM/ljyO0ycF9klecB+3ae6wE8A98F jJSztiHgOeBarVCLyE3rJIPRrlhohBhZzSzto5LnlDYExr+y4rQyT2FrRfgOYYSVbyrf jg9A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697635875; x=1698240675; 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=4JzNT1BOnEa9xt/v/nMXe1GFFvZS33OkSi1pdN0E7RE=; b=E+IPkImFt6QPFNEr/JqxYxNQvMIhfaSlQHVI06BIAiH1ajIdnGgMH7RETumUBVnqfl ZPdAsfm9gxEbciFQ86jleau3CEVReU61qCeA670PGO/IADQtB2PFUzquixAEVdjWUj51 7WxF+HxC8calKIXrUE70WxTmJb0nijVQUHPx8CcsvESu9hAi9IfLrL09UPAr0r0SH3wg G83/Z7Evub4LVLBHKzlYFTc2R5SyBRrGrS9qpwaqymsWgTk53d0rym1Jj5LvxIiGGoPg 9TMduQqBDt7bVkmqdwp63Bb7xb+6NeIP32rC2VUoEAttCK9XNoiViyXPw2zED82ji0Bu uI3w== X-Gm-Message-State: AOJu0Yw2oMUS90RNjRFs0JTT7i2vBcMAJ6tlMLe9ufnGzBBfI371hSBq vUynz2ZtSNq1vnaYK5hWtOKk8THtfUNyJmhvNw0= X-Google-Smtp-Source: AGHT+IGGC/DB16P3BB1nPMWKF5VXyCaUMtP+5TJuuZKA2x7kSuINdEw73p8KJAwQkuLGO7HIMlxqNA== X-Received: by 2002:a19:7411:0:b0:507:95ea:1e72 with SMTP id v17-20020a197411000000b0050795ea1e72mr4327162lfe.22.1697635875553; Wed, 18 Oct 2023 06:31:15 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: David Gibson , =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Barrat?= , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Harsh Prateek Bora , Nicholas Piggin , Daniel Henrique Barboza , qemu-ppc@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH 2/6] hw/ppc/pnv_xscom: Move sysbus_mmio_map() call within pnv_xscom_init() Date: Wed, 18 Oct 2023 15:30:55 +0200 Message-ID: <20231018133059.85765-3-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231018133059.85765-1-philmd@linaro.org> References: <20231018133059.85765-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::135; envelope-from=philmd@linaro.org; helo=mail-lf1-x135.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: 1697635913923100003 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: LIU Zhiwei Reviewed-by: Richard Henderson Reviewed-by: Thomas Huth --- 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 17:48:59 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=1697636245; cv=none; d=zohomail.com; s=zohoarc; b=S/1jY5mhMqSgiTMFBgkCFx9uLQSYUzCMQKLgUBBv/dvEahjbhiK0kDc2j03DSEeKh80x3EFAGNli7JMjY/uZv6cwUotjgxl3v5IKsQ/oU6ITb7Yh+iM1uZM8sCNdPjUyiweFxtAM/+M4WIfwLY3wgSKsXz+Pdee3d7DE6HQhlmI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1697636245; 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=T/OzLFcKSh0UPM5Lh64d1MpdKJAnWvLj8FsUJLUNjvo=; b=SajwnI28Hd8Kxng9Xp0SbsSmBYy7TT5rYes7yV2U0Eh2xfJsYme1+d9xIT3bzfi6GbtKzignh8f4HEXSkKXAZzJdQp75v1irJOYx8xCNGk/DR5JYnqEF1ycoAokaWhW30ObeGKfHU4mls+MWnW4nhFnAM9QwOhnYID7XFNOE98E= 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 1697636245439626.8192865437067; Wed, 18 Oct 2023 06:37:25 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qt6e5-0007qi-0Q; Wed, 18 Oct 2023 09:31:33 -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 1qt6dy-0007hr-VP for qemu-devel@nongnu.org; Wed, 18 Oct 2023 09:31:31 -0400 Received: from mail-wr1-x435.google.com ([2a00:1450:4864:20::435]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qt6dw-0004k5-2Y for qemu-devel@nongnu.org; Wed, 18 Oct 2023 09:31:26 -0400 Received: by mail-wr1-x435.google.com with SMTP id ffacd0b85a97d-32d9552d765so5321022f8f.2 for ; Wed, 18 Oct 2023 06:31:22 -0700 (PDT) Received: from m1x-phil.lan (gyl59-h01-176-171-218-149.dsl.sta.abo.bbox.fr. [176.171.218.149]) by smtp.gmail.com with ESMTPSA id p14-20020adfcc8e000000b0032db1d741a6sm2128974wrj.99.2023.10.18.06.31.20 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 18 Oct 2023 06:31:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697635881; x=1698240681; 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=T/OzLFcKSh0UPM5Lh64d1MpdKJAnWvLj8FsUJLUNjvo=; b=VYVsTTWeNDrE4l/vtCPuXX8NUI+4C6lNbImc9WVJd3Jo5YZIuv8vCPlbXWdCsQC6Dz sURxUyujmp1aE73D+fy7CT4L/8Xq2A6Jwg9KNSdANG0mREhanQi7PGKS9Y7rSy3d8Oa3 MONCTX/Jp5oTKKLa+niQ+AQ1Y5mPq3f0/78eIwRCdMVbDRrpNuBLEwIMTfqhvro8N4/F fWtOjVGE0GyJsCFiTZ1FrJbk1vnv5s1y/i2Td1WFV36wHmPZi85PF6p1fjNZPvM+DpuF 3YiEyj10B4TzNZqIxOBLcBqD7ZZOIBjMldftpTEOUCNutdcihyHDzfP5AAQN6l3MB/By Fh4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697635881; x=1698240681; 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=T/OzLFcKSh0UPM5Lh64d1MpdKJAnWvLj8FsUJLUNjvo=; b=GbKuUx6pm8HO27rrbOFWzmQ3Ugch/JHlgDuhdgoddAb2Gy1u7VdSO5SuDw3TTiDlw3 J1PppEptUKjqTrfmENKBjFhohwI5LMDw2EP+hoFx5cvYDksgy19iCfs6R97CHTwUvcsd 2K6Ra+Asja3aAtU1blmLVDgv5smg597tOOjlRYIOsMhz7Y5fXBnoSBtzwIP9YtTaeMNW TKKdud4hCaLECTSNZKgVoWUei0uKu+bW67p9vJjzazeagqrTcgeQHWrMtyxzROXCMcKl wfsrFXExQAyz2FFOEwgGmmdtp4EdVzEzYzfY2cP5K+5VQ2ndKmwLaPoeIWrjggJnGwih cn2Q== X-Gm-Message-State: AOJu0YweSKJDy8ZpfNj/E+nETEtR4faoRFz9b03ohWnwWaqyGANBh7CO 7//O3CCyVnEaLc5NHZ3hnOkE3EfyHkAYbw6kFHE= X-Google-Smtp-Source: AGHT+IHsgV4PzEBsYH1psVLwaff1VJl3OmiviOP4eeuhxOuFo1IIuUZpLReUOyt8uDoVUQI9Jp/36g== X-Received: by 2002:adf:f982:0:b0:32d:b06c:80b2 with SMTP id f2-20020adff982000000b0032db06c80b2mr4791674wrr.0.1697635881371; Wed, 18 Oct 2023 06:31:21 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: David Gibson , =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Barrat?= , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Harsh Prateek Bora , Nicholas Piggin , Daniel Henrique Barboza , qemu-ppc@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH 3/6] hw/ppc/pnv_xscom: Do not use SysBus API to map local MMIO region Date: Wed, 18 Oct 2023 15:30:56 +0200 Message-ID: <20231018133059.85765-4-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231018133059.85765-1-philmd@linaro.org> References: <20231018133059.85765-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::435; envelope-from=philmd@linaro.org; helo=mail-wr1-x435.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: 1697636247510100003 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. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: LIU Zhiwei Reviewed-by: Richard Henderson Reviewed-by: Thomas Huth --- 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 17:48:59 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=1697635936; cv=none; d=zohomail.com; s=zohoarc; b=efDIGBlOJdGyWOn3RSGvJVB7dBUBd0lCvzIrQh7JDydE2fl4Jky7kv6TaTcwzl4YSkGQIB2CVGE+axBgo8R2bPjFSrAwYnpSU9XKT4ECFykyyCPT4vVcnofUK3nIfFcbWJUJMsr+pKjccRex3ioS7QUNfA0DbO35N5pwlqxmKBo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1697635936; 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=lu/LAV3gHNQX3jkZpzINwdsDxIlwSvdZerkbZ9OixCM=; b=Hzho9/nSXJeB2yFKB/6Nykz9GrjvEYqi6sdIYBVPQlMotTJ1HNo3CL2BLyCzAi1v1cGW69P9svWZOgLlubvETSGT+21HcbsvzohkN3R1TtBcQMOQMoGikeKQVrfY6i3SQF8kQIeBC7tKpaaFh5465jV8Wd8QmfHQCKCCVISy/4Y= 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 1697635936378793.3744554737158; Wed, 18 Oct 2023 06:32:16 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qt6e7-0007yX-BO; Wed, 18 Oct 2023 09:31:35 -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 1qt6e4-0007nM-1j for qemu-devel@nongnu.org; Wed, 18 Oct 2023 09:31:32 -0400 Received: from mail-lj1-x235.google.com ([2a00:1450:4864:20::235]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qt6e1-0004l1-9q for qemu-devel@nongnu.org; Wed, 18 Oct 2023 09:31:31 -0400 Received: by mail-lj1-x235.google.com with SMTP id 38308e7fff4ca-2c50cd16f3bso70301451fa.2 for ; Wed, 18 Oct 2023 06:31:28 -0700 (PDT) Received: from m1x-phil.lan (gyl59-h01-176-171-218-149.dsl.sta.abo.bbox.fr. [176.171.218.149]) by smtp.gmail.com with ESMTPSA id j20-20020a05600c1c1400b004065daba6casm1709424wms.46.2023.10.18.06.31.26 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 18 Oct 2023 06:31:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697635887; x=1698240687; 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=lu/LAV3gHNQX3jkZpzINwdsDxIlwSvdZerkbZ9OixCM=; b=Flwtg+G381XLPe8uX9Qnes0U+mWxW26DggCSREM3Om6K5MyyYaeaBEC4KFhWwp4WNZ MyFj2RuB8kPT01kvzn8K1a00GJQiVz2EdpuN61W6rRDopB0KCMcO6v/j3MwqkUAwnmcC 1J8o/lR8FbNqXuPwKRQ5OyrULVq88Qpw/EtigmUlC7xl4PWylPLibS2Psa2S6VO4YzYf qDeOthmt9XeCCtBopzgpG69pCN1UiqWnKGoJbXMfnscUthf+RNABD+jT0Z8oo+YX73Da KejyulFn5c8HWFCfNlT3QjQKU4D+yT8pfY3TdfHgjWKtWqKiuzDcgrlGouHlXjxSKSOP M5xg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697635887; x=1698240687; 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=lu/LAV3gHNQX3jkZpzINwdsDxIlwSvdZerkbZ9OixCM=; b=NFgin2qaQa4qnZ2Xl6fVEmUKFO7gqq3qRAR/ZDt0RpZX2s8ZcS6NzFg94nhgttuL8x HDkAVZQhY4F/CNcCEWYS9Ik0h83m3jz5Er511Exjm0tYkFrrGcYmUD+5jTN9bTORRmbt WNZ5s5hXFDUeNFw7e3kxTht84K7Zh//QyAx940P73wAkpmNfVbdNKEHHt+my2qF9dtx6 dqIaXk/uSQs9tcvfm36rWpUXRoYEnjqkRn5/ZlaM23OG2H2Y3cRP80QeiccOJ7ySC3id gvduwJ1o9vLM3NiwMQYH128lHrn47Zxb4G379VHhTJduUBSujPJl59iVcQSVj7VTs8x8 C6nw== X-Gm-Message-State: AOJu0YwTNpUHckA4cXxnyGO1bFi5amMMtJvRom9oof7fkDNwv9TQYg+g Ydho9wYJjmp7c7I4kARA05odxO/piGikelEhrI4= X-Google-Smtp-Source: AGHT+IGIFCzR94M+GERBn5gvDvTexmVFoJjkQXqILgYsAGPeTOLKM2xlrb6NmZxLj4WqKMU5SqoILg== X-Received: by 2002:a2e:b558:0:b0:2c5:1ad0:e306 with SMTP id a24-20020a2eb558000000b002c51ad0e306mr3437827ljn.8.1697635887546; Wed, 18 Oct 2023 06:31:27 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: David Gibson , =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Barrat?= , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Harsh Prateek Bora , Nicholas Piggin , Daniel Henrique Barboza , qemu-ppc@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH 4/6] hw/ppc/pnv: Do not use SysBus API to map local MMIO region Date: Wed, 18 Oct 2023 15:30:57 +0200 Message-ID: <20231018133059.85765-5-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231018133059.85765-1-philmd@linaro.org> References: <20231018133059.85765-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::235; envelope-from=philmd@linaro.org; helo=mail-lj1-x235.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: 1697635938088100003 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. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: LIU Zhiwei Reviewed-by: Richard Henderson Reviewed-by: Thomas Huth --- 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 17:48:59 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=1697635916; cv=none; d=zohomail.com; s=zohoarc; b=LXIkJcaemK83WT7Wueei4eWcVCyVpVIY2cbHsYAE05u9RQHZuUMIurxNon0clcP+OBqi3aADsA4zfJCQ8TsG+qgLgB6Epy8tTLY7jDjkaddm8wf2ADGiVnxvqoX7ISO98qtWPmZrLmU8Usq9YuzbuKzcZYZsIhBVO3acYnSDKes= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1697635916; 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=3LiT9JTo43Z+vjp2dLyhikt+0rMd61MGWoGcd0rivsU=; b=cWhrLj/qie01J30/YkPjm74xyxGZThp3Abe7jwInwyrMf4bZXHiNBPnie4y9VNoLcaq7USuXXWa4bcRyNgAWLScFB6hNWz9JWyr0GNZYTU23GMXD+f8Zeq+em29URAAr7FsfjYk4bG/oUnYyViBG5W4Z5Ygy/Z5m03qdwJWpdRo= 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 169763591684833.79718807314987; Wed, 18 Oct 2023 06:31:56 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qt6eB-00089F-9Z; Wed, 18 Oct 2023 09:31:39 -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 1qt6e9-00085y-ME for qemu-devel@nongnu.org; Wed, 18 Oct 2023 09:31:37 -0400 Received: from mail-wr1-x435.google.com ([2a00:1450:4864:20::435]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qt6e7-0004lw-JG for qemu-devel@nongnu.org; Wed, 18 Oct 2023 09:31:37 -0400 Received: by mail-wr1-x435.google.com with SMTP id ffacd0b85a97d-307d20548adso5776961f8f.0 for ; Wed, 18 Oct 2023 06:31:35 -0700 (PDT) Received: from m1x-phil.lan (gyl59-h01-176-171-218-149.dsl.sta.abo.bbox.fr. [176.171.218.149]) by smtp.gmail.com with ESMTPSA id p14-20020adfcc8e000000b0032db1d741a6sm2129389wrj.99.2023.10.18.06.31.32 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 18 Oct 2023 06:31:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697635893; x=1698240693; 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=3LiT9JTo43Z+vjp2dLyhikt+0rMd61MGWoGcd0rivsU=; b=VBgNqKbZvtmMXG3Cfl5qYCx1laV9C36ZGDuC1HFfBH1cMTrma2Fb0YYYFtg2TD5hxF B50GSYa807yJSoFW9uL3J5aO0toFge+sx1OkUZLh+LSu0FqhLxDsTlDGKjzu/30KD0GP VR3Z6c86eagoSo/4vdzx6Fkl51WiFAWUGF3Lja73PjFWixHWLRbB9vpIip/U4jN1/HWR W5Rq1ipmWEWmU/U7OJOlkm2kQjc0FY3WNmGz/eE2rrScpKfyx8O8g6W1OGk2KvLc35a4 1gUwyee7M6NTe2KjMGPlT//oigrpDGaHb82DUPo4Qtgm+g2vV8nY8v/cd32xGzZZRc7l GsmQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697635893; x=1698240693; 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=3LiT9JTo43Z+vjp2dLyhikt+0rMd61MGWoGcd0rivsU=; b=utLLQa/4IXZ8IxuBvVhDq9FePnH93rmyW5dQM9Ptb08buG0SB+6qwOw4ZkAmVWVfgM 6O6cYiA3NuIlG1FnU6qQ3Z+pXKMTNqezsQiLhtohSSg/y+MghKVV/aGv9Hfs5Khv0hVC rmzl1ky78crc4VEuMJdkj4PMIHo/9ozs+LYMfCUc2QfPcXi08tftaWTNdRJF8DUk8Coz SjIdkqtft8SlMXwNcU2c642fg6Bppq6MG9Hf7NTAl+usl7RN42kSmJrmixms4iS6Zi0b SJkNyRdFFuNoKx8Uk8wj0D6cT+Ew4ukHe+fHTIxK2AfnWGLDNY2jdBXFIyoMXXs1bry7 RXKg== X-Gm-Message-State: AOJu0Yzbc9//11/Jk4CVH3Yq1uBiccx3uSeiqq4fZEOrrevE55in07dd n+AJomNZgl7MxqMxnP016SPgPdntEzhG0GS/nBA= X-Google-Smtp-Source: AGHT+IEIITG7d/4nNpJXJ1zKdRWbiPc4D0FgLsxV0rNMKRi8LetQrEdmiIg48t6ZcVWU7huA2hZnHw== X-Received: by 2002:a5d:4842:0:b0:32d:a211:798a with SMTP id n2-20020a5d4842000000b0032da211798amr3817524wrs.6.1697635893417; Wed, 18 Oct 2023 06:31:33 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: David Gibson , =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Barrat?= , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Harsh Prateek Bora , Nicholas Piggin , Daniel Henrique Barboza , qemu-ppc@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH 5/6] hw/intc/spapr_xive: Move sysbus_init_mmio() calls around Date: Wed, 18 Oct 2023 15:30:58 +0200 Message-ID: <20231018133059.85765-6-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231018133059.85765-1-philmd@linaro.org> References: <20231018133059.85765-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::435; envelope-from=philmd@linaro.org; helo=mail-wr1-x435.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: 1697635917915100003 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: LIU Zhiwei Reviewed-by: Richard Henderson Reviewed-by: Thomas Huth --- 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 17:48:59 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=1697636130; cv=none; d=zohomail.com; s=zohoarc; b=SLkM01J7J3GRpscaJoAZgY12CLSQbYSFVNp1TYT0wKgOhSjC+IWIGTkxW3/Kv32vkemB9jNI5qT3LptVg2UWq5rbol1odOm/aakAowU5nlVfbb9uZQeFuwP+sLcov4+eBqINZH6c38fFRQXJCRy2YieM4VcUrY/q20Gl2RmJxMA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1697636130; 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=2n8IpqQIL5F84eyb1MGuQCyy0ZKYgEpFAxkwPCfg6VQ=; b=Mv37Ubql/pO0ZcfvBnumdIbB9edpnxhE1bYmyz+AX98nkU+fG6kMJP0nJT2UkcPL4kj1CbxL3aLwPHzEyOmKpMFzEFqFqtP4AJJLLBySerHHceWiG4Olf9ffah7YK0NeoEcU3X4uoeyy7dsqkL5S4jiVrA3fdbg2nd3TCbsl8qE= 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 1697636130897808.1859595778028; Wed, 18 Oct 2023 06:35:30 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qt6eI-0008Gh-KP; Wed, 18 Oct 2023 09:31:46 -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 1qt6eG-0008B6-NO for qemu-devel@nongnu.org; Wed, 18 Oct 2023 09:31:45 -0400 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qt6eD-0004my-3a for qemu-devel@nongnu.org; Wed, 18 Oct 2023 09:31:43 -0400 Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-4083f613272so3856005e9.1 for ; Wed, 18 Oct 2023 06:31:40 -0700 (PDT) Received: from m1x-phil.lan (gyl59-h01-176-171-218-149.dsl.sta.abo.bbox.fr. [176.171.218.149]) by smtp.gmail.com with ESMTPSA id q1-20020adffec1000000b00326b8a0e817sm2126646wrs.84.2023.10.18.06.31.37 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 18 Oct 2023 06:31:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697635899; x=1698240699; 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=2n8IpqQIL5F84eyb1MGuQCyy0ZKYgEpFAxkwPCfg6VQ=; b=zQwo1CmzriR2TvsqqAml3/Xh0j3lSIX08ZtFs4XggEuGFrz6X2PcWx0F+GtrYWER6p GWn8MrD0ZJlr8A02+q3vilaXwRJ5eNLaHuIFtEqo3nLln1DfSDfRsvD25XAJMRMCX68z dT/jfvxrRsURivYaal5KfTF1n5Q2ScZnDj/w9bC33jucSuLc9FO2pX1BMCeh9kluGdK+ q6TH2n/ske3kld0et/rO6DbVsiUd0NBZCnQhnxKnEPDr1iu7TtqQ5NHhJC7UAaHyNFOJ joIvSat8kauk75WWad7375YDRPNISK2gHtDsiKgYGGWoXvayTbNhEY/qTPHD4EUoWmOa xTBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697635899; x=1698240699; 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=2n8IpqQIL5F84eyb1MGuQCyy0ZKYgEpFAxkwPCfg6VQ=; b=nPZLaiJBntqS2BMezJt30gH65a5dzDfeYO4b1d/5E8wOAGbzal3g43ZatVqy/hxdTU YK7KQgVCIAe0A15w44XAlQSEFqMMZs8fo3bscoFBZgnfWpwr8RLjKh667QgiE0k3srMj Kmp3tDEAuQNrtUoYvNmXcqnAWzcCRxuPfQ4If0MtEnU1hSPoVPUGYwMABKPyO427tkW/ m8Km+rT+0+l7vQny97wcL7wLDJNMUJiQeQHc2YLdya62YVH/WGE5tkPkslYYVgZUN6S5 A9Mp3Q/TRFkuRya/yjJV9YJTDp2I1Y/lhdGix5b0O0KX66+zzOyr3uFjNZb2z909gjyp IEwA== X-Gm-Message-State: AOJu0Yy46uPUbJSCWU1H5Nu+vf5L8Wj+/loKMMG1sQOnJg/GM7d2Xo2+ z2zLs47UcVgnASntQK2Xtwle9bdWIqwdusMMEXA= X-Google-Smtp-Source: AGHT+IHMkcWk3Ns01tOkZd1QYaErFwYIcllHtNRi9UrqJvyWps1z2vlDKxsazzamcbSjd+jthh+ihA== X-Received: by 2002:a05:600c:4fd2:b0:402:f07c:4b48 with SMTP id o18-20020a05600c4fd200b00402f07c4b48mr3998659wmq.28.1697635899276; Wed, 18 Oct 2023 06:31:39 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: David Gibson , =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Barrat?= , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Harsh Prateek Bora , Nicholas Piggin , Daniel Henrique Barboza , qemu-ppc@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH 6/6] hw/intc/spapr_xive: Do not use SysBus API to map local MMIO region Date: Wed, 18 Oct 2023 15:30:59 +0200 Message-ID: <20231018133059.85765-7-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231018133059.85765-1-philmd@linaro.org> References: <20231018133059.85765-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::32c; envelope-from=philmd@linaro.org; helo=mail-wm1-x32c.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: 1697636133077100003 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. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: LIU Zhiwei Reviewed-by: Richard Henderson Reviewed-by: Thomas Huth --- 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