From nobody Sun Oct 19 03:40:22 2025 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=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1747628836; cv=none; d=zohomail.com; s=zohoarc; b=HdY+KY+XnyhdGzHg2OFREw+q5vvIFjSuJperJx5yBQexTHwIdB2/JkWMzYgVKYB/NNlJ2lsUGs+XgMKj0WACdL73f8DuzdgzpgVE+8PJ2pdm+owPCYDCNSlhs6gATfL3XR2hrvKDzZetsMSwz+Mk/dLU+wPpJQAnW+r2hs2nqfQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1747628836; h=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=B300N4tFGzpqfBm+PQfnLU/hq0whY6Gs5bO28y2J7A4=; b=CZvTzx1+xRRLpl4Acve1q+czn9MoPJNyvezHxoESNCuSHm2xWfwyT2A/AqIo24ODlBTliDSBIJqkgPQUF3ZvMYmwNyfgbBhPcsHrRNzc/IlKbhNsgSLbaLUPkTDIkSAiJ0JtjR1hck5wN/hs8FW9ImOHv30BZ8E1uSYRA5olCPU= 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 1747628836536663.9789017852614; Sun, 18 May 2025 21:27:16 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uGs4c-0002uc-DB; Mon, 19 May 2025 00:25:58 -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 1uGrox-0008S2-VC for qemu-devel@nongnu.org; Mon, 19 May 2025 00:09:50 -0400 Received: from mail-pg1-x531.google.com ([2607:f8b0:4864:20::531]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uGrow-0004OC-2t for qemu-devel@nongnu.org; Mon, 19 May 2025 00:09:47 -0400 Received: by mail-pg1-x531.google.com with SMTP id 41be03b00d2f7-afc857702d1so3573090a12.3 for ; Sun, 18 May 2025 21:09:45 -0700 (PDT) Received: from toolbx.alistair23.me (2403-580b-97e8-0-82ce-f179-8a79-69f4.ip6.aussiebb.net. [2403:580b:97e8:0:82ce:f179:8a79:69f4]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-231ecd5ea41sm41750035ad.228.2025.05.18.21.09.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 18 May 2025 21:09:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1747627784; x=1748232584; 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=B300N4tFGzpqfBm+PQfnLU/hq0whY6Gs5bO28y2J7A4=; b=neL+TV46MuHtRU5srcIMQEMjgv/w0iweBOPpoKdaPcNJvGzQo6fwVhBzt6wmnIEQu1 +UT83cZ4E5clm7vJWVhPMNZEflVSeuR08F/gp9oXB9OH/J1WH9NFNJQYdM8gqoSEuB1T Eh65Cgl+rWUw6V51jSh3M2RLBl1zHgLoZrK51Ms87nPVsH7jgctw5VVhiqeXhr7Gt2OE QM/t1kFl26r8eiae7o4UJif4bdFcuGSUtCLnv+6yzsymxzGgn2Lhpjnoi5ziZOXymXWr coo6bes1Q7jK/gBSbeePa5v7Iarxg38DMlRzmWOjFNKLLmqc/WfpsN0ytt9FLA9idV16 84eQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1747627784; x=1748232584; 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=B300N4tFGzpqfBm+PQfnLU/hq0whY6Gs5bO28y2J7A4=; b=doKPMXhLJkuoacVV3TgHXnf111txh8MQTTP0zCSyBrmNMlJHmmLf1M7nWQqZsLREj9 5wIFc4nGq0g5DlzonTUkHofz5bLyCxZvF9oP+OxUoTRSL7YLMrVG5s0vbFrdNdkmduWR 5ncdJqj41UzsxkEhAQ2x0FF/khaHahSiJETUV/EMAqp6imsVuWZ+hxNeeQt3bKI022ay ufomISvOpvtLIskPK3JJB+lWkwoE4rthNDmaptzGkH5l92OzoOUk7NmF7eVzEC3Z7NJ5 zzeK5zWO7YZ4c/ED07czxDqEatFlygth+1JwdPTxef211izTmWjaiVRbG6BsbucbwKmn jIiQ== X-Gm-Message-State: AOJu0Yw0r8VRKKC4tQK0VjvgcniDaDqjVL97Z9AVVS/u4gTe3+c5wxit vcT2wrhWm3GJXgcXby4+ZetUgLwWEaBNH0Voj3GoY0wdwAxFobVyBVOrVNmpVQ== X-Gm-Gg: ASbGncu/C+aVpJhGEIdNdexwG3YIsu0oJ8gWVX2n8lOnwoQOO9+HyxZJMaizDwHSFJD T9BWQHRHlFw+1w2SIWYAnaeB4QaO/Ch8jBt6v6YVFXekX9s4qiGJmAHwgd+zj00JaUPjaGgbUoy g5qn6UwiFlmmvqaUhGkLEbB6BDLcs9aingmeOi7oeYEy76BGiUvBPo8hKHYYlFH+LQSSeRJxMLx cMh6R50TZQv210qWAvDjPgPxDHGVpKwT1k0+PSrPQe1jF9gnA0NvH8275Vgbun94Hz3Kz/nAkOF biKtTPPt+9GcSP058cTyNgFsAnHsTA526pzwWup4NYlOzM9Gy3PDk1saDRcnh7UHOcSeWlR1OKm m1zgHx2nux7lgniabjJ1YSg7ij/H3sXucZr11ML95/e81NwjPglpF6IQJ X-Google-Smtp-Source: AGHT+IGkd576SG3pbyCDzfw/V2/d31Bp1L1f/9OLaS8f/aprVg2gprPUvMl2TY7PPNa8CUtVQkhz7A== X-Received: by 2002:a17:903:230b:b0:22f:b6cc:421e with SMTP id d9443c01a7336-231d452683fmr162141075ad.26.1747627784344; Sun, 18 May 2025 21:09:44 -0700 (PDT) From: alistair23@gmail.com X-Google-Original-From: alistair.francis@wdc.com To: qemu-devel@nongnu.org Cc: alistair23@gmail.com, Daniel Henrique Barboza , Alistair Francis Subject: [PULL 49/56] hw/riscv/virt.c: remove trivial virt_memmap references Date: Mon, 19 May 2025 14:05:46 +1000 Message-ID: <20250519040555.3797167-50-alistair.francis@wdc.com> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250519040555.3797167-1-alistair.francis@wdc.com> References: <20250519040555.3797167-1-alistair.francis@wdc.com> MIME-Version: 1.0 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=2607:f8b0:4864:20::531; envelope-from=alistair23@gmail.com; helo=mail-pg1-x531.google.com X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 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, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, 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 @gmail.com) X-ZM-MESSAGEID: 1747628837643116600 Content-Type: text/plain; charset="utf-8" From: Daniel Henrique Barboza We should use s->memmap instead of virt_memmap to be able to use an updated memmap when we start versioning the board. Signed-off-by: Daniel Henrique Barboza Reviewed-by: Alistair Francis Message-ID: <20250429125811.224803-3-dbarboza@ventanamicro.com> Signed-off-by: Alistair Francis --- hw/riscv/virt.c | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/hw/riscv/virt.c b/hw/riscv/virt.c index 0200679240..843665a5bd 100644 --- a/hw/riscv/virt.c +++ b/hw/riscv/virt.c @@ -166,8 +166,8 @@ static void virt_flash_map1(PFlashCFI01 *flash, static void virt_flash_map(RISCVVirtState *s, MemoryRegion *sysmem) { - hwaddr flashsize =3D virt_memmap[VIRT_FLASH].size / 2; - hwaddr flashbase =3D virt_memmap[VIRT_FLASH].base; + hwaddr flashsize =3D s->memmap[VIRT_FLASH].size / 2; + hwaddr flashbase =3D s->memmap[VIRT_FLASH].base; =20 virt_flash_map1(s->flash[0], flashbase, flashsize, sysmem); @@ -999,8 +999,8 @@ static void create_fdt_rtc(RISCVVirtState *s, const Mem= MapEntry *memmap, static void create_fdt_flash(RISCVVirtState *s, const MemMapEntry *memmap) { MachineState *ms =3D MACHINE(s); - hwaddr flashsize =3D virt_memmap[VIRT_FLASH].size / 2; - hwaddr flashbase =3D virt_memmap[VIRT_FLASH].base; + hwaddr flashsize =3D s->memmap[VIRT_FLASH].size / 2; + hwaddr flashbase =3D s->memmap[VIRT_FLASH].base; g_autofree char *name =3D g_strdup_printf("/flash@%" PRIx64, flashbase= ); =20 qemu_fdt_add_subnode(ms->fdt, name); @@ -1035,7 +1035,7 @@ static void create_fdt_virtio_iommu(RISCVVirtState *s= , uint16_t bdf) g_autofree char *pci_node =3D NULL; =20 pci_node =3D g_strdup_printf("/soc/pci@%lx", - (long) virt_memmap[VIRT_PCIE_ECAM].base); + (long) s->memmap[VIRT_PCIE_ECAM].base); iommu_node =3D g_strdup_printf("%s/virtio_iommu@%x,%x", pci_node, PCI_SLOT(bdf), PCI_FUNC(bdf)); iommu_phandle =3D qemu_fdt_alloc_phandle(fdt); @@ -1104,7 +1104,7 @@ static void create_fdt_iommu(RISCVVirtState *s, uint1= 6_t bdf) g_autofree char *pci_node =3D NULL; =20 pci_node =3D g_strdup_printf("/soc/pci@%lx", - (long) virt_memmap[VIRT_PCIE_ECAM].base); + (long) s->memmap[VIRT_PCIE_ECAM].base); iommu_node =3D g_strdup_printf("%s/iommu@%x", pci_node, bdf); iommu_phandle =3D qemu_fdt_alloc_phandle(fdt); qemu_fdt_add_subnode(fdt, iommu_node); @@ -1126,24 +1126,24 @@ static void finalize_fdt(RISCVVirtState *s) uint32_t irq_pcie_phandle =3D 1, irq_virtio_phandle =3D 1; uint32_t iommu_sys_phandle =3D 1; =20 - create_fdt_sockets(s, virt_memmap, &phandle, &irq_mmio_phandle, + create_fdt_sockets(s, s->memmap, &phandle, &irq_mmio_phandle, &irq_pcie_phandle, &irq_virtio_phandle, &msi_pcie_phandle); =20 - create_fdt_virtio(s, virt_memmap, irq_virtio_phandle); + create_fdt_virtio(s, s->memmap, irq_virtio_phandle); =20 if (virt_is_iommu_sys_enabled(s)) { create_fdt_iommu_sys(s, irq_mmio_phandle, msi_pcie_phandle, &iommu_sys_phandle); } - create_fdt_pcie(s, virt_memmap, irq_pcie_phandle, msi_pcie_phandle, + create_fdt_pcie(s, s->memmap, irq_pcie_phandle, msi_pcie_phandle, iommu_sys_phandle); =20 - create_fdt_reset(s, virt_memmap, &phandle); + create_fdt_reset(s, s->memmap, &phandle); =20 - create_fdt_uart(s, virt_memmap, irq_mmio_phandle); + create_fdt_uart(s, s->memmap, irq_mmio_phandle); =20 - create_fdt_rtc(s, virt_memmap, irq_mmio_phandle); + create_fdt_rtc(s, s->memmap, irq_mmio_phandle); } =20 static void create_fdt(RISCVVirtState *s, const MemMapEntry *memmap) @@ -1361,14 +1361,13 @@ static void create_platform_bus(RISCVVirtState *s, = DeviceState *irqchip) { DeviceState *dev; SysBusDevice *sysbus; - const MemMapEntry *memmap =3D virt_memmap; int i; MemoryRegion *sysmem =3D get_system_memory(); =20 dev =3D qdev_new(TYPE_PLATFORM_BUS_DEVICE); dev->id =3D g_strdup(TYPE_PLATFORM_BUS_DEVICE); qdev_prop_set_uint32(dev, "num_irqs", VIRT_PLATFORM_BUS_NUM_IRQS); - qdev_prop_set_uint32(dev, "mmio_size", memmap[VIRT_PLATFORM_BUS].size); + qdev_prop_set_uint32(dev, "mmio_size", s->memmap[VIRT_PLATFORM_BUS].si= ze); sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal); s->platform_bus_dev =3D dev; =20 @@ -1379,7 +1378,7 @@ static void create_platform_bus(RISCVVirtState *s, De= viceState *irqchip) } =20 memory_region_add_subregion(sysmem, - memmap[VIRT_PLATFORM_BUS].base, + s->memmap[VIRT_PLATFORM_BUS].base, sysbus_mmio_get_region(sysbus, 0)); } =20 --=20 2.49.0