Switch to efi-enabled nic roms by default

All PCI nics are switched to EFI-enabled roms by default.  They are
composed from three images (legacy, efi ia32 & efi x86), so classic
pxe booting will continue to work.

Exception: eepro100 is not switched, it uses a single rom for all
emulated eepro100 variants, then goes patch the rom header on the
fly with the correct PCI IDs.  I doubt that will work as-is with
the efi roms.

Keep old roms for 1.4+older machine types via compat properties,
needed because the efi-enabled roms are larger so the pci rom bar
size would change.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
This commit is contained in:
Gerd Hoffmann 2013-02-26 17:46:11 +01:00
parent 8a24d3cb9b
commit c45e5b5b30
6 changed files with 27 additions and 7 deletions

View File

@ -1378,7 +1378,7 @@ static void e1000_class_init(ObjectClass *klass, void *data)
k->init = pci_e1000_init; k->init = pci_e1000_init;
k->exit = pci_e1000_uninit; k->exit = pci_e1000_uninit;
k->romfile = "pxe-e1000.rom"; k->romfile = "efi-e1000.rom";
k->vendor_id = PCI_VENDOR_ID_INTEL; k->vendor_id = PCI_VENDOR_ID_INTEL;
k->device_id = E1000_DEVID; k->device_id = E1000_DEVID;
k->revision = 0x03; k->revision = 0x03;

View File

@ -766,7 +766,7 @@ static void ne2000_class_init(ObjectClass *klass, void *data)
k->init = pci_ne2000_init; k->init = pci_ne2000_init;
k->exit = pci_ne2000_exit; k->exit = pci_ne2000_exit;
k->romfile = "pxe-ne2k_pci.rom", k->romfile = "efi-ne2k_pci.rom",
k->vendor_id = PCI_VENDOR_ID_REALTEK; k->vendor_id = PCI_VENDOR_ID_REALTEK;
k->device_id = PCI_DEVICE_ID_REALTEK_8029; k->device_id = PCI_DEVICE_ID_REALTEK_8029;
k->class_id = PCI_CLASS_NETWORK_ETHERNET; k->class_id = PCI_CLASS_NETWORK_ETHERNET;

24
hw/pc.h
View File

@ -212,7 +212,7 @@ int e820_add_entry(uint64_t, uint64_t, uint32_t);
.driver = "ide-drive",\ .driver = "ide-drive",\
.property = "discard_granularity",\ .property = "discard_granularity",\
.value = stringify(0),\ .value = stringify(0),\
},{\ },{\
.driver = "virtio-blk-pci",\ .driver = "virtio-blk-pci",\
.property = "discard_granularity",\ .property = "discard_granularity",\
.value = stringify(0),\ .value = stringify(0),\
@ -221,6 +221,26 @@ int e820_add_entry(uint64_t, uint64_t, uint32_t);
.property = "vectors",\ .property = "vectors",\
/* DEV_NVECTORS_UNSPECIFIED as a uint32_t string */\ /* DEV_NVECTORS_UNSPECIFIED as a uint32_t string */\
.value = stringify(0xFFFFFFFF),\ .value = stringify(0xFFFFFFFF),\
} },{\
.driver = "e1000",\
.property = "romfile",\
.value = "pxe-e1000.rom",\
},{\
.driver = "ne2k_pci",\
.property = "romfile",\
.value = "pxe-ne2k_pci.rom",\
},{\
.driver = "pcnet",\
.property = "romfile",\
.value = "pxe-pcnet.rom",\
},{\
.driver = "rtl8139",\
.property = "romfile",\
.value = "pxe-rtl8139.rom",\
},{\
.driver = "virtio-net-pci",\
.property = "romfile",\
.value = "pxe-virtio.rom",\
}
#endif #endif

View File

@ -351,7 +351,7 @@ static void pcnet_class_init(ObjectClass *klass, void *data)
k->init = pci_pcnet_init; k->init = pci_pcnet_init;
k->exit = pci_pcnet_uninit; k->exit = pci_pcnet_uninit;
k->romfile = "pxe-pcnet.rom", k->romfile = "efi-pcnet.rom",
k->vendor_id = PCI_VENDOR_ID_AMD; k->vendor_id = PCI_VENDOR_ID_AMD;
k->device_id = PCI_DEVICE_ID_AMD_LANCE; k->device_id = PCI_DEVICE_ID_AMD_LANCE;
k->revision = 0x10; k->revision = 0x10;

View File

@ -3530,7 +3530,7 @@ static void rtl8139_class_init(ObjectClass *klass, void *data)
k->init = pci_rtl8139_init; k->init = pci_rtl8139_init;
k->exit = pci_rtl8139_uninit; k->exit = pci_rtl8139_uninit;
k->romfile = "pxe-rtl8139.rom"; k->romfile = "efi-rtl8139.rom";
k->vendor_id = PCI_VENDOR_ID_REALTEK; k->vendor_id = PCI_VENDOR_ID_REALTEK;
k->device_id = PCI_DEVICE_ID_REALTEK_8139; k->device_id = PCI_DEVICE_ID_REALTEK_8139;
k->revision = RTL8139_PCI_REVID; /* >=0x20 is for 8139C+ */ k->revision = RTL8139_PCI_REVID; /* >=0x20 is for 8139C+ */

View File

@ -1140,7 +1140,7 @@ static void virtio_net_class_init(ObjectClass *klass, void *data)
k->init = virtio_net_init_pci; k->init = virtio_net_init_pci;
k->exit = virtio_net_exit_pci; k->exit = virtio_net_exit_pci;
k->romfile = "pxe-virtio.rom"; k->romfile = "efi-virtio.rom";
k->vendor_id = PCI_VENDOR_ID_REDHAT_QUMRANET; k->vendor_id = PCI_VENDOR_ID_REDHAT_QUMRANET;
k->device_id = PCI_DEVICE_ID_VIRTIO_NET; k->device_id = PCI_DEVICE_ID_VIRTIO_NET;
k->revision = VIRTIO_PCI_ABI_VERSION; k->revision = VIRTIO_PCI_ABI_VERSION;