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

[edn] Investigate why there are many EDN requests after ROM_EXT #22819

Closed
pamaury opened this issue Apr 25, 2024 · 3 comments
Closed

[edn] Investigate why there are many EDN requests after ROM_EXT #22819

pamaury opened this issue Apr 25, 2024 · 3 comments
Assignees
Labels
Component:RTL SW:ROM_EXT ROM_EXT related issues

Comments

@pamaury
Copy link
Contributor

pamaury commented Apr 25, 2024

Description

When working on the edn_kat test, I have identified a strange behaviour that only seems to happen when running the ROM_EXT: there seems to be too many requests going through the EDN. Specifically, we stop the entropy complex, setup the EDN in auto mode and start gathering 10 words of entropy thought the Ibex. By the time the Ibex has gotten 10 words, CSRNG reports that it got 150 requests through EDN0 (each generate commands generates 16 words).

Investigate why this number is so high.

Ping @vogelpi @h-filali

@andreaskurth
Copy link
Contributor

By @vogelpi: Could be that a configuration in ROM_EXT triggers this. Maybe KMAC?

By @moidx: I'll take a look and add my findings here.

@vogelpi
Copy link
Contributor

vogelpi commented Apr 29, 2024

Together with @pamaury, I've been able to track down the issue: keymgr has an internal, SW-configurable timer to automatically reseed it's local PRNG. The current ROM_EXT implementation doesn't alter the default value of 0x100, meaning keymgr is constantly reseeding it's internal PRNG every 256 clock cycles.

What's really problematic about this is that the counter doesn't currently factor in whether the PRNG is actually advanced or not. This is problematic as it leads to several issues:

For now, ROM_EXT should probably be changed to configure the max reseeding interval of 65536 clock cycles. This will still request a reseed operation every 655us which is not going to be sufficient, but it might already help against some of the issues we have seen on different fronts. FYI @moidx @timothytrippel

I am filing another issue start discussing design changes for keymgr, because we really should change this and there are easy changes we can do.

@pamaury pamaury changed the title [edn] Investigate why there are many requests after ROM_EXT [edn] Investigate why there are many EDN requests after ROM_EXT Apr 30, 2024
@vogelpi
Copy link
Contributor

vogelpi commented May 6, 2024

Update: the following changes have been made to alleviate/fix the underlying issue:

I am thus closing this issue now.

@vogelpi vogelpi closed this as completed May 6, 2024
vogelpi added a commit to vogelpi/opentitan that referenced this issue May 9, 2024
These tests are all working in ROM_EXT on master and earlgrey_es_sival
now that we've fixed the underlying keymgr issue. For details, see

lowRISC#22819 (comment)

This is related to lowRISC#21706 and lowRISC#22140.

Signed-off-by: Pirmin Vogel <[email protected]>
vogelpi added a commit to vogelpi/opentitan that referenced this issue May 9, 2024
These tests are all working in ROM_EXT on master and earlgrey_es_sival
now that we've fixed the underlying keymgr issue. For details, see

lowRISC#22819 (comment)

This is related to lowRISC#21706 and lowRISC#22140.

Signed-off-by: Pirmin Vogel <[email protected]>
vogelpi added a commit that referenced this issue May 10, 2024
These tests are all working in ROM_EXT on master and earlgrey_es_sival
now that we've fixed the underlying keymgr issue. For details, see

#22819 (comment)

This is related to #21706 and #22140.

Signed-off-by: Pirmin Vogel <[email protected]>
vogelpi added a commit to vogelpi/opentitan that referenced this issue May 10, 2024
These tests are all working in ROM_EXT on master and earlgrey_es_sival
now that we've fixed the underlying keymgr issue. For details, see

lowRISC#22819 (comment)

This is related to lowRISC#21706 and lowRISC#22140.

Signed-off-by: Pirmin Vogel <[email protected]>
vogelpi added a commit to vogelpi/opentitan that referenced this issue May 10, 2024
These tests are all working in ROM_EXT on master and earlgrey_es_sival
now that we've fixed the underlying keymgr issue. For details, see

lowRISC#22819 (comment)

This is related to lowRISC#21706 and lowRISC#22140.

Signed-off-by: Pirmin Vogel <[email protected]>
vogelpi added a commit to vogelpi/opentitan that referenced this issue May 10, 2024
These tests are all working in ROM_EXT on master and earlgrey_es_sival
now that we've fixed the underlying keymgr issue. For details, see

lowRISC#22819 (comment)

This is related to lowRISC#21706 and lowRISC#22140.

Signed-off-by: Pirmin Vogel <[email protected]>
vogelpi added a commit that referenced this issue May 13, 2024
These tests are all working in ROM_EXT on master and earlgrey_es_sival
now that we've fixed the underlying keymgr issue. For details, see

#22819 (comment)

This is related to #21706 and #22140.

Signed-off-by: Pirmin Vogel <[email protected]>
AlexJones0 pushed a commit to AlexJones0/opentitan that referenced this issue Jul 8, 2024
These tests are all working in ROM_EXT on master and earlgrey_es_sival
now that we've fixed the underlying keymgr issue. For details, see

lowRISC#22819 (comment)

This is related to lowRISC#21706 and lowRISC#22140.

Signed-off-by: Pirmin Vogel <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component:RTL SW:ROM_EXT ROM_EXT related issues
Projects
None yet
Development

No branches or pull requests

3 participants