ifeq ($(CONFIG_OVMF),y)
$(INSTALL_DATA) ovmf-dir/ovmf.bin $(INST_DIR)/ovmf.bin
endif
+ifeq ($(CONFIG_IPXE),y)
+ $(INSTALL_DATA) etherboot/ipxe/src/bin/ipxe.bin $(INST_DIR)/ipxe.bin
+endif
ifeq ($(CONFIG_PV_SHIM),y)
$(INSTALL_DATA) xen-dir/xen-shim $(INST_DIR)/xen-shim
$(INSTALL_DATA) xen-dir/xen-shim-syms $(DEBG_DIR)/xen-shim-syms
ifeq ($(CONFIG_OVMF),y)
rm -f $(INST_DIR)/ovmf.bin
endif
+ifeq ($(CONFIG_IPXE),y)
+ rm -r $(INST_DIR)/ipxe.bin
+endif
ifeq ($(CONFIG_PV_SHIM),y)
rm -f $(INST_DIR)/xen-shim
rm -f $(DEBG_DIR)/xen-shim-syms
else
CIRRUSVGA_ROM := ../vgabios/VGABIOS-lgpl-latest.cirrus.bin
endif
-ETHERBOOT_ROM := ../etherboot/ipxe/src/bin/ipxe.bin
endif
ROMS :=
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_ROM)
+ROMS += $(ROMBIOS_ROM) $(STDVGA_ROM) $(CIRRUSVGA_ROM)
endif
.PHONY: all
sh ../../misc/mkhex vgabios_cirrusvga $(CIRRUSVGA_ROM) >> $@.new
echo "#endif" >> $@.new
endif
-ifneq ($(ETHERBOOT_ROM),)
- echo "#ifdef ROM_INCLUDE_ETHERBOOT" >> $@.new
- sh ../../misc/mkhex etherboot $(ETHERBOOT_ROM) >> $@.new
- echo "#endif" >> $@.new
-endif
-
mv $@.new $@
.PHONY: clean
/* ROMS */
void (*load_roms)(void);
- void (*bios_load)(const struct bios_config *config, void *addr, uint32_t size);
+ void (*bios_load)(const struct bios_config *config, void *addr,
+ uint32_t size, void *extra_addr);
void (*bios_info_setup)(void);
void (*bios_info_finish)(void);
{
uint32_t paddr = bios_module->paddr;
- bios->bios_load(bios, (void*)paddr, bios_module->size);
+ bios->bios_load(bios, (void *)paddr, bios_module->size, NULL);
}
#ifdef ENABLE_ROMBIOS
else if ( bios == &rombios_config )
{
- bios->bios_load(bios, NULL, 0);
+ const struct hvm_modlist_entry *ipxe;
+ uint32_t paddr = 0;
+
+ ipxe = get_module_entry(hvm_start_info, "ipxe");
+ if ( ipxe )
+ paddr = ipxe->paddr;
+ bios->bios_load(bios, NULL, 0, (void *)paddr);
}
#endif
else
}
static void ovmf_load(const struct bios_config *config,
- void *bios_addr, uint32_t bios_length)
+ void *bios_addr, uint32_t bios_length,
+ void *unused_addr)
{
xen_pfn_t mfn;
uint64_t addr = OVMF_END
memset(info, 0, sizeof(*info));
}
+static void *ipxe_module_addr;
+
static void rombios_load_roms(void)
{
int option_rom_sz = 0, vgabios_sz = 0, etherboot_sz = 0;
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);
- option_rom_phys_addr = etherboot_phys_addr + etherboot_sz;
- option_rom_sz = pci_load_option_roms(OPTIONROM_PHYSICAL_END,
- option_rom_phys_addr);
+ if ( ipxe_module_addr )
+ {
+ etherboot_sz = scan_etherboot_nic(OPTIONROM_PHYSICAL_END,
+ etherboot_phys_addr,
+ ipxe_module_addr);
+
+ option_rom_phys_addr = etherboot_phys_addr + etherboot_sz;
+ option_rom_sz = pci_load_option_roms(OPTIONROM_PHYSICAL_END,
+ option_rom_phys_addr);
+ }
printf("Option ROMs:\n");
if ( vgabios_sz )
}
static void rombios_load(const struct bios_config *config,
- void *unused_addr, uint32_t unused_size)
+ void *unused_addr, uint32_t unused_size,
+ void *ipxe_addr)
{
uint32_t bioshigh;
struct rombios_info *info;
info = (struct rombios_info *)BIOS_INFO_PHYSICAL_ADDRESS;
info->bios32_entry = bioshigh;
+
+ /* Stash ipxe address */
+ ipxe_module_addr = ipxe_addr;
}
/*
}
static void seabios_load(const struct bios_config *bios,
- void *bios_addr, uint32_t bios_length)
+ void *bios_addr, uint32_t bios_length,
+ void *unused_addr)
{
unsigned int bios_dest = 0x100000 - bios_length;
if (rc) goto out;
}
+ if (info->type == LIBXL_DOMAIN_TYPE_HVM &&
+ info->u.hvm.bios == LIBXL_BIOS_TYPE_ROMBIOS &&
+ libxl__ipxe_path()) {
+ const char *fp = libxl__ipxe_path();
+ rc = xc_dom_module_file(dom, fp, "ipxe");
+
+ if (rc) {
+ LOGE(ERROR, "failed to load IPXE %s (%d)", fp, rc);
+ rc = ERROR_FAIL;
+ goto out;
+ }
+ }
+
if (info->type == LIBXL_DOMAIN_TYPE_HVM &&
info->u.hvm.smbios_firmware) {
data = NULL;
_hidden const char *libxl__run_dir_path(void);
_hidden const char *libxl__seabios_path(void);
_hidden const char *libxl__ovmf_path(void);
+_hidden const char *libxl__ipxe_path(void);
/*----- subprocess execution with timeout -----*/
#endif
}
+const char *libxl__ipxe_path(void)
+{
+ return XENFIRMWAREDIR "/ipxe.bin";
+}
+
/*
* Local variables:
* mode: C