Skip to content

[keymgr_dpe] Replace keymgr in EG - PR4 BootStageOwnerInt / Top dep. parameter#30618

Open
rroth-lowrisc wants to merge 8 commits into
lowRISC:masterfrom
rroth-lowrisc:keymgr_dpe_PR4_rtl_changes
Open

[keymgr_dpe] Replace keymgr in EG - PR4 BootStageOwnerInt / Top dep. parameter#30618
rroth-lowrisc wants to merge 8 commits into
lowRISC:masterfrom
rroth-lowrisc:keymgr_dpe_PR4_rtl_changes

Conversation

@rroth-lowrisc

@rroth-lowrisc rroth-lowrisc commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

PR4 - BootStageOwnerInt / Top dep. parameter

This PR is the fourth in a series which will replace the keymgr with the kemgr_dpe in earlgrey. The replacement was approved by this RFC.

Merge-Dependencies

Relevant Commits

Last two commits

Description

The goal of this PR is twofold:

  • Introduce the third bootstage required for the integration of the keymgr_dpe into earlgrey as approved by the RFC.
  • Make all necessary parameters top dependent which diverge between darjeeling and earlgrey (to avoid templating the IP)

After this PR is approved, both commits should be squashed together into a single commit.

@gautschimi gautschimi 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.

Thanks for this PR. It looks good from my side. Only a few minor comments/questions

Comment thread hw/ip/keymgr_dpe/dv/env/seq_lib/keymgr_dpe_smoke_vseq.sv Outdated
Comment thread hw/ip/keymgr_dpe/dv/env/seq_lib/keymgr_dpe_smoke_vseq.sv Outdated
Comment thread hw/ip/keymgr_dpe/dv/env/keymgr_dpe_if.sv
Comment thread hw/ip/keymgr_dpe/dv/env/keymgr_dpe_scoreboard.sv Outdated
device_id_i,
lc_keymgr_div_i,
rom_digests,
revision_seed});

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.

Is there a reason why the order has changed? (position of revision_seed)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Earlgrey and Darjeeling do not support the same ordering of seed material right now. Because keymgr and keymgr_dpe was developed for the corresponding top each, they reflect the ordering too.

In the future this could be changed so that both tops require the same ordering. However it would not change the RTL significantly as the if ... else ... could not be remove (due to the creator_seed).

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.

ok good, thanks

Comment thread hw/ip/keymgr_dpe/rtl/keymgr_dpe.sv
@rroth-lowrisc
rroth-lowrisc force-pushed the keymgr_dpe_PR4_rtl_changes branch from 4d3ee59 to c887a6a Compare July 15, 2026 15:16
@rroth-lowrisc

Copy link
Copy Markdown
Contributor Author

The last [CI-Blocker] commit is intentional to prevent the CI from running (at least partially) as discussed with @vogelpi . The reason is to avoid unnecessary runtime of the CI.

I will remove the commit as soon as I get review from the DV team.

@rroth-lowrisc
rroth-lowrisc marked this pull request as ready for review July 15, 2026 15:21
@rroth-lowrisc
rroth-lowrisc requested a review from a team as a code owner July 15, 2026 15:21
@rroth-lowrisc
rroth-lowrisc requested review from martin-velay and removed request for a team July 15, 2026 15:21
Split the otp_keymgr_key interface into its respective components.
Future version of the keymgr(_dpe) may receive the information from
different IP's rather than combined from the otp_ctrl.

To avoid a circular dependencies the DevIdWidth instantiated
in keymgr_dpe_pkg replaces the otp_ctrl_pkg::DeviceIdWidth.

As the keymgr still expects the combined message the earlgrey top
manually combines the key material. This fix will be removed when
the keymgr is replaced by the keymgr_dpe.

Signed-off-by: Raphael Roth <rroth@lowrisc.org>
This commit updates the `otp_ctrl` dv to reflect the new interface between
the `keymgr` and the `otp_ctrl`. The secret / seed verification inside the
otp_ctrl scoreboard template are no longer dynamically generated. The reason
is that the previously shared port signal has been split into its respective
components, which does not interacts well with the dynamic generation anymore.

However, adding a secret to the otp now results in a port-list change anyways the
resulting overhead is deemed acceptable.

Signed-off-by: Raphael Roth <rroth@lowrisc.org>
This commit removes all otp_ctrl dependency in the keymgr_dpe dv.
This change ensures that the dv architecture accurately reflects
the dependency in the RTL implementation.

Signed-off-by: Raphael Roth <rroth@lowrisc.org>
This commit improves the block level dv by:
- Introducing more verbose messages
- Latching the correct DEFAULT_UDS_POLICY
- Prevent ambiguous state after the disable operation
  by restricting any advance call

Signed-off-by: Raphael Roth <rroth@lowrisc.org>
The scoreboard loads the UDS directly from the DUT via interface.
The problem is the `keymgr_dpe` initializes the slot for the UDS
with randomness. The initaly loaded UDS is xored with the randomness
already present in the destination slot as countermeasure for SCA.
The scoreboard however can currently not recreate this randomness
thus the backdoor load.

Signed-off-by: Raphael Roth <rroth@lowrisc.org>
@rroth-lowrisc
rroth-lowrisc force-pushed the keymgr_dpe_PR4_rtl_changes branch from c887a6a to 40b5aa8 Compare July 20, 2026 08:57
Introduction of the third bootstage defined in the opentitan identities-and-root-keys
(https://opentitan.org/book/doc/security/specs/identities_and_root_keys/index.html)
strategy. The `creator_seed` is now consumed by BootStageOwnerInt rather
than by BootStageCreator.

Signed-off-by: Raphael Roth <rroth@lowrisc.org>
This commit allows for a limited parametrization by the top without
having a fully templated IP. The top can define the following:

- Number of bootstages (either two or three)
- Number of ROM digest values
- Number of HW slots instanciated (up to 8 slots)

The block level dv is extended to test two different configurations,
called earlgrey and darjeeling.

Signed-off-by: Raphael Roth <rroth@lowrisc.org>
@rroth-lowrisc
rroth-lowrisc force-pushed the keymgr_dpe_PR4_rtl_changes branch from 40b5aa8 to 267b186 Compare July 20, 2026 14:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants