diff -u kvm-72+dfsg/debian/changelog kvm-72+dfsg/debian/changelog --- kvm-72+dfsg/debian/changelog +++ kvm-72+dfsg/debian/changelog @@ -1,3 +1,9 @@ +kvm (1:72+dfsg-1ubuntu7~ppa0) intrepid; urgency=low + + * Copy restore_option_roms.patch from Debian Lenny to fix reboot on virtio. + + -- Philipp Kern Sun, 05 Apr 2009 13:06:07 +0200 + kvm (1:72+dfsg-1ubuntu6) intrepid; urgency=low * debian/patches/evdev_keycode_map.patch, debian/patches/series: ported the diff -u kvm-72+dfsg/debian/patches/series kvm-72+dfsg/debian/patches/series --- kvm-72+dfsg/debian/patches/series +++ kvm-72+dfsg/debian/patches/series @@ -16,0 +17 @@ +restore_option_roms.patch only in patch2: unchanged: --- kvm-72+dfsg.orig/debian/patches/restore_option_roms.patch +++ kvm-72+dfsg/debian/patches/restore_option_roms.patch @@ -0,0 +1,57 @@ +From: Avi Kivity +Date: Sat, 30 Aug 2008 10:02:43 +0000 (+0300) +Subject: kvm: qemu: restore option roms to their initial states on reset +X-Git-Tag: kvm-75~16 +X-Git-Url: http://git.kernel.org/?p=virt%2Fkvm%2Fkvm-userspace.git;a=commitdiff_plain;h=77c125369426a519fb9ea92dc159fa5ce392f354 + +kvm: qemu: restore option roms to their initial states on reset + +this fixes extboot failures on reset. since extboot writes to the rom, +it fails the checksum test on reset. reloading the data fixes this. + +Signed-off-by: Avi Kivity +--- + +diff --git a/qemu/hw/pc.c b/qemu/hw/pc.c +index fdb0a9c..026e96d 100644 +--- a/qemu/hw/pc.c ++++ b/qemu/hw/pc.c +@@ -722,6 +722,30 @@ static void pc_init_ne2k_isa(NICInfo *nd, qemu_irq *pic) + nb_ne2k++; + } + ++typedef struct rom_reset_data { ++ uint8_t *data; ++ target_phys_addr_t addr; ++ unsigned size; ++} RomResetData; ++ ++static void option_rom_reset(void *_rrd) ++{ ++ RomResetData *rrd = _rrd; ++ ++ cpu_physical_memory_write_rom(rrd->addr, rrd->data, rrd->size); ++} ++ ++static void option_rom_setup_reset(target_phys_addr_t addr, unsigned size) ++{ ++ RomResetData *rrd = qemu_malloc(sizeof *rrd); ++ ++ rrd->data = qemu_malloc(size); ++ cpu_physical_memory_read(addr, rrd->data, size); ++ rrd->addr = addr; ++ rrd->size = size; ++ qemu_register_reset(option_rom_reset, rrd); ++} ++ + static int load_option_rom(const char *filename, int offset, int type) + { + ram_addr_t option_rom_offset; +@@ -744,6 +768,7 @@ static int load_option_rom(const char *filename, int offset, int type) + size = (size + 4095) & ~4095; + cpu_register_physical_memory(0xd0000 + offset, + size, option_rom_offset | type); ++ option_rom_setup_reset(0xd0000 + offset, size); + if (kvm_enabled()) + kvm_cpu_register_physical_memory(0xd0000 + offset, + size, option_rom_offset | type);