x49gp/qemu/patches/qemu-0.9.0-x49gp-phys_ram_dirty.patch

17 lines
716 B
Diff

--- qemu-0.9.0/exec.c 2007-07-23 13:57:29.000000000 +0200
+++ qemu/exec.c 2007-07-23 13:53:06.000000000 +0200
@@ -1942,9 +1942,11 @@
cpu_register_io_memory(IO_MEM_NOTDIRTY >> IO_MEM_SHIFT, error_mem_read, notdirty_mem_write, NULL);
io_mem_nb = 5;
- /* alloc dirty bits array */
- phys_ram_dirty = qemu_vmalloc(phys_ram_size >> TARGET_PAGE_BITS);
- memset(phys_ram_dirty, 0xff, phys_ram_size >> TARGET_PAGE_BITS);
+ if (phys_ram_size) {
+ /* alloc dirty bits array */
+ phys_ram_dirty = qemu_vmalloc(phys_ram_size >> TARGET_PAGE_BITS);
+ memset(phys_ram_dirty, 0xff, phys_ram_size >> TARGET_PAGE_BITS);
+ }
}
/* mem_read and mem_write are arrays of functions containing the