Skip to contentSkip to conversation

cirrus: Properly re-register cirrus_linear_io_addr on vram unmap

PATCH In review Jan Kiszka 2 participants 2 messages Jan 29, 2010

lore
Share & tools
lore

Jan Kiszka

author
#0 lore raw

PATCH 1/1 cirrus: Properly re-register cirrus_linear_io_addr on vram unmap

This fixes CONFIG_FB_CIRRUS for Linux guests and probably much more:

When switching away from linearly mapped vram, we also have to restore the I/O handlers for the LFB.

This regression was once introduced by commit 2bec46dc97.

---
 hw/cirrus_vga.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
hw/cirrus_vga.c +4 -2
index 6fe433d..9f61a01 100644
@@ -2585,9 +2585,11 @@ static void map_linear_vram(CirrusVGAState *s)
 
 static void unmap_linear_vram(CirrusVGAState *s)
 {
-    if (s->vga.map_addr && s->vga.lfb_addr && s->vga.lfb_end)
+    if (s->vga.map_addr && s->vga.lfb_addr && s->vga.lfb_end) {
         s->vga.map_addr = s->vga.map_end = 0;
-
+         cpu_register_physical_memory(s->vga.lfb_addr, s->vga.vram_size,
+                                      s->cirrus_linear_io_addr);
+    }
     cpu_register_physical_memory(isa_mem_base + 0xa0000, 0x20000,
                                  s->vga.vga_io_memory);
 }
#1 lore raw
Quoted 34 lines · Jan Kiszka

This fixes CONFIG_FB_CIRRUS for Linux guests and probably much more:

When switching away from linearly mapped vram, we also have to restore the I/O handlers for the LFB.

This regression was once introduced by commit 2bec46dc97.

---
  hw/cirrus_vga.c |    6 ++++--
  1 files changed, 4 insertions(+), 2 deletions(-)
hw/cirrus_vga.c +4 -2
index 6fe433d..9f61a01 100644
@@ -2585,9 +2585,11 @@ static void map_linear_vram(CirrusVGAState *s)
 
  static void unmap_linear_vram(CirrusVGAState *s)
  {
-    if (s->vga.map_addr&&  s->vga.lfb_addr&&  s->vga.lfb_end)
+    if (s->vga.map_addr&&  s->vga.lfb_addr&&  s->vga.lfb_end) {
          s->vga.map_addr = s->vga.map_end = 0;
-
+         cpu_register_physical_memory(s->vga.lfb_addr, s->vga.vram_size,
+                                      s->cirrus_linear_io_addr);
+    }
      cpu_register_physical_memory(isa_mem_base + 0xa0000, 0x20000,
                                   s->vga.vga_io_memory);
  }