xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Ian Campbell <ian.campbell@citrix.com>
To: Anthony PERARD <anthony.perard@citrix.com>, xen-devel@lists.xen.org
Subject: Re: [RFC PATCH v2 09/16] hvmloader: Load SeaBIOS from hvm_start_info modules ...
Date: Wed, 4 Nov 2015 11:11:07 +0000	[thread overview]
Message-ID: <1446635467.6461.58.camel@citrix.com> (raw)
In-Reply-To: <1445875397-2846-10-git-send-email-anthony.perard@citrix.com>

On Mon, 2015-10-26 at 16:03 +0000, Anthony PERARD wrote:
> ... and do not include the SeaBIOS ROM into hvmloader anymore.

... but don't yet stop including it in rom.inc (I suppose that comes later)

Can we add a new hook to chose an address for the bios which the common
code which handles the no-bios_load-hook case could use and which could be
propagated to setup_e280 instead of using a global?

seabios_config isn't a const, so you could even just set .bios_address
dynamically?

> 
> Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
> ---
>  tools/firmware/hvmloader/seabios.c | 24 ++++++++++++++----------
>  1 file changed, 14 insertions(+), 10 deletions(-)
> 
> diff --git a/tools/firmware/hvmloader/seabios.c
> b/tools/firmware/hvmloader/seabios.c
> index c6b3d9f..766bd6b 100644
> --- a/tools/firmware/hvmloader/seabios.c
> +++ b/tools/firmware/hvmloader/seabios.c
> @@ -27,9 +27,6 @@
>  #include "smbios_types.h"
>  #include "acpi/acpi2_0.h"
>  
> -#define ROM_INCLUDE_SEABIOS
> -#include "roms.inc"
> -
>  extern unsigned char dsdt_anycpu_qemu_xen[];
>  extern int dsdt_anycpu_qemu_xen_len;
>  
> @@ -121,6 +118,7 @@ static void seabios_create_pir_tables(void)
>      add_table(create_pir_tables());
>  }
>  
> +unsigned int seabios_bios_address = 0;

If it really has to remain should at least be static.

>  static void seabios_setup_e820(void)
>  {
>      struct seabios_info *info = (void *)BIOS_INFO_PHYSICAL_ADDRESS;
> @@ -128,21 +126,27 @@ static void seabios_setup_e820(void)
>      info->e820 = (uint32_t)e820;
>  
>      /* SeaBIOS reserves memory in e820 as necessary so no low
> reservation. */
> -    info->e820_nr = build_e820_table(e820, 0, 0x100000-sizeof(seabios));
> +    BUG_ON(seabios_bios_address == 0);
> +    info->e820_nr = build_e820_table(e820, 0, seabios_bios_address);
>      dump_e820_table(e820, info->e820_nr);
>  }
>  
> -struct bios_config seabios_config = {
> -    .name = "SeaBIOS",
> +static void seabios_load(const struct bios_config *bios,
> +                         void *bios_addr, uint32_t bios_length)
> +{
> +    unsigned int bios_dest = 0x100000 - bios_length;
> +    seabios_bios_address = 0x100000 - bios_length;
>  
> -    .image = seabios,
> -    .image_size = sizeof(seabios),
> +    BUG_ON(bios_dest + bios_length > HVMLOADER_PHYSICAL_ADDRESS);
> +    memcpy((void *)bios_dest, bios_addr, bios_length);
> +}
>  
> -    .bios_address = 0x100000 - sizeof(seabios),
> +struct bios_config seabios_config = {
> +    .name = "SeaBIOS",
>  
>      .load_roms = NULL,
>  
> -    .bios_load = NULL,
> +    .bios_load = seabios_load,
>  
>      .bios_info_setup = seabios_setup_bios_info,
>      .bios_info_finish = seabios_finish_bios_info,

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

  reply	other threads:[~2015-11-04 11:11 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-26 16:03 [RFC PATCH v2 00/16] Load BIOS via toolstack instead of been embedded in hvmloader Anthony PERARD
2015-10-26 16:03 ` [RFC PATCH v2 01/16] hvmloader: Fix scratch_alloc to avoid overlaps Anthony PERARD
2015-11-03 17:38   ` Ian Campbell
2015-11-10 16:29   ` Jan Beulich
2015-10-26 16:03 ` [RFC PATCH v2 02/16] libxc: Load BIOS and ACPI table into guest memory Anthony PERARD
2015-11-03 17:45   ` Ian Campbell
2015-10-26 16:03 ` [RFC PATCH v2 03/16] configure: #define SEABIOS_PATH and OVMF_PATH Anthony PERARD
2015-11-04 10:24   ` Ian Campbell
2015-10-26 16:03 ` [RFC PATCH v2 04/16] firmware/makefile: install BIOS and ACPI blob Anthony PERARD
2015-11-04 10:35   ` Ian Campbell
2015-10-26 16:03 ` [RFC PATCH v2 05/16] libxl: Load guest BIOS from file Anthony PERARD
2015-11-04 10:51   ` Ian Campbell
2015-10-26 16:03 ` [RFC PATCH v2 06/16] libxl: Load guest ACPI table " Anthony PERARD
2015-11-04 10:57   ` Ian Campbell
2015-12-18 14:43     ` Anthony PERARD
2015-10-26 16:03 ` [RFC PATCH v2 07/16] hvmloader: Grab the hvmlite info page and parse the cmdline Anthony PERARD
2015-11-04 10:39   ` Andrew Cooper
2015-11-04 11:02   ` Ian Campbell
2015-10-26 16:03 ` [RFC PATCH v2 08/16] hvmloader: Locate the BIOS blob Anthony PERARD
2015-11-04 11:05   ` Ian Campbell
2015-10-26 16:03 ` [RFC PATCH v2 09/16] hvmloader: Load SeaBIOS from hvm_start_info modules Anthony PERARD
2015-11-04 11:11   ` Ian Campbell [this message]
2015-10-26 16:03 ` [RFC PATCH v2 10/16] hvmloader: Load OVMF from modules Anthony PERARD
2015-11-04 11:15   ` Ian Campbell
2015-10-26 16:03 ` [RFC PATCH v2 11/16] hvmloader: No BIOS ROM image allowed to be compiled in Anthony PERARD
2015-11-04 11:17   ` Ian Campbell
2015-10-26 16:03 ` [RFC PATCH v2 12/16] hvmloader: Load ACPI tables from hvm_start_info module Anthony PERARD
2015-11-04 11:20   ` Ian Campbell
2015-10-26 16:03 ` [RFC PATCH v2 13/16] hvmloader/makefile: Compile out SeaBIOS and OVMF ROM blob Anthony PERARD
2015-10-26 16:03 ` [RFC PATCH v2 14/16] hvmloader: Always build-in SeaBIOS and OVMF loader Anthony PERARD
2015-10-26 16:03 ` [RFC PATCH v2 15/16] hvmloader: Compile out the qemu-xen ACPI tables Anthony PERARD
2015-10-26 16:03 ` [RFC PATCH v2 16/16] hvmloader: do not depend on SEABIOS_PATH or OVMF_PATH Anthony PERARD
2015-11-03 17:30 ` [RFC PATCH v2 00/16] Load BIOS via toolstack instead of been embedded in hvmloader Ian Campbell
2015-11-03 17:50   ` Anthony PERARD
2015-11-04 10:18     ` Ian Campbell

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=1446635467.6461.58.camel@citrix.com \
    --to=ian.campbell@citrix.com \
    --cc=anthony.perard@citrix.com \
    --cc=xen-devel@lists.xen.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;
as well as URLs for NNTP newsgroup(s).