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

Additional AR feedback #183

Closed
ved-rivos opened this issue Nov 22, 2023 · 2 comments
Closed

Additional AR feedback #183

ved-rivos opened this issue Nov 22, 2023 · 2 comments

Comments

@ved-rivos
Copy link
Collaborator

Zicfiss will not depend on the A extension (or the Zaamo extension).

At the end of the section named "Zicfiss Instructions Summary", we
suggest adding another paragraph:

If a shadow stack (SS) instruction raises an access-fault,
page-fault, or guest-page-fault exception that is supposed to
indicate the original instruction type (load or store/AMO), then
the reported exception cause is respectively a store/AMO access
fault (code 7), a store/AMO page fault (code 15), or a store/AMO
guest-page fault (code 23).  For shadow stack instructions, the
reported instruction type is always as though it were a store or
AMO, even for instructions SSPOPCHK and C.SSPOPCHK that only read
from memory and do not write to it.

That paragraph can be followed with two non-normative notes, the first
being this:

When Zicfiss is implemented, the existing "store/AMO" exceptions
can be thought of as "store/AMO/SS" exceptions, indicating that the
trapping instruction is either a store, an AMO, or a shadow stack
instruction.

The second note is:

The H (hypervisor) extension specifies that when a guest-page
fault is caused by an implicit memory access of VS-stage address
translation, the reported exception is either a load or store/AMO
guest-page fault based not on the original instruction type
but rather on whether the memory access attempted for VS-stage
translation was a read or a write of memory.  VS-stage address
translation can thus cause a shadow stack instruction to raise
a load guest-page-fault exception.

The SSAMOSWAP instructions require memory attribute AMOSwap, the same
as the regular AMOSWAP instructions.

Please replace "single- and first-stage page tables" with "single-stage
and VS-stage page tables".

To avoid yet another special case, we propose that SSAMOSWAP can work
with mstatus.MPRV = 1. Hence, in this sentence,

At privilege mode M, any memory access by an SSAMOSWAP instruction
will result in a store/AMO access-fault exception.

replace "At privilege mode M" with "When the effective privilege mode
is M".

@ved-rivos
Copy link
Collaborator Author

PR #184 addresses 1 through 4. Item 5 was previously addressed in PR #182

@ved-rivos
Copy link
Collaborator Author

Merging the PR for readability. Please leave feedback in the PR or in this issue.

ved-rivos added a commit that referenced this issue Nov 22, 2023
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

1 participant