Skip to contentSkip to conversation

seabios: going to 256k size

RFC PATCH In review Gerd Hoffmann 3 participants 11 messages Sep 30, 2013 – Oct 1, 2013

lore
Share & tools
lore
#0 lore raw

cover seabios: going to 256k size

Hi,

With the seabios update to the next master branch relase (NOT the stable branch pull sent out earlier today) seabios rom size will cross the 128k boundary and we have to deal with that.

So here is a RfC patch series with one aproach to handle this: We'll go build two seabios binaries, one 128k (will less features), one 256k (full featured). Machine types 1.7+ will use the 256k bios while older machine types will continue to use the 128k sized one.

Series applies on top of the "roms: various build improvements" pull request sent out earlier today.

Comments?

cheers,
Gerd

Gerd Hoffmann (2):
roms: build two seabios binaries
machine type dependant bios

 hw/i386/pc_piix.c        | 1 +
 hw/i386/pc_q35.c         | 1 +
 hw/i386/pc_sysfw.c       | 4 ++--
 include/hw/i386/pc.h     | 2 ++
 roms/Makefile            | 7 ++++---
 roms/config.seabios      | 1 -
 roms/config.seabios-128k | 5 +++++
 roms/config.seabios-256k | 3 +++
 8 files changed, 18 insertions(+), 6 deletions(-)
 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/2 roms: build two seabios binaries

---
 roms/Makefile            | 7 ++++---
 roms/config.seabios      | 1 -
 roms/config.seabios-128k | 5 +++++
 roms/config.seabios-256k | 3 +++
 4 files changed, 12 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..1d84230 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-128k.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 +5 -0
new file mode 100644
index 0000000..23ca812
@@ -0,0 +1,5 @@
+# for qemu machine types 1.6 + older
+# need to turn off features (xhci) to make it fit into 128k
+CONFIG_QEMU=y
+CONFIG_ROM_SIZE=128
+CONFIG_USB_XHCI=n
roms/config.seabios-256k new file +3 -0
new file mode 100644
index 0000000..cc37a78
@@ -0,0 +1,3 @@
+# for qemu machine types 1.7 + newer
+CONFIG_QEMU=y
+CONFIG_ROM_SIZE=256
Signature · 1 line
1.8.3.1
#2 lore raw

Re: [Qemu-devel] [PATCH 1/2] roms: build two seabios binaries

Il 30/09/2013 12:46, Gerd Hoffmann ha scritto:

Quoted 42 lines
---
 roms/Makefile            | 7 ++++---
 roms/config.seabios      | 1 -
 roms/config.seabios-128k | 5 +++++
 roms/config.seabios-256k | 3 +++
 4 files changed, 12 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..1d84230 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-128k.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 +0 -0
new file mode 100644
index 0000000..23ca812

roms/config.seabios-128k line 5

Quoted 5 lines
roms/config.seabios-128k new file +5 -0
@@ -0,0 +1,5 @@
+# for qemu machine types 1.6 + older
+# need to turn off features (xhci) to make it fit into 128k
+CONFIG_QEMU=y
+CONFIG_ROM_SIZE=128
+CONFIG_USB_XHCI=n

Is it enough to disable Xen or perhaps OHCI?

roms/config.seabios-256k line 3

Quoted 9 lines
roms/config.seabios-256k new file +3 -0
new file mode 100644
index 0000000..cc37a78
@@ -0,0 +1,3 @@
+# for qemu machine types 1.7 + newer
+CONFIG_QEMU=y
+CONFIG_ROM_SIZE=256

Is there already an option to remove ACPI tables generation? Should it be enabled for 1.7, irrespective of the 128k->256k switch?

Paolo

#3 lore raw

Re: [Qemu-devel] [PATCH 1/2] roms: build two seabios binaries

Quoted 5 lines
Quoted 5 lines
roms/config.seabios-128k new file +0 -0
new file mode 100644
index 0000000..23ca812
Quoted 8 lines

roms/config.seabios-128k line 5

Quoted 6 lines
roms/config.seabios-128k new file +5 -0
@@ -0,0 +1,5 @@
+# for qemu machine types 1.6 + older
+# need to turn off features (xhci) to make it fit into 128k
+CONFIG_QEMU=y
+CONFIG_ROM_SIZE=128
+CONFIG_USB_XHCI=n

Is it enough to disable Xen or perhaps OHCI?

We can try that. I've picked xhci because it is new in master, so we don't take something away.

Quoted 4 lines
Quoted 4 lines
roms/config.seabios-256k new file +0 -1
new file mode 100644
index 0000000..cc37a78
--- /dev/null
Quoted 8 lines

roms/config.seabios-256k line 3

Quoted 5 lines

+++ b/roms/config.seabios-256k

roms/config.seabios-256k new file +3 -0
@@ -0,0 +1,3 @@
+# for qemu machine types 1.7 + newer
+CONFIG_QEMU=y
+CONFIG_ROM_SIZE=256

Is there already an option to remove ACPI tables generation? Should it be enabled for 1.7, irrespective of the 128k->256k switch?

Not yet, but will be once mst's patches are in. Yes, we can set that for the 256k rom.

cheers,
Gerd

#4 lore raw

Re: [Qemu-devel] [PATCH 1/2] roms: build two seabios binaries

Il 30/09/2013 15:44, Gerd Hoffmann ha scritto:

Quoted 10 lines
Quoted 7 lines
Quoted 7 lines
Quoted 5 lines

roms/config.seabios-128k line 5

Quoted 5 lines
roms/config.seabios-128k new file +5 -0
+# for qemu machine types 1.6 + older
+# need to turn off features (xhci) to make it fit into 128k
+CONFIG_QEMU=y
+CONFIG_ROM_SIZE=128
+CONFIG_USB_XHCI=n

Is it enough to disable Xen or perhaps OHCI?

We can try that. I've picked xhci because it is new in master, so we don't take something away.

Ok. But if we can enable XHCI and disable Xen, that'd be a win because Xen anyway embeds SeaBIOS within its own hvmloader firmware.

Paolo

#5 lore raw

PATCH 2/2 machine type dependant bios

In reply to Gerd Hoffmann
---
 hw/i386/pc_piix.c    | 1 +
 hw/i386/pc_q35.c     | 1 +
 hw/i386/pc_sysfw.c   | 4 ++--
 include/hw/i386/pc.h | 2 ++
 4 files changed, 6 insertions(+), 2 deletions(-)
hw/i386/pc_piix.c +1 -0
index 907792b..35188a5 100644
@@ -238,6 +238,7 @@ static void pc_init_pci(QEMUMachineInitArgs *args)
 
 static void pc_compat_1_6(QEMUMachineInitArgs *args)
 {
+    pc_default_bios_name = "bios-128k.bin";
     has_pci_info = false;
     rom_file_in_ram = false;
 }
hw/i386/pc_q35.c +1 -0
index ca84e1c..e8b0168 100644
@@ -222,6 +222,7 @@ static void pc_q35_init(QEMUMachineInitArgs *args)
 
 static void pc_compat_1_6(QEMUMachineInitArgs *args)
 {
+    pc_default_bios_name = "bios-128k.bin";
     has_pci_info = false;
     rom_file_in_ram = false;
 }
hw/i386/pc_sysfw.c +2 -2
index e917c83..deb8869 100644
@@ -34,7 +34,7 @@
 #include "hw/block/flash.h"
 #include "sysemu/kvm.h"
 
-#define BIOS_FILENAME "bios.bin"
+const char *pc_default_bios_name = "bios-256k.bin";
 
 typedef struct PcSysFwDevice {
     SysBusDevice busdev;
@@ -112,7 +112,7 @@ static void old_pc_system_rom_init(MemoryRegion *rom_memory, bool isapc_ram_fw)
 
     /* BIOS load */
     if (bios_name == NULL) {
-        bios_name = BIOS_FILENAME;
+        bios_name = pc_default_bios_name;
     }
     filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, bios_name);
     if (filename) {
include/hw/i386/pc.h +2 -0
index 9b2ddc4..cf9e47e 100644
@@ -12,6 +12,8 @@
 
 /* PC-style peripherals (also used by other machines).  */
 
+extern const char *pc_default_bios_name;
+
 typedef struct PcPciInfo {
     Range w32;
     Range w64;
Signature · 1 line
1.8.3.1
#6 lore raw

Re: [Qemu-devel] [PATCH 2/2] machine type dependant bios

Wouldn't this be logical as a machine option? They way you are introducing it makes it impossible to control with -global.

Regards,

Anthony Liguori

Quoted 72 lines · Gerd Hoffmann
---
 hw/i386/pc_piix.c    | 1 +
 hw/i386/pc_q35.c     | 1 +
 hw/i386/pc_sysfw.c   | 4 ++--
 include/hw/i386/pc.h | 2 ++
 4 files changed, 6 insertions(+), 2 deletions(-)
hw/i386/pc_piix.c +1 -0
index 907792b..35188a5 100644
@@ -238,6 +238,7 @@ static void pc_init_pci(QEMUMachineInitArgs *args)
 
 static void pc_compat_1_6(QEMUMachineInitArgs *args)
 {
+    pc_default_bios_name = "bios-128k.bin";
     has_pci_info = false;
     rom_file_in_ram = false;
 }
hw/i386/pc_q35.c +1 -0
index ca84e1c..e8b0168 100644
@@ -222,6 +222,7 @@ static void pc_q35_init(QEMUMachineInitArgs *args)
 
 static void pc_compat_1_6(QEMUMachineInitArgs *args)
 {
+    pc_default_bios_name = "bios-128k.bin";
     has_pci_info = false;
     rom_file_in_ram = false;
 }
hw/i386/pc_sysfw.c +2 -2
index e917c83..deb8869 100644
@@ -34,7 +34,7 @@
 #include "hw/block/flash.h"
 #include "sysemu/kvm.h"
 
-#define BIOS_FILENAME "bios.bin"
+const char *pc_default_bios_name = "bios-256k.bin";
 
 typedef struct PcSysFwDevice {
     SysBusDevice busdev;
@@ -112,7 +112,7 @@ static void old_pc_system_rom_init(MemoryRegion
 *rom_memory, bool isapc_ram_fw)
 
     /* BIOS load */
     if (bios_name == NULL) {
-        bios_name = BIOS_FILENAME;
+        bios_name = pc_default_bios_name;
     }
     filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, bios_name);
     if (filename) {
include/hw/i386/pc.h +2 -1
index 9b2ddc4..cf9e47e 100644
@@ -12,6 +12,8 @@
 
 /* PC-style peripherals (also used by other machines).  */
 
+extern const char *pc_default_bios_name;
+
 typedef struct PcPciInfo {
     Range w32;
     Range w64;
--

1.8.3.1

#7 lore raw

Re: [Qemu-devel] [PATCH 2/2] machine type dependant bios

Il 01/10/2013 00:08, Anthony Liguori ha scritto:

Quoted 2 lines

Wouldn't this be logical as a machine option? They way you are introducing it makes it impossible to control with -global.

You still have -bios.

We should introduce a machine object and convert unknown "-machine" options to -global on that object. But until that exists, IMO there's no reason to do anything different from what has been done so far.

Paolo

#8 lore raw

Re: [Qemu-devel] [PATCH 2/2] machine type dependant bios

Quoted 6 lines · Paolo Bonzini

Il 01/10/2013 00:08, Anthony Liguori ha scritto:

Quoted 2 lines

Wouldn't this be logical as a machine option? They way you are introducing it makes it impossible to control with -global.

You still have -bios.

Which cannot be versioned.

Quoted 2 lines

We should introduce a machine object and convert unknown "-machine" options to -global on that object.

There's no need. -global works on QemuOpts, not QObjects. By making this a machine option, you get -global and machine compat for free.

We also have a way to set per-machine default machine options already too.

Regards,

Anthony Liguori

Quoted 5 lines

But until that exists, IMO there's
no reason to do anything different from what has been done so far.

Paolo

#9 lore raw

Re: [Qemu-devel] [PATCH 2/2] machine type dependant bios

Il 01/10/2013 00:57, Anthony Liguori ha scritto:

Quoted 10 lines

On Mon, Sep 30, 2013 at 5:43 PM, Paolo Bonzini <[email protected] <mailto:[email protected]>> wrote:

Il 01/10/2013 00:08, Anthony Liguori ha scritto:
> Wouldn't this be logical as a machine option? They way you are > introducing it makes it impossible to control with -global.

You still have -bios.

Which cannot be versioned.

Yeah, that's right.

Quoted 5 lines

We should introduce a machine object and convert unknown "-machine" options to -global on that object.

There's no need. -global works on QemuOpts, not QObjects.

No, it doesn't. :)

Paolo

#10 lore raw

Re: [Qemu-devel] [PATCH 2/2] machine type dependant bios

Quoted 14 lines · Paolo Bonzini

Il 01/10/2013 00:57, Anthony Liguori ha scritto:

Quoted 10 lines

On Mon, Sep 30, 2013 at 5:43 PM, Paolo Bonzini <[email protected] <mailto:[email protected]>> wrote:

Il 01/10/2013 00:08, Anthony Liguori ha scritto:
> Wouldn't this be logical as a machine option? They way you are > introducing it makes it impossible to control with -global.

You still have -bios.

Which cannot be versioned.

Yeah, that's right.

Quoted 8 lines
Quoted 5 lines

We should introduce a machine object and convert unknown "-machine" options to -global on that object.

There's no need. -global works on QemuOpts, not QObjects.

No, it doesn't. :)

You are correct. Too long of a day I guess.

Nonetheless, I still think it belongs as a machine option. The other comments about having a way to have default machine arguments still applies.

Regards,

Anthony Liguori

Quoted 3 lines

Paolo