While QEMU can remap portions of physical ram to a higher address in
phys_ram_base, KVM requires that the memory be present where it would be in
physical memory.  Make sure to copy the option ROMs to the right space in
physical memory when KVM is enabled.

Signed-off-by: Anthony Liguori <[EMAIL PROTECTED]>

diff --git a/qemu/hw/pc.c b/qemu/hw/pc.c
index eda49cf..a6e4ea1 100644
--- a/qemu/hw/pc.c
+++ b/qemu/hw/pc.c
@@ -558,14 +558,20 @@ static void pc_init1(int ram_size, int vga_ram_size, int 
boot_device,
     
     option_rom_offset = 0;
     for (i = 0; i < nb_option_roms; i++) {
-       int offset = bios_offset + bios_size + option_rom_offset;
+       int offset = bios_size + option_rom_offset;
        int size;
 
-       size = load_image(option_rom[i], phys_ram_base + offset);
+       size = load_image(option_rom[i], phys_ram_base + bios_offset + offset);
        if ((size + option_rom_offset) > 0x10000) {
            fprintf(stderr, "Too many option ROMS\n");
            exit(1);
        }
+
+       if (kvm_allowed)
+           memcpy(phys_ram_base + 0xc0000 + offset,
+                  phys_ram_base + bios_offset + offset,
+                  size);
+
        cpu_register_physical_memory(0xd0000 + option_rom_offset,
                                     size, offset | IO_MEM_ROM);
        option_rom_offset += size + 2047;

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
kvm-devel mailing list
kvm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-devel

Reply via email to