qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] vga: fix vram double-mapping with -vga std and -M pc-0.12
@ 2012-05-09 15:23 Avi Kivity
  2012-05-09 16:39 ` Michael Tokarev
  2012-05-14 10:07 ` Avi Kivity
  0 siblings, 2 replies; 3+ messages in thread
From: Avi Kivity @ 2012-05-09 15:23 UTC (permalink / raw)
  To: qemu-devel, Michael Tokarev

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>
---
 hw/vga.c     |    7 ++++++-
 hw/vga_int.h |    1 +
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/hw/vga.c b/hw/vga.c
index 5824f85..d784df7 100644
--- a/hw/vga.c
+++ b/hw/vga.c
@@ -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 
 }
diff --git a/hw/vga_int.h b/hw/vga_int.h
index 7685b2b..d244d8f 100644
--- a/hw/vga_int.h
+++ b/hw/vga_int.h
@@ -105,6 +105,7 @@ typedef struct VGACommonState {
     MemoryRegion *legacy_address_space;
     uint8_t *vram_ptr;
     MemoryRegion vram;
+    MemoryRegion vram_vbe;
     uint32_t vram_size;
     uint32_t latch;
     MemoryRegion *chain4_alias;
-- 
1.7.10.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [PATCH] vga: fix vram double-mapping with -vga std and -M pc-0.12
  2012-05-09 15:23 [Qemu-devel] [PATCH] vga: fix vram double-mapping with -vga std and -M pc-0.12 Avi Kivity
@ 2012-05-09 16:39 ` Michael Tokarev
  2012-05-14 10:07 ` Avi Kivity
  1 sibling, 0 replies; 3+ messages in thread
From: Michael Tokarev @ 2012-05-09 16:39 UTC (permalink / raw)
  To: Avi Kivity; +Cc: qemu-devel

On 09.05.2012 19:23, Avi Kivity wrote:
> 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.

This appears to work now, at least with -M pc-0.12 -vga std, a win7 guest
boots and works (before qemu were aborting at startup).  So you can add

Tested-By: Michael Tokarev <mjt@tls.msk.ru>

if necessary.  Thank you for the quick fix!

/mjt

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [PATCH] vga: fix vram double-mapping with -vga std and -M pc-0.12
  2012-05-09 15:23 [Qemu-devel] [PATCH] vga: fix vram double-mapping with -vga std and -M pc-0.12 Avi Kivity
  2012-05-09 16:39 ` Michael Tokarev
@ 2012-05-14 10:07 ` Avi Kivity
  1 sibling, 0 replies; 3+ messages in thread
From: Avi Kivity @ 2012-05-14 10:07 UTC (permalink / raw)
  To: qemu-devel, Michael Tokarev

On 05/09/2012 06:23 PM, Avi Kivity wrote:
> 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.
>
>

Ping; should be 1.1ed.

-- 
error compiling committee.c: too many arguments to function

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-05-14 10:07 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-09 15:23 [Qemu-devel] [PATCH] vga: fix vram double-mapping with -vga std and -M pc-0.12 Avi Kivity
2012-05-09 16:39 ` Michael Tokarev
2012-05-14 10:07 ` Avi Kivity

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).