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

Add Zicfiss extension #377

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Open

Add Zicfiss extension #377

wants to merge 10 commits into from

Conversation

ved-rivos
Copy link
Contributor

@ved-rivos ved-rivos commented Dec 17, 2023

Specification: https://github.com/riscv/riscv-cfi/blob/main/cfi_backward.adoc
Tests: riscv-non-isa/riscv-arch-test#417

Includes the unratified Zimop and Zcmop extensions which Zicfiss depends on:
https://github.com/riscv/riscv-isa-manual/blob/main/src/zimop.adoc

Parts of the sw-check exception code is duplicated here and in PR #361

@Alasdair
Copy link
Collaborator

Just letting you know I am away on Holiday until early January, so it might take me a while before I can go through this in detail.

Copy link

github-actions bot commented Mar 28, 2024

Test Results

712 tests  ±0   712 ✅ ±0   0s ⏱️ ±0s
  6 suites ±0     0 💤 ±0 
  1 files   ±0     0 ❌ ±0 

Results for commit 1615063. ± Comparison against base commit 40ed0c5.

♻️ This comment has been updated with latest results.

- Separate legalizers for menvcfg and senvcfg
- Add a getter for senvcfg as fields in senvcfg depend on menvcfg
Zicfiss instructions use codepoints defined by Zimop/Zcmop extension.
Add the baseline Zimop/Zcmop as preparation to be extended by Zicfiss.
- SSE field in menvcfg
- SSE field in senvcfg
- New CSR ssp
- Zicfiss instructions can generate software check exceptions
  with xtval set to SHADOW_STACK_FAULT.
With Zicfiss, PTE based checks may cause a page-fault or an access
fault. Extend the PTE permission checks plumbing to be able to signal
both.
- SS pages are encoded in pte as XWR=010b.
- Add rules for access to such pages by non-SS load/store/AMO and inst. fetch.
- Add rules for access to such pages by SS load/store/AMO.
- SS access not allowed in Svbare. When virtual memory system is not active,
  all shadow stack accesses cause an access violation.
- Add rules for PMP access checks by shadow stack accesses
- Some zimop and zcmop codepoints may be used by extensions such as Zicfiss.
  Add generic infrastructure to support this.
@ved-rivos ved-rivos force-pushed the zicfiss_1216 branch 3 times, most recently from 0c444de to 673ef17 Compare June 22, 2024 21:15
- Add sspush/sspopchk/ssrdp/ssamoswap
- Add c_sspush/c_sspopchk
@ved-rivos ved-rivos changed the title Add unratified Zicfiss extension Add Zicfiss extension Jul 3, 2024
@billmcspadden-riscv billmcspadden-riscv added the tgmm-agenda Tagged for the next Golden Model meeting agenda. label Jul 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tgmm-agenda Tagged for the next Golden Model meeting agenda.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants