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

Question on the role of MXR with respect to different transformations #84

Open
vishmohan opened this issue Sep 28, 2024 · 3 comments
Open

Comments

@vishmohan
Copy link

Hi,

The Zjpm spec mentions two different types of transformations:

  1. Ignore transformation on the virtual address
  2. Ignore transformation on the physical address

It also specifies that MXR being set disables pointer masking. Can you clarify if that applies to physical address transformation as well?
Specifically, I am trying to understand the behavior when:
Mode = M, mstatus.MPRV=0, mstatus.MXR=1 and a load/store from/to physical address is performed. Does a ignore transformation on physical address occur in this case?

MPRV and SPVP affect pointer masking as well, causing the pointer masking settings of the effective
privilege mode to be applied. When MXR is in effect at the effective privilege mode where explicit
memory access is performed, pointer masking does not apply.

Thank you.

@martinmaas
Copy link
Collaborator

Which of the two operations is performed depends entirely on whether the address is virtual or physical and is not affected by MXR or MPRV. I.e., the fact that it is a physical address has no impact on whether pointer masking is applied, just which of the two operations it is.

In this case, because MXR=1, no pointer masking will be applied.

@jiahzhang
Copy link

@martinmaas The privileged spec says

MXR has no effect when page-based virtual memory is not in effect.

which in M-mode accesses are not using virtual memory.

The spec here says

When MXR is in effect at the effective privilege mode where explicit
memory access is performed, pointer masking does not apply.

This seems to indicate that MXR=1 should not affect whether pointer masking is applied.

@martinmaas
Copy link
Collaborator

Although MXR has no effect on permission checks, it does have an effect on whether or not pointer masking applies. We agree that these two statements taken together could lead to confusion, and we will thus add the following non-normative statement after the second paragraph quoted above:

Note that this includes cases where page-based virtual memory is not in effect; i.e., although MXR has no effect on permissions checks when page-based virtual memory is not in effect, it is still used in determining whether or not pointer masking should be applied.

(Please note that this is just adding a non-normative clarifying statement and not a change to the spec.)

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

No branches or pull requests

3 participants