Skip to content

Conversation

@binno
Copy link
Contributor

@binno binno commented Nov 4, 2025

This adds support for the Svukte extension, which adds support for address-independent latency of user-mode faults to supervisor addresses.

Copy link
Collaborator

@aswaterman aswaterman left a comment

Choose a reason for hiding this comment

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

@ingallsj can I delegate to you to review this, particularly the various cases in check_svukte_qualified?

Copy link
Contributor Author

@binno binno left a comment

Choose a reason for hiding this comment

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

Hi @aswaterman
Modification by your suggestion has been done.
Many thanks for review

Copy link
Contributor Author

@binno binno left a comment

Choose a reason for hiding this comment

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

Hi @aswaterman
Modification by your suggestion has been done.
Please help to review it again

This adds support for the Svukte extension, which adds support for
address-independent latency of user-mode faults to supervisor addresses.
@aswaterman aswaterman merged commit 0d0863c into riscv-software-src:master Nov 7, 2025
3 checks passed
if (proc->extension_enabled('S') && get_field(state->senvcfg->read(), SENVCFG_UKTE)) {
if (forced_virt && state->prv == PRV_U) {
bool hstatus_hukte = proc->extension_enabled('H') && (get_field(state->hstatus->read(), HSTATUS_HUKTE) == 1);
return !hstatus_hukte;
Copy link
Collaborator

Choose a reason for hiding this comment

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

I feel like there should be an address check before this return statement.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think there's both an actual bug and a conceptual bug here. Per the spec, "Svukte-qualified" is a property of an access type, not an address. Either this function should not accept an address arg, or it should be renamed. That might be why this bug cropped up. I'll make a fix.

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 think the address check is in line 587

Copy link
Collaborator

@aswaterman aswaterman Dec 2, 2025

Choose a reason for hiding this comment

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

But if you hit the return statement, you never reach like 587, so the address never gets checked for HLV/HSV in U-mode.

I think my PR #2171 fixes this case.


assert(proc->get_xlen() == 64);
if ((addr >> 63) & 1) {
return (state->v || forced_virt) && ((state->vsatp->read() & SATP64_MODE) == 0);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Am I understanding this return statement correctly, that we pass the Svukte check if in VU mode and vsatp.MODE == Bare? Where do we check satp for when in HU mode?

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.

4 participants