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
159 stars 18 forks source link

Zjpm: Differences in ignore transformation and sign extension when paging is enabled v/s not enabled #22

Closed deepak0414 closed 11 months ago

deepak0414 commented 1 year ago

Ignore transformation is explained mainly from perspective when paging is enabled.

When paging is not enabled (or bare mode), ignore transformation still apply? I believe sign extension exist to accommodate negative kernel addresses (which is function of paging)

In case of M mode or bare mode, there is no paging and thus a sign extended address may fault (may not be even required) Is the behavior same (of sign extension) when paging doesn't exist ?

martinmaas commented 1 year ago

Addressed in fd7220807e1405ba9b5de38d9d4ac26e73312128 (Sections 2.1 and 2.4)

deepak0414 commented 1 year ago

Can you point to specific text? I couldn't figure after reading 2.1 and 2.4 I saw a comment that in bare mode, it's implementation dependent.

Without paging there is no to define NVBITS or VBITS. Linux kernel can be compiled for nommu and for M-mode. How should linux kernel reason about NVBITS and VBITS when paging is not enabled?

Also I couldn't find out if sign extension is needed in M-mode or bare mode. Why would it be required to do sign extension in M-mode.

martinmaas commented 11 months ago

The new version of the spec further clarifies this – now, virtual addresses are using sign extension and physical addresses are using zero extension (Section 2.2). Section 2.3 has examples of both. Physically addressed environments therefore no longer have to reason about NVBITS and VBITS.

I will close this issue for now – please feel free to reopen if there are still concerns about the latest version.