Instruction
SGDT
Stores the base and limit of the global descriptor table to memory; user code may run it unless CR4.UMIP is set.
- Extensions
- Forms
- 2 (2 Legacy)
- Data
- Intel XED v2026.08.23
SGDT stores the global descriptor table register, GDTR, to memory: first its 16-bit limit, the size of the table in bytes minus one, then its base address. In 64-bit mode the operand is 10 bytes, 2 of limit and 8 of base, whatever the operand size; outside 64-bit mode it is 6 bytes with a 32-bit base. AMD’s manual says that operand-size prefixes are ignored in every mode, and Intel’s stores the full 32-bit base with a 16-bit operand size too, noting only that the 286 had set the top byte of the 24-bit base to ones. LGDT loads the register; SIDT is the same store for the interrupt descriptor table, and SLDT and STR store the selectors of the LDT and the task register.
Memory only
The operand must be in memory. The bytes 0F 01 with a ModR/M byte that names a register belong to other instructions, such as VMCALL (0F 01 C1), VMLAUNCH, VMRESUME, VMXOFF, PCONFIG and WRMSRNS; AMD’s manual lists a register operand as a cause of #UD. The headers of GCC 14 and Clang 23 have no intrinsic for SGDT, so C code reaches it with inline assembly, storing into a packed structure of a 16-bit limit followed by the base.
User-mode instruction prevention
Both manuals allow SGDT at any privilege level, so before UMIP any program could learn where the kernel keeps its GDT, and SIDT the IDT, which are addresses in kernel memory. UMIP (CPUID leaf 7, ECX bit 2), enabled by CR4 bit 11, makes SGDT, SIDT, SLDT, SMSW and STR raise #GP(0) at CPL above 0; at CPL 0 they work as before. Intel’s and AMD’s manuals agree on this, though AMD’s description of SGDT itself does not list the fault: it appears in its description of CR4 and of system instructions in Volume 2. The Zen 5 behind this site’s recorded cases reports UMIP in CPUID leaf 7.
The probe does not run SGDT, for the reasons its Operation section gives.
Forms
| Instruction | Encoding | Requires |
|---|---|---|
SGDT m16&64 64-bit mode only
SGDT_MEMs64 | 0F 01 /0 | Base instruction set |
SGDT m16&32 not in 64-bit mode
SGDT_MEMs | 0F 01 /0 | Base instruction set |
Operation
What the forms do, in pseudocode that our tests run against results recorded on real processors. How to read.
if CPL > 0 and cr4 >> 11 & 1: # CR4.UMIP
fault(GP, 0) # Linux 7.2 emulates it: limit 0,
# base FFFFFFFFFFFE0000H
dest.write(gdtr) # the limit, 2 bytes, then the base:
# 8 bytes in 64-bit mode, whatever
# the operand size; 4 outside it
# a register operand: #UDNot run on a processor: at CPL 3 with CR4.UMIP set, as Linux sets it, SGDT raises #GP(0), and Linux 7.2 emulates it for programs with made-up values; SGDT m16&32 does not exist in 64-bit mode, where the probe runs.
Operands
| Operand | Kind | Action |
|---|---|---|
SGDT m16&64 64-bit mode only SGDT m16&32 not in 64-bit mode | ||
m16&64, m16&32 | explicit | write |
GDTR | implicit | read |
Flags
None: XED records no flag that the forms test or change.
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 |
|---|---|---|
I286REAL | 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. - Intel 64 and IA-32 Architectures Software Developer's Manual, Volume 2 (325383-093, September 2026): Volume 2B, page 4-629 (SGDT)
- 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.42, March 2024), Wayback Machine copy of AMD's PDF
- 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
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.