Skip to content

Conversation

AlexJones0
Copy link

On program/erase operations, mark the corresponding part of the MemoryRegion as dirty so that the TCG knows to invalidate any existing TLB pages when performing execution-in-place from flash.

The TLB should be flushed on changes to the EPMP CSRs, meaning that this only really impacts the case where you execute some code (causing it to be cached in the TLB), then write over that code, and then execute the new code from the same location. This kind of self-modifying code could be possible in owner code which performs relevant firmware updates without resetting, for example.

On program/erase operations, mark the corresponding part of the
MemoryRegion as dirty so that the TCG knows to invalidate any existing
TLB pages when performing XIP execution from flash.

The TLB should be flushed on changes to the EPMP CSRs, meaning that this
only really impacts the case where you execute some code (causing it to
be cached in the TLB), then write over that code, and then execute the
new code from the same location. This kind of self-modifying code could
be possible in owner code which performs relevant firmware updates
without resetting, for example.

Also fix a frequent misuse of an unsigned int constant in memsets.

Signed-off-by: Alex Jones <[email protected]>
Copy link

@rivos-eblot rivos-eblot left a comment

Choose a reason for hiding this comment

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

LGTM. Sorry, I had not seen that a new review was requested.

@AlexJones0
Copy link
Author

Sorry, I had not seen that a new review was requested.

No worries, this was not urgent for me, just a small fix that I noticed while going through the code :)

@AlexJones0 AlexJones0 merged commit c24e1cc into lowRISC:ot-9.2.0 Oct 21, 2025
9 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.

3 participants