aboutsummaryrefslogtreecommitdiff
path: root/hw/vga.c
diff options
context:
space:
mode:
authorAnthony Liguori <aliguori@us.ibm.com>2009-12-18 08:08:07 +1000
committerAnthony Liguori <aliguori@us.ibm.com>2009-12-19 08:26:23 -0600
commit3c547d7bb7889182d5bcecbb3edea4c71774c6a3 (patch)
treec4d2257aa2119e95d607754f3d190820ddfd7488 /hw/vga.c
parent3b43502e3aaf6102d6f4c75bfc1f61da0620196e (diff)
Make sure to enable dirty tracking of VBE vram mapping
Apparently, VBE maps the VGA vram to a fixed physical location. KVM requires that all mappings of the VGA vram have dirty tracking enabled on them. Any access to the VGA vram through the VBE mapping currently fails to result in dirty page tracking updates causing a black screen. This is the true root cause of VMware VGA not working correctly under KVM and likely also an issue with some of the std-vga black screen issues too. Cirrus does not enable VBE so it would not be a problem when using Cirrus. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> Rebased-by: Dave Airlie <airlied@redhat.com> (cherry picked from commit f0138a63a41fe26bcef61d031ae53d872d12a992)
Diffstat (limited to 'hw/vga.c')
-rw-r--r--hw/vga.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/hw/vga.c b/hw/vga.c
index 740fe28352..5b0c55e99d 100644
--- a/hw/vga.c
+++ b/hw/vga.c
@@ -1581,6 +1581,14 @@ static void vga_sync_dirty_bitmap(VGACommonState *s)
cpu_physical_sync_dirty_bitmap(isa_mem_base + 0xa0000, 0xa8000);
cpu_physical_sync_dirty_bitmap(isa_mem_base + 0xa8000, 0xb0000);
}
+
+#ifdef CONFIG_BOCHS_VBE
+ if (s->vbe_mapped) {
+ cpu_physical_sync_dirty_bitmap(VBE_DISPI_LFB_PHYSICAL_ADDRESS,
+ VBE_DISPI_LFB_PHYSICAL_ADDRESS + s->vram_size);
+ }
+#endif
+
}
void vga_dirty_log_start(VGACommonState *s)
@@ -1592,6 +1600,13 @@ void vga_dirty_log_start(VGACommonState *s)
kvm_log_start(isa_mem_base + 0xa0000, 0x8000);
kvm_log_start(isa_mem_base + 0xa8000, 0x8000);
}
+
+#ifdef CONFIG_BOCHS_VBE
+ if (kvm_enabled() && s->vbe_mapped) {
+ kvm_log_start(VBE_DISPI_LFB_PHYSICAL_ADDRESS, s->vram_size);
+ }
+#endif
+
}
/*
@@ -2294,6 +2309,15 @@ void vga_init(VGACommonState *s)
qemu_register_coalesced_mmio(isa_mem_base + 0x000a0000, 0x20000);
}
+void vga_init_vbe(VGACommonState *s)
+{
+#ifdef CONFIG_BOCHS_VBE
+ /* XXX: use optimized standard vga accesses */
+ cpu_register_physical_memory(VBE_DISPI_LFB_PHYSICAL_ADDRESS,
+ VGA_RAM_SIZE, s->vram_offset);
+ s->vbe_mapped = 1;
+#endif
+}
/********************************************************/
/* vga screen dump */