* [PATCH] accel/mshv: mark VGA mem as dirty in mshv_log_sync
@ 2026-11-25 13:11 Magnus Kulke
2026-11-25 14:29 ` Mohamed Mediouni
0 siblings, 1 reply; 3+ messages in thread
From: Magnus Kulke @ 2026-11-25 13:11 UTC (permalink / raw)
To: qemu-devel
Cc: Doru Blânzeanu, Doru Blânzeanu, Wei Liu, Wei Liu,
Paolo Bonzini, Magnus Kulke
The accelerator needs to report changed video memory for the VGA display
update (e.g. for a VNC backend). We currently report the full section as
dirty. MSHV enables hypervisor dirty tracking only during migration, so
a VGA-only refresh is not able to query that bitmap.
During migrations we will use the migration dirty-log.
Signed-off-by: Magnus Kulke <magnuskulke@linux.microsoft.com>
---
accel/mshv/mem.c | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/accel/mshv/mem.c b/accel/mshv/mem.c
index 00d69fca8d..98db7bf117 100644
--- a/accel/mshv/mem.c
+++ b/accel/mshv/mem.c
@@ -428,11 +428,24 @@ void mshv_log_sync(MemoryListener *listener, MemoryRegionSection *section)
ram_addr_t ram_addr;
int ret;
MemoryRegion *mr = section->mr;
+ bool vga_logging, migration_logging;
if (!memory_region_is_ram(mr) || memory_region_is_rom(mr)) {
return;
}
+ /* mark VGA always dirty, but keep bitmap tracking during migration */
+ vga_logging = memory_region_get_dirty_log_mask(mr) & BIT(DIRTY_MEMORY_VGA);
+ migration_logging = memory_region_get_dirty_log_mask(mr) &
+ BIT(DIRTY_MEMORY_MIGRATION);
+ if (vga_logging && !migration_logging) {
+ mr_offset = section->offset_within_region;
+ size = int128_get64(section->size);
+
+ memory_region_set_dirty(mr, mr_offset, size);
+ return;
+ }
+
size = align_section(section, &start_addr);
if (!size) {
return;
--
2.34.1
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH] accel/mshv: mark VGA mem as dirty in mshv_log_sync
2026-11-25 13:11 [PATCH] accel/mshv: mark VGA mem as dirty in mshv_log_sync Magnus Kulke
@ 2026-11-25 14:29 ` Mohamed Mediouni
2026-11-25 19:48 ` Magnus Kulke
0 siblings, 1 reply; 3+ messages in thread
From: Mohamed Mediouni @ 2026-11-25 14:29 UTC (permalink / raw)
To: Magnus Kulke
Cc: qemu-devel, Doru Blânzeanu, Doru Blânzeanu, Wei Liu,
Wei Liu, Paolo Bonzini
> On 25. Nov 2026, at 14:11, Magnus Kulke <magnuskulke@linux.microsoft.com> wrote:
>
> The accelerator needs to report changed video memory for the VGA display
> update (e.g. for a VNC backend). We currently report the full section as
> dirty. MSHV enables hypervisor dirty tracking only during migration, so
> a VGA-only refresh is not able to query that bitmap.
>
> During migrations we will use the migration dirty-log.
Hi,
Is there a blocker to having granular dirty tracking only for the VGA frame buffer area
as always-on?
>
> Signed-off-by: Magnus Kulke <magnuskulke@linux.microsoft.com>
> ---
> accel/mshv/mem.c | 13 +++++++++++++
> 1 file changed, 13 insertions(+)
>
> diff --git a/accel/mshv/mem.c b/accel/mshv/mem.c
> index 00d69fca8d..98db7bf117 100644
> --- a/accel/mshv/mem.c
> +++ b/accel/mshv/mem.c
> @@ -428,11 +428,24 @@ void mshv_log_sync(MemoryListener *listener, MemoryRegionSection *section)
> ram_addr_t ram_addr;
> int ret;
> MemoryRegion *mr = section->mr;
> + bool vga_logging, migration_logging;
>
> if (!memory_region_is_ram(mr) || memory_region_is_rom(mr)) {
> return;
> }
>
> + /* mark VGA always dirty, but keep bitmap tracking during migration */
> + vga_logging = memory_region_get_dirty_log_mask(mr) & BIT(DIRTY_MEMORY_VGA);
> + migration_logging = memory_region_get_dirty_log_mask(mr) &
> + BIT(DIRTY_MEMORY_MIGRATION);
> + if (vga_logging && !migration_logging) {
> + mr_offset = section->offset_within_region;
> + size = int128_get64(section->size);
> +
> + memory_region_set_dirty(mr, mr_offset, size);
> + return;
> + }
> +
> size = align_section(section, &start_addr);
> if (!size) {
> return;
> --
> 2.34.1
>
>
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] accel/mshv: mark VGA mem as dirty in mshv_log_sync
2026-11-25 14:29 ` Mohamed Mediouni
@ 2026-11-25 19:48 ` Magnus Kulke
0 siblings, 0 replies; 3+ messages in thread
From: Magnus Kulke @ 2026-11-25 19:48 UTC (permalink / raw)
To: Mohamed Mediouni
Cc: qemu-devel, Doru Blânzeanu, Doru Blânzeanu, Wei Liu,
Wei Liu, Paolo Bonzini
On Wed, Nov 25, 2026 at 03:29:08PM +0100, Mohamed Mediouni wrote:
>
>
> > On 25. Nov 2026, at 14:11, Magnus Kulke <magnuskulke@linux.microsoft.com> wrote:
> >
> > The accelerator needs to report changed video memory for the VGA display
> > update (e.g. for a VNC backend). We currently report the full section as
> > dirty. MSHV enables hypervisor dirty tracking only during migration, so
> > a VGA-only refresh is not able to query that bitmap.
> >
> > During migrations we will use the migration dirty-log.
>
> Hi,
>
> Is there a blocker to having granular dirty tracking only for the VGA frame buffer area
> as always-on?
Hey Mohamed,
currently dirty page tracking is only enabled during migration. I have
put sth in the backlog to look into a discrete dirty tracking for the
VGA buffer as an optimization. I vaguely remember that there was a
problem w/ mshv regarding that, but I don't remember details atm.
best,
magnus
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-11-25 19:49 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-25 13:11 [PATCH] accel/mshv: mark VGA mem as dirty in mshv_log_sync Magnus Kulke
2026-11-25 14:29 ` Mohamed Mediouni
2026-11-25 19:48 ` Magnus Kulke
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.