[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH V2 5/5] vga-cirrus: Workaround during restore when u
From: |
Anthony PERARD |
Subject: |
[Qemu-devel] [PATCH V2 5/5] vga-cirrus: Workaround during restore when using Xen. |
Date: |
Fri, 9 Dec 2011 21:54:05 +0000 |
During the initialisation of the machine at restore time, the access to the
VRAM will fail because QEMU does not know yet the right guest address to map,
so the vram_ptr is NULL.
So this patch avoid using a NULL pointer during initialisation, and try to get
another vram_ptr if the call failed the first time.
Signed-off-by: Anthony PERARD <address@hidden>
---
hw/cirrus_vga.c | 16 +++++++++++++---
1 files changed, 13 insertions(+), 3 deletions(-)
diff --git a/hw/cirrus_vga.c b/hw/cirrus_vga.c
index c7e365b..2e049c9 100644
--- a/hw/cirrus_vga.c
+++ b/hw/cirrus_vga.c
@@ -32,6 +32,7 @@
#include "console.h"
#include "vga_int.h"
#include "loader.h"
+#include "sysemu.h"
/*
* TODO:
@@ -2696,6 +2697,13 @@ static int cirrus_post_load(void *opaque, int version_id)
s->vga.gr[0x01] = s->cirrus_shadow_gr1 & 0x0f;
cirrus_update_memory_access(s);
+ if (!s->vga.vram_ptr) {
+ /* At this point vga.vram_ptr can be invalid on Xen because we need to
+ * know the position of the videoram in the guest physical address
space in
+ * order to be able to map it. After cirrus_update_memory_access we do
know
+ * where the videoram is, so let's map it now. */
+ s->vga.vram_ptr = memory_region_get_ram_ptr(&s->vga.vram);
+ }
/* force refresh */
s->vga.graphic_mode = -1;
cirrus_update_bank_ptr(s, 0);
@@ -2784,9 +2792,11 @@ static void cirrus_reset(void *opaque)
}
s->vga.cr[0x27] = s->device_id;
- /* Win2K seems to assume that the pattern buffer is at 0xff
- initially ! */
- memset(s->vga.vram_ptr, 0xff, s->real_vram_size);
+ if (!runstate_check(RUN_STATE_PREMIGRATE)) {
+ /* Win2K seems to assume that the pattern buffer is at 0xff
+ initially ! */
+ memset(s->vga.vram_ptr, 0xff, s->real_vram_size);
+ }
s->cirrus_hidden_dac_lockindex = 5;
s->cirrus_hidden_dac_data = 0;
--
Anthony PERARD
[Qemu-devel] [PATCH V2 4/5] xen: Change memory access behavior during migration., Anthony PERARD, 2011/12/09
[Qemu-devel] [PATCH V2 5/5] vga-cirrus: Workaround during restore when using Xen.,
Anthony PERARD <=
- Re: [Qemu-devel] [PATCH V2 5/5] vga-cirrus: Workaround during restore when using Xen., Jan Kiszka, 2011/12/10
- Re: [Qemu-devel] [PATCH V2 5/5] vga-cirrus: Workaround during restore when using Xen., Stefano Stabellini, 2011/12/12
- Re: [Qemu-devel] [PATCH V2 5/5] vga-cirrus: Workaround during restore when using Xen., Jan Kiszka, 2011/12/12
- Re: [Qemu-devel] [PATCH V2 5/5] vga-cirrus: Workaround during restore when using Xen., Stefano Stabellini, 2011/12/12
- Re: [Qemu-devel] [PATCH V2 5/5] vga-cirrus: Workaround during restore when using Xen., Jan Kiszka, 2011/12/12
- Re: [Qemu-devel] [PATCH V2 5/5] vga-cirrus: Workaround during restore when using Xen., Stefano Stabellini, 2011/12/12
- [Qemu-devel] early_savevm (was: [PATCH V2 5/5] vga-cirrus: Workaround during restore when using Xen.), Stefano Stabellini, 2011/12/13
- Re: [Qemu-devel] early_savevm, Jan Kiszka, 2011/12/13
- Re: [Qemu-devel] early_savevm, Stefano Stabellini, 2011/12/13
- Re: [Qemu-devel] early_savevm, Avi Kivity, 2011/12/18