@samitouri / QOSamiQemu / commits / 4022a1dcee

xen-hvm: Handle framebuffer relocation

It is possible for a guest to relocate the linear framebuffer by writing to the VGA device's BAR. This causes QEMU to report an error and if the VM is migrated, the destination QEMU hits an assertion. The problem is that updating the BAR causes the PCI core code to call the del region callback followed by the add region callback but the xen-hvm code ignores the del region call and therefore the subsequent call to xen_relocate_memory() during the add region callback fails because the source address is not correct. Fix it by calling in to xen_remove_from_physmap() in response to a del region callback for the linear framebuffer so that the subsequent add region callback succeeds. Signed-off-by: Ross Lagerwall <ross.lagerwall@citrix.com> Reviewed-by: Anthony PERARD <anthony.perard@vates.tech> Message-ID: <20260108132514.1862552-1-ross.lagerwall@citrix.com> Signed-off-by: Anthony PERARD <anthony.perard@vates.tech>

Ross Lagerwall committed Jan 8, 2026 at 13:25 UTC 4022a1dceea88a15b871591141c5b77f5f0748a3
1 file changed +2 -1
hw/i386/xen/xen-hvm.c
+2 -1
@@ -720,7 +720,8 @@ void arch_xen_set_memory(XenIOState *state, MemoryRegionSection *section,
720 return;
721 }
722
723 - if (log_dirty != add) {
723 + if (log_dirty != add &&
724 + !(section->mr == framebuffer && start_addr > 0xbffff)) {
725 return;
726 }
727