Ian Jackson wrote:
> Stefano Stabellini writes ("Re: [PATCH 2/2] ioemu: initialize vram area to
> 0xff"):
>> [stuff]
>
> We seem to be reaching agreement here ? I'm afraid I've slightly lost
> track of exactly which hunks of Isaku's patch are now to be
> applied ...
>
> Ian.
>
Something like this:
diff --git a/hw/cirrus_vga.c b/hw/cirrus_vga.c
index f2ec05b..e1a416b 100644
--- a/hw/cirrus_vga.c
+++ b/hw/cirrus_vga.c
@@ -3167,8 +3167,9 @@ static int cirrus_vga_load(QEMUFile *f, void *opaque, int
version_id)
* ourselves */
s->vram_gmfn = vga_acc ? s->lfb_addr : VRAM_RESERVED_ADDRESS;
xen_vga_populate_vram(s->vram_gmfn, s->vram_size);
+ } else {
+ xen_vga_vram_map(s->vram_gmfn, s->vram_size);
}
- xen_vga_vram_map(s->vram_gmfn, s->vram_size);
if (version_id < 3 || (!vga_acc && !t))
qemu_get_buffer(f, s->vram_ptr, s->vram_size);
diff --git a/hw/vga.c b/hw/vga.c
index 2ae6e85..d1d61ea 100644
--- a/hw/vga.c
+++ b/hw/vga.c
@@ -2251,7 +2251,6 @@ static int vga_load(QEMUFile *f, void *opaque, int
version_id)
/* Old guest, VRAM is not mapped, we have to restore it ourselves */
if (!s->vram_gmfn) {
xen_vga_populate_vram(VRAM_RESERVED_ADDRESS, s->vram_size);
- xen_vga_vram_map(VRAM_RESERVED_ADDRESS, s->vram_size);
s->vram_gmfn = VRAM_RESERVED_ADDRESS;
qemu_get_buffer(f, s->vram_ptr, s->vram_size);
}
@@ -2447,6 +2446,12 @@ void xen_vga_populate_vram(uint64_t vram_addr, uint32_t
vga_ram_size)
exit(1);
}
free(pfn_list);
+
+ xen_vga_vram_map(vram_addr, vga_ram_size);
+
+ /* Win2K seems to assume that the pattern buffer is at 0xff
+ initially ! */
+ memset(xen_vga_state->vram_ptr, 0xff, vga_ram_size);
}
/* Mapping the video memory from GPFN space */
@@ -2456,7 +2461,6 @@ void xen_vga_vram_map(uint64_t vram_addr, uint32_t
vga_ram_size)
xen_pfn_t *pfn_list;
int i;
void *vram;
- DisplayState *ds;
fprintf(logfile, "mapping video RAM from %llx\n",
(unsigned long long)vram_addr);
@@ -2526,7 +2530,6 @@ void vga_common_init(VGAState *s, DisplayState *ds,
uint8_t *vga_ram_base,
if (!restore) {
xen_vga_populate_vram(VRAM_RESERVED_ADDRESS, s->vram_size);
- xen_vga_vram_map(VRAM_RESERVED_ADDRESS, s->vram_size);
s->vram_gmfn = VRAM_RESERVED_ADDRESS;
}
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
|