Skip to content

Provide initial randomness for aarch64 - #5906

Merged
ShadowCurse merged 2 commits into
firecracker-microvm:mainfrom
ShadowCurse:provide_initial_randomness
May 22, 2026
Merged

Provide initial randomness for aarch64#5906
ShadowCurse merged 2 commits into
firecracker-microvm:mainfrom
ShadowCurse:provide_initial_randomness

Conversation

@ShadowCurse

Copy link
Copy Markdown
Contributor

Changes

Add rng-seed node to the FDT on aarch64 to help VMs booted on the older hosts which do not have hardware rng device to get initial randomness.

Reason

Help older instances to run VMs with good initial entropy.

License Acceptance

By submitting this pull request, I confirm that my contribution is made under
the terms of the Apache 2.0 license. For more information on following Developer
Certificate of Origin and signing off your commits, please check
CONTRIBUTING.md.

PR Checklist

  • I have read and understand CONTRIBUTING.md.
  • I have run tools/devtool checkbuild --all to verify that the PR passes
    build checks on all supported architectures.
  • I have run tools/devtool checkstyle to verify that the PR passes the
    automated style checks.
  • I have described what is done in these changes, why they are needed, and
    how they are solving the problem in a clear and encompassing way.
  • I have updated any relevant documentation (both in code and in the docs)
    in the PR.
  • I have mentioned all user-facing changes in CHANGELOG.md.
  • If a specific issue led to this PR, this PR closes the issue.
  • When making API changes, I have followed the
    Runbook for Firecracker API changes.
  • I have tested all new and changed functionalities in unit tests and/or
    integration tests.
  • I have linked an issue to every new TODO.

  • This functionality cannot be added in rust-vmm.

@ShadowCurse ShadowCurse self-assigned this May 21, 2026
@ShadowCurse ShadowCurse added Status: Awaiting review Indicates that a pull request is ready to be reviewed Type: Enhancement Indicates new feature requests labels May 21, 2026
@ShadowCurse
ShadowCurse force-pushed the provide_initial_randomness branch from f8d7544 to 8948f8a Compare May 21, 2026 15:47
@codecov

codecov Bot commented May 21, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.89%. Comparing base (ef25fc4) to head (d73dca8).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5906   +/-   ##
=======================================
  Coverage   82.89%   82.89%           
=======================================
  Files         277      277           
  Lines       30072    30075    +3     
=======================================
+ Hits        24927    24930    +3     
  Misses       5145     5145           
Flag Coverage Δ
5.10-m5n.metal 83.18% <ø> (ø)
5.10-m6a.metal 82.52% <ø> (-0.01%) ⬇️
5.10-m6g.metal 79.82% <100.00%> (+<0.01%) ⬆️
5.10-m6i.metal 83.18% <ø> (-0.01%) ⬇️
5.10-m7a.metal-48xl 82.52% <ø> (ø)
5.10-m7g.metal 79.81% <100.00%> (-0.01%) ⬇️
5.10-m7i.metal-24xl 83.16% <ø> (ø)
5.10-m7i.metal-48xl 83.16% <ø> (-0.01%) ⬇️
5.10-m8g.metal-24xl 79.82% <100.00%> (+<0.01%) ⬆️
5.10-m8g.metal-48xl 79.81% <100.00%> (+<0.01%) ⬆️
5.10-m8i.metal-48xl 83.16% <ø> (+<0.01%) ⬆️
5.10-m8i.metal-96xl 83.16% <ø> (ø)
6.1-m5n.metal 83.21% <ø> (+<0.01%) ⬆️
6.1-m6a.metal 82.55% <ø> (ø)
6.1-m6g.metal 79.81% <100.00%> (-0.01%) ⬇️
6.1-m6i.metal 83.21% <ø> (ø)
6.1-m7a.metal-48xl 82.54% <ø> (ø)
6.1-m7g.metal 79.81% <100.00%> (-0.01%) ⬇️
6.1-m7i.metal-24xl 83.23% <ø> (+<0.01%) ⬆️
6.1-m7i.metal-48xl 83.23% <ø> (+<0.01%) ⬆️
6.1-m8g.metal-24xl 79.81% <100.00%> (-0.01%) ⬇️
6.1-m8g.metal-48xl 79.81% <100.00%> (+<0.01%) ⬆️
6.1-m8i.metal-48xl 83.23% <ø> (ø)
6.1-m8i.metal-96xl 83.23% <ø> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@deRemo
deRemo self-requested a review May 21, 2026 16:03
@ShadowCurse
ShadowCurse force-pushed the provide_initial_randomness branch from 8948f8a to 46d8347 Compare May 21, 2026 16:37
deRemo
deRemo previously approved these changes May 21, 2026

@Manciukic Manciukic left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

lgtm

Comment thread CHANGELOG.md Outdated
Older aarch64 machines may not have hardware random generators. Because
of this it takes a lot of time for the entropy to built up naturally in
VMs booted on such hosts.

To mitigate this add `rng-seed` FDT node which will contain 64 bytes of
the initial seed guest can use.

Note about x86_64: Since we only support FDT on aarch64, this is aarch64
only solution. On x86_64 the only option we have is to use
`SETUP_RNG_SEED` setup_data section in the Linux boot protocol. The
problem with it is that it only works with Linux boot which is less
preferable than PVH boot (which does not support setup_data and thus
`SETUP_RNG_SEED`). Additionally there is no ACPI support for providing
initial seed as well. The only proper way to do this on x86_64 is to use
EFI, which we don't do right now.

Signed-off-by: Egor Lazarchuk <yegorlz@amazon.co.uk>
Mention addition of new FDT node with initial random seed for the guest.

Signed-off-by: Egor Lazarchuk <yegorlz@amazon.co.uk>
@ShadowCurse
ShadowCurse merged commit 053f521 into firecracker-microvm:main May 22, 2026
7 checks passed
@ShadowCurse
ShadowCurse deleted the provide_initial_randomness branch May 22, 2026 14:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Status: Awaiting review Indicates that a pull request is ready to be reviewed Type: Enhancement Indicates new feature requests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants