diff options
author | Avi Kivity <avi@redhat.com> | 2012-05-09 18:23:06 +0300 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2012-05-29 20:19:24 -0500 |
commit | 8294a64d7f9ecc428cd58ba36ad0b913084a8824 (patch) | |
tree | 47ce59f81adfdcade3d2eb282acac53bbfe6d974 /hw/vga.c | |
parent | 1c4ad9d2b4b5f2be08588a91e4193d13cc314282 (diff) | |
download | qemu-8294a64d7f9ecc428cd58ba36ad0b913084a8824.zip qemu-8294a64d7f9ecc428cd58ba36ad0b913084a8824.tar.gz qemu-8294a64d7f9ecc428cd58ba36ad0b913084a8824.tar.bz2 |
vga: fix vram double-mapping with -vga std and -M pc-0.12
With pc-0.12, we map the video RAM both through the PCI BAR (the guest does
this) and through a fixed mapping at 0xe0000000. The memory API doesn't allow
this double map, and aborts.
Fix by using an alias.
Reported-by: Michael Tokarev <mjt@tls.msk.ru>
Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/vga.c')
-rw-r--r-- | hw/vga.c | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -2357,10 +2357,15 @@ void vga_init(VGACommonState *s, MemoryRegion *address_space, void vga_init_vbe(VGACommonState *s, MemoryRegion *system_memory) { #ifdef CONFIG_BOCHS_VBE + /* With pc-0.12 and below we map both the PCI BAR and the fixed VBE region, + * so use an alias to avoid double-mapping the same region. + */ + memory_region_init_alias(&s->vram_vbe, "vram.vbe", + &s->vram, 0, memory_region_size(&s->vram)); /* XXX: use optimized standard vga accesses */ memory_region_add_subregion(system_memory, VBE_DISPI_LFB_PHYSICAL_ADDRESS, - &s->vram); + &s->vram_vbe); s->vbe_mapped = 1; #endif } |