Skip to content

Commit

Permalink
Misaligned LC/SC is a fatal error
Browse files Browse the repository at this point in the history
Make it clear in the spec that this overrides Zicclsm and should not
be emulated.

Resolves #59.
  • Loading branch information
sorear committed Jan 31, 2024
1 parent e9f968f commit 1ffbda1
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/riscv-integration.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,20 @@ Capability load and store instructions also cause load or store/AMO address
misaligned exceptions if the address is not naturally aligned to a CLEN
boundary.

Misaligned capability loads and stores are errors. Implementations must
generate exceptions for misaligned capability loads and stores even if they
allow misaligned integer loads and stores to complete normally. Execution
environments must report misaligned capability loads and stores as errors
and not attempt to emulate them using byte access. The Zicclsm extension
does not affect capability loads and stores. Software which uses capability
loads and stores to copy data other than capabilities must ensure that
addresses are aligned.

NOTE: Since there is only one tag per CLEN bit block in memory, it is not
possible to represeent a capability value complete with its tag at an
address not aligned to CLEN. To transfer CLEN bits without a tag, use
integer loads and stores.

For loads, the tag of the capability loaded from memory is cleared if the
authorising capability does not grant permission to read capabilities (i.e.
both <<r_perm>> and <<c_perm>> must be set in AP). For stores, the tag of the
Expand Down

0 comments on commit 1ffbda1

Please sign in to comment.