From mboxrd@z Thu Jan 1 00:00:00 1970 From: Anthony Liguori Subject: Re: [PATCH] Fix network boot whether KVM is enabled or disabled Date: Fri, 10 Aug 2007 21:52:05 -0500 Message-ID: <46BD2455.2040204@codemonkey.ws> References: <135cb3c30708101552j6ed4433et5c18f2dfae9cce6d@mail.gmail.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: Chuan-kai Lin Return-path: In-Reply-To: <135cb3c30708101552j6ed4433et5c18f2dfae9cce6d-JsoAwUIsXosN+BqQ9rBEUg@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 Chuan-kai Lin wrote: > From: Chuan-kai Lin > > This patch is based on the one Anthony Liguori submitted to kvm-devel > on July 2nd, which fixes PXE booting with KVM enabled but breaks PXE > booting when not using KVM. I simplified Anthony's patch and > duplicated the cpu_register_physical_memory call to ensure that the > code retains its original behavior when kvm_allowed is 0. > > Signed-off-by: Chuan-kai Lin > > --- > > diff -r 3aba64456000 qemu/hw/pc.c > --- a/qemu/hw/pc.c Fri Aug 10 11:33:03 2007 -0700 > +++ b/qemu/hw/pc.c Fri Aug 10 14:53:28 2007 -0700 > @@ -566,8 +566,15 @@ static void pc_init1(int ram_size, int v > fprintf(stderr, "Too many option ROMS\n"); > exit(1); > } > - cpu_register_physical_memory(0xd0000 + option_rom_offset, > - size, offset | IO_MEM_ROM); > + if (kvm_allowed) { > + memcpy(phys_ram_base + 0xc0000 + offset - bios_offset, > + phys_ram_base + offset, size); > + cpu_register_physical_memory(0xd0000 + option_rom_offset, > + size, (offset - bios_offset) | > IO_MEM_ROM); > + } > + else > Should be: } else I clearly preferred the way I did it but I don't care that much. Thanks for bringing this patch up again, I've been meaning to resubmit it. Regards, Anthony Liguori > + cpu_register_physical_memory(0xd0000 + option_rom_offset, > + size, offset | IO_MEM_ROM); > option_rom_offset += size + 2047; > option_rom_offset -= (option_rom_offset % 2048); > } > > ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/