This adds an option to generate a small bios, so that it's easy for people who want to generate binary compatible with QEMU 1.6 and earlier (which used a 128K buffer).
Default is 256K (for future QEMU).
Michael S. Tsirkin (3): Kconfig: add explicit QEMU 128/QEMU 256 targets xhci: disable for QEMU_128K acpi rom file loading: disable for QEMU 128K
src/Kconfig | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-)
Older QEMU versions need a small bios <128K, and don't need lots of modern features (no hardware for them). Add an option you can use for that, so that QEMU developers don't need to go hunting: what's required and what's not.
Signed-off-by: Michael S. Tsirkin mst@redhat.com --- src/Kconfig | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-)
diff --git a/src/Kconfig b/src/Kconfig index 5780885..d6b6608 100644 --- a/src/Kconfig +++ b/src/Kconfig @@ -6,18 +6,32 @@ menu "General Features"
choice prompt "Build Target" - default QEMU + default QEMU_256K
config COREBOOT bool "Build for coreboot" help Configure as a coreboot payload.
- config QEMU - bool "Build for QEMU/Xen/KVM/Bochs" + config QEMU_128K + bool "Build 128K binary for legacy QEMU/Xen/KVM/Bochs" + select QEMU + select QEMU_HARDWARE + help + Configure for an emulated machine (QEMU, Xen, KVM, or Bochs). + Select this option to generate smaller BIOS, disabling + some features to fit within 128Kbyte memory buffer used + by QEMU 1.6 and earlier. + + config QEMU_256K + bool "Build 256K binary for QEMU/Xen/KVM/Bochs" + select QEMU select QEMU_HARDWARE help Configure for an emulated machine (QEMU, Xen, KVM, or Bochs). + Select this option to generate a bigger (up to 256Kbyte), more + full-featured BIOS, enabling more features useful for QEMU 1.7 and + newer.
config CSM bool "Build as Compatibilty Support Module for EFI BIOS" @@ -27,6 +41,10 @@ choice
endchoice
+ config QEMU + bool + default n + config QEMU_HARDWARE bool "Support hardware found on emulators (QEMU/Xen/KVM/Bochs)" if !QEMU default n
QEMU 1.6 and earlier didn't have XHCI so we can safely disable that for QEMU_128K.
Signed-off-by: Michael S. Tsirkin mst@redhat.com --- src/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/Kconfig b/src/Kconfig index d6b6608..f753170 100644 --- a/src/Kconfig +++ b/src/Kconfig @@ -235,7 +235,7 @@ menu "Hardware support" help Support USB EHCI controllers. config USB_XHCI - depends on USB && QEMU_HARDWARE + depends on USB && QEMU_HARDWARE && !QEMU_128K bool "USB XHCI controllers" default y help
On Mi, 2013-09-25 at 12:36 +0300, Michael S. Tsirkin wrote:
QEMU 1.6 and earlier didn't have XHCI so we can safely disable that for QEMU_128K.
Signed-off-by: Michael S. Tsirkin mst@redhat.com
src/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/Kconfig b/src/Kconfig index d6b6608..f753170 100644 --- a/src/Kconfig +++ b/src/Kconfig @@ -235,7 +235,7 @@ menu "Hardware support" help Support USB EHCI controllers. config USB_XHCI
depends on USB && QEMU_HARDWARE
depends on USB && QEMU_HARDWARE && !QEMU_128K bool "USB XHCI controllers" default y help
I still think this is a bad idea.
In any case you should not add a dependency but flip the default for the small rom, using "default n if QEMU_128K"
cheers, Gerd
On Wed, Sep 25, 2013 at 04:02:18PM +0200, Gerd Hoffmann wrote:
On Mi, 2013-09-25 at 12:36 +0300, Michael S. Tsirkin wrote:
QEMU 1.6 and earlier didn't have XHCI so we can safely disable that for QEMU_128K.
Signed-off-by: Michael S. Tsirkin mst@redhat.com
src/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/Kconfig b/src/Kconfig index d6b6608..f753170 100644 --- a/src/Kconfig +++ b/src/Kconfig @@ -235,7 +235,7 @@ menu "Hardware support" help Support USB EHCI controllers. config USB_XHCI
depends on USB && QEMU_HARDWARE
depends on USB && QEMU_HARDWARE && !QEMU_128K bool "USB XHCI controllers" default y help
I still think this is a bad idea.
It's a convenience feature. QEMU developer can just build stuff without worrying that someone just added a new feature so now bios size is too large. There will be less churn in the QEMU config file. What's the harm?
In any case you should not add a dependency but flip the default for the small rom, using "default n if QEMU_128K"
cheers, Gerd
Interesting. How does this work?
It's only useful for QEMU 1.7 and newer.
Signed-off-by: Michael S. Tsirkin mst@redhat.com --- src/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/Kconfig b/src/Kconfig index f753170..bf2ce1b 100644 --- a/src/Kconfig +++ b/src/Kconfig @@ -444,7 +444,7 @@ menu "BIOS Tables" If unsure, say Y. config FW_ROMFILE_LOAD bool "Load BIOS tables from ROM files" - depends on QEMU_HARDWARE + depends on QEMU_HARDWARE && !QEMU_128K default y help Support loading BIOS firmware tables from ROM files.
On Wed, Sep 25, 2013 at 12:36:13PM +0300, Michael S. Tsirkin wrote:
This adds an option to generate a small bios, so that it's easy for people who want to generate binary compatible with QEMU 1.6 and earlier (which used a 128K buffer).
Default is 256K (for future QEMU).
No, this is not a good idea. It doesn't actually work - different compilers may be over 128K anyway, different options (eg, debug level) will bring the size up over 128K, and it is meaningless for xen/csm/coreboot.
-Kevin
On Wed, Sep 25, 2013 at 08:08:56PM -0400, Kevin O'Connor wrote:
On Wed, Sep 25, 2013 at 12:36:13PM +0300, Michael S. Tsirkin wrote:
This adds an option to generate a small bios, so that it's easy for people who want to generate binary compatible with QEMU 1.6 and earlier (which used a 128K buffer).
Default is 256K (for future QEMU).
No, this is not a good idea. It doesn't actually work - different compilers may be over 128K anyway, different options (eg, debug level) will bring the size up over 128K, and it is meaningless for xen/csm/coreboot.
-Kevin
How about BIOS_FOR_QEMU_1_6, with just enough stuff that was there? Looking at linux as an example, it does have easy to use configurations for different boards.