Parcourir la source

[prefix] Ignore PCI autoboot device location if set to 00:00.0

qemu can load an option ROM which is not associated with a particular
PCI device using the "-option-rom" syntax.  Under these circumstances,
we should ignore the PCI bus:dev.fn address that we expect to find in
%ax on entry to the initialisation vector.

Fix by using the PCI bus:dev.fn address only if it is non-zero.  Since
00:00.0 will always be the host bridge, it can never be the address of
a network card.

Reported-by: Alex Williamson <alex.williamson@redhat.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Michael Brown il y a 10 ans
Parent
révision
ff1e7fc72b
1 fichiers modifiés avec 4 ajouts et 2 suppressions
  1. 4
    2
      src/arch/i386/core/pci_autoboot.c

+ 4
- 2
src/arch/i386/core/pci_autoboot.c Voir le fichier

@@ -34,8 +34,10 @@ uint16_t __bss16 ( autoboot_busdevfn );
34 34
  */
35 35
 static void pci_autoboot_init ( void ) {
36 36
 
37
-	autoboot_device.bus_type = BUS_TYPE_PCI;
38
-	autoboot_device.location = autoboot_busdevfn;
37
+	if ( autoboot_busdevfn ) {
38
+		autoboot_device.bus_type = BUS_TYPE_PCI;
39
+		autoboot_device.location = autoboot_busdevfn;
40
+	}
39 41
 }
40 42
 
41 43
 /** PCI autoboot device initialisation function */

Chargement…
Annuler
Enregistrer