public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Fix network boot whether KVM is enabled or disabled
@ 2007-08-10 22:52 Chuan-kai Lin
       [not found] ` <135cb3c30708101552j6ed4433et5c18f2dfae9cce6d-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 9+ messages in thread
From: Chuan-kai Lin @ 2007-08-10 22:52 UTC (permalink / raw)
  To: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

From: Chuan-kai Lin <cklin-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>

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 <cklin-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>

---

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

-- 
Chuan-kai Lin

-------------------------------------------------------------------------
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/

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2007-08-23 19:17 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-08-10 22:52 [PATCH] Fix network boot whether KVM is enabled or disabled Chuan-kai Lin
     [not found] ` <135cb3c30708101552j6ed4433et5c18f2dfae9cce6d-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2007-08-11  2:52   ` Anthony Liguori
     [not found]     ` <46BD2455.2040204-rdkfGonbjUSkNkDKm+mE6A@public.gmane.org>
2007-08-13  8:07       ` Avi Kivity
     [not found]         ` <46C0112C.6020707-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-08-13 17:22           ` Chuan-kai Lin
     [not found]             ` <135cb3c30708131022y55383d65m41b997d2c393036-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2007-08-23  0:10               ` Anthony Liguori
2007-08-23  1:52                 ` Chuan-kai Lin
     [not found]                   ` <135cb3c30708221852v2de7377t8fefee7e18836e77-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2007-08-23  2:46                     ` Anthony Liguori
2007-08-23 19:08                       ` Chuan-kai Lin
     [not found]                         ` <135cb3c30708231208y4e2d3e87ua4bca7922bf27646-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2007-08-23 19:17                           ` Anthony Liguori

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox