RSTORSSP—Restore Saved Shadow Stack PointerInstruction Operand EncodingDescriptionRestores SSP from the shadow-stack-restore token pointed to by m64. If the SSP restore was successful then the instruction replaces the shadow-stack-restore token with a previous-ssp token. The instruction sets the CF flag to indicate whether the SSP address recorded in the shadow-stack-restore token that was processed was 4 byte aligned, i.e., whether an alignment hole was created when the restore-shadow-stack token was pushed on this shadow stack. Following RSTORSSP if a restore-shadow-stack token needs to be saved on the previous shadow stack, use the SAVEPREVSSP instruction. If pushing a restore-shadow-stack token on the previous shadow stack is not required, the previous-ssp token can be popped using the INCSSPQ instruction. If the CF flag was set to indicate presence of an alignment hole, an addi-tional INCSSPD instruction is needed to advance the SSP past the alignment hole.OperationIF CPL = 3IF (CR4.CET & IA32_U_CET.SH_STK_EN) = 0THEN #UD; FI;ELSEIF (CR4.CET & IA32_S_CET.SH_STK_EN) = 0THEN #UD; FI;FI;SSP_LA = Linear_Address(mem operand)IF SSP_LA not aligned to 8 bytesTHEN #GP(0); FI;previous_ssp_token = SSP | (IA32_EFER.LMA AND CS.L) | 0x02Start Atomic Executionrestore_ssp_token = Locked shadow_stack_load 8 bytes from SSP_LAfault = 0IF ((restore_ssp_token & 0x03) != (IA32_EFER.LMA & CS.L))THEN fault = 1; FI;(* If L flag in token does not match IA32_EFER.LMA & CS.L or bit 1 is not 0 *)IF ((IA32_EFER.LMA AND CS.L) = 0 AND restore_ssp_token[63:32] != 0)THEN fault = 1; FI;(* If compatibility/legacy mode and SSP to be restored not below 4G *)TMP = restore_ssp_token & ~0x01TMP = (TMP - 8)TMP = TMP & ~0x07Opcode/InstructionOp/ En64/32 bit Mode SupportCPUID Feature FlagDescriptionF3 0F 01 /5 (mod!=11, /5, memory only)RSTORSSP m64MV/VCET_SSRestore SSP.Op/EnOperand 1Operand 2Operand 3Operand 4MModRM:r/m (r, w)NANANA
This UNOFFICIAL reference was generated from the official Intel® 64 and IA-32 Architectures Software Developer’s Manual by a dumb script. There is no guarantee that some parts aren't mangled or broken and is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.