It is pointless to overlap a memory subregion with priority 0. Use the simpler memory_region_add_subregion() function. This patch was produced with the following spatch script: @@ expression region; expression offset; expression subregion; @@ -memory_region_add_subregion_overlap(region, offset, subregion, 0) +memory_region_add_subregion(region, offset, subregion) Signed-off-by: Philippe Mathieu-Daudé <philmd@xxxxxxxxxx> --- hw/arm/xlnx-versal-virt.c | 3 +-- hw/arm/xlnx-versal.c | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/hw/arm/xlnx-versal-virt.c b/hw/arm/xlnx-versal-virt.c index 462493c467..901e9ed86c 100644 --- a/hw/arm/xlnx-versal-virt.c +++ b/hw/arm/xlnx-versal-virt.c @@ -437,8 +437,7 @@ static void versal_virt_init(MachineState *machine) /* Make the APU cpu address space visible to virtio and other * modules unaware of muliple address-spaces. */ - memory_region_add_subregion_overlap(get_system_memory(), - 0, &s->soc.fpd.apu.mr, 0); + memory_region_add_subregion(get_system_memory(), 0, &s->soc.fpd.apu.mr); s->binfo.ram_size = machine->ram_size; s->binfo.loader_start = 0x0; diff --git a/hw/arm/xlnx-versal.c b/hw/arm/xlnx-versal.c index 8b3d8d85b8..538d907f8a 100644 --- a/hw/arm/xlnx-versal.c +++ b/hw/arm/xlnx-versal.c @@ -281,8 +281,8 @@ static void versal_realize(DeviceState *dev, Error **errp) memory_region_init_ram(&s->lpd.mr_ocm, OBJECT(s), "ocm", MM_OCM_SIZE, &error_fatal); - memory_region_add_subregion_overlap(&s->mr_ps, MM_OCM, &s->lpd.mr_ocm, 0); - memory_region_add_subregion_overlap(&s->fpd.apu.mr, 0, &s->mr_ps, 0); + memory_region_add_subregion(&s->mr_ps, MM_OCM, &s->lpd.mr_ocm); + memory_region_add_subregion(&s->fpd.apu.mr, 0, &s->mr_ps); } static void versal_init(Object *obj) -- 2.21.0