Skip to content

caliptra_ss_fuse_ctrl_integrity_check fix#727

Closed
antmarzam wants to merge 5 commits intomainfrom
lowrisc_tlt_regression_fixes
Closed

caliptra_ss_fuse_ctrl_integrity_check fix#727
antmarzam wants to merge 5 commits intomainfrom
lowrisc_tlt_regression_fixes

Conversation

@antmarzam
Copy link
Collaborator

Expected mask in wait_dai_op_idle now masks all partition errors.

The error mask within wait_dai_op_idle now masks only partition errors and nothing else.


wait_dai_op_idle(0x3FFFF);
// Masking all partition errors - since they should all be sert after forcing a different digest
wait_dai_op_idle(0x7FFFFF);
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: Is there an autogenerated constant that can be used to dynamically calculate this mask?

Copy link
Contributor

Choose a reason for hiding this comment

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

Integrators will have the ability to re-generate the memory map. We will ask them to re-run the caliptra-ss test suite to make sure there are no issues. This is the reason we should aim to make the test cases resilient to memory map changes.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Makes sense - thanks.
We've already added the autogenerated constant to fuse_ctrl.c, so the same should be applied here.

Copy link
Contributor

Choose a reason for hiding this comment

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

@antmarzam , I think you've now replaced the literal here with the constant right? If yes, this should be flagged to re-trigger a review. Can you please clarify?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes - hardcoded values have been swapped with autogen constant.
I just re-trigger a review!

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks @antmarzam , also for triggering the pipeline as requested by Emre.

@antmarzam antmarzam force-pushed the lowrisc_tlt_regression_fixes branch from 6d049d8 to cbb8ca9 Compare September 16, 2025 16:29
martin-velay
martin-velay previously approved these changes Sep 17, 2025
Copy link
Collaborator

@martin-velay martin-velay 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 Antonio for fixing the issues

CMD_FC_LCC_UNCORRECTABLE_FAULT
};

const uint32_t partition_lower_addr_bound = 0x40;
Copy link
Collaborator

Choose a reason for hiding this comment

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

assign UDS base addr

Copy link
Contributor

Choose a reason for hiding this comment

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

@ekarabu , would you mind pointing us to where these auto-generated base addresses live in C-land please? The team knows where to find the values in the RTL sources but not on the C side. Can it be that these header files are auto-generated at compile time and then only live in the build folder? I've seen this in other projects as well. I I understand why it may be done this way but it makes it a bit harder to find out the names of the constants in C land.

Copy link
Collaborator

@ekarabu ekarabu Sep 18, 2025

Choose a reason for hiding this comment

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

please check *mmap.h file

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thanks @ekarabu I believe I'm using now the correct autogen constant - please let me know if you're happy with it

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks @ekarabu for the pointer, it's appreciated.

};

const uint32_t partition_lower_addr_bound = 0x40;
const uint32_t partition_upper_addr_bound = 0xF0;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Assign FE3's Zeroization base address

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I've replaced the harcoded constant for the autogen value:

const uint32_t partition_lower_addr_bound = partitions[SECRET_MANUF_PARTITION].address;
const uint32_t partition_upper_addr_bound = partitions[SECRET_PROD_PARTITION_3].zer_address;

@ekarabu
Copy link
Collaborator

ekarabu commented Sep 18, 2025

Please ensure your branch is up-to-date and run a promote-pipeline to qualify your PR to be merged!

@antmarzam antmarzam force-pushed the lowrisc_tlt_regression_fixes branch from 412dc6b to 478e8f6 Compare September 19, 2025 08:00
@antmarzam antmarzam force-pushed the lowrisc_tlt_regression_fixes branch from 478e8f6 to 0a8046f Compare September 19, 2025 08:15
@antmarzam
Copy link
Collaborator Author

Please ensure your branch is up-to-date and run a promote-pipeline to qualify your PR to be merged!

Thanks Emre - I rebased with the latest main and just started a promote pipeline

reset_fc_lcc_rtl();
wait_dai_op_idle(
fault == CMD_FC_LCC_CORRECTABLE_FAULT ? 1 << partition.index : 0x3FFFF
fault == CMD_FC_LCC_CORRECTABLE_FAULT ? 1 << partition.index : OTP_CTRL_STATUS_LIFE_CYCLE_ERROR_MASK - 1 //0x3FFFFFF
Copy link
Contributor

Choose a reason for hiding this comment

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

@antmarzam: I think you probably want to drop the commented constant from this line? I'd also either get rid of the newline after the ( or put the indentation back to what it was.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good spot - thanks

rswarbrick pushed a commit to rswarbrick/caliptra-ss that referenced this pull request Sep 19, 2025
Fix to the address bounds in the partition and to the expected error sent to
`wait_dai_op_idle()`

This came from the head of PR chipsalliance#727.
@rswarbrick
Copy link
Contributor

Hi @antmarzam! As well as the tidy-up I'm suggesting above, do you think you could pull the commits of mine from #740? These all seem related, and maybe this would be a way to land the change atomically.

@rswarbrick
Copy link
Contributor

Boo. Looks like this just failed CI. The results that caused it to fail:

  -smoke_test_fc_key_revocation.yml ...degraded
  -smoke_test_fc_ocp_lock_zeroization.yml ...degraded
  -smoke_test_fc_pk_volatile_lock.yml ...degraded
  -smoke_test_fc_prov_lcc_tokens.yml ...degraded
  -smoke_test_fc_registers.yml ...degraded
  -smoke_test_lcc_registers.yml ...degraded
  -smoke_test_lcc_scrap.yml ...degraded
  -smoke_test_mbox0_csr_zeros_after_release.yml ...degraded
  -smoke_test_mci_axi_miss.yml ...degraded
  -smoke_test_mci_brkpoint_axi.yml ...degraded
  -smoke_test_mci_soc_config_always_enable.yml ...degraded
  -smoke_test_mci_soc_config_diff_mcu.yml ...degraded
  -smoke_test_mci_soc_config_disable.yml ...degraded
  -smoke_test_mcu_mbox0.yml ...degraded
  -smoke_test_mcu_mbox0_csrs_warm_rst.yml ...degraded
  -smoke_test_mcu_mbox0_ecc.yml ...degraded
  -smoke_test_mcu_mbox0_invalid_axi.yml ...degraded
  -smoke_test_mcu_mbox0_strb_wr_csr.yml ...degraded
  -smoke_test_mcu_mbox0_write_user_lock.yml ...degraded
  -smoke_test_mcu_mbox0_zeroize.yml ...degraded
  -smoke_test_mcu_no_rom_config.yml ...degraded
  -smoke_test_mcu_no_rom_config_brkpoint.yml ...degraded
  -smoke_test_mcu_sram_byte_write.yml ...degraded
  -smoke_test_mcu_sram_ecc_db.yml ...degraded
  -smoke_test_mcu_sram_ecc_sb.yml ...degraded
  -smoke_test_mcu_sram_execution_region.yml ...degraded
  -smoke_test_mcu_sram_execution_region_max_size.yml ...degraded
  -smoke_test_mcu_sram_execution_region_random_sram_config_axi_user.yml ...degraded
  -smoke_test_mcu_sram_protected_region.yml ...degraded
  -smoke_test_mcu_trace_buffer.yml ...degraded
  -smoke_test_mcu_trace_buffer_63.yml ...degraded
  -smoke_test_mcu_trace_buffer_64.yml ...degraded
  -smoke_test_mcu_trace_buffer_no_debug.yml ...degraded
  -smoke_test_mcu_trace_buffer_random.yml ...degraded
  -smoke_test_mcu_trace_buffer_single.yml ...degraded
  -smoke_test_wdt.yml ...degraded

I'll take a look at this now.

@rswarbrick
Copy link
Contributor

Well that's embarrassing: it's a build failure. Tidying it up now.

@andreaskurth
Copy link
Contributor

@rswarbrick, could you please add the test added in PR #685 to the L1 regression set, in this PR?

@rswarbrick
Copy link
Contributor

@andreaskurth: Sadly not because I still can't push to cailptra-ss. It's extremely frustrating. What's worse, I'm deep in a maze of irritating linker problems (because fuse_ctrl_mmap.h defines symbols, which means you can't currently include it in more than one compilation object).

@ekarabu: I suggest you grab #685 (that Andreas pointed to) and I will have this PR working by tomorrow. Grump, grump, grump!

@rswarbrick
Copy link
Contributor

Ok, I've finally got everything working (this was rather hard!)

There's a working version of this PR at https://github.com/rswarbrick/caliptra-ss/tree/new-727. If someone would like to force-push that to this PR, that would be brilliant. If not, I hope that I'll be a member of chipsalliance at last by tomorrow.

@rswarbrick rswarbrick force-pushed the lowrisc_tlt_regression_fixes branch from e3cf8f7 to 7438b43 Compare September 24, 2025 08:58
rswarbrick and others added 5 commits September 24, 2025 11:48
This avoids fuse_ctrl_mmap.h defining something that actually gets
instantiated (and defines a symbol). Without fixing that, if more than
one compilation unit includes the header then link will fail because
more than one object file defines "partitions" and various fuse index
arrays.
Expected mask in `wait_dai_op_idle` now masks all partition errors.

The error mask within `wait_dai_op_idle` now masks only partition errors and
nothing else.
Fix to the address bounds in the partition and to the expected error sent to
`wait_dai_op_idle()`
No functional change (but hopefully it makes things a bit clearer: I
found these ranges a bit hard to reason about).
The value in caliptra_ss_fuse_ctrl_manuf_prod_prov hadn't yet been
updated for the change in 275521b. This change should make it so
that test and also caliptra_ss_fuse_ctrl_init_fail get a magic number
from a single (documented) place.

Apply the same change to caliptra_ss_fuse_ctrl_test_unlocked0_prov.
@rswarbrick rswarbrick force-pushed the lowrisc_tlt_regression_fixes branch from 7438b43 to 42c81b8 Compare September 24, 2025 12:15
@rswarbrick
Copy link
Contributor

I've been looking at this more carefully and I'm rather unconvinced by the two "fix" commits in this series. I will open an orthogonal PR with the other changes (which I think are easier to be certain about).

@rswarbrick
Copy link
Contributor

I think the changes we need have been implemented in other PRs, so I'm going to close this one now.

@rswarbrick rswarbrick closed this Sep 30, 2025
@rswarbrick rswarbrick deleted the lowrisc_tlt_regression_fixes branch October 15, 2025 16:31
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.

8 participants