From bd8f2f5d7034172a53c5a5b229613761f3297493 Mon Sep 17 00:00:00 2001 From: Jan Kiszka Date: Thu, 23 Aug 2012 13:02:33 +0200 Subject: VGA: Flush coalesced MMIO on related MMIO/PIO accesses In preparation of stopping to flush coalesced MMIO unconditionally on vmexits, mark VGA MMIO and PIO regions as synchronous /wrt coalesced MMIO and flush the buffer explicitly on PIO accesses that do not use generic memory regions yet. Signed-off-by: Jan Kiszka Signed-off-by: Marcelo Tosatti --- hw/vga.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'hw/vga.c') diff --git a/hw/vga.c b/hw/vga.c index 80299ea1d4..afaef0d711 100644 --- a/hw/vga.c +++ b/hw/vga.c @@ -361,6 +361,8 @@ uint32_t vga_ioport_read(void *opaque, uint32_t addr) VGACommonState *s = opaque; int val, index; + qemu_flush_coalesced_mmio_buffer(); + if (vga_ioport_invalid(s, addr)) { val = 0xff; } else { @@ -453,6 +455,8 @@ void vga_ioport_write(void *opaque, uint32_t addr, uint32_t val) VGACommonState *s = opaque; int index; + qemu_flush_coalesced_mmio_buffer(); + /* check port range access depending on color/monochrome mode */ if (vga_ioport_invalid(s, addr)) { return; @@ -2338,6 +2342,7 @@ MemoryRegion *vga_init_io(VGACommonState *s, vga_mem = g_malloc(sizeof(*vga_mem)); memory_region_init_io(vga_mem, &vga_mem_ops, s, "vga-lowmem", 0x20000); + memory_region_set_flush_coalesced(vga_mem); return vga_mem; } -- cgit v1.2.3