From: Wei Liu <wei.liu2@citrix.com>
To: Xen-devel <xen-devel@lists.xenproject.org>
Cc: Anthony PERARD <anthony.perard@citrix.com>
Subject: [PATCH v8 08/13] hvmloader: Load SeaBIOS from hvm_start_info modules
Date: Thu, 18 Aug 2016 15:13:53 +0100 [thread overview]
Message-ID: <1471529638-2436-9-git-send-email-wei.liu2@citrix.com> (raw)
In-Reply-To: <1471529638-2436-1-git-send-email-wei.liu2@citrix.com>
From: Anthony PERARD <anthony.perard@citrix.com>
... and do not include the SeaBIOS ROM into hvmloader anymore.
This also fix the dependency on roms.inc, hvmloader.o does not include it.
Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
Change in V6:
acked
Change in V5:
- update BUG_ON in seabios_setup_e820().
Change in V4:
- check that seabios_config.bios_address have a probably good value
instead of checking only if it's set.
Change in V3:
- change makefile to not include seabios roms into roms.inc.
- update the struct bios_config with the location of the bios blob.
---
tools/firmware/hvmloader/Makefile | 15 +--------------
tools/firmware/hvmloader/seabios.c | 25 +++++++++++++++----------
2 files changed, 16 insertions(+), 24 deletions(-)
diff --git a/tools/firmware/hvmloader/Makefile b/tools/firmware/hvmloader/Makefile
index f2f4791..ed0bfad 100644
--- a/tools/firmware/hvmloader/Makefile
+++ b/tools/firmware/hvmloader/Makefile
@@ -45,7 +45,6 @@ CIRRUSVGA_DEBUG ?= n
OVMF_DIR := ../ovmf-dir
ROMBIOS_DIR := ../rombios
-SEABIOS_DIR := ../seabios-dir
ifeq ($(CONFIG_ROMBIOS),y)
STDVGA_ROM := ../vgabios/VGABIOS-lgpl-latest.bin
@@ -80,19 +79,13 @@ endif
ifeq ($(CONFIG_SEABIOS),y)
OBJS += seabios.o
CFLAGS += -DENABLE_SEABIOS
-ifeq ($(SEABIOS_PATH),)
- SEABIOS_ROM := $(SEABIOS_DIR)/out/bios.bin
-else
- SEABIOS_ROM := $(SEABIOS_PATH)
-endif
-ROMS += $(SEABIOS_ROM)
endif
.PHONY: all
all: subdirs-all
$(MAKE) hvmloader
-ovmf.o rombios.o seabios.o hvmloader.o: roms.inc
+ovmf.o rombios.o: roms.inc
smbios.o: CFLAGS += -D__SMBIOS_DATE__="\"$(SMBIOS_REL_DATE)\""
hvmloader: $(OBJS) acpi/acpi.a
@@ -109,12 +102,6 @@ ifneq ($(ROMBIOS_ROM),)
echo "#endif" >> $@.new
endif
-ifneq ($(SEABIOS_ROM),)
- echo "#ifdef ROM_INCLUDE_SEABIOS" >> $@.new
- sh ./mkhex seabios $(SEABIOS_ROM) >> $@.new
- echo "#endif" >> $@.new
-endif
-
ifneq ($(OVMF_ROM),)
echo "#ifdef ROM_INCLUDE_OVMF" >> $@.new
sh ./mkhex ovmf $(OVMF_ROM) >> $@.new
diff --git a/tools/firmware/hvmloader/seabios.c b/tools/firmware/hvmloader/seabios.c
index 2fbc3af..5c9a351 100644
--- a/tools/firmware/hvmloader/seabios.c
+++ b/tools/firmware/hvmloader/seabios.c
@@ -28,9 +28,6 @@
#include "acpi/acpi2_0.h"
#include "acpi/libacpi.h"
-#define ROM_INCLUDE_SEABIOS
-#include "roms.inc"
-
extern unsigned char dsdt_anycpu_qemu_xen[];
extern int dsdt_anycpu_qemu_xen_len;
@@ -128,22 +125,30 @@ static void seabios_setup_e820(void)
struct e820entry *e820 = scratch_alloc(sizeof(struct e820entry)*16, 0);
info->e820 = (uint32_t)e820;
+ /* Upper boundary already checked by seabios_load(). */
+ BUG_ON(seabios_config.bios_address < 0x000c0000);
/* SeaBIOS reserves memory in e820 as necessary so no low reservation. */
- info->e820_nr = build_e820_table(e820, 0, 0x100000-sizeof(seabios));
+ info->e820_nr = build_e820_table(e820, 0, seabios_config.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;
- .image = seabios,
- .image_size = sizeof(seabios),
+ BUG_ON(bios_dest + bios_length > HVMLOADER_PHYSICAL_ADDRESS);
+ memcpy((void *)bios_dest, bios_addr, bios_length);
+ seabios_config.bios_address = bios_dest;
+ seabios_config.image_size = 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,
--
2.1.4
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
next prev parent reply other threads:[~2016-08-18 14:14 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-18 14:13 [PATCH v8 00/13] Load BIOS via toolstack instead of been embedded in hvmloader Wei Liu
2016-08-18 14:13 ` [PATCH v8 01/13] libxc: Rework extra module initialisation Wei Liu
2016-08-18 14:13 ` [PATCH v8 02/13] libxc: Prepare a start info structure for hvmloader Wei Liu
2016-08-18 14:13 ` [PATCH v8 03/13] configure: #define SEABIOS_PATH and OVMF_PATH Wei Liu
2016-08-18 14:13 ` [PATCH v8 04/13] firmware/makefile: install BIOS blob Wei Liu
2016-08-18 14:13 ` [PATCH v8 05/13] libxl: Load guest BIOS from file Wei Liu
2016-08-19 14:43 ` Andrew Cooper
2016-08-22 13:13 ` Wei Liu
2016-08-22 13:26 ` Andrew Cooper
2016-08-22 14:26 ` Wei Liu
2016-08-22 15:05 ` [PATCH 0/2] Fix issue with {OVMF,SEABIOS}_PATH Wei Liu
2016-08-22 15:05 ` [PATCH 1/2] tools: only define {OVMF, SEABIOS}_PATH when they are enabled Wei Liu
2016-08-22 15:05 ` [PATCH 2/2] libxl: only return {OVMF, SEABIOS}_PATH if available Wei Liu
2016-08-23 9:37 ` [PATCH 0/2] Fix issue with {OVMF,SEABIOS}_PATH Andrew Cooper
2016-08-24 11:38 ` Ian Jackson
2016-08-24 11:59 ` Wei Liu
2016-08-22 15:09 ` [PATCH v8 05/13] libxl: Load guest BIOS from file Andrew Cooper
2016-08-22 15:13 ` Wei Liu
2016-08-23 20:00 ` Doug Goldstein
2016-08-24 9:16 ` Wei Liu
2016-08-18 14:13 ` [PATCH v8 06/13] hvmloader: Grab the hvm_start_info pointer Wei Liu
2016-08-18 14:13 ` [PATCH v8 07/13] hvmloader: Locate the BIOS blob Wei Liu
2016-08-18 15:39 ` Jan Beulich
2016-08-18 15:48 ` Andrew Cooper
2016-08-18 15:51 ` Wei Liu
2016-08-18 14:13 ` Wei Liu [this message]
2016-08-18 14:13 ` [PATCH v8 09/13] hvmloader: Load OVMF from modules Wei Liu
2016-08-18 14:13 ` [PATCH v8 10/13] hvmloader: bios->bios_load() now needs to be defined Wei Liu
2016-08-18 14:13 ` [PATCH v8 11/13] hvmloader: Always build-in SeaBIOS and OVMF loader Wei Liu
2016-08-18 14:13 ` [PATCH v8 12/13] configure: do not depend on SEABIOS_PATH or OVMF_PATH Wei Liu
2016-08-18 14:13 ` [PATCH v8 13/13] docs/misc/hvmlite: Point to the canonical definition of hvm_start_info Wei Liu
2016-08-18 16:23 ` [PATCH v8 00/13] Load BIOS via toolstack instead of been embedded in hvmloader Wei Liu
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=1471529638-2436-9-git-send-email-wei.liu2@citrix.com \
--to=wei.liu2@citrix.com \
--cc=anthony.perard@citrix.com \
--cc=xen-devel@lists.xenproject.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).