From mboxrd@z Thu Jan 1 00:00:00 1970 From: Anthony Liguori Subject: Re: [PATCH] Fix network boot while KVM is enabled Date: Mon, 02 Jul 2007 23:32:39 -0500 Message-ID: <4689D167.4020800@us.ibm.com> References: 46896F37.6030302@bitrunner.com <11834267632309-git-send-email-aliguori@us.ibm.com> <4689D0A1.5020400@qumranet.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org To: Avi Kivity Return-path: In-Reply-To: <4689D0A1.5020400-atKUWr5tajBWk0Htik3J/w@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org Errors-To: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org List-Id: kvm.vger.kernel.org Avi Kivity wrote: > Anthony Liguori wrote: >> 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 >> >> 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); >> > > #ifdef USE_KVM is needed here. I thought a patch was recently submitted that made kvm_allowed not depend on USE_KVM? If not, do you have a problem with one? Regards, Anthony Liguori ------------------------------------------------------------------------- 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/