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

Encoding of INFO for 2M_PAGES and 4M_PAGES #100

Closed
pright opened this issue Oct 18, 2024 · 4 comments
Closed

Encoding of INFO for 2M_PAGES and 4M_PAGES #100

pright opened this issue Oct 18, 2024 · 4 comments

Comments

@pright
Copy link

pright commented Oct 18, 2024

The spec says,

For 2M_PAGES,

The INFO field holds 16 2-bit PERM access-encoding for each 2 MiB address range to indicate ...
Bits mpte.info[31:0] holds the 2 MiB page permissions, and mpte.info[43:32] are reserved and must be zero.

and for 4M_PAGES,

The INFO field holds 8 2-bit PERM access-encoding for each 4 MiB address range to indicate ...
Bits mpte.info[15:0] holds the 2 MiB page permissions, and mpte.info[21:16] are reserved and must be zero.

However, it does not specify whether the encoding is in big-endian or little-endian order. Regarding 2MB_PAGES, whether the 2-bit PERM for the first 2MB address range is encoded in INFO[1:0] or INFO[31:30] remains unclear.

@ved-rivos
Copy link
Collaborator

However, it does not specify whether the encoding is in big-endian or little-endian order.

MTT accesses are implicit accesses and all implicit accesses are little-endian - even when the hart is big-endian.

@pright
Copy link
Author

pright commented Oct 21, 2024

However, it does not specify whether the encoding is in big-endian or little-endian order.

MTT accesses are implicit accesses and all implicit accesses are little-endian - even when the hart is big-endian.

To my knowledge, the Priv spec states that implicit accesses from S-mode are controlled by SBE. If MTT accesses are classified as implicit accesses, should they also be subject to SBE control?

For implicit accesses to supervisor-level memory management data structures, such as page tables,
endianness is always controlled by SBE.

@ved-rivos
Copy link
Collaborator

If MTT accesses are classified as implicit accesses, should they also be subject to SBE control?

Yes, you are correct. These implicit accesses to the MTT that is setup by M-mode and they should be governed by MBE control.

@rsahita
Copy link
Collaborator

rsahita commented Oct 28, 2024

@pright PTAL PR #104 addresses this issue.

@rsahita rsahita closed this as completed Oct 28, 2024
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