# HG changeset patch
# User Ian Campbell <ian.campbell@xxxxxxxxxx>
# Date 1306916275 -3600
# Node ID 253a38db096bdc72b4e266ed103643210a739d93
# Parent cdc873250db270f1d7593eb7381cc308aa5c517f
hvmloader: allow per-BIOS decision on loading option ROMS
SeaBIOS has functionality to load ROMs from the PCI device directly,
it makes sense to use this when it is available.
Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
diff -r cdc873250db2 -r 253a38db096b tools/firmware/hvmloader/config-seabios.h
--- a/tools/firmware/hvmloader/config-seabios.h Tue May 31 17:31:28 2011 +0100
+++ b/tools/firmware/hvmloader/config-seabios.h Wed Jun 01 09:17:55 2011 +0100
@@ -1,9 +1,6 @@
#ifndef __HVMLOADER_CONFIG_SEABIOS_H__
#define __HVMLOADER_CONFIG_SEABIOS_H__
-#define OPTIONROM_PHYSICAL_ADDRESS 0x000C8000
-#define OPTIONROM_PHYSICAL_END 0x000E0000
-
#define SEABIOS_PHYSICAL_ADDRESS 0x000E0000
#endif /* __HVMLOADER_CONFIG_SEABIOS_H__ */
diff -r cdc873250db2 -r 253a38db096b tools/firmware/hvmloader/config.h
--- a/tools/firmware/hvmloader/config.h Tue May 31 17:31:28 2011 +0100
+++ b/tools/firmware/hvmloader/config.h Wed Jun 01 09:17:55 2011 +0100
@@ -19,7 +19,8 @@ struct bios_config {
/* SMBIOS */
unsigned int smbios_start, smbios_end;
- /* Option ROMs */
+ /* ROMS */
+ int load_roms;
unsigned int optionrom_start, optionrom_end;
/* ACPI tables */
diff -r cdc873250db2 -r 253a38db096b tools/firmware/hvmloader/hvmloader.c
--- a/tools/firmware/hvmloader/hvmloader.c Tue May 31 17:31:28 2011 +0100
+++ b/tools/firmware/hvmloader/hvmloader.c Wed Jun 01 09:17:55 2011 +0100
@@ -373,7 +373,7 @@ int main(void)
uint32_t highbios = 0;
const struct bios_config *bios;
int option_rom_sz = 0, vgabios_sz = 0, etherboot_sz = 0, smbios_sz = 0;
- uint32_t etherboot_phys_addr, option_rom_phys_addr;
+ uint32_t etherboot_phys_addr = 0, option_rom_phys_addr = 0;
/* Initialise hypercall stubs with RET, rendering them no-ops. */
memset((void *)HYPERCALL_PHYSICAL_ADDRESS, 0xc3 /* RET */, PAGE_SIZE);
@@ -417,40 +417,43 @@ int main(void)
( (hvm_info->nr_vcpus > 1) || hvm_info->apic_mode ) )
bios->create_mp_tables();
- switch ( virtual_vga )
+ if ( bios->load_roms )
{
- case VGA_cirrus:
- printf("Loading Cirrus VGABIOS ...\n");
- memcpy((void *)VGABIOS_PHYSICAL_ADDRESS,
- vgabios_cirrusvga, sizeof(vgabios_cirrusvga));
- vgabios_sz = round_option_rom(sizeof(vgabios_cirrusvga));
- break;
- case VGA_std:
- printf("Loading Standard VGABIOS ...\n");
- memcpy((void *)VGABIOS_PHYSICAL_ADDRESS,
- vgabios_stdvga, sizeof(vgabios_stdvga));
- vgabios_sz = round_option_rom(sizeof(vgabios_stdvga));
- break;
- case VGA_pt:
- printf("Loading VGABIOS of passthroughed gfx ...\n");
- vgabios_sz =
- round_option_rom((*(uint8_t *)(VGABIOS_PHYSICAL_ADDRESS+2)) * 512);
- break;
- default:
- printf("No emulated VGA adaptor ...\n");
- break;
+ switch ( virtual_vga )
+ {
+ case VGA_cirrus:
+ printf("Loading Cirrus VGABIOS ...\n");
+ memcpy((void *)VGABIOS_PHYSICAL_ADDRESS,
+ vgabios_cirrusvga, sizeof(vgabios_cirrusvga));
+ vgabios_sz = round_option_rom(sizeof(vgabios_cirrusvga));
+ break;
+ case VGA_std:
+ printf("Loading Standard VGABIOS ...\n");
+ memcpy((void *)VGABIOS_PHYSICAL_ADDRESS,
+ vgabios_stdvga, sizeof(vgabios_stdvga));
+ vgabios_sz = round_option_rom(sizeof(vgabios_stdvga));
+ break;
+ case VGA_pt:
+ printf("Loading VGABIOS of passthroughed gfx ...\n");
+ vgabios_sz =
+ round_option_rom((*(uint8_t *)(VGABIOS_PHYSICAL_ADDRESS+2)) *
512);
+ break;
+ default:
+ printf("No emulated VGA adaptor ...\n");
+ break;
+ }
+
+ etherboot_phys_addr = VGABIOS_PHYSICAL_ADDRESS + vgabios_sz;
+ if ( etherboot_phys_addr < bios->optionrom_start )
+ etherboot_phys_addr = bios->optionrom_start;
+ etherboot_sz = scan_etherboot_nic(bios->optionrom_end,
+ etherboot_phys_addr);
+
+ option_rom_phys_addr = etherboot_phys_addr + etherboot_sz;
+ option_rom_sz = pci_load_option_roms(bios->optionrom_end,
+ option_rom_phys_addr);
}
- etherboot_phys_addr = VGABIOS_PHYSICAL_ADDRESS + vgabios_sz;
- if ( etherboot_phys_addr < bios->optionrom_start )
- etherboot_phys_addr = bios->optionrom_start;
- etherboot_sz = scan_etherboot_nic(bios->optionrom_end,
- etherboot_phys_addr);
-
- option_rom_phys_addr = etherboot_phys_addr + etherboot_sz;
- option_rom_sz = pci_load_option_roms(bios->optionrom_end,
- option_rom_phys_addr);
-
if ( hvm_info->acpi_enabled )
{
struct xen_hvm_param p = {
diff -r cdc873250db2 -r 253a38db096b tools/firmware/hvmloader/rombios.c
--- a/tools/firmware/hvmloader/rombios.c Tue May 31 17:31:28 2011 +0100
+++ b/tools/firmware/hvmloader/rombios.c Wed Jun 01 09:17:55 2011 +0100
@@ -372,6 +372,8 @@ struct bios_config rombios_config = {
.smbios_start = SMBIOS_PHYSICAL_ADDRESS,
.smbios_end = SMBIOS_PHYSICAL_END,
+ .load_roms = 1,
+
.optionrom_start = OPTIONROM_PHYSICAL_ADDRESS,
.optionrom_end = OPTIONROM_PHYSICAL_END,
diff -r cdc873250db2 -r 253a38db096b tools/firmware/hvmloader/seabios.c
--- a/tools/firmware/hvmloader/seabios.c Tue May 31 17:31:28 2011 +0100
+++ b/tools/firmware/hvmloader/seabios.c Wed Jun 01 09:17:55 2011 +0100
@@ -46,8 +46,10 @@ struct bios_config seabios_config = {
.smbios_start = 0,
.smbios_end = 0,
- .optionrom_start = OPTIONROM_PHYSICAL_ADDRESS,
- .optionrom_end = OPTIONROM_PHYSICAL_END,
+ .load_roms = 0,
+
+ .optionrom_start = 0,
+ .optionrom_end = 0,
.acpi_start = 0,
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
|