Instruction
PSMASH
Splits the reverse map (RMP) entry of a 2-MByte page into the entries of its 512 4-KByte pages; SEV-SNP.
An AMD extension: Intel processors do not have this instruction.
- Extensions
- Forms
- 1 (1 Legacy)
- Data
- Intel XED v2026.08.23
Forms
| Instruction | Encoding | Requires |
|---|---|---|
PSMASH RAX 64-bit mode only
PSMASH_RAX | F3 0F 01 FF | SNP |
Operation
What the forms do, in pseudocode that our tests run against results recorded on real processors. How to read.
if not msr[SYSCFG] >> 24 & 1:
fault(UD) # SEV-SNP off (SYSCFG.SNPEn)
if CPL > 0:
fault(GP, 0)
spa = addr.read() & ~0x1FFFFF # RAX: a 2-MB page
if asid != 0:
eax = 2 # FAIL_PERMISSION: the hypervisor
# alone, at ASID 0
elif not in_rmp(spa):
eax = 1 # FAIL_INPUT: no RMP entry
else:
r = rmp(spa)
if r >> 80 & 1 or not r >> 64 & 1:
eax = 7 # FAIL_BADADDR: immutable, or free
elif not r >> 72 & 1:
eax = 7 # FAIL_BADADDR: no 2-MB page
else:
r = r & ~(1 << 72) # 512 pages of 4 KB, the same but
for i in range(512): # for their guest addresses
a = spa + 4096 * i
set_rmp(a, r + 4096 * i)
eax = 0 # SUCCESS
of = zf = af = pf = sf = UNDEFINEDRun on AMD Zen 5 (EPYC 9645): 2 cases. Its cases ran where CPUID reported no SEV-SNP, and every one raised an exception.
Operands
| Operand | Kind | Action |
|---|---|---|
PSMASH RAX 64-bit mode only | ||
RAX | explicit | read, write |
RFLAGS | implicit | write |
Flags
| OF | SF | ZF | AF | PF |
|---|---|---|---|---|
| All forms | ||||
| M | M | M | M | M |
Attributes
What else XED records about the forms. How to read.
- All forms
- privileged: CPL 0 only
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.
More SEV-SNP 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. - AMD64 Architecture Programmer's Manual, Volume 3: General-Purpose and System Instructions (24594, rev. 3.36, March 2024), Wayback Machine copy of AMD's PDF
- AMD64 Architecture Programmer's Manual, Volume 2: System Programming (24593, rev. 3.42, March 2024), Wayback Machine copy of AMD's PDF
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 text is our own.