Skip to content
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

mmu: fix pointer masking with mstatus.MXR in M-mode #1955

Merged
merged 1 commit into from
Apr 10, 2025

Conversation

radimkrcmar
Copy link
Contributor

Pointer masking is disabled if sstatus.MXR is in effect, but M-mode doesn't use paging and hence sstatus.MXR should not be in effect for effective M-mode loads.

Do not consider mstatus.MXR when deciding the pointer mask length for effective M-mode loads.

vsstatus.MXR wasn't an issue as no effective M-mode load could happen with V=1, but move it below M-mode as well to simplify the conditions.

Fixes: 71bdc3b ("pointer masking: Pointer masking does not apply when MXR=1 regardless of MPRV in v1.0.0-rc2")

Pointer masking is disabled if sstatus.MXR is in effect, but M-mode
doesn't use paging and hence sstatus.MXR should not be in effect for
effective M-mode loads.

Do not consider mstatus.MXR when deciding the pointer mask length for
effective M-mode loads.

vsstatus.MXR wasn't an issue as no effective M-mode load could happen
with V=1, but move it below M-mode as well to simplify the conditions.

Fixes: 71bdc3b ("pointer masking: Pointer masking does not apply when MXR=1 regardless of MPRV in v1.0.0-rc2")
Signed-off-by: Radim Krčmář <rkrcmar@ventanamicro.com>
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.

Looks correct to me. Thanks, @radimkrcmar.

@aswaterman aswaterman merged commit c703940 into riscv-software-src:master Apr 10, 2025
3 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.

2 participants