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

[lc_ctrl/top_earlgrey] Disable RAW unlock feature and additional DV checks #21320

Closed

Conversation

msfschaffner
Copy link
Contributor

@msfschaffner msfschaffner commented Feb 13, 2024

This disables the volatile unlock feature in top_earlgrey for the production stepping and enhances the block-level DV environment to test both lc_ctrl variants. The PR also parameterizes the corresponding top-level test so that the expectation whether the mechanism is supported or not can be indicated via a plusarg.

This fixes part of #18250.

This addresses the design side of lowRISC#18250

Signed-off-by: Michael Schaffner <[email protected]>
@msfschaffner msfschaffner force-pushed the lc-ctrl-volatile-unlock branch 6 times, most recently from 5761280 to bb144fe Compare February 13, 2024 23:47
@msfschaffner msfschaffner self-assigned this Feb 14, 2024
@msfschaffner msfschaffner force-pushed the lc-ctrl-volatile-unlock branch 2 times, most recently from b544a9f to 3508d05 Compare February 14, 2024 00:05
This addresses the block-level DV parts of lowRISC#18250.

Signed-off-by: Michael Schaffner <[email protected]>
When we are in RMA or PROD_END state, we can't inject a transition
error since the only valid transition is into SCRAP (and that transition
is always allowed, no matter the transition counter).

While we make sure to not initialize the DUT with RMA or PROD_END if we
intend to inject such an error, it can happen that we end up in one of
these states when running multiple transactions back-to-back. In those
cases we need to catch the corner case and make sure we skip the
life cycle transition attempt.

Signed-off-by: Michael Schaffner <[email protected]>
Some CSR accesses via JTAG take a long time, hence the timeout
in wait_to_issue_reset() needs to be higher so that the function
does not error out unexpectedly.

Signed-off-by: Michael Schaffner <[email protected]>
@msfschaffner msfschaffner force-pushed the lc-ctrl-volatile-unlock branch from 3508d05 to 06055dc Compare February 14, 2024 00:07
cfg.set_test_phase(LcCtrlBadNextState);
// wait at least two clks for scb to finish checking lc outputs
cfg.clk_rst_vif.wait_clks($urandom_range(10, 2));
end
Copy link
Contributor Author

@msfschaffner msfschaffner Feb 14, 2024

Choose a reason for hiding this comment

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

This looks like a big change, but what it really does is move this else leg towards the end of the test, so that either we perform a transition and do all the checking, or we skip the transition and go straight to the LcCtrlBadNextState phase.

@msfschaffner msfschaffner requested a review from a-will February 14, 2024 00:17
// In RAW state the ROM should halt as RomExecEn is not set yet.
`DV_WAIT(cfg.sw_test_status_vif.sw_test_status == SwTestStatusInBootRomHalt)
// If we're expecting the feature to be enabled, the device should boot.
if (exp_volatile_raw_unlock_en) begin
Copy link
Contributor Author

Choose a reason for hiding this comment

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

no change below, just made the rest of the test conditional on exp_volatile_raw_unlock_en

@msfschaffner msfschaffner marked this pull request as ready for review February 14, 2024 00:19
@msfschaffner msfschaffner requested a review from a team as a code owner February 14, 2024 00:19
@msfschaffner msfschaffner requested review from rswarbrick and jdonjdon and removed request for a team February 14, 2024 00:19
@msfschaffner msfschaffner force-pushed the lc-ctrl-volatile-unlock branch 2 times, most recently from 7575851 to 2590c33 Compare February 14, 2024 00:38
@msfschaffner msfschaffner force-pushed the lc-ctrl-volatile-unlock branch 3 times, most recently from c47ddbe to 8087405 Compare February 14, 2024 01:23
Besides being able to test the volatile RAW unlock mechanism,
we should also be able to test whether the case where that
mechanism has been disabled in HW.

This patch adds a plusarg that allows to parameterize the test with our
expectation.

In production silicon this mechanism should be disabled, for example.

Signed-off-by: Michael Schaffner <[email protected]>
@msfschaffner msfschaffner force-pushed the lc-ctrl-volatile-unlock branch from 8087405 to 9c78061 Compare February 14, 2024 01:36
@msfschaffner msfschaffner requested a review from a team as a code owner February 14, 2024 23:54
@msfschaffner msfschaffner requested review from HU90m and removed request for a team February 14, 2024 23:54
@@ -478,6 +478,9 @@ impl CommandDispatch for VolatileRawUnlock {
/*use_external_clk=*/ true,
/*post_transition_tap=*/ JtagTap::LcTap,
&self.jtag_params,
// whether we expect the RAW unlock feature to be present or not.
// on prod silicon this should be disabled.
false,
Copy link
Contributor Author

@msfschaffner msfschaffner Feb 14, 2024

Choose a reason for hiding this comment

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

@timothytrippel can you take a look at this here?
we do not expect this to work on production silicon, and we need to test this because if it were supported, that would be a bad loophole.

We may want to feed in some global target configuration at some point so that this remains compatible with multiple top-levels/targets.

Copy link
Contributor

Choose a reason for hiding this comment

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

yep this looks good to keep the testing path open. Thanks @msfschaffner !

@msfschaffner msfschaffner force-pushed the lc-ctrl-volatile-unlock branch from 893b593 to 639a1a0 Compare February 14, 2024 23:58
@@ -478,6 +478,9 @@ impl CommandDispatch for VolatileRawUnlock {
/*use_external_clk=*/ true,
/*post_transition_tap=*/ JtagTap::LcTap,
&self.jtag_params,
// whether we expect the RAW unlock feature to be present or not.
// on prod silicon this should be disabled.
false,
Copy link
Contributor

Choose a reason for hiding this comment

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

yep this looks good to keep the testing path open. Thanks @msfschaffner !

@msfschaffner msfschaffner force-pushed the lc-ctrl-volatile-unlock branch 3 times, most recently from ef0ef2f to f8101a1 Compare February 15, 2024 07:02
This updates the manuf_cp_volatile_unlock_raw test so that
we can indicate whether we expect the target to support volatile RAW
unlock or not.

Signed-off-by: Michael Schaffner <[email protected]>
@msfschaffner msfschaffner force-pushed the lc-ctrl-volatile-unlock branch from f8101a1 to db8f9b8 Compare February 15, 2024 17:23
Copy link
Contributor

@vogelpi vogelpi left a comment

Choose a reason for hiding this comment

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

Thanks for the PR and thanks for splitting it up into individual, clearly separated commits. This LGTM.

After inspecting fda744c (the commit which introduced the RAW unlock feature) I am convinced that disabling done here is done in a robust / secure way. It looks so simple because it changes just a single parameter :-)

@msfschaffner
Copy link
Contributor Author

Thanks for the reviews. Due to increased CI latency, I will close this PR in favor of #21372 which adds just one commit to this chain that makes the life cycle key manager diversification constants unique per life cycle state.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants