-
Notifications
You must be signed in to change notification settings - Fork 13
ot_entropy_src: unify implementations from EarlGrey and Darjeeling
#257
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
ot_entropy_src: unify implementations from EarlGrey and Darjeeling
#257
Conversation
30ea9b6 to
48d5715
Compare
48d5715 to
a44f0ba
Compare
AlexJones0
left a comment
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.
(only looked at the first commit for now because I didn't realise it was still a draft)
I was eagerly waiting for the results from the EG CI before removing the flag :-) |
|
It seems there is one single test failing: |
a44f0ba to
e765107
Compare
|
(rebase after OT_OTP update) |
ot_entropy_src unify implementations from EarlGrey and Darjeelingot_entropy_src: unify implementations from EarlGrey and Darjeeling
e765107 to
4f0d11b
Compare
…ions - remove deprecated Darjeeling version - rename EarlGrey version as unique entropy src implementation - update machine definitions and dependencies Note that EarlGrey-1.0.0 version uses v2 while Darjeeling master uses v3, so execution of Darjeeling machine is broken for now, till the implementation also supports v3 Signed-off-by: Emmanuel Blot <eblot@rivosinc.com>
4f0d11b to
d078d01
Compare
AlexJones0
left a comment
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.
Thanks, this LGTM. The CI failure in newversion_pq_downgrade_test looks unrelated (albeit I'm not sure why it failed, it doesn't look like the normal timing error) as it passes fine when I test locally.
Support either version 2 or 3. Both versions are mostly similar, however a "REV" register has been added in v2 then removed in v3. This register stands at the 8th register slot. This causes most of the register map to shift down on v3 compared to v2. The version upgrade also introduces a couple of bitfield permutations and width changes in other registers. Add a new property to select the version to use. To address the register map shifting, split the register map in 3 segments: * lo: for registers before the REV register, whose base address is the same for both versions * rev: for the register which has been introduced in v2 and removed in v3 * hi: for the registers located after the REV register, whose base address depends on the presence of the REV register, i.e. whether emulutating v2 or v3 Use QEMU sub memory regions to map each register segment to the proper location based on the selected version. The addresses of each segment defined with REG32 macros are made relative to the start location of the matching segment. Traces reporting addresses are updated with the base address of each segment to preserve the "natural" address of each register. In order to avoid many offset computations and degrade code readability, also split the register array to support on array for each segment. Update macros to use the select the proper segment while addressing the register content. To address the register bitfield permutations/widening, as the scope of these changes is limited, simply dispatch handling based on the selected version. Signed-off-by: Emmanuel Blot <eblot@rivosinc.com>
Both EarlGrey and Darjeeling now use the EntropySrc to obtain entropy, whereas previous Darjeeling implementation was collecting entropy from the AST. Rework the EntropySrc class to expose a method to provide entropy to the CSRNG, and update CSRNG to use this "unique" entropy source. Signed-off-by: Emmanuel Blot <eblot@rivosinc.com>
Remove deprecated states, update state magic values Signed-off-by: Emmanuel Blot <eblot@rivosinc.com>
…ct ot_entropy_src calls Signed-off-by: Emmanuel Blot <eblot@rivosinc.com>
…vider Signed-off-by: Emmanuel Blot <eblot@rivosinc.com>
replace the direct ot_ast_eg calls with the new abstract interface Signed-off-by: Emmanuel Blot <eblot@rivosinc.com>
Signed-off-by: Emmanuel Blot <eblot@rivosinc.com>
…tation Signed-off-by: Emmanuel Blot <eblot@rivosinc.com>
Signed-off-by: Emmanuel Blot <eblot@rivosinc.com>
it is no longer useful Signed-off-by: Emmanuel Blot <eblot@rivosinc.com>
- configure entropy src version - replace random src interface with entropy src - replace entropy src noise source Signed-off-by: Emmanuel Blot <eblot@rivosinc.com>
- configure entropy src version - replace random src interface with entropy src - replace entropy src noise source Signed-off-by: Emmanuel Blot <eblot@rivosinc.com>
Move the en_csrng_sw_app_read field to where it belongs: OtOTPHWCfg Signed-off-by: Emmanuel Blot <eblot@rivosinc.com>
…bit booleans Signed-off-by: Emmanuel Blot <eblot@rivosinc.com>
Signed-off-by: Emmanuel Blot <eblot@rivosinc.com>
Signed-off-by: Emmanuel Blot <eblot@rivosinc.com>
…oke test Introduced in 5d9dfd6 Signed-off-by: Emmanuel Blot <eblot@rivosinc.com>
d078d01 to
cf90a32
Compare
Support
ot_entropy_srcv2 and v3, using a property to select the emulated version.Rework & clean up random/noise sources management, now that both tops are using the same entropy stack.