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

Should it raise an exception when VA exceed the max range of the VA when mmu off? what kind of the that exception? #1754

Open
rock-ifly opened this issue Dec 6, 2024 · 3 comments

Comments

@rock-ifly
Copy link

rock-ifly commented Dec 6, 2024

Should it raise an exception when VA exceed the max range of the VA when mmu off? and what kind of the that exception?

Let's think about a PAW(PA width) = 40, when it is in M mode and mstatus.mprv=0 (MMU off)

1) Can the software use a VA that exceed 40-bits, like VA0=0xAAAA_BBBB_CCCC? Here the VA0 width is 48bits, exceed the max PA width(40bits).
2) if The answer is NO, then an exception should be raised, the what kind shold we use? access fault, selfdefined fault, or any other determined kind? The RV spec is better to make this clear.

@rock-ifly
Copy link
Author

The same case when pte.ppn[55:40] is not full-0, when the PAW=40, should an exception be raised? access fault or any other exception?

@allenjbaum
Copy link

allenjbaum commented Dec 6, 2024 via email

@rock-ifly
Copy link
Author

rock-ifly commented Dec 9, 2024

for SV48, a VA can be any address such that A[63:47] == either all1s, or all 0s (so, sign extended from the VA MSB. the PAW is completely independent from that; it can be larger or smaller. if A[63:PAW] !=0, then you should get an illegal access fault. (I don't recall if there are any weird cases that some other cause would be reported offhand, and I'm too lazy to look) It is the responsibility of the OS to ensure that the VA->PA mapping defined by the page table never exceeds that PAW limit.

On Thu, Dec 5, 2024 at 11:17 PM rock-ifly @.> wrote: The same case when pte.ppn[55:40] is not full-0, when the PAW=40, should an exception be raised? access fault or any other exception? — Reply to this email directly, view it on GitHub <#1754 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHPXVJQOTUZD5DORDLT7MTD2EFFQFAVCNFSM6AAAAABTEAWWOCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDKMRSGI4TSNRTGM . You are receiving this because you are subscribed to this thread.Message ID: @.>

Thanks, I see.

  1. mmu on, for a Sv39/Sv48/Sv57, sign extenstoin is checked for VA
  2. mmu on, OS should ensure the pte.ppn(PA) not exceed the PAW during the PTW process.
  3. mmu off, OS should ensure the PA=VA not exceed the PAW

Why not make it clear in Ch12.3.2 vritual address translation prcess in the RV spec, since the PAW is different for every implementation.

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