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

PMP as an option for supervisor domain isolation #3

Closed
NicholasWoodIMG opened this issue Aug 16, 2023 · 10 comments
Closed

PMP as an option for supervisor domain isolation #3

NicholasWoodIMG opened this issue Aug 16, 2023 · 10 comments
Assignees

Comments

@NicholasWoodIMG
Copy link

NicholasWoodIMG commented Aug 16, 2023

Add PMP as an option for supervisor domain isolation:

  • Add PMP as a mode in table 3.1
  • When PMP mode is used, then MTT is not required and PMP is used instead for physical memory isolation between domains
  • When PMP mode is used, the SDID CSR can still be used to identify the currently active supervisor domain

This allows systems based on PMP or MTT as the underlying physical memory isolation mechanism to implement and support supervisor domains in a consistent way across the RVI architecture.

@jackwdandrew
Copy link

Additionally, when only PMP and Bare modes are supported, mttp.MTTPN is redundant. Therefore an implementation that can tie it to 0. Probably calling mttp.MTTPN out as WARL is sufficient.

@rsahita
Copy link
Collaborator

rsahita commented Sep 19, 2023

Makes sense. Sub-fields of that CSR are already specified as WARL.

from 9-19 discussion - Krste's comment - will need to use SFENCE to flush TLBs with any PMP settings changes

@kasanovic
Copy link
Collaborator

To clarify, if we did add SDID we may be able to provide more targeted SFENCE versions to reduce the microarchitectural translation/protection cache flushing when PMP entries are swapped.

@NicholasWoodIMG
Copy link
Author

NicholasWoodIMG commented Sep 19, 2023 via email

@rsahita
Copy link
Collaborator

rsahita commented Oct 17, 2023

For the Supervisor Domains spec - adding an "option" to the SDID configuration with no MTT is the only requirement here (normative). We need to add the basic theory of operation (informative) for this mode of operation that (e)PMPs may be used here instead.

The design for any changes to (e)PMP for SDID is to be done separately from this spec. That design should cover - partitioning/switching, design tradeoffs, optimal flushing etc., access-control masks on (e)PMPs etc.

@rsahita
Copy link
Collaborator

rsahita commented Oct 17, 2023

Eckhard: Do we also need an informative section for the "no-MTT" Scenario where IOPMP is used for Access Control (instead of IOMMU-MTT)?

@NicholasWoodIMG
Copy link
Author

NicholasWoodIMG commented Oct 17, 2023

Table 2. Encoding of mttMODE field:

5|"No MTT"|Supervisor domain isolation not using MTT for physical memory isolation, for example (e)PMP.


Rationale (in the intro section of the doc?):

"The Smmtt extension defines an SDID CSR, and a physical memory isolation mechanism for access control rules across domain boundaries.

The SDID can be used by the Risc-V architecture to provide domain isolation guarantees beyond memory isolation. For example interrupt management, performance counters and debug controls.

For memory access control, the Smmtt specification introduces MTT. MTT enables fine grained (page level) dynamic memory allocation.

Other memory access control mechanisms can also be used to enforce supervisor domain boundaries for use cases that do not require the full flexibility of MTT. For example, (e)PMP configurations controlled by M-mode during domain context switching. In this case the "No MTT" mode is used. The same security guarantees are provided to supervisor domains, and the SDID CSR is still valid. Only MTT is not used."

@gagachang
Copy link

gagachang commented Oct 18, 2023

Hi
If Smmtt also supports M-mode only or M/U mode systems, where S-mode is absent, adding some description or diagrams for those use cases is helpful to people.

@rsahita
Copy link
Collaborator

rsahita commented Jan 22, 2024

Moved @gagachang's comment to separate issue.

Opened PR to address this issue.

rsahita added a commit to rsahita/riscv-smmtt that referenced this issue Jan 25, 2024
Signed-off-by: Ravi Sahita <ravi@rivosinc.com>
rsahita added a commit to rsahita/riscv-smmtt that referenced this issue Jan 25, 2024
Signed-off-by: Ravi Sahita <ravi@rivosinc.com>
@rsahita rsahita self-assigned this Jan 26, 2024
rsahita added a commit that referenced this issue Feb 7, 2024
@rsahita
Copy link
Collaborator

rsahita commented Feb 7, 2024

addressed by #19

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

5 participants