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

* Re: [PATCH] Fix network boot whether KVM is enabled or disabled
       [not found] ` <135cb3c30708101552j6ed4433et5c18f2dfae9cce6d-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2007-08-11  2:52   ` Anthony Liguori
       [not found]     ` <46BD2455.2040204-rdkfGonbjUSkNkDKm+mE6A@public.gmane.org>
  0 siblings, 1 reply; 9+ messages in thread
From: Anthony Liguori @ 2007-08-11  2:52 UTC (permalink / raw)
  To: Chuan-kai Lin; +Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

Chuan-kai Lin wrote:
> 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
>   

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/

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

* Re: [PATCH] Fix network boot whether KVM is enabled or disabled
       [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>
  0 siblings, 1 reply; 9+ messages in thread
From: Avi Kivity @ 2007-08-13  8:07 UTC (permalink / raw)
  To: Anthony Liguori; +Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f, Chuan-kai Lin

Anthony Liguori wrote:
> Chuan-kai Lin wrote:
>   
>> 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.
>>     
> Should be:
>
> } else
>   

[other indentation errors there too]

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

I must have missed or forgotten about that earlier patch, sorry.  If you 
think your patch is better, please send it.  While we want to encourage 
newcomers we also want the best patches...

-- 
error compiling committee.c: too many arguments to function


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

* Re: [PATCH] Fix network boot whether KVM is enabled or disabled
       [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>
  0 siblings, 1 reply; 9+ messages in thread
From: Chuan-kai Lin @ 2007-08-13 17:22 UTC (permalink / raw)
  To: Avi Kivity; +Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

On 8/13/07, Avi Kivity <avi-atKUWr5tajBWk0Htik3J/w@public.gmane.org> wrote:
> Anthony Liguori wrote:
> > Should be:
> > } else
> [other indentation errors there too]

My apologies.  Webmail is probably not the best MUA for submitting
patches in the message body.

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

As long as PXE booting works both with and without kvm, I don't care
which one gets included either.

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

* Re: [PATCH] Fix network boot whether KVM is enabled or disabled
       [not found]             ` <135cb3c30708131022y55383d65m41b997d2c393036-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2007-08-23  0:10               ` Anthony Liguori
  2007-08-23  1:52                 ` Chuan-kai Lin
  0 siblings, 1 reply; 9+ messages in thread
From: Anthony Liguori @ 2007-08-23  0:10 UTC (permalink / raw)
  To: Chuan-kai Lin; +Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f, Avi Kivity

How did you test your patch?  PXE boot hasn't ever worked with
qemu-system-x86_64.  I never dug into it because I didn't use it
(although now I do since KVM uses it by default).  I don't know that
it's worth pulling in the PXE boot fix until we figure out why it
doesn't work on qemu-system-x86_64 since KVM uses that by default now.

Regards,

Anthony Liguori


On Mon, 2007-08-13 at 10:22 -0700, Chuan-kai Lin wrote:
> On 8/13/07, Avi Kivity <avi-atKUWr5tajBWk0Htik3J/w@public.gmane.org> wrote:
> > Anthony Liguori wrote:
> > > Should be:
> > > } else
> > [other indentation errors there too]
> 
> My apologies.  Webmail is probably not the best MUA for submitting
> patches in the message body.
> 
> > > 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.
> 
> As long as PXE booting works both with and without kvm, I don't care
> which one gets included either.
> 


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

* Re: [PATCH] Fix network boot whether KVM is enabled or disabled
  2007-08-23  0:10               ` Anthony Liguori
@ 2007-08-23  1:52                 ` Chuan-kai Lin
       [not found]                   ` <135cb3c30708221852v2de7377t8fefee7e18836e77-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 9+ messages in thread
From: Chuan-kai Lin @ 2007-08-23  1:52 UTC (permalink / raw)
  To: Anthony Liguori; +Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f, Avi Kivity

On 8/22/07, Anthony Liguori <anthony-rdkfGonbjUSkNkDKm+mE6A@public.gmane.org> wrote:
> How did you test your patch?  PXE boot hasn't ever worked with
> qemu-system-x86_64.

Really?  It worked for me (qemu-system-x86_64 from kvm28, atftpd
serving i386 dapper ubuntu-installer image over tap networking
device).  Could you clarify what "PXE boot hasn't ever worked with
qemu-system-x86_64" means?

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

* Re: [PATCH] Fix network boot whether KVM is enabled or disabled
       [not found]                   ` <135cb3c30708221852v2de7377t8fefee7e18836e77-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2007-08-23  2:46                     ` Anthony Liguori
  2007-08-23 19:08                       ` Chuan-kai Lin
  0 siblings, 1 reply; 9+ messages in thread
From: Anthony Liguori @ 2007-08-23  2:46 UTC (permalink / raw)
  To: Chuan-kai Lin; +Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f, Avi Kivity


On Wed, 2007-08-22 at 18:52 -0700, Chuan-kai Lin wrote:
> On 8/22/07, Anthony Liguori <anthony-rdkfGonbjUSkNkDKm+mE6A@public.gmane.org> wrote:
> > How did you test your patch?  PXE boot hasn't ever worked with
> > qemu-system-x86_64.
> 
> Really?  It worked for me (qemu-system-x86_64 from kvm28, atftpd
> serving i386 dapper ubuntu-installer image over tap networking
> device).  Could you clarify what "PXE boot hasn't ever worked with
> qemu-system-x86_64" means?

Hrm, it looks like it's the BIOS.  Using the BIOS in qemu-0.9.0, -boot n works with x86_64 but the bios installed by KVM doesn't work.

-boot n doesn't seem to work for me with recent gits with my old patch
or with -no-kvm.  I don't think kvm-28 built x86_64 on i386 by default
btw.

Can you try a more recent KVM with -no-kvm?

Regards,

Anthony Liguori


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

* Re: [PATCH] Fix network boot whether KVM is enabled or disabled
  2007-08-23  2:46                     ` Anthony Liguori
@ 2007-08-23 19:08                       ` Chuan-kai Lin
       [not found]                         ` <135cb3c30708231208y4e2d3e87ua4bca7922bf27646-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 9+ messages in thread
From: Chuan-kai Lin @ 2007-08-23 19:08 UTC (permalink / raw)
  To: Anthony Liguori; +Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f, Avi Kivity

On 8/22/07, Anthony Liguori <anthony-rdkfGonbjUSkNkDKm+mE6A@public.gmane.org> wrote:
> Hrm, it looks like it's the BIOS.  Using the BIOS in qemu-0.9.0, -boot n works with
> x86_64 but the bios installed by KVM doesn't work.

Yeah, it does seem to be the case.  I ran a few experiments after
reading your message: kvm-28 and kvm-36 successfully PXE-boots when
using bios.bin from kvm-28, but both fails to PXE-boot when using
bios.bin from kvm-36.

> Can you try a more recent KVM with -no-kvm?

Using the patch I posted to the list, I can PXE-boot using the
qemu-system-x86_64 executable from kvm-36 both with and without kvm
kernel module acceleration (provided that I use the bios from kvm-28,
that is).

Regards,

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

* Re: [PATCH] Fix network boot whether KVM is enabled or disabled
       [not found]                         ` <135cb3c30708231208y4e2d3e87ua4bca7922bf27646-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2007-08-23 19:17                           ` Anthony Liguori
  0 siblings, 0 replies; 9+ messages in thread
From: Anthony Liguori @ 2007-08-23 19:17 UTC (permalink / raw)
  To: Chuan-kai Lin; +Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f, Avi Kivity


On Thu, 2007-08-23 at 12:08 -0700, Chuan-kai Lin wrote:
> On 8/22/07, Anthony Liguori <anthony-rdkfGonbjUSkNkDKm+mE6A@public.gmane.org> wrote:
> > Hrm, it looks like it's the BIOS.  Using the BIOS in qemu-0.9.0, -boot n works with
> > x86_64 but the bios installed by KVM doesn't work.
> 
> Yeah, it does seem to be the case.  I ran a few experiments after
> reading your message: kvm-28 and kvm-36 successfully PXE-boots when
> using bios.bin from kvm-28, but both fails to PXE-boot when using
> bios.bin from kvm-36.
> 
> > Can you try a more recent KVM with -no-kvm?
> 
> Using the patch I posted to the list, I can PXE-boot using the
> qemu-system-x86_64 executable from kvm-36 both with and without kvm
> kernel module acceleration (provided that I use the bios from kvm-28,
> that is).

Only with the old BIOS right?  The new BIOS provides very limited
support for plug-and-play option ROMs.  This needs to be indicated in
CMOS memory.  This morning I made a quick attempt to change the CMOS
boot value to 0x04 which would indicate booting from an expansion ROM
but that didn't work.  There was a patch on qemu-devel recently that
might be worth looking at.

Regards,

Anthony Liguori

> Regards,
> 


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