rpms/kvm/F-10 kvm-restore-option-rom.patch, NONE, 1.1 kvm.spec, 1.73, 1.74

Glauber Costa glommer at fedoraproject.org
Mon Nov 24 19:14:30 UTC 2008


Author: glommer

Update of /cvs/pkgs/rpms/kvm/F-10
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv16768

Modified Files:
	kvm.spec 
Added Files:
	kvm-restore-option-rom.patch 
Log Message:
added upstream patch kvm-restore-option-rom.patch - #470561



kvm-restore-option-rom.patch:

--- NEW FILE kvm-restore-option-rom.patch ---
commit 77c125369426a519fb9ea92dc159fa5ce392f354
Author: Avi Kivity <avi at qumranet.com>
Date:   Sat Aug 30 13:02:43 2008 +0300

    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 <avi at qumranet.com>

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);


Index: kvm.spec
===================================================================
RCS file: /cvs/pkgs/rpms/kvm/F-10/kvm.spec,v
retrieving revision 1.73
retrieving revision 1.74
diff -u -r1.73 -r1.74
--- kvm.spec	11 Nov 2008 15:57:35 -0000	1.73
+++ kvm.spec	24 Nov 2008 19:14:00 -0000	1.74
@@ -1,7 +1,7 @@
 Summary: Kernel-based Virtual Machine
 Name: kvm
 Version: 74
-Release: 6%{?dist}
+Release: 7%{?dist}
 License: GPLv2+ and LGPLv2+
 Group: Development/Tools
 URL: http://%{name}.sf.net
@@ -14,6 +14,7 @@
 Patch3: %{name}-74-page-find.patch
 Patch4: %{name}-fix-pc-bios-make-install-missing-files.patch
 Patch5: %{name}-cirrus-cve-2008-4539.patch
+Patch6: %{name}-restore-option-rom.patch
 # patches from upstream qemu
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 BuildRequires: SDL-devel
@@ -50,6 +51,7 @@
 %patch3 -p1
 %patch4 -p1
 %patch5 -p1
+%patch6 -p1
 # we must not use any of the binaries from the qemu/pc-bios/ directory,
 # as they don't have the corresponding sources shipped with them
 rm -f qemu/pc-bios/*
@@ -140,6 +142,9 @@
 %{_sysconfdir}/sysconfig/modules/%{name}.modules
 
 %changelog
+* Mon Nov 24 2008 Glauber Costa <glommer at redhat.com> - 74-7
+- added upstream patch kvm-restore-option-rom.patch - #470561
+
 * Tue Nov 11 2008 Glauber Costa <glommer at redhat.com> - 74-6
 - Fix cirrus vulnerability (CVE-2008-4539) - #471055
 




More information about the fedora-extras-commits mailing list