From patchwork Wed Oct 18 13:30:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 1850844 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=TdqlEWr6; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4S9X2h1dYhz20Zj for ; Thu, 19 Oct 2023 00:37:16 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qt6e4-0007qs-V8; Wed, 18 Oct 2023 09:31:32 -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 1qt6dm-0007f8-2e for qemu-ppc@nongnu.org; Wed, 18 Oct 2023 09:31:15 -0400 Received: from mail-lf1-x136.google.com ([2a00:1450:4864:20::136]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qt6dk-0004hP-9g for qemu-ppc@nongnu.org; Wed, 18 Oct 2023 09:31:13 -0400 Received: by mail-lf1-x136.google.com with SMTP id 2adb3069b0e04-507a29c7eefso5717598e87.1 for ; Wed, 18 Oct 2023 06:31:11 -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=bjE1Jmf40pq2jp2Hq+54B4dTU4qCVZ6w0WcZHnf2MeMzOvaXsebjEo8pUDyxrlNDM7 q9trWKfun/6oy5OHb1BvrBuMs/q1nej5f/n1LrQtT/6rU49Osr2I+dHQPIBOu/7ePrxl yoPKDzcdunZ3VLuBmLDzsb1RjQVIYvpGC4q0fXSV/cNSNyipDZwc1j1y08deh+U9hId+ FlEOOfX0KZWYADeMNQ3okGxSBiuoUSPsiVlcCPfmqbJZ7IfYMA7MTFoKi82tBr+2YWfD 2dUjGrmx8L3cQ83OLtFwxMPP+SKZTK1RtDJEyFQshueh+X0E83y07hcIDu1vljegi+LY A3hA== X-Gm-Message-State: AOJu0Yx5/QqVmCq2dQ6HfYLPJKymQ+Ocfa6IMV2ioCY60yiKBA8q8R0S g3EfnA3dlcXpqDJx15Cp/69Xew== 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) 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) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: David Gibson , =?utf-8?b?RnLDqWTDqXJpYyBC?= =?utf-8?b?YXJyYXQ=?= , =?utf-8?q?C=C3=A9dric_Le_Goat?= =?utf-8?q?er?= , Harsh Prateek Bora , Nicholas Piggin , Daniel Henrique Barboza , qemu-ppc@nongnu.org, =?utf-8?q?Philippe_Mathieu-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 Received-SPF: pass client-ip=2a00:1450:4864:20::136; envelope-from=philmd@linaro.org; helo=mail-lf1-x136.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-ppc@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-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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é 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 -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); /* 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)); pcc->parent_realize(dev, &local_err); @@ -1512,11 +1508,7 @@ static void pnv_chip_power9_realize(DeviceState *dev, Error **errp) Error *local_err = NULL; /* 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)); pcc->parent_realize(dev, &local_err); @@ -1727,11 +1719,7 @@ static void pnv_chip_power10_realize(DeviceState *dev, Error **errp) Error *local_err = NULL; /* 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)); 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 = { .endianness = DEVICE_BIG_ENDIAN, }; -void pnv_xscom_realize(PnvChip *chip, uint64_t size, Error **errp) +void pnv_xscom_init(PnvChip *chip, uint64_t size) { SysBusDevice *sbd = SYS_BUS_DEVICE(chip); char *name; From patchwork Wed Oct 18 13:30:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 1850842 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=iqiTj8zu; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4S9X0J497jz20Zj for ; Thu, 19 Oct 2023 00:35:12 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qt6e6-0007ws-Tt; 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-0007hL-Qm for qemu-ppc@nongnu.org; Wed, 18 Oct 2023 09:31:27 -0400 Received: from mail-lf1-x12e.google.com ([2a00:1450:4864:20::12e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qt6dp-0004i4-C7 for qemu-ppc@nongnu.org; Wed, 18 Oct 2023 09:31:20 -0400 Received: by mail-lf1-x12e.google.com with SMTP id 2adb3069b0e04-504a7f9204eso9077736e87.3 for ; Wed, 18 Oct 2023 06:31:16 -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=i58cK7R7tWFasAE3Jok0NlLJkWaeBYiuiWszo+CMdzk5HyWOGaWBDz1tZdcOCWcRmX FXuWgkvWkl5WUt9RrTzsm3B/jj3fEH1Lk18Om0Tok6Q2VoLyYt+bzTHIHhd0SdYxUKMI xb12VnJOyxvsrIbb5v1iNF7q4uJKVozhg7SK1DbIR0UlDbPs8daVUv7WA1HIK1B4fT1c pfswdX8/EGjGFdx5LFWLDkri2BHWWYhd7uavJFf0tP3Xf/dYqXrCkngq11+DV8oIWUg8 MKI+IPjVomMUoNLj4E1F5+jwHn7kVbvcDDTNPYnNDXq2CN5b+8hPKoCzEHnYn9A+cscA E3dA== X-Gm-Message-State: AOJu0Yw19sicrD5CLDg7urwWHiqLFqzw9pCNVbzU4APYeY9dGallxleQ lFDUGkc67POQfp//RMcSWjXx7Q== 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) 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) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: David Gibson , =?utf-8?b?RnLDqWTDqXJpYyBC?= =?utf-8?b?YXJyYXQ=?= , =?utf-8?q?C=C3=A9dric_Le_Goat?= =?utf-8?q?er?= , Harsh Prateek Bora , Nicholas Piggin , Daniel Henrique Barboza , qemu-ppc@nongnu.org, =?utf-8?q?Philippe_Mathieu-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 Received-SPF: pass client-ip=2a00:1450:4864:20::12e; envelope-from=philmd@linaro.org; helo=mail-lf1-x12e.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-ppc@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-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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é 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 -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); /* 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)); 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 = NULL; /* 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)); 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 = NULL; /* 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)); 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 = { .endianness = DEVICE_BIG_ENDIAN, }; -void pnv_xscom_init(PnvChip *chip, uint64_t size) +void pnv_xscom_init(PnvChip *chip, uint64_t size, hwaddr addr) { SysBusDevice *sbd = 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); memory_region_init(&chip->xscom, OBJECT(chip), name, size); address_space_init(&chip->xscom_as, &chip->xscom, name); From patchwork Wed Oct 18 13:30:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 1850845 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=VYVsTTWe; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4S9X2h6NfQz23jS for ; Thu, 19 Oct 2023 00:37:16 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qt6e5-0007sS-AL; 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 1qt6dx-0007hm-HY for qemu-ppc@nongnu.org; Wed, 18 Oct 2023 09:31:31 -0400 Received: from mail-wr1-x434.google.com ([2a00:1450:4864:20::434]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qt6dv-0004k2-UG for qemu-ppc@nongnu.org; Wed, 18 Oct 2023 09:31:25 -0400 Received: by mail-wr1-x434.google.com with SMTP id ffacd0b85a97d-32d9552d765so5321019f8f.2 for ; Wed, 18 Oct 2023 06:31:22 -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=dFOgFb04zm0wJc1YwycEHXS7wuAEnvw8oC+kJ+q5nlohUBBcX16RYxW4J9dU4efPJ2 jSwyTG5vgK2xNOpxRG6DHrlbLcLFj5LKrT4jeU/qxaoX0YTHrtLMO1gC9lZ3qcZyk42s RP+l2ai55x5zHfKsShE0SxMbWKtsbOPB54sn0wHvwyEhTUMGYRZgJNgFMjrzfiMUZ6Gc JjLMgYAEzSRmlzX8FjffGNZEowBpDAlbizfo224t+Y59Zcdbp0ML9snymUOhzdVKs6Px 6VKptKER79AUQM0UzcnXrR8yS5dBTQ+m//xfZr+HPE1yyxYpgoxGISXptd9mNfJzjqZs mPVg== X-Gm-Message-State: AOJu0YyjVkx7pdVUrpZGKhrlO57kyApjdgegZTRh9554XdMjHAeubdWv 0OXezObEX6zxNJQ1X0+SRTXeIg== 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) 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) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: David Gibson , =?utf-8?b?RnLDqWTDqXJpYyBC?= =?utf-8?b?YXJyYXQ=?= , =?utf-8?q?C=C3=A9dric_Le_Goat?= =?utf-8?q?er?= , Harsh Prateek Bora , Nicholas Piggin , Daniel Henrique Barboza , qemu-ppc@nongnu.org, =?utf-8?q?Philippe_Mathieu-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 Received-SPF: pass client-ip=2a00:1450:4864:20::434; envelope-from=philmd@linaro.org; helo=mail-wr1-x434.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-ppc@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-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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é 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 = { void pnv_xscom_init(PnvChip *chip, uint64_t size, hwaddr addr) { - SysBusDevice *sbd = SYS_BUS_DEVICE(chip); char *name; name = 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_mmio); memory_region_init(&chip->xscom, OBJECT(chip), name, size); address_space_init(&chip->xscom_as, &chip->xscom, name); From patchwork Wed Oct 18 13:30:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 1850840 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=Flwtg+G3; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4S9Wxj49Zhz20Pd for ; Thu, 19 Oct 2023 00:32:57 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qt6e7-00081S-U4; 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-0007nl-4p for qemu-ppc@nongnu.org; Wed, 18 Oct 2023 09:31:32 -0400 Received: from mail-lj1-x22b.google.com ([2a00:1450:4864:20::22b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qt6e1-0004kr-Ai for qemu-ppc@nongnu.org; Wed, 18 Oct 2023 09:31:31 -0400 Received: by mail-lj1-x22b.google.com with SMTP id 38308e7fff4ca-2c4fe37f166so83952401fa.1 for ; Wed, 18 Oct 2023 06:31:28 -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=B9ORDJfDtdWgpTPf2w+atEJzMis/8w3Hayuto7jU1NCHC6ip8MeoZ1RZM2FzWykTQT bA+NQ3Tfw25P0Mq8cOC9CVcKxAfspmCfMVZ0Cn4i/OZYr8wWs4jL0mOAVRM1hBDrj5Mc GpLHF5r/PzuOkKufNyZgCVRX5qlNNQy1AtFOQYeStoSjTp0z8q63VPmUxYaxAFYDqVv9 lSFf/HVacVP4s5UMdG5aepLJB6DvKjTexjb4CvM+6le7DRzzv0PCKl4iuaeWovDB60Zj Z118txLs2uSEO3ER8Tkw6XTPzYFGF72eo72OBCG1I+W20RBT7YPCRP4SgVsMDdr2RqOc Srtw== X-Gm-Message-State: AOJu0YzlMijWBZVDL9+dOCrfX6DOXR6l69mVnhruz/KnadnBb1bf75hJ PSdhhnlYT2tHnoLr3oORpuDXxQ== 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) 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) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: David Gibson , =?utf-8?b?RnLDqWTDqXJpYyBC?= =?utf-8?b?YXJyYXQ=?= , =?utf-8?q?C=C3=A9dric_Le_Goat?= =?utf-8?q?er?= , Harsh Prateek Bora , Nicholas Piggin , Daniel Henrique Barboza , qemu-ppc@nongnu.org, =?utf-8?q?Philippe_Mathieu-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 Received-SPF: pass client-ip=2a00:1450:4864:20::22b; envelope-from=philmd@linaro.org; helo=mail-lj1-x22b.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-ppc@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-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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é 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, Error **errp) name = 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); /* Map the ICP registers for each thread */ for (i = 0; i < chip->nr_cores; i++) { From patchwork Wed Oct 18 13:30:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 1850839 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=VBgNqKbZ; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4S9Wxc6NSkz20Pd for ; Thu, 19 Oct 2023 00:32:52 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qt6eA-00087Q-E9; Wed, 18 Oct 2023 09:31:38 -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 1qt6e8-00084e-R2 for qemu-ppc@nongnu.org; Wed, 18 Oct 2023 09:31:37 -0400 Received: from mail-wr1-x42d.google.com ([2a00:1450:4864:20::42d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qt6e7-0004lt-1n for qemu-ppc@nongnu.org; Wed, 18 Oct 2023 09:31:36 -0400 Received: by mail-wr1-x42d.google.com with SMTP id ffacd0b85a97d-32da7ac5c4fso3287699f8f.1 for ; Wed, 18 Oct 2023 06:31:34 -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=Jo+vbncmaWI4con6bVPRH+W6qgnGjFtEOub5TvZ8/l4r0hQncDDefE0PzofMftHL9m S1x8BSGUQ1rOz/jyNPcV83BAqyyTEXA8epy2DR0Pey9KM5PezWKkAUKpaHVM/6A6B4Jv /1oMM5tDQBtdkiq6rUHxcfPXVTwDaTmhbyGkbW/OGQAYUdFse7SCAzf6jpV63a3ZnSYf J05SFD4hKC+lriA72lE95HzL0HwFmyRlpLHcRLZan06o7G1yRKdtGbw610K0tQKGXJzu aK0Tlq4nSh5juQaHNPr67oiLicjQ35Pt9ita9kpVNL2+LXPC2lpcB66cfUMCVkp2fsmU u7EA== X-Gm-Message-State: AOJu0YxCG1zC/RnLu61VwsF9xejVKXegJcIdRg/gimyk3IH5wrYIRYd4 NkVP7ANydOcKkwRvhWudu4vyeg== 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) 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) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: David Gibson , =?utf-8?b?RnLDqWTDqXJpYyBC?= =?utf-8?b?YXJyYXQ=?= , =?utf-8?q?C=C3=A9dric_Le_Goat?= =?utf-8?q?er?= , Harsh Prateek Bora , Nicholas Piggin , Daniel Henrique Barboza , qemu-ppc@nongnu.org, =?utf-8?q?Philippe_Mathieu-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 Received-SPF: pass client-ip=2a00:1450:4864:20::42d; envelope-from=philmd@linaro.org; helo=mail-wr1-x42d.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-ppc@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-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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é 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); /* * 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); /* Set the mapping address of the END ESB pages after the source ESBs */ xive->end_base = xive->vc_base + xive_source_esb_len(xsrc); @@ -347,14 +345,16 @@ static void spapr_xive_realize(DeviceState *dev, Error **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); /* * 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); } From patchwork Wed Oct 18 13:30:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 1850841 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=zQwo1Cmz; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4S9Wy00rMRz20Pd for ; Thu, 19 Oct 2023 00:33:12 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qt6eJ-0008II-2Y; Wed, 18 Oct 2023 09:31: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 1qt6eG-0008B4-Ny for qemu-ppc@nongnu.org; Wed, 18 Oct 2023 09:31:45 -0400 Received: from mail-wm1-x32a.google.com ([2a00:1450:4864:20::32a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qt6eC-0004mx-Tt for qemu-ppc@nongnu.org; Wed, 18 Oct 2023 09:31:42 -0400 Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-405497850dbso64345445e9.0 for ; Wed, 18 Oct 2023 06:31:40 -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=Ed3A1dcocOkDGLmUO1ECjOU6ZUD5HZ1Ir3pEhwHzN5i1Yyl8lwHV+sFrfZzkL8BiWn P4Ry8iR2djcPAyRbcQpAOGH873WtCCUgRPbhyzUWPwhUjo4Ba0RDDp1TQyAYeDOEV3pe pvgClpFgISl0ewmhWgRx2sb5iul90LjbkSBGc/MEh9QcIGHo8GljG2ZX+8IWUPgAy7KO 8d3njqx3nOuQ6RNs8Zs4SYCoGnUMUCTqPJ5bzoxiLrx95j86vAoI+0jB7pgKtpPnEosG rNX2yf1cnkCanXfsE82gQaeZxsEyiEyDYeNtwqjyovr+aptsYS6SVNvkvDbIIXIYxH+O NLnA== X-Gm-Message-State: AOJu0YxbRkBjoNNnNtzUdv4RrPZqzFpOowhqEgcRaihTjay6PX/gRah0 Jfn7Vo4hnYxn+5wV3Oj0Rp06nuibnBwbnlrS/W0= 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) 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) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: David Gibson , =?utf-8?b?RnLDqWTDqXJpYyBC?= =?utf-8?b?YXJyYXQ=?= , =?utf-8?q?C=C3=A9dric_Le_Goat?= =?utf-8?q?er?= , Harsh Prateek Bora , Nicholas Piggin , Daniel Henrique Barboza , qemu-ppc@nongnu.org, =?utf-8?q?Philippe_Mathieu-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 Received-SPF: pass client-ip=2a00:1450:4864:20::32a; envelope-from=philmd@linaro.org; helo=mail-wm1-x32a.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-ppc@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-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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é 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, Error **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); } static int spapr_xive_get_eas(XiveRouter *xrtr, uint8_t eas_blk,