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

[rom_ext] Remove dbg print in imm_section #26532

Open
wants to merge 1 commit into
base: earlgrey_1.0.0
Choose a base branch
from

Conversation

sasdf
Copy link
Contributor

@sasdf sasdf commented Mar 6, 2025

Prints are removed due to:

  • Pen Testing
  • Boot timing
  • Code size

@@ -257,6 +257,14 @@ cc_test(
],
)

cc_library(
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do you need a lib to disable dbg_prints in the immutable section? I think you should just remove all calls to dbg_printf().

@cfrantz what would you prefer here?

Copy link
Contributor

Choose a reason for hiding this comment

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

I'd prefer removing the dbg_{printf,puts} completely from the code that lands in the immutable section.

If there are some dbg prints that are getting linked in unexpectedly, lets have a discussion about them.

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 have removed all the instances.

That includes two messages from common libraries, which means they’re also removed from the mutable section.

  • otbn_boot_service - Warning: Attestation key seed flash info page not provisioned.
  • dice_chain - info: flushed dice cert page

Prints are removed due to:
* Pen Testing
* Boot timing
* Code size

Change-Id: Icce141e2bb4a2658ee5ef6e061c6a54346cc8d7d
Signed-off-by: Yi-Hsuan Deng <[email protected]>
@@ -328,7 +328,6 @@ rom_error_t dice_chain_attestation_creator(
// Check if the current CDI_0 cert is valid.
RETURN_IF_ERROR(dice_chain_load_cert_obj("CDI_0", /*name_size=*/6));
if (dice_chain.cert_valid == kHardenedBoolFalse) {
dbg_puts("warning: CDI_0 certificate not valid; updating\r\n");
Copy link
Contributor

Choose a reason for hiding this comment

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

We still want to have the mutable portion of the ROM_EXT print if certs were updated. We have tests that depend on these (e.g., https://cs.opensource.google/opentitan/opentitan/+/earlgrey_1.0.0:sw/device/silicon_creator/rom_ext/e2e/dice_chain/BUILD;l=38)

@cfrantz and I spoke, we would like to have a block of dbg_printf's here (https://cs.opensource.google/opentitan/opentitan/+/earlgrey_1.0.0:sw/device/silicon_creator/rom_ext/rom_ext.c;l=428) that prints the following:

  1. if UDS was invalid
  2. if CDI_0 was updated
  3. if CDI_1 was updated

Would this be possible? I.e., could you save the state of which certs are valid in the static_dice section maybe? and then just have a block of prints after the certs are flushed to flash?

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.

3 participants