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/vfio/pci.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c index 2d40b396f2..74b1eb7ddc 100644 --- a/hw/vfio/pci.c +++ b/hw/vfio/pci.c @@ -1095,8 +1095,7 @@ static void vfio_sub_page_bar_update_mapping(PCIDevice *pdev, int bar) memory_region_set_size(mmap_mr, size); if (size != vdev->bars[bar].size && memory_region_is_mapped(base_mr)) { memory_region_del_subregion(r->address_space, base_mr); - memory_region_add_subregion_overlap(r->address_space, - bar_addr, base_mr, 0); + memory_region_add_subregion(r->address_space, bar_addr, base_mr); } memory_region_transaction_commit(); -- 2.21.0