Skip to content

fix(csr): fix set/get sip/sie in V mode#938

Merged
cebarobot merged 1 commit intomasterfrom
fix-csr-xie-xip
Nov 23, 2025
Merged

fix(csr): fix set/get sip/sie in V mode#938
cebarobot merged 1 commit intomasterfrom
fix-csr-xie-xip

Conversation

@sinceforYy
Copy link
Copy Markdown
Contributor

@sinceforYy sinceforYy commented Nov 5, 2025

Guest read/write operations on sie/sip in VS mode are functionally equivalent to host read/write operations on vsie/vsip in M mode.
vmode_set_sip and set_vsip, as well as vmode_set_sie and set_vsie, are not entirely equivalent. Therefore, replace them with the correct set_vsip and set_vsie methods.

@cebarobot
Copy link
Copy Markdown
Member

Is there any context about these changes? I don't get the reason.

@SeddonShen
Copy link
Copy Markdown

plz see this issue
OpenXiangShan/XiangShan#5168

@Anzooooo
Copy link
Copy Markdown
Member

Anzooooo commented Nov 6, 2025

Alright, regardless, perhaps from now on we should follow OpenXiangShan is example and standardize the descriptions for NEMU PR to facilitate better review by reviewers.

@sinceforYy
Copy link
Copy Markdown
Contributor Author

Alright, I've added a detailed description of the PR.

Copy link
Copy Markdown
Member

@cebarobot cebarobot left a comment

Choose a reason for hiding this comment

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

What's the different between these pairs?

  • vmode_get_sie and get_vsie
  • vmode_set_sie and set_vsie
  • vmode_get_sip and get_vsip
  • vmode_set_sip and set_vsip

I have diffed these pairs and found that the key difference seems to be about hideleg and hedeleg?

Also, I don't get the reason that causes this bug. Is it a misunderstanding of the RISC-V priv spec?

By the way, please rebase to the latest master and remove the PMEM modification. This has been fixed before.

@sinceforYy
Copy link
Copy Markdown
Contributor Author

Yes, this bug is caused by a misunderstanding of the RISC-V priv spec. Additionally, regarding PMEM, I will rebase it.

Copy link
Copy Markdown
Member

@cebarobot cebarobot left a comment

Choose a reason for hiding this comment

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

LGTM

@cebarobot cebarobot merged commit 4d7e685 into master Nov 23, 2025
9 checks passed
@cebarobot cebarobot deleted the fix-csr-xie-xip branch November 23, 2025 12:21
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