Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nixos/qemu-vm: add option to use qboot #88574

Merged
merged 1 commit into from Jun 8, 2020

Conversation

JJJollyjim
Copy link
Member

@JJJollyjim JJJollyjim commented May 22, 2020

Motivation for this change

qboot is a minimal x86 bios for use under QEMU, replacing the default (SeaBIOS).

This provides a 700-800ms improvement to boot times when enabled, so long-term I'd love to turn it on by default (at least for nixos tests).

See the runtimes of a simple "wait for multi-user.target" test, with and without the option enabled:

Desktop, AMD 2600X

Screenshot_20200522_153812

Laptop, Intel i5-8250U

Screenshot_20200522_154122

Percentage-wise, this becomes much more significant after further changes I'm working on, especially the use of virtiofs instead of 9pfs.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@JJJollyjim
Copy link
Member Author

@ofborg test simple qboot

@JJJollyjim
Copy link
Member Author

Is it possible for ofborg to run the tests on i386?

@flokli
Copy link
Contributor

flokli commented May 24, 2020

@GrahamcOfBorg build pkgsi686Linux.nixosTests.simple pkgsi686Linux.nixosTests.qboot

Copy link
Contributor

@rnhmjoj rnhmjoj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't be better to add a bios option that takes a package or path?
It would be useful when developing a bios.

@JJJollyjim JJJollyjim force-pushed the qemu-vm-qboot-opt branch 3 times, most recently from cda1161 to 12bfe1e Compare May 31, 2020 09:19
@JJJollyjim
Copy link
Member Author

@ofborg test simple qboot pkgsi686Linux.nixosTests.simple pkgsi686Linux.nixosTests.qboot

@rnhmjoj done as requested.

@flokli
Copy link
Contributor

flokli commented May 31, 2020

More a question, less a requirement for this PR to be merged:

I ran $(nix-build nixos/tests/qboot.nix -A driver --no-out-link)/bin/nixos-run-vms, and didn't get any output until the getty prompt. I'd expect the console output to be helpful for debugging and as getty is able to drive the display, can earlier stages too?

@JJJollyjim
Copy link
Member Author

@flokli If you're not aware, that status quo is that only this output (from SeaBIOS) is shown on the display, up until the getty part:
image

The kernel logs all go to the serial console, i.e. the output of nix-build - imo this is probably the most useful place for them to be.

@JJJollyjim
Copy link
Member Author

Fixed an embarrassing type-system mistake (I forgot to allow null, despite that being the default...)

@ofborg test simple qboot

@JJJollyjim
Copy link
Member Author

I'm weirded out by how ofborg didn't error when I tested simple before though :/

pkgs/applications/virtualization/qboot/default.nix Outdated Show resolved Hide resolved
nixos/tests/qboot.nix Outdated Show resolved Hide resolved
I'd like to change the default on x86 platforms to qboot at some point, since it
saves a fair bit of startup time.
@JJJollyjim
Copy link
Member Author

@Floki fixed both those
@ofborg test qboot

@flokli flokli merged commit 3590f02 into NixOS:master Jun 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants