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

[Xen-changelog] [xen-unstable] hvmloader: allow per-BIOS decision on loading option ROMS



# HG changeset patch
# User Ian Campbell <ian.campbell@xxxxxxxxxx>
# Date 1306942795 -3600
# Node ID cc73b30326556165b864708a3ceeee8ef018d98f
# Parent  98c39a052e7ccabb68a355d072d401082fc718eb
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 98c39a052e7c -r cc73b3032655 tools/firmware/hvmloader/config-seabios.h
--- a/tools/firmware/hvmloader/config-seabios.h Wed Jun 01 16:12:29 2011 +0100
+++ b/tools/firmware/hvmloader/config-seabios.h Wed Jun 01 16:39: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 98c39a052e7c -r cc73b3032655 tools/firmware/hvmloader/config.h
--- a/tools/firmware/hvmloader/config.h Wed Jun 01 16:12:29 2011 +0100
+++ b/tools/firmware/hvmloader/config.h Wed Jun 01 16:39:55 2011 +0100
@@ -19,7 +19,8 @@
     /* SMBIOS */
     unsigned int smbios_start, smbios_end;
 
-    /* Option ROMs */
+    /* ROMS */
+    int load_roms;
     unsigned int optionrom_start, optionrom_end;
 
     /* ACPI tables */
diff -r 98c39a052e7c -r cc73b3032655 tools/firmware/hvmloader/hvmloader.c
--- a/tools/firmware/hvmloader/hvmloader.c      Wed Jun 01 16:12:29 2011 +0100
+++ b/tools/firmware/hvmloader/hvmloader.c      Wed Jun 01 16:39:55 2011 +0100
@@ -373,7 +373,7 @@
     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 @@
          ( (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 98c39a052e7c -r cc73b3032655 tools/firmware/hvmloader/rombios.c
--- a/tools/firmware/hvmloader/rombios.c        Wed Jun 01 16:12:29 2011 +0100
+++ b/tools/firmware/hvmloader/rombios.c        Wed Jun 01 16:39:55 2011 +0100
@@ -372,6 +372,8 @@
     .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 98c39a052e7c -r cc73b3032655 tools/firmware/hvmloader/seabios.c
--- a/tools/firmware/hvmloader/seabios.c        Wed Jun 01 16:12:29 2011 +0100
+++ b/tools/firmware/hvmloader/seabios.c        Wed Jun 01 16:39:55 2011 +0100
@@ -46,8 +46,10 @@
     .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-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

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