Instruction
RSM
Returns from system-management mode to the interrupted program and restores its state; valid only in SMM.
- Extensions
- Forms
- 1 (1 Legacy)
- Data
- Intel XED v2026.08.23
RSM, 0F AA, leaves system-management mode (SMM). An SMI saves the interrupted state in SMRAM, the memory set aside for the firmware’s SMI handler, and switches to that handler; RSM, the only way out, reloads the saved state, all of RFLAGS included, and resumes the interrupted code in the mode it was in. Outside SMM it raises #UD, which is all it does anywhere an operating system or an application runs. Both vendors use a 64-bit layout for the saved state on their 64-bit processors, and the handler may change fields of it before RSM to change the state it returns to.
A bad save area stops the processor
RSM checks what it reloads, and when the state is not possible it does not fault: the processor enters shutdown. Both manuals list reserved bits set in CR4 and contradictory CR0 bits, such as PG without PE or NW without CD. AMD’s list, which its instruction page leaves to Volume 2, goes on with reserved bits of CR3, EFER, DR6 and DR7, long mode with paging but without PAE, a 64-bit code segment with D set, PCIDE outside long mode, a changed revision field, and two cases of CET: CR0.WP clear under CR4.CET, and a return to virtual-8086 mode with user shadow stacks on. On processors with shadow stacks it reloads SSP from the save area too. AMD’s processors also set the CPL themselves where the saved CR0.PE is clear (0) or RFLAGS.VM set (3).
In virtual machines
In a VMX guest, RSM in SMM causes a VM exit with reason 17; outside SMM it raises #UD, in VMX operation or not. Linux 7.3’s KVM gives guests a virtual SMM: the guest’s RSM raises #UD on the real processor, and KVM’s emulator, which handles RSM after a #UD, raises #UD itself when the virtual CPU is not in SMM, and otherwise reloads the guest’s state from its SMRAM, turning a failed reload into a triple fault. In a TDX guest the kernel documentation lists RSM among the instructions that raise #GP. Intel’s entry also allows #GP(0) where a bit of IA32_CORE_CAPABILITIES restricts RSM to CPL 0.
Recorded on Zen 5
The probe runs as a program at CPL 3, outside SMM, and both cases
raised #UD with RFLAGS unchanged. GCC 14 and Clang 23 have no intrinsic
for it; GNU as 2.44 encodes rsm as 0F AA.
Forms
| Instruction | Encoding | Requires |
|---|---|---|
RSM
RSM | 0F AA | Base instruction set |
Latency and throughput
| Model | RSM |
|---|---|
| Sandy Bridge | 100 / 0.33p015 |
| Haswell, Broadwell, Skylake, Skylake-SP, Ice Lake, Alder Lake, Sapphire Rapids | 100 / 0.25p0156 |
| Lunar Lake | 100 / 0.17p012345 |
| Bonnell | 100 / 0.5p01 |
| Silvermont | 100 / 1FPC0 |
| Piledriver | 100 / 0.5EX0 EX1 |
| Zen, Zen 2 | 100 / 0.25 |
| Zen 3, Zen 4 | 100 / 25ALU0 ALU1 ALU2 ALU3 |
| Jaguar | 100 / 0.5ALU0 ALU1 |
Operation
What the forms do, in pseudocode that our tests run against results recorded on real processors. How to read.
if not smm:
fault(UD) # outside system-management mode
smm_restore() # the state that the SMI saved, from
# SMRAM's save area; SMM ends
# the processor shuts down rather than load a state that is not
# possible, such as CR0.PG without PE, or reserved bits of CR4 or
# EFER set; AMD's keeps EFER.SVME as it wasRun on AMD Zen 5 (EPYC 9645): 2 cases. Every one raised an exception, at CPL 3, where the probe runs.
Operands
| Operand | Kind | Action |
|---|---|---|
RSM | ||
rIP | implicit | write |
RFLAGS | implicit | write |
Flags
| OF | SF | ZF | AF | PF | CF | DF | IF | TF | AC | IOPL | NT | RF | VM | VIF | VIP | ID |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| All forms | ||||||||||||||||
| M | M | M | M | M | M | M | M | M | M | M | M | M | M | M | M | M |
Attributes
What else XED records about the forms. How to read.
- All forms
- may abort a TSX transaction
CPUID and processors
Each form belongs to an XED ISA set. A form can be used when the processor reports every CPUID bit of one of its ISA set's alternatives.
| ISA set | CPUID | Processors |
|---|---|---|
I486 | No CPUID bit: part of the base instruction set. | Every x86-64 processor in XED’s model and Zen 3 to Zen 6 |
More System instructions
Sources
- Intel XED v2026.08.23 (commit
0bcb6237345c): forms, encodings, operands, flags, exception classes, attributes, ISA sets, CPUID bits and chip model. - The CPU data of x86-64.net: Zen 3 to Zen 6, from GCC’s
-marchfeature sets and AMD’s Processor Programming References, which the page of each processor cites. - LLVM 23.1.2's x86 scheduling models (commit
85ac56026243): the latency, reciprocal throughput and ports of each form, as llvm-mca reports them. - Intel 64 and IA-32 Architectures Software Developer's Manual, Volume 2 (325383-093, September 2026): Volume 2B, page 4-592 (RSM)
- Intel 64 and IA-32 Architectures Software Developer's Manual, Volume 3 (325384-093, September 2026)
- AMD64 Architecture Programmer's Manual, Volume 2: System Programming (24593, rev. 3.46, October 2026)
- AMD64 Architecture Programmer's Manual, Volume 3: General-Purpose and System Instructions (24594, rev. 3.39, October 2026)
- Linux 7.3: arch/x86/kvm/emulate.c, x86.c and cpuid.c (the instructions KVM emulates after a #UD, and the CPUID bits it offers a guest)
- Linux kernel documentation: Intel Trust Domain Extensions (TDX)
The tables are derived from Intel XED, Copyright Intel Corporation, licensed under the Apache License 2.0; x86-64.net converted and reformatted them. The timings come from LLVM's scheduling models, part of the LLVM Project, licensed under the Apache License 2.0 with LLVM Exceptions. The text is our own.