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)
s->ds = graphic_console_init(s->update, s->invalidate,
s->screen_dump, s->text_update, 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);
-#endif
+ vga_init_vbe(s);
/* ROM BIOS */
rom_add_vga(VGABIOS_FILENAME);
return 0;
PCI_BASE_ADDRESS_MEM_PREFETCH, vga_map);
}
-#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);
-#endif
-
+ vga_init_vbe(s);
/* ROM BIOS */
rom_add_vga(VGABIOS_FILENAME);
return 0;
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)
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
+
}
/*
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 */
uint16_t vbe_regs[VBE_DISPI_INDEX_NB]; \
uint32_t vbe_start_addr; \
uint32_t vbe_line_offset; \
- uint32_t vbe_bank_mask;
-
+ uint32_t vbe_bank_mask; \
+ int vbe_mapped;
#else
#define VGA_STATE_COMMON_BOCHS_VBE
unsigned int color_xor);
int vga_ioport_invalid(VGACommonState *s, uint32_t addr);
+void vga_init_vbe(VGACommonState *s);
extern const uint8_t sr_mask[8];
extern const uint8_t gr_mask[16];
vmsvga_screen_dump,
vmsvga_text_update, s);
-#ifdef CONFIG_BOCHS_VBE
- /* XXX: use optimized standard vga accesses */
- cpu_register_physical_memory(VBE_DISPI_LFB_PHYSICAL_ADDRESS,
- vga_ram_size, s->vga.vram_offset);
-#endif
- rom_add_vga(VGABIOS_FILENAME);
+ vga_init_vbe(&s->vga);
+ rom_add_vga(VGABIOS_FILENAME);
}
static void pci_vmsvga_map_ioport(PCIDevice *pci_dev, int region_num,