What happens if the related CFI feature is inactive for SSAMOSWAP.W?
Zicfiss instructions degrade according to the official Zimop/Zcmop-compatible behavior and do not perform shadow-stack checks or updates.
SSAMOSWAP.W performs an AMO-style swap on shadow-stack memory, returning the old value and storing the new value.
Beginner view: SSAMOSWAP.W atomically reads a value from the shadow-stack location addressed by rs1 into rd and writes the corresponding value from rs2 back to that address. It supports shadow-stack switching and checkpoint maintenance.
SSAMOSWAP.W belongs to the RISC-V CFI instruction set; behavior depends on whether Zicfilp/Zicfiss is enabled and on environment configuration.
Understand this scenario with real code like «ssamoswap.w t0, t1, (t2)».
Understand this scenario with real code like «ssamoswap.w t0, t1, (t2)».
Understand this scenario with real code like «ssamoswap.w t0, t1, (t2)».
Zicfiss instructions degrade according to the official Zimop/Zcmop-compatible behavior and do not perform shadow-stack checks or updates.
The Control-Flow Integrity chapter of the RISC-V Unprivileged ISA defines LPAD, SSPUSH, SSPOPCHK, SSRDP, and SSAMOSWAP.