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

[otp_ctrl] Increase Hamming distance in OTP commands #21953

Merged
merged 1 commit into from
Mar 12, 2024

Conversation

msfschaffner
Copy link
Contributor

This a security patch for closing out D2S for OTP_CTRL.

Fixes #21948

@msfschaffner
Copy link
Contributor Author

msfschaffner commented Mar 11, 2024

@arnonsha @meisnere @sha-ron FYI

This is a security patch that touches the primitive wrapper interface.
We will have to update the encoding in the closed source wrapper once you ingest a newer M2 release candidate than RC0.

parameter int ErrWidth = 3;

// Encoding generated with:
// $ ./util/design/sparse-fsm-encode.py -d 3 -m 5 -n 6 \
Copy link
Contributor

Choose a reason for hiding this comment

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

I thought we typically aimed for higher hamming distances?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

For FSM encodings, yes, we would typically do 4 or 5, but at least 3.
I am not sure this is really required in this setting for the command.
We can do 4, but the command needs to be 7bit wide then for this to work.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I increased the HD to 4

@msfschaffner msfschaffner force-pushed the otp-ctrl-cmd-fix branch 2 times, most recently from a050424 to cd59108 Compare March 11, 2024 19:31
Copy link
Contributor

@andreaskurth andreaskurth left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

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.

LGTM, thanks @msfschaffner !

In case you need to push once more, there is also a comment in hw/ip/prim_generic/rtl/prim_generic_otp.sv mentioning the now outdated 3-bit commands.

For refernce, commit dc9da97 added the raw commands ignoring the integrity.

@msfschaffner
Copy link
Contributor Author

In case you need to push once more, there is also a comment in hw/ip/prim_generic/rtl/prim_generic_otp.sv mentioning the now outdated 3-bit commands.

I patched that up, thanks!

@msfschaffner msfschaffner merged commit 185e4e9 into lowRISC:master Mar 12, 2024
32 checks passed
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.

[otp_ctrl] Use sparse encoding for cmd_e in prim_otp_pkg.sv
4 participants