public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Avi Kivity <avi-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
To: Anthony Liguori <aliguori-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
Subject: Re: [PATCH] Fix network boot while KVM is enabled
Date: Mon, 02 Jul 2007 21:29:21 -0700	[thread overview]
Message-ID: <4689D0A1.5020400@qumranet.com> (raw)
In-Reply-To: <11834267632309-git-send-email-aliguori-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>

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 <aliguori-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
>
> 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.


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

  parent reply	other threads:[~2007-07-03  4:29 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-03  1:39 [PATCH] Fix network boot while KVM is enabled Anthony Liguori
     [not found] ` <11834267632309-git-send-email-aliguori-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2007-07-03  4:29   ` Avi Kivity [this message]
     [not found]     ` <4689D0A1.5020400-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-07-03  4:32       ` Anthony Liguori
     [not found]         ` <4689D167.4020800-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2007-07-03  4:36           ` Avi Kivity
  -- strict thread matches above, loose matches on Subject: below --
2007-07-03 11:01 Gregory Haskins

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4689D0A1.5020400@qumranet.com \
    --to=avi-atkuwr5tajbwk0htik3j/w@public.gmane.org \
    --cc=aliguori-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org \
    --cc=kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox