B.4.316. `SYSRET': Return From Operating System
-----------------------------------------------
SYSRET ; 0F 07 [P6,AMD,PRIV]
`SYSRET' is the return instruction used in conjunction with the
`SYSCALL' instruction to provide fast entry/exit to an operating system.
* The `ECX' register, which points to the next sequential instruction
after the corresponding `SYSCALL' instruction, is copied into the
`EIP' register.
* Bits [63-48] of the `STAR' register specify the selector that is
copied into the `CS' register.
* Bits [63-48]+1000b of the `STAR' register specify the selector
that is copied into the `SS' register.
* Bits [1-0] of the `SS' register are set to 11b (RPL of 3)
regardless of the value of bits [49-48] of the `STAR' register.
The `CS' and `SS' registers should not be modified by the operating
system between the execution of the `SYSCALL' instruction and its
corresponding `SYSRET' instruction.
For more information, see the `SYSCALL and SYSRET Instruction
Specification' (AMD document number 21086.pdf).