xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Anoob Soman <anoob.soman@citrix.com>
To: xen-devel@lists.xen.org
Cc: wei.liu2@citrix.com, Anoob Soman <anoob.soman@citrix.com>,
	ian.jackson@eu.citrix.com, jbeulich@suse.com,
	andrew.cooper3@citrix.com
Subject: [PATCH 5/5] hvmloader: Use iPXE ROM loaded from a standalone file
Date: Thu, 15 Mar 2018 17:31:53 +0000	[thread overview]
Message-ID: <1521135113-3764-6-git-send-email-anoob.soman@citrix.com> (raw)
In-Reply-To: <1521135113-3764-1-git-send-email-anoob.soman@citrix.com>

splatering of mkhex-ed etherboot inside hvmloader/rombios is removed,
instead hvmloader/rombios now relies on iPXE ROM to be added,loaded as
a module.

Signed-off-by: Anoob Soman <anoob.soman@citrix.com>
---
 tools/firmware/hvmloader/Makefile    |  7 +------
 tools/firmware/hvmloader/config.h    |  5 +++++
 tools/firmware/hvmloader/hvmloader.c |  9 ++++++++-
 tools/firmware/hvmloader/rombios.c   | 13 +++++++++----
 4 files changed, 23 insertions(+), 11 deletions(-)

diff --git a/tools/firmware/hvmloader/Makefile b/tools/firmware/hvmloader/Makefile
index fa1bf30..f347cb4 100644
--- a/tools/firmware/hvmloader/Makefile
+++ b/tools/firmware/hvmloader/Makefile
@@ -64,7 +64,7 @@ ifeq ($(CONFIG_ROMBIOS),y)
 OBJS += optionroms.o 32bitbios_support.o rombios.o
 CFLAGS += -DENABLE_ROMBIOS
 ROMBIOS_ROM := $(ROMBIOS_DIR)/BIOS-bochs-latest
-ROMS += $(ROMBIOS_ROM) $(STDVGA_ROM) $(CIRRUSVGA_ROM) $(ETHERBOOT_ROMS)
+ROMS += $(ROMBIOS_ROM) $(STDVGA_ROM) $(CIRRUSVGA_ROM)
 endif
 
 .PHONY: all
@@ -109,11 +109,6 @@ ifneq ($(CIRRUSVGA_ROM),)
 	sh ../../misc/mkhex vgabios_cirrusvga $(CIRRUSVGA_ROM) >> $@.new
 	echo "#endif" >> $@.new
 endif
-ifneq ($(ETHERBOOT_ROMS),)
-	echo "#ifdef ROM_INCLUDE_ETHERBOOT" >> $@.new
-	sh ../../misc/mkhex etherboot $(ETHERBOOT_ROMS) >> $@.new
-	echo "#endif" >> $@.new
-endif
 
 	mv $@.new $@
 
diff --git a/tools/firmware/hvmloader/config.h b/tools/firmware/hvmloader/config.h
index 6e00413..8f5d1040 100644
--- a/tools/firmware/hvmloader/config.h
+++ b/tools/firmware/hvmloader/config.h
@@ -33,6 +33,11 @@ struct bios_config {
     void (*create_mp_tables)(void);
     void (*create_smbios_tables)(void);
     void (*create_pir_tables)(void);
+
+    /* Physical address of iPXE ROM, loaded by domain builder
+     * when using ROMBIOS
+     */
+    unsigned int *ipxe_rom_addresss;
 };
 
 extern struct bios_config rombios_config;
diff --git a/tools/firmware/hvmloader/hvmloader.c b/tools/firmware/hvmloader/hvmloader.c
index f603f68..731cd81 100644
--- a/tools/firmware/hvmloader/hvmloader.c
+++ b/tools/firmware/hvmloader/hvmloader.c
@@ -323,6 +323,8 @@ int main(void)
     const struct bios_config *bios;
     int acpi_enabled;
     const struct hvm_modlist_entry *bios_module;
+    const struct hvm_modlist_entry *ipxe_module = NULL;
+    unsigned int ipxe_rom_addresss = 0;
 
     /* Initialise hypercall stubs with RET, rendering them no-ops. */
     memset((void *)HYPERCALL_PHYSICAL_ADDRESS, 0xc3 /* RET */, PAGE_SIZE);
@@ -368,7 +370,12 @@ int main(void)
 #ifdef ENABLE_ROMBIOS
     else if ( bios == &rombios_config )
     {
-        bios->bios_load(bios, NULL, 0);
+        ipxe_module = get_module_entry(hvm_start_info, "ipxe");
+
+        if ( ipxe_module )
+            ipxe_rom_addresss = ipxe_module->paddr;
+
+        bios->bios_load(bios, (void *)ipxe_rom_addresss, 0);
     }
 #endif
     else
diff --git a/tools/firmware/hvmloader/rombios.c b/tools/firmware/hvmloader/rombios.c
index c736fd9..c0e04cb 100644
--- a/tools/firmware/hvmloader/rombios.c
+++ b/tools/firmware/hvmloader/rombios.c
@@ -95,9 +95,12 @@ static void rombios_load_roms(void)
     etherboot_phys_addr = VGABIOS_PHYSICAL_ADDRESS + vgabios_sz;
     if ( etherboot_phys_addr < OPTIONROM_PHYSICAL_ADDRESS )
         etherboot_phys_addr = OPTIONROM_PHYSICAL_ADDRESS;
-    etherboot_sz = scan_etherboot_nic(OPTIONROM_PHYSICAL_END,
-                                      etherboot_phys_addr,
-                                      etherboot);
+
+    if ( rombios_config.ipxe_rom_addresss )
+        etherboot_sz = scan_etherboot_nic(OPTIONROM_PHYSICAL_END,
+                                          etherboot_phys_addr,
+                                          rombios_config.ipxe_rom_addresss);
+
 
     option_rom_phys_addr = etherboot_phys_addr + etherboot_sz;
     option_rom_sz = pci_load_option_roms(OPTIONROM_PHYSICAL_END,
@@ -119,7 +122,7 @@ static void rombios_load_roms(void)
 }
 
 static void rombios_load(const struct bios_config *config,
-                         void *unused_addr, uint32_t unused_size)
+                         void *ipxe_rom_addr, uint32_t unused_size)
 {
     uint32_t bioshigh;
     struct rombios_info *info;
@@ -133,6 +136,8 @@ static void rombios_load(const struct bios_config *config,
 
     info = (struct rombios_info *)BIOS_INFO_PHYSICAL_ADDRESS;
     info->bios32_entry = bioshigh;
+
+    rombios_config.ipxe_rom_addresss = ipxe_rom_addr;
 }
 
 /*
-- 
1.8.3.1


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

  parent reply	other threads:[~2018-03-15 17:31 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-15 17:31 Make iPXE a standalone ROM Anoob Soman
2018-03-15 17:31 ` [PATCH 1/5] tools/firmware: Build ipxe as " Anoob Soman
2018-03-16 11:18   ` Jan Beulich
2018-03-16 11:21     ` Andrew Cooper
2018-03-18  1:30     ` Doug Goldstein
2018-03-19  7:48       ` Jan Beulich
2018-03-19 13:52         ` Doug Goldstein
2018-03-15 17:31 ` [PATCH 2/5] tools/firmware: #define IPXE_PATH Anoob Soman
2018-03-21 15:18   ` Wei Liu
2018-03-26 15:53     ` Anoob Soman
2018-03-15 17:31 ` [PATCH 3/5] libxc: Allow loading of firmware modules for HVM guest Anoob Soman
2018-03-18  1:32   ` Doug Goldstein
2018-03-19 14:31     ` Anoob Soman
2018-03-21 15:17   ` Wei Liu
2018-03-26 15:51     ` Anoob Soman
2018-03-15 17:31 ` [PATCH 4/5] libxl: Load iPXE ROM from a file Anoob Soman
2018-03-18  1:34   ` Doug Goldstein
2018-03-21 15:25   ` Wei Liu
2018-03-26 15:51     ` Anoob Soman
2018-03-15 17:31 ` Anoob Soman [this message]
2018-03-16 11:26   ` [PATCH 5/5] hvmloader: Use iPXE ROM loaded from a standalone file Jan Beulich
2018-03-16 11:44     ` Andrew Cooper
2018-03-17 16:54       ` Doug Goldstein
2018-03-19 14:24     ` Anoob Soman
2018-03-19 15:21       ` Jan Beulich

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=1521135113-3764-6-git-send-email-anoob.soman@citrix.com \
    --to=anoob.soman@citrix.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=jbeulich@suse.com \
    --cc=wei.liu2@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).