Skip to contentSkip to conversation

seabios update

PATCH In review Gerd Hoffmann 3 participants 12 messages Dec 2, 2013

lore
Share & tools
lore
#0 lore raw

cover seabios update

Hi,

SeaBIOS update patch series. A bit more complicated than just "update submodule and binaries" this time as seabios doesn't fit into 256k any more. So we have to go & build seabios twice, one stripped down version for old machine types and one full-featured for 2.0. Also qemu needs some changes so we can use different firmeare binaries per machine type.

This patch series also switches vgabios from lgplvgabios to seavgabios.

Git tree with updated binary blobs for easy testing available at:
git://git.kraxel.org/qemu seabios-6233543

Please review and test.

seabios plans for the 1.7.4 release are freeze on 6th, release on 20th of december. I want get a snapshot into qemu once we are in freeze so the new bits get some qemu testing during the freeze period. Once we have a final release update to that of course.

cheers,
Gerd

Gerd Hoffmann (8):
add pc-{i440fx,q35}-2.0 machine types
add firmware to machine options
roms: update seabios submodule to latest master
roms: build two seabios binaries
roms: enable seabios cross builds
roms: update seabios binaries
roms: update vgabios binaries
pc: switch 2.0 machine types to large seabios binary

 hw/i386/pc_piix.c          |  16 ++++++++++++++--
 hw/i386/pc_q35.c           |  13 ++++++++++++-
 pc-bios/acpi-dsdt.aml      | Bin 4407 -> 4407 bytes
 pc-bios/bios-256k.bin      | Bin 0 -> 262144 bytes
 pc-bios/bios.bin           | Bin 131072 -> 131072 bytes
 pc-bios/q35-acpi-dsdt.aml  | Bin 7344 -> 7344 bytes
 pc-bios/vgabios-cirrus.bin | Bin 35840 -> 36352 bytes
 pc-bios/vgabios-qxl.bin    | Bin 40448 -> 36352 bytes
 pc-bios/vgabios-stdvga.bin | Bin 40448 -> 36352 bytes
 pc-bios/vgabios-vmware.bin | Bin 40448 -> 36352 bytes
 pc-bios/vgabios.bin        | Bin 40448 -> 36352 bytes
 roms/Makefile              |   9 ++++++---
 roms/config.seabios        |   1 -
 roms/config.seabios-128k   |   6 ++++++
 roms/config.seabios-256k   |   3 +++
 roms/seabios               |   2 +-
 vl.c                       |   7 ++++++-
 17 files changed, 48 insertions(+), 9 deletions(-)
 create mode 100644 pc-bios/bios-256k.bin
 delete mode 100644 roms/config.seabios
 create mode 100644 roms/config.seabios-128k
 create mode 100644 roms/config.seabios-256k
Signature · 1 line
1.8.3.1
#1 lore raw

PATCH 1/8 add pc-{i440fx,q35}-2.0 machine types

---
 hw/i386/pc_piix.c | 14 ++++++++++++--
 hw/i386/pc_q35.c  | 11 ++++++++++-
 2 files changed, 22 insertions(+), 3 deletions(-)
hw/i386/pc_piix.c +12 -2
index 2111f01..9329f04 100644
@@ -339,13 +339,22 @@ static void pc_xen_hvm_init(QEMUMachineInitArgs *args)
     .desc = "Standard PC (i440FX + PIIX, 1996)", \
     .hot_add_cpu = pc_hot_add_cpu
 
+#define PC_I440FX_2_0_MACHINE_OPTIONS PC_I440FX_MACHINE_OPTIONS
+
+static QEMUMachine pc_i440fx_machine_v2_0 = {
+    PC_I440FX_2_0_MACHINE_OPTIONS,
+    .name = "pc-i440fx-2.0",
+    .alias = "pc",
+    .init = pc_init_pci,
+    .is_default = 1,
+};
+
 #define PC_I440FX_1_7_MACHINE_OPTIONS PC_I440FX_MACHINE_OPTIONS
+
 static QEMUMachine pc_i440fx_machine_v1_7 = {
     PC_I440FX_1_7_MACHINE_OPTIONS,
     .name = "pc-i440fx-1.7",
-    .alias = "pc",
     .init = pc_init_pci,
-    .is_default = 1,
 };
 
 #define PC_I440FX_1_6_MACHINE_OPTIONS PC_I440FX_MACHINE_OPTIONS
@@ -747,6 +756,7 @@ static QEMUMachine xenfv_machine = {
 
 static void pc_machine_init(void)
 {
+    qemu_register_machine(&pc_i440fx_machine_v2_0);
     qemu_register_machine(&pc_i440fx_machine_v1_7);
     qemu_register_machine(&pc_i440fx_machine_v1_6);
     qemu_register_machine(&pc_i440fx_machine_v1_5);
hw/i386/pc_q35.c +10 -1
index 600fc02..ac69e5d 100644
@@ -259,12 +259,20 @@ static void pc_q35_init_1_4(QEMUMachineInitArgs *args)
     .desc = "Standard PC (Q35 + ICH9, 2009)", \
     .hot_add_cpu = pc_hot_add_cpu
 
+#define PC_Q35_2_0_MACHINE_OPTIONS PC_Q35_MACHINE_OPTIONS
+
+static QEMUMachine pc_q35_machine_v2_0 = {
+    PC_Q35_2_0_MACHINE_OPTIONS,
+    .name = "pc-q35-2.0",
+    .alias = "q35",
+    .init = pc_q35_init,
+};
+
 #define PC_Q35_1_7_MACHINE_OPTIONS PC_Q35_MACHINE_OPTIONS
 
 static QEMUMachine pc_q35_machine_v1_7 = {
     PC_Q35_1_7_MACHINE_OPTIONS,
     .name = "pc-q35-1.7",
-    .alias = "q35",
     .init = pc_q35_init,
 };
 
@@ -306,6 +314,7 @@ static QEMUMachine pc_q35_machine_v1_4 = {
 
 static void pc_q35_machine_init(void)
 {
+    qemu_register_machine(&pc_q35_machine_v2_0);
     qemu_register_machine(&pc_q35_machine_v1_7);
     qemu_register_machine(&pc_q35_machine_v1_6);
     qemu_register_machine(&pc_q35_machine_v1_5);
Signature · 1 line
1.8.3.1
#2 lore raw

Re: [Qemu-devel] [PATCH 1/8] add pc-{i440fx,q35}-2.0 machine types

On Mon, 2 Dec 2013 13:24:36 +0100
Gerd Hoffmann <[email protected]> wrote:
why 2.0, are we jumping from 1.7 strait to 2.0?

Quoted 77 lines
---
 hw/i386/pc_piix.c | 14 ++++++++++++--
 hw/i386/pc_q35.c  | 11 ++++++++++-
 2 files changed, 22 insertions(+), 3 deletions(-)
hw/i386/pc_piix.c +12 -2
index 2111f01..9329f04 100644
@@ -339,13 +339,22 @@ static void pc_xen_hvm_init(QEMUMachineInitArgs *args)
     .desc = "Standard PC (i440FX + PIIX, 1996)", \
     .hot_add_cpu = pc_hot_add_cpu
 
+#define PC_I440FX_2_0_MACHINE_OPTIONS PC_I440FX_MACHINE_OPTIONS
+
+static QEMUMachine pc_i440fx_machine_v2_0 = {
+    PC_I440FX_2_0_MACHINE_OPTIONS,
+    .name = "pc-i440fx-2.0",
+    .alias = "pc",
+    .init = pc_init_pci,
+    .is_default = 1,
+};
+
 #define PC_I440FX_1_7_MACHINE_OPTIONS PC_I440FX_MACHINE_OPTIONS
+
 static QEMUMachine pc_i440fx_machine_v1_7 = {
     PC_I440FX_1_7_MACHINE_OPTIONS,
     .name = "pc-i440fx-1.7",
-    .alias = "pc",
     .init = pc_init_pci,
-    .is_default = 1,
 };
 
 #define PC_I440FX_1_6_MACHINE_OPTIONS PC_I440FX_MACHINE_OPTIONS
@@ -747,6 +756,7 @@ static QEMUMachine xenfv_machine = {
 
 static void pc_machine_init(void)
 {
+    qemu_register_machine(&pc_i440fx_machine_v2_0);
     qemu_register_machine(&pc_i440fx_machine_v1_7);
     qemu_register_machine(&pc_i440fx_machine_v1_6);
     qemu_register_machine(&pc_i440fx_machine_v1_5);
hw/i386/pc_q35.c +10 -1
index 600fc02..ac69e5d 100644
@@ -259,12 +259,20 @@ static void pc_q35_init_1_4(QEMUMachineInitArgs *args)
     .desc = "Standard PC (Q35 + ICH9, 2009)", \
     .hot_add_cpu = pc_hot_add_cpu
 
+#define PC_Q35_2_0_MACHINE_OPTIONS PC_Q35_MACHINE_OPTIONS
+
+static QEMUMachine pc_q35_machine_v2_0 = {
+    PC_Q35_2_0_MACHINE_OPTIONS,
+    .name = "pc-q35-2.0",
+    .alias = "q35",
+    .init = pc_q35_init,
+};
+
 #define PC_Q35_1_7_MACHINE_OPTIONS PC_Q35_MACHINE_OPTIONS
 
 static QEMUMachine pc_q35_machine_v1_7 = {
     PC_Q35_1_7_MACHINE_OPTIONS,
     .name = "pc-q35-1.7",
-    .alias = "q35",
     .init = pc_q35_init,
 };
 
@@ -306,6 +314,7 @@ static QEMUMachine pc_q35_machine_v1_4 = {
 
 static void pc_q35_machine_init(void)
 {
+    qemu_register_machine(&pc_q35_machine_v2_0);
     qemu_register_machine(&pc_q35_machine_v1_7);
     qemu_register_machine(&pc_q35_machine_v1_6);
     qemu_register_machine(&pc_q35_machine_v1_5);
#3 lore raw

Re: [Qemu-devel] [PATCH 1/8] add pc-{i440fx,q35}-2.0 machine types

Quoted 3 lines · Igor Mammedov

On Mon, 2 Dec 2013 13:24:36 +0100
Gerd Hoffmann <[email protected]> wrote:
why 2.0, are we jumping from 1.7 strait to 2.0?

Looks like this is the plan ...

nilsson kraxel ~/projects/qemu# git show master
commit 7dc65c02fe3fb8f3146ce0b9ff5fec5945329f0e

Author: Anthony Liguori <[email protected]>
Date:   Wed Nov 27 14:02:45 2013 -0800

Open 2.0 development tree

cheers,
Gerd

#4 lore raw

Re: [Qemu-devel] [PATCH 1/8] add pc-{i440fx,q35}-2.0 machine types

Am 02.12.2013 15:44, schrieb Gerd Hoffmann:

Quoted 5 lines · Igor Mammedov
Quoted 1 line

why 2.0, are we jumping from 1.7 strait to 2.0?

Looks like this is the plan ...

Quoted 8 lines

nilsson kraxel ~/projects/qemu# git show master
commit 7dc65c02fe3fb8f3146ce0b9ff5fec5945329f0e

Author: Anthony Liguori <[email protected]>
Date:   Wed Nov 27 14:02:45 2013 -0800

Open 2.0 development tree

Yes, Anthony announced at QEMU Summit to do regular major version updates, and in theory that should be in the minutes posted to the list after KVM Forum...

Regards,
Andreas

Signature · 2 lines
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg
#5 lore raw

PATCH 2/8 add firmware to machine options

In reply to Gerd Hoffmann

This patch adds firmware to the machine options. -bios <file> becomes a shortcut for -machine firmware=<file>. Advantage is that the firmware can be specified via config file as -machine is parsed using QemuOpts and it is also possible to use different defaults for different machine types (via QEMUMachine->default_machine_opts).

---
 vl.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
vl.c +6 -1
index 8d5d874..27b09e5 100644
@@ -428,6 +428,10 @@ static QemuOptsList qemu_machine_opts = {
             .name = "usb",
             .type = QEMU_OPT_BOOL,
             .help = "Set on/off to enable/disable usb",
+        },{
+            .name = "firmware",
+            .type = QEMU_OPT_STRING,
+            .help = "firmware image",
         },
         { /* End of list */ }
     },
@@ -3229,7 +3233,7 @@ int main(int argc, char **argv, char **envp)
                 }
                 break;
             case QEMU_OPTION_bios:
-                bios_name = optarg;
+                qemu_opts_set(qemu_find_opts("machine"), 0, "firmware", optarg);
                 break;
             case QEMU_OPTION_singlestep:
                 singlestep = 1;
@@ -4050,6 +4054,7 @@ int main(int argc, char **argv, char **envp)
     kernel_filename = qemu_opt_get(machine_opts, "kernel");
     initrd_filename = qemu_opt_get(machine_opts, "initrd");
     kernel_cmdline = qemu_opt_get(machine_opts, "append");
+    bios_name = qemu_opt_get(machine_opts, "firmware");
 
     boot_order = machine->default_boot_order;
     opts = qemu_opts_find(qemu_find_opts("boot-opts"), NULL);
Signature · 1 line
1.8.3.1
#6 lore raw

PATCH 3/8 roms: update seabios submodule to latest master

In reply to Gerd Hoffmann
---
 roms/seabios | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
roms/seabios +1 -1
index ece025f..6233543 160000
@@ -1 +1 @@
-Subproject commit ece025f5980bae88fa677bc9c0d24d2e580e205d
+Subproject commit 62335436b649aea80242b6961f23c59b8f989f73
Signature · 1 line
1.8.3.1
#7 lore raw

PATCH 4/8 roms: build two seabios binaries

In reply to Gerd Hoffmann

Adding xhci support to seabios made it jump over the 128k line. Changing the bios size breaks migration, so we have to keep a 128k seabios binary for old machine types. New machine types can use a large 256k bios which should be big enougth for a while.

This patch updates the seabios build process to build seabios twice, once full featured and once with xen and xhci turned off so the resulting binary is small enougth to fit into 128k.

---
 roms/Makefile            | 7 ++++---
 roms/config.seabios      | 1 -
 roms/config.seabios-128k | 6 ++++++
 roms/config.seabios-256k | 3 +++
 4 files changed, 13 insertions(+), 4 deletions(-)
 delete mode 100644 roms/config.seabios
 create mode 100644 roms/config.seabios-128k
 create mode 100644 roms/config.seabios-256k
roms/Makefile +4 -3
index 10d5a65..fc716c1 100644
@@ -56,9 +56,10 @@ default:
 	@echo "                    the EfiRom utility from edk2 / tianocore)"
 	@echo "  slof           -- update slof.bin"
 
-bios: build-seabios-config-seabios
-	cp seabios/builds/seabios/bios.bin ../pc-bios/bios.bin
-	cp seabios/builds/seabios/*dsdt.aml ../pc-bios/
+bios: build-seabios-config-seabios-128k build-seabios-config-seabios-256k
+	cp seabios/builds/seabios-128k/bios.bin ../pc-bios/bios.bin
+	cp seabios/builds/seabios-256k/bios.bin ../pc-bios/bios-256k.bin
+	cp seabios/builds/seabios-256k/src/fw/*dsdt.aml ../pc-bios/
 
 seavgabios: $(patsubst %,seavgabios-%,$(vgabios_variants))
 
roms/config.seabios deleted +0 -1
deleted file mode 100644
index c373b87..0000000
@@ -1 +0,0 @@
-# empty, default config works for us
roms/config.seabios-128k new file +6 -0
new file mode 100644
index 0000000..41f8381
@@ -0,0 +1,6 @@
+# for qemu machine types 1.7 + older
+# need to turn off features (xhci) to make it fit into 128k
+CONFIG_QEMU=y
+CONFIG_ROM_SIZE=128
+CONFIG_XEN=n
+CONFIG_USB_XHCI=n
roms/config.seabios-256k new file +3 -0
new file mode 100644
index 0000000..65e5015
@@ -0,0 +1,3 @@
+# for qemu machine types 2.0 + newer
+CONFIG_QEMU=y
+CONFIG_ROM_SIZE=256
Signature · 1 line
1.8.3.1
#8 lore raw

PATCH 5/8 roms: enable seabios cross builds

In reply to Gerd Hoffmann
---
 roms/Makefile | 2 ++
 1 file changed, 2 insertions(+)
roms/Makefile +2 -0
index fc716c1..1e04669 100644
@@ -73,9 +73,11 @@ build-seabios-config-%: config.%
 	mkdir -p seabios/builds/$*
 	cp $< seabios/builds/$*/.config
 	$(MAKE) $(MAKEFLAGS) -C seabios \
+		CROSS_COMPILE=$(x86_64_cross_prefix) \
 		KCONFIG_CONFIG=$(CURDIR)/seabios/builds/$*/.config \
 		OUT=$(CURDIR)/seabios/builds/$*/ oldnoconfig
 	$(MAKE) $(MAKEFLAGS) -C seabios \
+		CROSS_COMPILE=$(x86_64_cross_prefix) \
 		KCONFIG_CONFIG=$(CURDIR)/seabios/builds/$*/.config \
 		OUT=$(CURDIR)/seabios/builds/$*/ all
 
Signature · 1 line
1.8.3.1
#9 lore raw

PATCH 6/8 roms: update seabios binaries

In reply to Gerd Hoffmann
---
 pc-bios/acpi-dsdt.aml     | Bin 4407 -> 4407 bytes
 pc-bios/bios-256k.bin     | Bin 0 -> 262144 bytes
 pc-bios/bios.bin          | Bin 131072 -> 131072 bytes
 pc-bios/q35-acpi-dsdt.aml | Bin 7344 -> 7344 bytes
 4 files changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 pc-bios/bios-256k.bin
pc-bios/acpi-dsdt.aml binary +0 -0
index 528372b41e0c500170e64e9b718e50f2d9e55212..cfd16d756ec79115174be176753f361585e3e051 100644
GIT binary patch
pc-bios/bios-256k.bin new file binary +0 -0
new file mode 100644
index 0000000000000000000000000000000000000000..810181118969879abc7d244b127558cb73a72d7c
GIT binary patch
pc-bios/bios.bin binary +0 -0
index 697440c26c144ca6c4aa90d2f8a5014298137cfe..08006aae8dec9d8224dd650eecbbf0d4d77e4e2f 100644
GIT binary patch
pc-bios/q35-acpi-dsdt.aml binary +0 -0
index 4d23746ebf2f5d4da3bc7e3f139a17f0d887a6e6..d71b3a328ced5ce2cb16d153cfa7cda0aca966a4 100644
GIT binary patch
Signature · 1 line
1.8.3.1
#10 lore raw

PATCH 7/8 roms: update vgabios binaries

In reply to Gerd Hoffmann

This also switches from lgplvgabios to seavgabios.

---
 pc-bios/vgabios-cirrus.bin | Bin 35840 -> 36352 bytes
 pc-bios/vgabios-qxl.bin    | Bin 40448 -> 36352 bytes
 pc-bios/vgabios-stdvga.bin | Bin 40448 -> 36352 bytes
 pc-bios/vgabios-vmware.bin | Bin 40448 -> 36352 bytes
 pc-bios/vgabios.bin        | Bin 40448 -> 36352 bytes
 5 files changed, 0 insertions(+), 0 deletions(-)
pc-bios/vgabios-cirrus.bin binary +0 -0
index 424dd0c70c4a52e1a98d8a64ebf4aa382b85d5cf..df85d4a694852675523555a5ee28ba04709267b1 100644
GIT binary patch
pc-bios/vgabios-qxl.bin binary +0 -0
index 3156c6e3f1a18f011014cd983bf57fe7c5a03e96..8b2416618cdc873e18dd4a05a4d11f95f54f866e 100644
GIT binary patch
pc-bios/vgabios-stdvga.bin binary +0 -0
index 5123c5fd070c14c1d11b432e5c522ec2d1026253..8d08e9948e576e35c491ae356fd40e896106a34d 100644
GIT binary patch
pc-bios/vgabios-vmware.bin binary +0 -0
index 5e8c06b2286de62f27aa72c79defab686cdb07b5..3783b7c43ecc82fb0889e60a13c1e506e19b694e 100644
GIT binary patch
pc-bios/vgabios.bin binary +0 -0
index 892a2b537468cb8adcf85afb59588bfe35edec72..0984ee2f3f004af321774e94c60905153c4dc000 100644
GIT binary patch
Signature · 1 line
1.8.3.1
#11 lore raw

PATCH 8/8 pc: switch 2.0 machine types to large seabios binary

In reply to Gerd Hoffmann
---
 hw/i386/pc_piix.c | 4 +++-
 hw/i386/pc_q35.c  | 4 +++-
 2 files changed, 6 insertions(+), 2 deletions(-)
hw/i386/pc_piix.c +3 -1
index 9329f04..ab56285 100644
@@ -339,7 +339,9 @@ static void pc_xen_hvm_init(QEMUMachineInitArgs *args)
     .desc = "Standard PC (i440FX + PIIX, 1996)", \
     .hot_add_cpu = pc_hot_add_cpu
 
-#define PC_I440FX_2_0_MACHINE_OPTIONS PC_I440FX_MACHINE_OPTIONS
+#define PC_I440FX_2_0_MACHINE_OPTIONS                           \
+    PC_I440FX_MACHINE_OPTIONS,                                  \
+    .default_machine_opts = "firmware=bios-256k.bin"
 
 static QEMUMachine pc_i440fx_machine_v2_0 = {
     PC_I440FX_2_0_MACHINE_OPTIONS,
hw/i386/pc_q35.c +3 -1
index ac69e5d..97aa842 100644
@@ -259,7 +259,9 @@ static void pc_q35_init_1_4(QEMUMachineInitArgs *args)
     .desc = "Standard PC (Q35 + ICH9, 2009)", \
     .hot_add_cpu = pc_hot_add_cpu
 
-#define PC_Q35_2_0_MACHINE_OPTIONS PC_Q35_MACHINE_OPTIONS
+#define PC_Q35_2_0_MACHINE_OPTIONS                      \
+    PC_Q35_MACHINE_OPTIONS,                             \
+    .default_machine_opts = "firmware=bios-256k.bin"
 
 static QEMUMachine pc_q35_machine_v2_0 = {
     PC_Q35_2_0_MACHINE_OPTIONS,
Signature · 1 line
1.8.3.1