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
Merged

Conversation

@JJJollyjim
Copy link
Contributor

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
Contributor Author

JJJollyjim commented May 22, 2020

@ofborg test simple qboot

@JJJollyjim
Copy link
Contributor Author

JJJollyjim commented May 22, 2020

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 left a comment

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 JJJollyjim:qemu-vm-qboot-opt branch 3 times, most recently from cda1161 to 12bfe1e May 31, 2020
@JJJollyjim
Copy link
Contributor Author

JJJollyjim commented May 31, 2020

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

@rnhmjoj done as requested.

@ofborg ofborg bot added the 8.has: clean-up label May 31, 2020
@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
Contributor Author

JJJollyjim commented Jun 4, 2020

@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 JJJollyjim force-pushed the JJJollyjim:qemu-vm-qboot-opt branch from 12bfe1e to 3c72e00 Jun 4, 2020
@JJJollyjim
Copy link
Contributor Author

JJJollyjim commented Jun 4, 2020

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

@ofborg test simple qboot

@JJJollyjim
Copy link
Contributor Author

JJJollyjim commented Jun 4, 2020

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 JJJollyjim force-pushed the JJJollyjim:qemu-vm-qboot-opt branch from 3c72e00 to 55912f3 Jun 7, 2020
@JJJollyjim
Copy link
Contributor Author

JJJollyjim commented Jun 7, 2020

@Floki fixed both those
@ofborg test qboot

@rnhmjoj
rnhmjoj approved these changes Jun 8, 2020
@flokli flokli merged commit 3590f02 into NixOS:master Jun 8, 2020
15 checks passed
15 checks passed
Evaluation Performance Report Evaluator Performance Report
Details
grahamcofborg-eval ^.^!
Details
grahamcofborg-eval-check-meta config.nix: checkMeta = true
Details
grahamcofborg-eval-darwin nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="55912f3"; rev="55912f3535217910b12e81f07fb10d70511a471b"; } ./pkgs/t
Details
grahamcofborg-eval-lib-tests nix-build --arg pkgs import ./. {} ./lib/tests/release.nix
Details
grahamcofborg-eval-nixos nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="55912f3"; rev="55912f3535217910b12e81f07fb10d70511a471b"; } ./nixos/
Details
grahamcofborg-eval-nixos-manual nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="55912f3"; rev="55912f3535217910b12e81f07fb10d70511a471b"; } ./nixos/
Details
grahamcofborg-eval-nixos-options nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="55912f3"; rev="55912f3535217910b12e81f07fb10d70511a471b"; } ./nixos/
Details
grahamcofborg-eval-nixpkgs-manual nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="55912f3"; rev="55912f3535217910b12e81f07fb10d70511a471b"; } ./pkgs/t
Details
grahamcofborg-eval-nixpkgs-tarball nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="55912f3"; rev="55912f3535217910b12e81f07fb10d70511a471b"; } ./pkgs/t
Details
grahamcofborg-eval-nixpkgs-unstable-jobset nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="55912f3"; rev="55912f3535217910b12e81f07fb10d70511a471b"; } ./pkgs/t
Details
grahamcofborg-eval-package-list nix-env -qa --json --file .
Details
grahamcofborg-eval-package-list-no-aliases nix-env -qa --json --file . --arg config { allowAliases = false; }
Details
tests.qboot on aarch64-linux Success
Details
tests.qboot on x86_64-linux Success
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants
You can’t perform that action at this time.