On 7/15/25 08:59, Zhenzhong Duan wrote:
Currently region_mr and mmap_mr size are recovered to original size when
base address is updated to non-PAGE_SIZE aligned, but still leave base_mr
with PAGE_SIZE size. This is harmless as base_mr is a only container but
still a bit confusing when executing hmp command mtree.
Signed-off-by: Zhenzhong Duan <zhenzhong.d...@intel.com>
---
hw/vfio/pci.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c
index 1093b28df7..0455e6ce30 100644
--- a/hw/vfio/pci.c
+++ b/hw/vfio/pci.c
@@ -1348,9 +1348,7 @@ static void vfio_sub_page_bar_update_mapping(PCIDevice
*pdev, int bar)
memory_region_transaction_begin();
- if (vdev->bars[bar].size < size) {
- memory_region_set_size(base_mr, size);
- }
+ memory_region_set_size(base_mr, size);
memory_region_set_size(region_mr, size);
memory_region_set_size(mmap_mr, size);
if (size != vdev->bars[bar].size && memory_region_is_mapped(base_mr)) {
Looks ok to me. I'll queue it for 10.2 though.
Thanks,
C.