From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: qemu-devel@nongnu.org
Cc: "Mark Cave-Ayland" <mark.caveayland@nutanix.com>,
qemu-ppc@nongnu.org, qemu-riscv@nongnu.org,
qemu-block@nongnu.org,
"Marc-André Lureau" <marcandre.lureau@redhat.com>,
qemu-arm@nongnu.org, qemu-s390x@nongnu.org,
"Philippe Mathieu-Daudé" <philmd@linaro.org>,
"Michael S. Tsirkin" <mst@redhat.com>,
"Marcel Apfelbaum" <marcel.apfelbaum@gmail.com>,
"Paolo Bonzini" <pbonzini@redhat.com>,
"Richard Henderson" <richard.henderson@linaro.org>,
"Eduardo Habkost" <eduardo@habkost.net>,
"Song Gao" <gaosong@loongson.cn>,
"Bibo Mao" <maobibo@loongson.cn>,
"Jiaxun Yang" <jiaxun.yang@flygoat.com>
Subject: [PATCH v3 14/25] hw/fdt: Use memory_region_get_address()
Date: Tue, 28 Oct 2025 19:12:48 +0100 [thread overview]
Message-ID: <20251028181300.41475-15-philmd@linaro.org> (raw)
In-Reply-To: <20251028181300.41475-1-philmd@linaro.org>
MemoryRegion::addr is private data of MemoryRegion, use
memory_region_get_address() to access it.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
hw/i386/microvm-dt.c | 4 ++--
hw/loongarch/virt-fdt-build.c | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/hw/i386/microvm-dt.c b/hw/i386/microvm-dt.c
index d7f49bc1b5f..5b64f5b7f30 100644
--- a/hw/i386/microvm-dt.c
+++ b/hw/i386/microvm-dt.c
@@ -72,7 +72,7 @@ static void dt_add_virtio(MicrovmMachineState *mms, VirtIOMMIOProxy *mmio)
}
MemoryRegion *mr = sysbus_mmio_get_region(dev, 0);
- hwaddr base = mr->addr;
+ hwaddr base = memory_region_get_address(mr);
hwaddr size = 512;
unsigned index = (base - VIRTIO_MMIO_BASE) / size;
uint32_t irq = mms->virtio_irq_base + index;
@@ -152,7 +152,7 @@ static void dt_add_pcie(MicrovmMachineState *mms)
static void dt_add_ioapic(MicrovmMachineState *mms, SysBusDevice *dev)
{
MemoryRegion *mr = sysbus_mmio_get_region(dev, 0);
- hwaddr base = mr->addr;
+ hwaddr base = memory_region_get_address(mr);
char *nodename;
uint32_t ph;
int index;
diff --git a/hw/loongarch/virt-fdt-build.c b/hw/loongarch/virt-fdt-build.c
index 1f0ba01f711..54524e5aca9 100644
--- a/hw/loongarch/virt-fdt-build.c
+++ b/hw/loongarch/virt-fdt-build.c
@@ -195,11 +195,11 @@ static void fdt_add_flash_node(LoongArchVirtMachineState *lvms)
hwaddr flash1_size;
flash_mem = pflash_cfi01_get_memory(lvms->flash[0]);
- flash0_base = flash_mem->addr;
+ flash0_base = memory_region_get_address(flash_mem);
flash0_size = memory_region_size(flash_mem);
flash_mem = pflash_cfi01_get_memory(lvms->flash[1]);
- flash1_base = flash_mem->addr;
+ flash1_base = memory_region_get_address(flash_mem);
flash1_size = memory_region_size(flash_mem);
nodename = g_strdup_printf("/flash@%" PRIx64, flash0_base);
--
2.51.0
next prev parent reply other threads:[~2025-10-28 18:32 UTC|newest]
Thread overview: 71+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-28 18:12 [PATCH v3 00/25] hw/sysbus: Spring cleanups (part 1) Philippe Mathieu-Daudé
2025-10-28 18:12 ` [PATCH v3 01/25] hw/i386/microvm: Use proper SysBus accessors Philippe Mathieu-Daudé
2025-10-29 5:54 ` Thomas Huth
2025-10-30 6:58 ` Zhao Liu
2025-10-28 18:12 ` [PATCH v3 02/25] hw/i386/ioapic: " Philippe Mathieu-Daudé
2025-10-30 6:58 ` Zhao Liu
2025-10-30 7:03 ` Zhao Liu
2025-10-28 18:12 ` [PATCH v3 03/25] hw/timer/hpet: " Philippe Mathieu-Daudé
2025-10-30 6:57 ` Zhao Liu
2025-10-28 18:12 ` [PATCH v3 04/25] hw/acpi/cxl: " Philippe Mathieu-Daudé
2025-10-29 7:56 ` Richard Henderson
2025-10-29 11:05 ` Jonathan Cameron via
2025-10-28 18:12 ` [PATCH v3 05/25] hw/ppc/e500: " Philippe Mathieu-Daudé
2025-10-29 7:56 ` Richard Henderson
2025-10-28 18:12 ` [PATCH v3 06/25] hw/pci-bridge: " Philippe Mathieu-Daudé
2025-10-28 19:28 ` BALATON Zoltan
2025-10-28 18:12 ` [PATCH v3 07/25] hw/sysbus: Use memory_region_name() Philippe Mathieu-Daudé
2025-10-29 7:57 ` Richard Henderson
2025-10-28 18:12 ` [PATCH v3 08/25] hw/nvme/ctrl: Use memory_region_size() Philippe Mathieu-Daudé
2025-10-29 7:58 ` Richard Henderson
2025-10-30 7:59 ` Klaus Jensen
2025-10-28 18:12 ` [PATCH v3 09/25] hw/s390x: " Philippe Mathieu-Daudé
2025-10-29 5:42 ` Thomas Huth
2025-10-29 7:59 ` Richard Henderson
2025-10-29 8:26 ` David Hildenbrand
2025-10-28 18:12 ` [PATCH v3 10/25] system/memory: Have memory_region_size() take a const argument Philippe Mathieu-Daudé
2025-10-28 18:41 ` Peter Xu
2025-10-29 5:48 ` Thomas Huth
2025-10-29 8:00 ` Richard Henderson
2025-10-29 8:26 ` David Hildenbrand
2025-10-28 18:12 ` [PATCH v3 11/25] system/memory: Introduce memory_region_get_address() Philippe Mathieu-Daudé
2025-10-28 18:41 ` Peter Xu
2025-10-29 5:52 ` Thomas Huth
2025-10-29 8:21 ` Richard Henderson
2025-10-29 8:26 ` David Hildenbrand
2025-10-28 18:12 ` [PATCH v3 12/25] migration/ram: Use memory_region_get_address() Philippe Mathieu-Daudé
2025-10-28 18:41 ` Peter Xu
2025-10-29 8:28 ` Richard Henderson
2025-10-28 18:12 ` [PATCH v3 13/25] hw/acpi: " Philippe Mathieu-Daudé
2025-10-29 8:41 ` Richard Henderson
2025-10-29 11:06 ` Jonathan Cameron via
2025-10-28 18:12 ` Philippe Mathieu-Daudé [this message]
2025-10-29 8:41 ` [PATCH v3 14/25] hw/fdt: " Richard Henderson
2025-10-28 18:12 ` [PATCH v3 15/25] hw/nvme: " Philippe Mathieu-Daudé
2025-10-29 8:42 ` Richard Henderson
2025-10-30 7:58 ` Klaus Jensen
2025-10-28 18:12 ` [PATCH v3 16/25] hw/s390x: " Philippe Mathieu-Daudé
2025-10-29 5:55 ` Thomas Huth
2025-10-29 8:28 ` David Hildenbrand
2025-10-29 13:18 ` Philippe Mathieu-Daudé
2025-10-29 13:23 ` David Hildenbrand
2025-10-28 18:12 ` [PATCH v3 17/25] hw/timer/hpet: " Philippe Mathieu-Daudé
2025-10-29 8:46 ` Richard Henderson
2025-10-30 6:52 ` Zhao Liu
2025-10-28 18:12 ` [PATCH v3 18/25] hw/watchdog/aspeed: " Philippe Mathieu-Daudé
2025-10-29 8:46 ` Richard Henderson
2025-10-29 17:13 ` Cédric Le Goater
2025-10-28 18:12 ` [PATCH v3 19/25] hw/pci-bridge: " Philippe Mathieu-Daudé
2025-10-29 8:48 ` Richard Henderson
2025-10-28 18:12 ` [PATCH v3 20/25] system/ioport: " Philippe Mathieu-Daudé
2025-10-29 8:49 ` Richard Henderson
2025-10-28 18:12 ` [PATCH v3 21/25] hw/sysbus: " Philippe Mathieu-Daudé
2025-10-29 8:52 ` Richard Henderson
2025-10-28 18:12 ` [PATCH v3 22/25] hw/sysbus: Hoist MemoryRegion in sysbus_mmio_map_common() Philippe Mathieu-Daudé
2025-10-29 8:52 ` Richard Henderson
2025-10-28 18:12 ` [PATCH v3 23/25] hw/sysbus: Remove sysbus_mmio_map_common() @may_overlap argument Philippe Mathieu-Daudé
2025-10-29 8:53 ` Richard Henderson
2025-10-28 18:12 ` [PATCH v3 24/25] hw/sysbus: Use memory_region_is_mapped() to check for mapped region Philippe Mathieu-Daudé
2025-10-29 8:54 ` Richard Henderson
2025-10-28 18:12 ` [PATCH v3 25/25] hw/sysbus: Simplify SysBusDevice::mmio Philippe Mathieu-Daudé
2025-10-29 8:55 ` Richard Henderson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20251028181300.41475-15-philmd@linaro.org \
--to=philmd@linaro.org \
--cc=eduardo@habkost.net \
--cc=gaosong@loongson.cn \
--cc=jiaxun.yang@flygoat.com \
--cc=maobibo@loongson.cn \
--cc=marcandre.lureau@redhat.com \
--cc=marcel.apfelbaum@gmail.com \
--cc=mark.caveayland@nutanix.com \
--cc=mst@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-arm@nongnu.org \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.org \
--cc=qemu-riscv@nongnu.org \
--cc=qemu-s390x@nongnu.org \
--cc=richard.henderson@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).