[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [RFC PATCH v2 09/16] hvmloader: Load SeaBIOS from hvm_start_info modules ...



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@xxxxxxxxxx>
> ---
> Â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@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.