-
Notifications
You must be signed in to change notification settings - Fork 10
Update QEMU implementation #157
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
Merged
loiclefort
merged 175 commits into
lowRISC:ot-earlgrey-9.2.0
from
loiclefort:dev/loic/resync_on_dj
Jul 22, 2025
Merged
Update QEMU implementation #157
loiclefort
merged 175 commits into
lowRISC:ot-earlgrey-9.2.0
from
loiclefort:dev/loic/resync_on_dj
Jul 22, 2025
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
loiclefort
commented
Jul 22, 2025
- Add initial support for dynamic clock management (clocks can be modified at runtime rather than build time). Clock tree follows OpenTitan HW: AST --> Clock Manager --> Devices. Clock gating/hinting is not yet supported
- Improve LC controller implementation
- Add code execution disablement
- Darjeeling KeyManager DPE with AES/KMAC/OTBN sideloading
- Bug fixing
…ettable API Signed-off-by: Emmanuel Blot <[email protected]>
Use the PMP implementation from v9.2.0 Signed-off-by: Rob Bradford <[email protected]>
When running in TOR mode (Top of Range) the next PMP entry controls whether the entry is locked. However simply checking if the PMP_LOCK bit is set is not sufficient with the Smepmp extension which now provides a bit (mseccfg.RLB (Rule Lock Bypass)) to disregard the lock bits. In order to respect this bit use the convenience pmp_is_locked() function rather than directly checking PMP_LOCK since this function checks mseccfg.RLB. Signed-off-by: Rob Bradford <[email protected]>
When Smepmp is supported, mseccfg.RLB allows bypassing locks when writing CSRs but should not affect interpretation of actual PMP rules. This is not the case with the current implementation where pmp_hart_has_privs calls pmp_is_locked which implements mseccfg.RLB bypass. This commit implements the correct behavior by removing mseccfg.RLB bypass from pmp_is_locked. RLB bypass when writing CSRs is implemented by adding a new pmp_is_readonly function that calls pmp_is_locked and check mseccfg.RLB. pmp_write_cfg and pmpaddr_csr_write are changed to use this new function. Signed-off-by: Loïc Lefort <[email protected]> Reviewed-by: Alistair Francis <[email protected]> Reviewed-by: Daniel Henrique Barboza <[email protected]> Reviewed-by: LIU Zhiwei <[email protected]> Message-ID: <[email protected]>
…function Signed-off-by: Loïc Lefort <[email protected]> Reviewed-by: Daniel Henrique Barboza <[email protected]> Reviewed-by: Alistair Francis <[email protected]> Reviewed-by: LIU Zhiwei <[email protected]> Message-ID: <[email protected]>
… MML mode With Machine Mode Lockdown (mseccfg.MML) set and RLB not set, checks on pmpcfg writes would match the wrong cases of Smepmp truth table. The existing code allows writes for the following cases: - L=1, X=0: cases 8, 10, 12, 14 - L=0, RWX!=WX: cases 0-2, 4-6 This leaves cases 3, 7, 9, 11, 13, 15 for which writes are ignored. From the Smepmp specification: "Adding a rule with executable privileges that either is M-mode-only or a locked Shared-Region is not possible (...)" This description matches cases 9-11, 13 of the truth table. This commit implements an explicit check for these cases by using pmp_get_epmp_operation to convert between PMP configuration and Smepmp truth table cases. Signed-off-by: Loïc Lefort <[email protected]> Reviewed-by: Daniel Henrique Barboza <[email protected]> Reviewed-by: LIU Zhiwei <[email protected]> Message-ID: <[email protected]>
…hanged Signed-off-by: Loïc Lefort <[email protected]> Reviewed-by: Daniel Henrique Barboza <[email protected]> Reviewed-by: Alistair Francis <[email protected]> Reviewed-by: LIU Zhiwei <[email protected]> Message-ID: <[email protected]>
Remove useless check in pmp_is_locked, the function will return 0 in either case. Signed-off-by: Loïc Lefort <[email protected]> Reviewed-by: Daniel Henrique Barboza <[email protected]> Reviewed-by: Alistair Francis <[email protected]> Reviewed-by: LIU Zhiwei <[email protected]> Message-ID: <[email protected]>
- re-organize code to follow the common function order for all OT devices - prepare for clock management upgrade Signed-off-by: Emmanuel Blot <[email protected]>
…ions Signed-off-by: Emmanuel Blot <[email protected]>
…tions Signed-off-by: Emmanuel Blot <[email protected]>
Some devices may disable instruction fetch while keeping data access. Signed-off-by: Emmanuel Blot <[email protected]>
If no OTP file is in use, default to enabling execution from SRAM. Signed-off-by: Emmanuel Blot <[email protected]>
…t to ot_vmapper Signed-off-by: Emmanuel Blot <[email protected]>
Instruction fetch management is handled with ot_vmapper. Signed-off-by: Emmanuel Blot <[email protected]>
…nt to ot_vmapper Signed-off-by: Emmanuel Blot <[email protected]>
Instruction fetch management is handled with ot_vmapper. Signed-off-by: Emmanuel Blot <[email protected]>
…out of spec. Signed-off-by: Emmanuel Blot <[email protected]>
* EG_252 matches EarlGrey 2.5.2-rc0, which is the first supported version of QEMU OpenTitan emulation * DJ_PRE is the initial Darjeeling version based on EarlGrey 2.5.2-rc0 Signed-off-by: Emmanuel Blot <[email protected]>
Signed-off-by: Emmanuel Blot <[email protected]>
* EG_252 matches EarlGrey 2.5.2-rc0, which is the first supported version of QEMU OpenTitan emulation * DJ_PRE is the initial Darjeeling version based on EarlGrey 2.5.2-rc0 Signed-off-by: Emmanuel Blot <[email protected]>
Signed-off-by: Emmanuel Blot <[email protected]>
…ontrol warning Some SRAM controller may never be associated with an ot_vmapper, leading to recurrent warnings. Signed-off-by: Emmanuel Blot <[email protected]>
use-after-free issue. Signed-off-by: Emmanuel Blot <[email protected]>
Signed-off-by: Emmanuel Blot <[email protected]>
With multiple Debug Module, it is sometimes useful to track down where DTM requests are routed to. Signed-off-by: Emmanuel Blot <[email protected]>
Signed-off-by: Emmanuel Blot <[email protected]>
Address a misunderstanding in RISC-V debug spec 0.13.2: DMCONTROL.dmactive bit should not be automatically reverted back to 1 once is reset is completed: it seems it is up to the remote debugger to release the DM from the reset state, which is now implemented as such. Signed-off-by: Emmanuel Blot <[email protected]>
…dress for debug/trace purposes Signed-off-by: Emmanuel Blot <[email protected]>
Signed-off-by: Emmanuel Blot <[email protected]>
Signed-off-by: Emmanuel Blot <[email protected]>
Signed-off-by: Emmanuel Blot <[email protected]>
Signed-off-by: Emmanuel Blot <[email protected]>
Signed-off-by: Loïc Lefort <[email protected]>
Signed-off-by: Loïc Lefort <[email protected]>
Signed-off-by: Loïc Lefort <[email protected]>
Signed-off-by: Loïc Lefort <[email protected]>
Signed-off-by: Loïc Lefort <[email protected]>
…type Signed-off-by: Emmanuel Blot <[email protected]>
…type Signed-off-by: Emmanuel Blot <[email protected]>
…methods These should enable providing data extraction method to other modules. Signed-off-by: Emmanuel Blot <[email protected]>
…ation Not yet fully tested. Signed-off-by: Emmanuel Blot <[email protected]>
…led image files Signed-off-by: Emmanuel Blot <[email protected]>
It should be used to report an invalid parsed argument, to delegate ArgumentParser validation to modules. Signed-off-by: Emmanuel Blot <[email protected]>
Signed-off-by: Emmanuel Blot <[email protected]>
Signed-off-by: Emmanuel Blot <[email protected]>
…o a file Signed-off-by: Emmanuel Blot <[email protected]>
…ace event name Signed-off-by: Emmanuel Blot <[email protected]>
… a single test When define as a test option, the VCP port are also logged into an additional file. It is possible to use a temporary file to perform post-analysis of the UART outputs Signed-off-by: Emmanuel Blot <[email protected]>
Signed-off-by: Emmanuel Blot <[email protected]>
…r DPE testing Signed-off-by: Emmanuel Blot <[email protected]>
Signed-off-by: Loïc Lefort <[email protected]>
Signed-off-by: Loïc Lefort <[email protected]>
Signed-off-by: Emmanuel Blot <[email protected]>
Signed-off-by: Loïc Lefort <[email protected]>
Allow commit line to start with "FROMLIST:" to indicate a commit cherry-picked from a mailing list. Signed-off-by: Loïc Lefort <[email protected]>
rivos-eblot
approved these changes
Jul 22, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See #156
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.