-
Notifications
You must be signed in to change notification settings - Fork 141
Add Sspmp, Sspmpen, and Smpmpdeleg extension definitions #1817
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
Open
ybc-alkaid
wants to merge
7
commits into
riscv:main
Choose a base branch
from
ybc-alkaid:spmp
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+102
−41,247
Open
Changes from 2 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
627638b
Add Sspmp, Sspmpen, and Smpmpdeleg extension definitions
ybc-alkaid daa0e84
Apply suggestions from code review
ybc-alkaid 582a8e3
polish
ybc-alkaid fe53556
Merge branch 'spmp' of github.com:ybc-alkaid/riscv-unified-db into spmp
ybc-alkaid 933efb8
Fix Sspmp requirements: remove Sm/Smcsrind, make Smpmpdeleg condition…
ybc-alkaid 996a685
[autofix.ci] apply automated fixes
autofix-ci[bot] 78accd6
Apply suggestions from code review
ybc-alkaid File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| # Copyright (c) Shanghai Jiao Tong University | ||
| # SPDX-License-Identifier: BSD-3-Clause-Clear | ||
|
|
||
| # yaml-language-server: $schema=../../../schemas/ext_schema.json | ||
|
|
||
| $schema: "ext_schema.json#" | ||
| kind: extension | ||
| name: Smpmpdeleg | ||
| type: privileged | ||
| long_name: Machine PMP Delegation to SPMP | ||
| description: | | ||
| The Smpmpdeleg extension provides the mpmpdeleg CSR, which controls how many | ||
| PMP entries are delegated to SPMP. | ||
|
|
||
| The mpmpdeleg CSR contains a pmpnum field in bits [6:0]. Entries 0 through | ||
| pmpnum-1 remain as PMP entries, while entries pmpnum through max_pmp-1 are | ||
| delegated to SPMP. | ||
|
|
||
| When pmpnum = 0, all entries are delegated to SPMP. | ||
| When pmpnum = max_pmp, no entries are delegated to SPMP. | ||
|
|
||
| Writes to SPMP CSRs are ignored when no entries are delegated to SPMP. | ||
| versions: | ||
| - version: "0.8.18" | ||
| state: frozen | ||
| url: "https://github.com/riscv/riscv-spmp/tree/0.8.18" | ||
|
ybc-alkaid marked this conversation as resolved.
Outdated
|
||
| requirements: | ||
| extension: | ||
| allOf: | ||
| - name: S | ||
| - name: Sm | ||
|
|
||
|
|
||
|
ybc-alkaid marked this conversation as resolved.
Outdated
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| # Copyright (c) Shanghai Jiao Tong University | ||
| # SPDX-License-Identifier: BSD-3-Clause-Clear | ||
|
|
||
| # yaml-language-server: $schema=../../../schemas/ext_schema.json | ||
|
|
||
| $schema: "ext_schema.json#" | ||
| kind: extension | ||
| name: Sspmp | ||
| type: privileged | ||
| long_name: Supervisor Physical Memory Protection | ||
| description: | | ||
| The Sspmp extension defines a Supervisor-level Physical Memory Protection (SPMP) | ||
| mechanism that allows S-mode software to configure memory protection regions. | ||
|
|
||
| SPMP entries are accessed indirectly via the Sscsrind/Smcsrind extension. | ||
|
ybc-alkaid marked this conversation as resolved.
|
||
| The siselect CSR selects the SPMP entry (0x100-0x13F), and sireg/sireg2 access | ||
| the corresponding spmpaddr/spmpcfg values. | ||
|
|
||
| SPMP provides memory protection for S-mode and U-mode accesses when satp.MODE | ||
| is Bare. It does not apply when virtual memory translation is active. | ||
|
|
||
| Key behaviors: | ||
| * SPMP entries are delegated from PMP entries via the mpmpdeleg CSR | ||
|
ybc-alkaid marked this conversation as resolved.
Outdated
|
||
| * Each SPMP entry has address (spmpaddr) and configuration (spmpcfg) registers | ||
| * spmpcfg includes R, W, X permissions, address matching mode (A), lock bit (L), | ||
| U-mode bit (U), and SHARED bit | ||
| * Out-of-bounds siselect values read as 0 and writes are ignored | ||
| versions: | ||
| - version: "0.8.18" | ||
| state: frozen | ||
| url: "https://github.com/riscv/riscv-spmp/tree/v0.8.18" | ||
| requirements: | ||
| extension: | ||
| allOf: | ||
| - name: S | ||
| - name: Sm | ||
| - name: Sscsrind | ||
| - name: Smcsrind | ||
| - name: Smpmpdeleg | ||
|
ybc-alkaid marked this conversation as resolved.
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| # Copyright (c) Shanghai Jiao Tong University | ||
| # SPDX-License-Identifier: BSD-3-Clause-Clear | ||
|
|
||
| # yaml-language-server: $schema=../../../schemas/ext_schema.json | ||
|
|
||
| $schema: "ext_schema.json#" | ||
| kind: extension | ||
| name: Sspmpen | ||
| type: privileged | ||
| long_name: SPMP Enable Register | ||
| description: | | ||
| The Sspmpen extension adds the spmpen CSR, which provides per-entry enable bits | ||
| for SPMP regions. | ||
|
|
||
| Each bit spmpen[i] controls whether SPMP entry i is active. An entry is active | ||
| only when both spmpen[i] is set and spmpcfg[i].A != 0 (address matching mode | ||
| is not OFF). | ||
|
|
||
| When spmpcfg[i].L (lock bit) is set, spmpen[i] becomes read-only. | ||
|
|
||
| The spmpen CSR is a WARL register. Bits beyond the number of implemented SPMP | ||
| entries are read-only-zero. | ||
| versions: | ||
| - version: "0.8.18" | ||
| state: frozen | ||
| url: "https://github.com/riscv/riscv-spmp/tree/v0.8.18" | ||
| requirements: | ||
| extension: | ||
| name: Sspmp | ||
|
|
||
|
ybc-alkaid marked this conversation as resolved.
Outdated
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.