-
Notifications
You must be signed in to change notification settings - Fork 187
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
Lib lpc55 rng seed #1820
Open
flihp
wants to merge
16
commits into
oxidecomputer:master
Choose a base branch
from
flihp:lib-lpc55-rng-seed
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Lib lpc55 rng seed #1820
Changes from 9 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
5a6ce9e
lpc55-rng: Move Lpc55Core and Lpc55Rng to a library.
flihp 6551ef3
lpc55-rng: Combine Lpc55Core and Lpc55Rng.
flihp 6427006
lpc55-rng: cleanup some nonsense
flihp dd1dbc0
lpc55-rng: Streamline the `fill` loop & increase the read buffer size.
flihp f76e271
lpc55-rng: Make ReseedingRng generic over the reseeder.
flihp c16168f
lpc55-rng: Include 32 bytes from the last PRNG instance when reseeding.
flihp 67828cf
lpc55-rng: Include DICE derived seed in initial PRNG seed.
flihp 0c8a4be
lpc55-rng: Include SN from platform id cert in initial PRNG seed.
flihp 6036d0e
oxide-rot-1: Add rng task to app-dev.toml.
flihp bce3889
Pass lpc55 PMC & RNG devices as parameters to Lpc55Rng 'new'.
flihp c29dffa
Panic if RNG is powered off after Lpc55Rng instantiation.
flihp cf2704f
Make safety comment on code loading data from handoff region true.
flihp bf092d3
Undo increased stack usage from cf2704fae6.
flihp 11f962a
Create inputs to `Lpc55Rng::new` in dedicated scope.
flihp de27347
Restructure the construction of the server.
flihp b43295c
Use `mutable-static` to create hash instance.
flihp File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
// This Source Code Form is subject to the terms of the Mozilla Public | ||
// License, v. 2.0. If a copy of the MPL was not distributed with this | ||
// file, You can obtain one at https://mozilla.org/MPL/2.0/. | ||
|
||
#[derive(serde::Deserialize, Default, Debug)] | ||
#[serde(rename_all = "kebab-case")] | ||
#[cfg(feature = "dice-seed")] | ||
pub struct DataRegion { | ||
pub address: usize, | ||
pub size: usize, | ||
} |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So I think this'd make it the highest stack usage in the system, above control-plane-agent. Do we have a sense for what caused this? (Asking because I've been winding up playing stack size whack-a-mole lately.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Having read more of the code, I can answer this question at least partially: the
Server
type used in the RNG server is large, and it's being created on the stack and passed around.It's large primarily due to the
Sha3
embedded within it, which I recently noticed in an unrelated case was about 2 kiB.The easiest way to fix this would be to allocate a static Sha3 instance using
ClaimOnceCell
(fromlib/static-cell
) and then pass it into the server constructor to take ownership of (via a&'static mut
).There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Had to use
mutable-statics
becauseSha3
doesn't have a const constructor (per discussion in chat): b43295c