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

How to decide the memory attribute when PBMT=NC & PMA=IO ? #1723

Open
rock-ifly opened this issue Nov 13, 2024 · 1 comment
Open

How to decide the memory attribute when PBMT=NC & PMA=IO ? #1723

rock-ifly opened this issue Nov 13, 2024 · 1 comment

Comments

@rock-ifly
Copy link

rock-ifly commented Nov 13, 2024

The Svpbmt says that memAttr is both IO and NC for the purpose of FENCE, .aq and .rl

If the underlying physical memory attribute for a page is I/O, and the page has PBMT=NC, then
accesses to that page obey RVWMO. However, accesses to such pages are considered to be both I/O and
main memory accesses for the purposes of FENCE, .aq, and .rl.

How to understand the "both"?

the MMU only gives a definity memAttr for a specific PA, doesn't it ?
If PA0 is defined as IO in PMA, and is override by PBMT=NC in a pte, then MMU output memAttr = NC according to Svpbmt spec. Then

  1. for a common ld/st intruction, ld xn, [PA0], what is the acutual memAttr with the PA0 in LSU interface to memory?
  2. for a FENCE/.aq/.rl instruction, what is the acutual memAttr with the PA0 in LSU interface to memory?
  3. any differences between 1 and 2 ?
@gfavor
Copy link
Collaborator

gfavor commented Nov 14, 2024

Yes, a leaf PTE defines the memory attributes for just (all) the PAs within that page.

The highlighted Svpbmt text is saying that all addresses within such a page (PMA=IO, PBMT=NC), are fenced by both IO fences and main memory fences (and similar for .aq/.rl fencing purposes). Whereas PMA=IO, by itself, would say that all addresses are only fenced by IO fences. And if PMA=main_mem and PBMT=NC together, then all addresses are only fenced by main memory fences.

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

2 participants