@@ -569,6 +569,7 @@ static void integratorcp_init(MachineState *machine)
memory_region_allocate_system_memory(ram, NULL, "integrator.ram",
ram_size);
+ memory_region_set_log(ram, true, DIRTY_MEMORY_VGA);
/* ??? On a real system the first 1Mb is mapped as SSRAM or boot flash. */
/* ??? RAM should repeat to fill physical memory space. */
/* SDRAM at address zero*/
@@ -3880,9 +3880,11 @@ struct omap_mpu_state_s *omap310_mpu_init(MemoryRegion *system_memory,
/* Memory-mapped stuff */
memory_region_allocate_system_memory(&s->emiff_ram, NULL, "omap1.dram",
s->sdram_size);
+ memory_region_set_log(&s->emiff_ram, true, DIRTY_MEMORY_VGA);
memory_region_add_subregion(system_memory, OMAP_EMIFF_BASE, &s->emiff_ram);
memory_region_init_ram(&s->imif_ram, NULL, "omap1.sram", s->sram_size,
&error_abort);
+ memory_region_set_log(&s->imif_ram, true, DIRTY_MEMORY_VGA);
vmstate_register_ram_global(&s->imif_ram);
memory_region_add_subregion(system_memory, OMAP_IMIF_BASE, &s->imif_ram);
@@ -2080,10 +2080,12 @@ PXA2xxState *pxa270_init(MemoryRegion *address_space,
/* SDRAM & Internal Memory Storage */
memory_region_init_ram(&s->sdram, NULL, "pxa270.sdram", sdram_size,
&error_abort);
+ memory_region_set_log(&s->sdram, true, DIRTY_MEMORY_VGA);
vmstate_register_ram_global(&s->sdram);
memory_region_add_subregion(address_space, PXA2XX_SDRAM_BASE, &s->sdram);
memory_region_init_ram(&s->internal, NULL, "pxa270.internal", 0x40000,
&error_abort);
+ memory_region_set_log(&s->sdram, true, DIRTY_MEMORY_VGA);
vmstate_register_ram_global(&s->internal);
memory_region_add_subregion(address_space, PXA2XX_INTERNAL_BASE,
&s->internal);
@@ -2214,10 +2216,12 @@ PXA2xxState *pxa255_init(MemoryRegion *address_space, unsigned int sdram_size)
/* SDRAM & Internal Memory Storage */
memory_region_init_ram(&s->sdram, NULL, "pxa255.sdram", sdram_size,
&error_abort);
+ memory_region_set_log(&s->sdram, true, DIRTY_MEMORY_VGA);
vmstate_register_ram_global(&s->sdram);
memory_region_add_subregion(address_space, PXA2XX_SDRAM_BASE, &s->sdram);
memory_region_init_ram(&s->internal, NULL, "pxa255.internal",
PXA2XX_INTERNAL_SIZE, &error_abort);
+ memory_region_set_log(&s->sdram, true, DIRTY_MEMORY_VGA);
vmstate_register_ram_global(&s->internal);
memory_region_add_subregion(address_space, PXA2XX_INTERNAL_BASE,
&s->internal);
@@ -228,6 +228,7 @@ static void versatile_init(MachineState *machine, int board_id)
memory_region_allocate_system_memory(ram, NULL, "versatile.ram",
machine->ram_size);
+ memory_region_set_log(ram, true, DIRTY_MEMORY_VGA);
/* ??? RAM should repeat to fill physical memory space. */
/* SDRAM at address zero. */
memory_region_add_subregion(sysmem, 0, ram);
@@ -21,7 +21,10 @@
#include "ui/console.h"
#include "framebuffer.h"
-/* Render an image from a shared memory framebuffer. */
+/* Render an image from a shared memory framebuffer. For efficiency,
+ * the board should enable DIRTY_MEMORY_VGA on RAM memory regions that
+ * can be used for the framebuffer.
+ */
void framebuffer_update_display(
DisplaySurface *ds,
@@ -120,6 +120,7 @@ milkymist_init(MachineState *machine)
memory_region_allocate_system_memory(phys_sdram, NULL, "milkymist.sdram",
sdram_size);
+ memory_region_set_log(phys_sdram, true, DIRTY_MEMORY_VGA);
memory_region_add_subregion(address_space_mem, sdram_base, phys_sdram);
dinfo = drive_get(IF_PFLASH, 0, 0);
The pxa2xx_lcd, omap_lcdc, pl110 and milkymist-vgafb devices use framebuffer.c to render an image from a shared memory framebuffer. With KVM, DIRTY_MEMORY_VGA always had to be enabled explicitly on RAM memory regions that can be used for the framebuffer, and the 2.4 changes to dirty bitmap handling made that mandatory for TCG as well. If the board does not set DIRTY_MEMORY_VGA, framebuffer.c detects this (commit d55d420, framebuffer: check memory_region_is_logging, 2015-03-23) and always invalidates the screen; this is inefficient, to the point that blocking X11 calls on slow network connections can prevent the guest from making progress. Fix this by setting the flag on the boards that use the aforementioned devices. Reported-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> --- This is a layering violation, but it's the simplest patch that works. I also have worked on Peter's suggestion that framebuffer.c could manage DIRTY_MEMORY_VGA. The (prototype) patch however is a bit large, so perhaps it's better to have this in 2.4 instead. Posting this one as RFC for now. hw/arm/integratorcp.c | 1 + hw/arm/omap1.c | 2 ++ hw/arm/pxa2xx.c | 4 ++++ hw/arm/versatilepb.c | 1 + hw/display/framebuffer.c | 5 ++++- hw/lm32/milkymist.c | 1 + 6 files changed, 13 insertions(+), 1 deletion(-)