* [Qemu-devel] [PATCH 1/5] Add Makefile rules to build nic rom binaries
2013-03-04 10:07 [Qemu-devel] [PATCH 0/5] ipxe: add efi support Gerd Hoffmann
@ 2013-03-04 10:07 ` Gerd Hoffmann
2013-03-04 10:07 ` [Qemu-devel] [PATCH 2/5] Update ipxe submodule to latest master Gerd Hoffmann
` (4 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: Gerd Hoffmann @ 2013-03-04 10:07 UTC (permalink / raw)
To: qemu-devel; +Cc: Gerd Hoffmann
"make -C roms pxerom" will build the ipxe roms and update
the binaries in pc-bios/, i.e. it basically documents how
the build process of our current nic roms works.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
roms/Makefile | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
diff --git a/roms/Makefile b/roms/Makefile
index 5e645bc..be33652 100644
--- a/roms/Makefile
+++ b/roms/Makefile
@@ -1,5 +1,19 @@
vgabios_variants := stdvga cirrus vmware qxl
+pxerom_variants := e1000 eepro100 ne2k_pci pcnet rtl8139 virtio
+
+pxe-rom-e1000 : VID := 8086
+pxe-rom-e1000 : DID := 100e
+pxe-rom-eepro100 : VID := 8086
+pxe-rom-eepro100 : DID := 1209
+pxe-rom-ne2k_pci : VID := 1050
+pxe-rom-ne2k_pci : DID := 0940
+pxe-rom-pcnet : VID := 1022
+pxe-rom-pcnet : DID := 2000
+pxe-rom-rtl8139 : VID := 10ec
+pxe-rom-rtl8139 : DID := 8139
+pxe-rom-virtio : VID := 1af4
+pxe-rom-virtio : DID := 1000
default:
@echo "nothing is build by default"
@@ -7,6 +21,7 @@ default:
@echo " bios -- update bios.bin (seabios)"
@echo " seavgabios -- update vgabios binaries (seabios)"
@echo " lgplvgabios -- update vgabios binaries (lgpl)"
+ @echo " pxerom -- update nic roms (bios only)"
bios: config.seabios
sh configure-seabios.sh $<
@@ -26,3 +41,9 @@ lgplvgabios: $(patsubst %,lgplvgabios-%,$(vgabios_variants))
lgplvgabios-%:
make -C vgabios vgabios-$*.bin
cp vgabios/VGABIOS-lgpl-latest.$*.bin ../pc-bios/vgabios-$*.bin
+
+pxerom: $(patsubst %,pxe-rom-%,$(pxerom_variants))
+
+pxe-rom-%:
+ make -C ipxe/src bin/$(VID)$(DID).rom
+ cp ipxe/src/bin/$(VID)$(DID).rom ../pc-bios/pxe-$*.rom
--
1.7.9.7
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [Qemu-devel] [PATCH 2/5] Update ipxe submodule to latest master
2013-03-04 10:07 [Qemu-devel] [PATCH 0/5] ipxe: add efi support Gerd Hoffmann
2013-03-04 10:07 ` [Qemu-devel] [PATCH 1/5] Add Makefile rules to build nic rom binaries Gerd Hoffmann
@ 2013-03-04 10:07 ` Gerd Hoffmann
2013-03-04 10:07 ` [Qemu-devel] [PATCH 3/5] Add Makefile rules to build nic rom binaries with efi support Gerd Hoffmann
` (3 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: Gerd Hoffmann @ 2013-03-04 10:07 UTC (permalink / raw)
To: qemu-devel; +Cc: Gerd Hoffmann
Needed for efi support.
ipxe is grown a bit, so *not* recompiling the (non-efi) pxe roms
because that would make some pxe roms larger than 64k, which in
turn would be a guest-visible change because the rom bar size
grows from 64k to 128k.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
roms/ipxe | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/roms/ipxe b/roms/ipxe
index 7aee315..09c5109 160000
--- a/roms/ipxe
+++ b/roms/ipxe
@@ -1 +1 @@
-Subproject commit 7aee315f61aaf1be6d2fff26339f28a1137231a5
+Subproject commit 09c5109b8585178172c7608de8d52e9d9af0b680
--
1.7.9.7
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [Qemu-devel] [PATCH 3/5] Add Makefile rules to build nic rom binaries with efi support
2013-03-04 10:07 [Qemu-devel] [PATCH 0/5] ipxe: add efi support Gerd Hoffmann
2013-03-04 10:07 ` [Qemu-devel] [PATCH 1/5] Add Makefile rules to build nic rom binaries Gerd Hoffmann
2013-03-04 10:07 ` [Qemu-devel] [PATCH 2/5] Update ipxe submodule to latest master Gerd Hoffmann
@ 2013-03-04 10:07 ` Gerd Hoffmann
2013-03-04 10:07 ` [Qemu-devel] [PATCH 4/5] Add efi rom binaries Gerd Hoffmann
` (2 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: Gerd Hoffmann @ 2013-03-04 10:07 UTC (permalink / raw)
To: qemu-devel; +Cc: Gerd Hoffmann
"make -C roms efirom" will build rom binaries with EFI support.
They are composed from three images: legacy bios, efi ia32
and efi x64. So netbooting via SeaBIOS will continue to work
like it does today, and additionally we get network support
for EFI. This target needs the EfiRom utility (shipped with
edk2) somewhere in the $PATH.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
roms/Makefile | 49 +++++++++++++++++++++++++++++++++++++------------
1 file changed, 37 insertions(+), 12 deletions(-)
diff --git a/roms/Makefile b/roms/Makefile
index be33652..3dc5609 100644
--- a/roms/Makefile
+++ b/roms/Makefile
@@ -2,18 +2,29 @@
vgabios_variants := stdvga cirrus vmware qxl
pxerom_variants := e1000 eepro100 ne2k_pci pcnet rtl8139 virtio
-pxe-rom-e1000 : VID := 8086
-pxe-rom-e1000 : DID := 100e
-pxe-rom-eepro100 : VID := 8086
-pxe-rom-eepro100 : DID := 1209
-pxe-rom-ne2k_pci : VID := 1050
-pxe-rom-ne2k_pci : DID := 0940
-pxe-rom-pcnet : VID := 1022
-pxe-rom-pcnet : DID := 2000
-pxe-rom-rtl8139 : VID := 10ec
-pxe-rom-rtl8139 : DID := 8139
-pxe-rom-virtio : VID := 1af4
-pxe-rom-virtio : DID := 1000
+pxe-rom-e1000 efi-rom-e1000 : VID := 8086
+pxe-rom-e1000 efi-rom-e1000 : DID := 100e
+pxe-rom-eepro100 efi-rom-eepro100 : VID := 8086
+pxe-rom-eepro100 efi-rom-eepro100 : DID := 1209
+pxe-rom-ne2k_pci efi-rom-ne2k_pci : VID := 1050
+pxe-rom-ne2k_pci efi-rom-ne2k_pci : DID := 0940
+pxe-rom-pcnet efi-rom-pcnet : VID := 1022
+pxe-rom-pcnet efi-rom-pcnet : DID := 2000
+pxe-rom-rtl8139 efi-rom-rtl8139 : VID := 10ec
+pxe-rom-rtl8139 efi-rom-rtl8139 : DID := 8139
+pxe-rom-virtio efi-rom-virtio : VID := 1af4
+pxe-rom-virtio efi-rom-virtio : DID := 1000
+
+#
+# EfiRom utility is shipped with edk2 / tianocore, in BaseTools/
+#
+# We need that to combine multiple images (legacy bios,
+# efi ia32, efi x64) into a single rom binary.
+#
+# We try to find it in the path. You can also pass the location on
+# the command line, i.e. "make EFIROM=/path/to/EfiRom efirom"
+#
+EFIROM ?= $(shell which EfiRom 2>/dev/null)
default:
@echo "nothing is build by default"
@@ -22,6 +33,8 @@ default:
@echo " seavgabios -- update vgabios binaries (seabios)"
@echo " lgplvgabios -- update vgabios binaries (lgpl)"
@echo " pxerom -- update nic roms (bios only)"
+ @echo " efirom -- update nic roms (bios+efi, this needs"
+ @echo " the EfiRom utility from edk2 / tianocore)"
bios: config.seabios
sh configure-seabios.sh $<
@@ -47,3 +60,15 @@ pxerom: $(patsubst %,pxe-rom-%,$(pxerom_variants))
pxe-rom-%:
make -C ipxe/src bin/$(VID)$(DID).rom
cp ipxe/src/bin/$(VID)$(DID).rom ../pc-bios/pxe-$*.rom
+
+efirom: $(patsubst %,efi-rom-%,$(pxerom_variants))
+
+efi-rom-%:
+ make -C ipxe/src bin/$(VID)$(DID).rom
+ make -C ipxe/src bin-i386-efi/$(VID)$(DID).efidrv
+ make -C ipxe/src bin-x86_64-efi/$(VID)$(DID).efidrv
+ $(EFIROM) -f "0x$(VID)" -i "0x$(DID)" -l 0x02 \
+ -b ipxe/src/bin/$(VID)$(DID).rom \
+ -ec ipxe/src/bin-i386-efi/$(VID)$(DID).efidrv \
+ -ec ipxe/src/bin-x86_64-efi/$(VID)$(DID).efidrv \
+ -o ../pc-bios/efi-$*.rom
--
1.7.9.7
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [Qemu-devel] [PATCH 4/5] Add efi rom binaries
2013-03-04 10:07 [Qemu-devel] [PATCH 0/5] ipxe: add efi support Gerd Hoffmann
` (2 preceding siblings ...)
2013-03-04 10:07 ` [Qemu-devel] [PATCH 3/5] Add Makefile rules to build nic rom binaries with efi support Gerd Hoffmann
@ 2013-03-04 10:07 ` Gerd Hoffmann
2013-03-04 10:07 ` [Qemu-devel] [PATCH 5/5] Switch to efi-enabled nic roms by default Gerd Hoffmann
2013-03-04 13:33 ` [Qemu-devel] [PATCH 0/5] ipxe: add efi support Anthony Liguori
5 siblings, 0 replies; 7+ messages in thread
From: Gerd Hoffmann @ 2013-03-04 10:07 UTC (permalink / raw)
To: qemu-devel; +Cc: Gerd Hoffmann
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
pc-bios/efi-e1000.rom | Bin 0 -> 174080 bytes
pc-bios/efi-eepro100.rom | Bin 0 -> 175104 bytes
pc-bios/efi-ne2k_pci.rom | Bin 0 -> 173568 bytes
pc-bios/efi-pcnet.rom | Bin 0 -> 173568 bytes
pc-bios/efi-rtl8139.rom | Bin 0 -> 177152 bytes
pc-bios/efi-virtio.rom | Bin 0 -> 171008 bytes
6 files changed, 0 insertions(+), 0 deletions(-)
create mode 100644 pc-bios/efi-e1000.rom
create mode 100644 pc-bios/efi-eepro100.rom
create mode 100644 pc-bios/efi-ne2k_pci.rom
create mode 100644 pc-bios/efi-pcnet.rom
create mode 100644 pc-bios/efi-rtl8139.rom
create mode 100644 pc-bios/efi-virtio.rom
diff --git a/pc-bios/efi-e1000.rom b/pc-bios/efi-e1000.rom
[ ... snipped xxl binary patch ... ]
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Qemu-devel] [PATCH 5/5] Switch to efi-enabled nic roms by default
2013-03-04 10:07 [Qemu-devel] [PATCH 0/5] ipxe: add efi support Gerd Hoffmann
` (3 preceding siblings ...)
2013-03-04 10:07 ` [Qemu-devel] [PATCH 4/5] Add efi rom binaries Gerd Hoffmann
@ 2013-03-04 10:07 ` Gerd Hoffmann
2013-03-04 13:33 ` [Qemu-devel] [PATCH 0/5] ipxe: add efi support Anthony Liguori
5 siblings, 0 replies; 7+ messages in thread
From: Gerd Hoffmann @ 2013-03-04 10:07 UTC (permalink / raw)
To: qemu-devel; +Cc: Anthony Liguori, Gerd Hoffmann
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>
---
hw/e1000.c | 2 +-
hw/ne2000.c | 2 +-
hw/pc.h | 24 ++++++++++++++++++++++--
hw/pcnet-pci.c | 2 +-
hw/rtl8139.c | 2 +-
hw/virtio-pci.c | 2 +-
6 files changed, 27 insertions(+), 7 deletions(-)
diff --git a/hw/e1000.c b/hw/e1000.c
index d6fe815..c95304f 100644
--- a/hw/e1000.c
+++ b/hw/e1000.c
@@ -1353,7 +1353,7 @@ static void e1000_class_init(ObjectClass *klass, void *data)
k->init = pci_e1000_init;
k->exit = pci_e1000_uninit;
- k->romfile = "pxe-e1000.rom";
+ k->romfile = "efi-e1000.rom";
k->vendor_id = PCI_VENDOR_ID_INTEL;
k->device_id = E1000_DEVID;
k->revision = 0x03;
diff --git a/hw/ne2000.c b/hw/ne2000.c
index 3dd1c84..ba86701 100644
--- a/hw/ne2000.c
+++ b/hw/ne2000.c
@@ -766,7 +766,7 @@ static void ne2000_class_init(ObjectClass *klass, void *data)
k->init = pci_ne2000_init;
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->device_id = PCI_DEVICE_ID_REALTEK_8029;
k->class_id = PCI_CLASS_NETWORK_ETHERNET;
diff --git a/hw/pc.h b/hw/pc.h
index da1b102..30b0cf5 100644
--- a/hw/pc.h
+++ b/hw/pc.h
@@ -212,10 +212,30 @@ int e820_add_entry(uint64_t, uint64_t, uint32_t);
.driver = "ide-drive",\
.property = "discard_granularity",\
.value = stringify(0),\
- },{\
+ },{\
.driver = "virtio-blk-pci",\
.property = "discard_granularity",\
.value = stringify(0),\
- }
+ },{\
+ .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
diff --git a/hw/pcnet-pci.c b/hw/pcnet-pci.c
index df63b22..e89e5fa 100644
--- a/hw/pcnet-pci.c
+++ b/hw/pcnet-pci.c
@@ -351,7 +351,7 @@ static void pcnet_class_init(ObjectClass *klass, void *data)
k->init = pci_pcnet_init;
k->exit = pci_pcnet_uninit;
- k->romfile = "pxe-pcnet.rom",
+ k->romfile = "efi-pcnet.rom",
k->vendor_id = PCI_VENDOR_ID_AMD;
k->device_id = PCI_DEVICE_ID_AMD_LANCE;
k->revision = 0x10;
diff --git a/hw/rtl8139.c b/hw/rtl8139.c
index d7716be..fc2c7f1 100644
--- a/hw/rtl8139.c
+++ b/hw/rtl8139.c
@@ -3530,7 +3530,7 @@ static void rtl8139_class_init(ObjectClass *klass, void *data)
k->init = pci_rtl8139_init;
k->exit = pci_rtl8139_uninit;
- k->romfile = "pxe-rtl8139.rom";
+ k->romfile = "efi-rtl8139.rom";
k->vendor_id = PCI_VENDOR_ID_REALTEK;
k->device_id = PCI_DEVICE_ID_REALTEK_8139;
k->revision = RTL8139_PCI_REVID; /* >=0x20 is for 8139C+ */
diff --git a/hw/virtio-pci.c b/hw/virtio-pci.c
index a869f53..e24b20f 100644
--- a/hw/virtio-pci.c
+++ b/hw/virtio-pci.c
@@ -1137,7 +1137,7 @@ static void virtio_net_class_init(ObjectClass *klass, void *data)
k->init = virtio_net_init_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->device_id = PCI_DEVICE_ID_VIRTIO_NET;
k->revision = VIRTIO_PCI_ABI_VERSION;
--
1.7.9.7
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [Qemu-devel] [PATCH 0/5] ipxe: add efi support
2013-03-04 10:07 [Qemu-devel] [PATCH 0/5] ipxe: add efi support Gerd Hoffmann
` (4 preceding siblings ...)
2013-03-04 10:07 ` [Qemu-devel] [PATCH 5/5] Switch to efi-enabled nic roms by default Gerd Hoffmann
@ 2013-03-04 13:33 ` Anthony Liguori
5 siblings, 0 replies; 7+ messages in thread
From: Anthony Liguori @ 2013-03-04 13:33 UTC (permalink / raw)
To: Gerd Hoffmann, qemu-devel
Gerd Hoffmann <kraxel@redhat.com> writes:
> Hi,
>
> This patch series adds efi support to our nic roms.
> Patch #4 (carrying the binaries) is pretty big and
> isn't sent to the list. If you wanna test without
> compiling your own roms please pull the git tree
> below.
Looks pretty reasonable.
Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
Regards,
Anthony Liguori
> cheers,
> Gerd
>
> The following changes since commit 806f352d3d6f7b326b0ab3a49c622b124459dc8d:
>
> gen-icount.h: Rename gen_icount_start/end to gen_tb_start/end (2013-03-03 14:29:08 +0000)
>
> are available in the git repository at:
>
> git://git.kraxel.org/qemu ipxe.1
>
> for you to fetch changes up to 3741d5a42cf9658d6ba7e0bb06db67f6f4a485e4:
>
> Switch to efi-enabled nic roms by default (2013-03-04 10:21:19 +0100)
>
> ----------------------------------------------------------------
> Gerd Hoffmann (5):
> Add Makefile rules to build nic rom binaries
> Update ipxe submodule to latest master
> Add Makefile rules to build nic rom binaries with efi support
> Add efi rom binaries
> Switch to efi-enabled nic roms by default
>
> hw/e1000.c | 2 +-
> hw/ne2000.c | 2 +-
> hw/pc.h | 24 ++++++++++++++++++++++--
> hw/pcnet-pci.c | 2 +-
> hw/rtl8139.c | 2 +-
> hw/virtio-pci.c | 2 +-
> pc-bios/efi-e1000.rom | Bin 0 -> 174080 bytes
> pc-bios/efi-eepro100.rom | Bin 0 -> 175104 bytes
> pc-bios/efi-ne2k_pci.rom | Bin 0 -> 173568 bytes
> pc-bios/efi-pcnet.rom | Bin 0 -> 173568 bytes
> pc-bios/efi-rtl8139.rom | Bin 0 -> 177152 bytes
> pc-bios/efi-virtio.rom | Bin 0 -> 171008 bytes
> roms/Makefile | 46 ++++++++++++++++++++++++++++++++++++++++++++++
> roms/ipxe | 2 +-
> 14 files changed, 74 insertions(+), 8 deletions(-)
> create mode 100644 pc-bios/efi-e1000.rom
> create mode 100644 pc-bios/efi-eepro100.rom
> create mode 100644 pc-bios/efi-ne2k_pci.rom
> create mode 100644 pc-bios/efi-pcnet.rom
> create mode 100644 pc-bios/efi-rtl8139.rom
> create mode 100644 pc-bios/efi-virtio.rom
^ permalink raw reply [flat|nested] 7+ messages in thread