Add a config option for fast device init (i.e. skip non-bootable devices). This optimization breaks boot in some rare configurations, specifically in case the boot loader needs access to secondary disks.
Signed-off-by: Gerd Hoffmann kraxel@redhat.com --- src/boot.c | 2 ++ src/Kconfig | 10 ++++++++++ 2 files changed, 12 insertions(+)
diff --git a/src/boot.c b/src/boot.c index 1effd802ce06..771d2382e38f 100644 --- a/src/boot.c +++ b/src/boot.c @@ -299,6 +299,8 @@ u8 is_bootprio_strict(void) { static int prio_halt = -2;
+ if (!CONFIG_BOOT_FAST_INIT) + return 0; if (prio_halt == -2) prio_halt = find_prio("HALT"); return prio_halt >= 0; diff --git a/src/Kconfig b/src/Kconfig index 3a8ffa15fded..6b750a41b42c 100644 --- a/src/Kconfig +++ b/src/Kconfig @@ -72,6 +72,16 @@ endchoice help Support controlling of the boot order via the fw_cfg/CBFS "bootorder" file. + config BOOT_FAST_INIT + depends on BOOTORDER + bool "Fast boot device init" + default y + help + Skip initialization for devices without bootindex. Speeds + up boot and reduced memory footprint, but may cause boot + problems in case the bootloader needs access to secondary + disks. + config HOST_BIOS_GEOMETRY depends on BOOT bool "Boot device bios geometry override"
Dear Gerd,
On 2021-03-23 15:18, Gerd Hoffmann wrote:
Add a config option for fast device init (i.e. skip non-bootable devices). This optimization breaks boot in some rare configurations, specifically in case the boot loader needs access to secondary disks.
Thank you for the patch. Could you please elaborate and describe your test setup and how much the boot time is decreased?
Signed-off-by: Gerd Hoffmann kraxel@redhat.com
src/boot.c | 2 ++ src/Kconfig | 10 ++++++++++ 2 files changed, 12 insertions(+)
diff --git a/src/boot.c b/src/boot.c index 1effd802ce06..771d2382e38f 100644 --- a/src/boot.c +++ b/src/boot.c @@ -299,6 +299,8 @@ u8 is_bootprio_strict(void) { static int prio_halt = -2;
- if (!CONFIG_BOOT_FAST_INIT)
Maybe print a debug message?
if (prio_halt == -2) prio_halt = find_prio("HALT"); return prio_halt >= 0;return 0;
diff --git a/src/Kconfig b/src/Kconfig index 3a8ffa15fded..6b750a41b42c 100644 --- a/src/Kconfig +++ b/src/Kconfig @@ -72,6 +72,16 @@ endchoice help Support controlling of the boot order via the fw_cfg/CBFS "bootorder" file.
- config BOOT_FAST_INIT
depends on BOOTORDER
bool "Fast boot device init"
default y
help
Skip initialization for devices without bootindex. Speeds
up boot and reduced memory footprint, but may cause boot
problems in case the bootloader needs access to secondary
disks.
- config HOST_BIOS_GEOMETRY depends on BOOT bool "Boot device bios geometry override"
The diff looks good.
Kind regards,
Paul
On Tue, Mar 23, 2021 at 04:31:41PM +0100, Paul Menzel wrote:
Dear Gerd,
On 2021-03-23 15:18, Gerd Hoffmann wrote:
Add a config option for fast device init (i.e. skip non-bootable devices). This optimization breaks boot in some rare configurations, specifically in case the boot loader needs access to secondary disks.
Thank you for the patch. Could you please elaborate and describe your test setup and how much the boot time is decreased?
Have no numbers.
Note that optimization is already in 1.14 and this only adds a config option to turn it *off*.
take care, Gerd
On Fri, Mar 26, 2021 at 09:52:49AM +0100, Gerd Hoffmann wrote:
On Tue, Mar 23, 2021 at 04:31:41PM +0100, Paul Menzel wrote:
Dear Gerd,
On 2021-03-23 15:18, Gerd Hoffmann wrote:
Add a config option for fast device init (i.e. skip non-bootable devices). This optimization breaks boot in some rare configurations, specifically in case the boot loader needs access to secondary disks.
Thank you for the patch. Could you please elaborate and describe your test setup and how much the boot time is decreased?
Have no numbers.
Note that optimization is already in 1.14 and this only adds a config option to turn it *off*.
Unfortunately, I missed the initial email due to seabios mailing list problems a few weeks ago.
What's the reason to add a config option for this setting? We typically make these choices at runtime using settings from fwcfg.
Cheers, -Kevin
Hi,
Add a config option for fast device init (i.e. skip non-bootable devices). This optimization breaks boot in some rare configurations, specifically in case the boot loader needs access to secondary disks.
Unfortunately, I missed the initial email due to seabios mailing list problems a few weeks ago.
Quote above is the commit message, actual patch below.
What's the reason to add a config option for this setting? We typically make these choices at runtime using settings from fwcfg.
Well, there is a fwcfg setting already. Skipping non-bootable devices happens only in case there is a HALT line in the fw_cfg bootorder file, which translates to "-boot strict={on,off}" on the qemu command line.
Problem is that libvirt runs qemu with strict=on and provides no way to request strict=off instead. Fixing that is on the way, but it'll take some time as it affects not only libvirt itself but also the management apps using libvirt.
So this patch allows to handles the reported regressions with a compile time switch for the time being. If you don't like it, fine, we can also carry the patch downstream for a while until libvirt & co are fixed, it should only be needed temporarily after all.
I suspect we are not the only ones running into this though, so it might be useful to have that upstream too ...
take care, Gerd
------------------------------ cut here ------------------------- diff --git a/src/boot.c b/src/boot.c index 1effd802ce06..771d2382e38f 100644 --- a/src/boot.c +++ b/src/boot.c @@ -299,6 +299,8 @@ u8 is_bootprio_strict(void) { static int prio_halt = -2;
+ if (!CONFIG_BOOT_FAST_INIT) + return 0; if (prio_halt == -2) prio_halt = find_prio("HALT"); return prio_halt >= 0; diff --git a/src/Kconfig b/src/Kconfig index 3a8ffa15fded..6b750a41b42c 100644 --- a/src/Kconfig +++ b/src/Kconfig @@ -72,6 +72,16 @@ endchoice help Support controlling of the boot order via the fw_cfg/CBFS "bootorder" file. + config BOOT_FAST_INIT + depends on BOOTORDER + bool "Fast boot device init" + default y + help + Skip initialization for devices without bootindex. Speeds + up boot and reduced memory footprint, but may cause boot + problems in case the bootloader needs access to secondary + disks. + config HOST_BIOS_GEOMETRY depends on BOOT bool "Boot device bios geometry override"
On Thu, Apr 08, 2021 at 12:02:23PM +0200, Gerd Hoffmann wrote:
Hi,
Add a config option for fast device init (i.e. skip non-bootable devices). This optimization breaks boot in some rare configurations, specifically in case the boot loader needs access to secondary disks.
Unfortunately, I missed the initial email due to seabios mailing list problems a few weeks ago.
Quote above is the commit message, actual patch below.
What's the reason to add a config option for this setting? We typically make these choices at runtime using settings from fwcfg.
Well, there is a fwcfg setting already. Skipping non-bootable devices happens only in case there is a HALT line in the fw_cfg bootorder file, which translates to "-boot strict={on,off}" on the qemu command line.
Problem is that libvirt runs qemu with strict=on and provides no way to request strict=off instead. Fixing that is on the way, but it'll take some time as it affects not only libvirt itself but also the management apps using libvirt.
So this patch allows to handles the reported regressions with a compile time switch for the time being. If you don't like it, fine, we can also carry the patch downstream for a while until libvirt & co are fixed, it should only be needed temporarily after all.
In general, it sounds like it would be better to address this in libvirt and not add a temporary compile time setting. However, if you feel the timing of rollout warrents a SeaBIOS change, then I'm okay with that.
-Kevin