riscv / riscv-j-extension

Working Draft of the RISC-V J Extension Specification
https://jira.riscv.org/browse/RVG-128
Creative Commons Attribution 4.0 International
162 stars 17 forks source link

Sign extension or no sign extension when V=1 but vsatp.MODE = Bare #50

Closed deepak0414 closed 11 months ago

deepak0414 commented 1 year ago

Section 2.2 (Ignore Transformation) in current spec (0.7) says that

The ignore transformation differs depending on whether it applies to a virtual or physical address.
For virtual addresses, it replaces the upper N bits with the sign extension of the N+1st bit.

Additionally it says

When applied to a physical address, the ignore transformation replaces the upper N bits with 0.
This includes both the case of running in M-mode and running in other privilege modes with Bare
address translation mode.

Consider software running in VS / VU mode with vsatp.MODE = Bare (but hgatp.MODE != Bare) From PM perspective is it considered non-bare address translation mode or bare translation mode ? In this situation, PM is applying to VS / VU mode software and from their perspective its Bare mode. And all they care about is their own address space which is physical and thus sign extension won't apply. Is my understanding correct? Probably having this clarification somewhere in spec would be useful.

Let me know if I missed something or overthinking this and it is spelled out somewhere in spec.

martinmaas commented 1 year ago

I agree this case should be treated as physical address translation (zero extension). We can add a clarification to the spec and I will keep this issue open until then.

martinmaas commented 11 months ago

Added a non-normative comment in 92a88a2.