System
FSGSBASE
RDFSBASE, RDGSBASE, WRFSBASE and WRGSBASE read and write the FS and GS segment bases in 64-bit mode, once the operating system has enabled them in CR4.
- CPUID
- FSGSBASE
CPUID.(EAX=07H,ECX=0):EBX[0] - Instructions
- 4 mnemonics
- Processors
- Ivy Bridge, Haswell, Broadwell, Skylake, Comet Lake, Cannon Lake, Ice Lake (client), Tiger Lake, Alder Lake, Arrow Lake, Panther Lake, Nova Lake, Skylake-SP, Cascade Lake, Cooper Lake, Ice Lake (server), Sapphire Rapids, Emerald Rapids, Granite Rapids, Diamond Rapids, Goldmont, Goldmont Plus, Tremont, Snow Ridge, Lakefield, Sierra Forest, Clearwater Forest, Knights Landing, Knights Mill, Bulldozer, Piledriver, Zen, Zen+, Zen 2, Zen 3, Zen 4, Zen 5, Zen 6
In 64-bit mode the FS and GS segments are mostly just a base address,
and FS points to the current thread’s thread-local storage on x86-64
Linux (see the thread pointer).
Without these instructions only the kernel could change the bases, so a
program asked it with a system call, arch_prctl() on Linux.
RDFSBASE, RDGSBASE,
WRFSBASE and WRGSBASE read and
write them directly.
They work only in 64-bit mode and only after the kernel has set
CR4.FSGSBASE, since older kernels relied on the bases they had set;
otherwise they raise #UD. Linux reports the enabled state with
HWCAP2_FSGSBASE in the auxiliary vector. Intel introduced them with
Ivy Bridge.
Instructions
| Mnemonic | Summary | Forms |
|---|---|---|
| RDFSBASE | Reads the FS base, where x86-64 Linux keeps a thread's TLS pointer, into a register; 64-bit mode, when the kernel set CR4.FSGSBASE. | 1 |
| RDGSBASE | Reads the GS base into a register; 64-bit mode, when the kernel set CR4.FSGSBASE. | 1 |
| WRFSBASE | Writes the FS base from a register, so a thread can change its TLS pointer without a system call; 64-bit mode, with CR4.FSGSBASE. | 1 |
| WRGSBASE | Writes the GS base from a register; 64-bit mode, when the kernel set CR4.FSGSBASE. | 1 |
CPUID and processors
XED splits FSGSBASE into 1 ISA set. Software can use a form when the processor reports every CPUID bit of one alternative of the form's ISA set.
| ISA set | CPUID | Processors |
|---|---|---|
RDWRFSGS | FSGSBASE | Ivy Bridge, Haswell, Broadwell, Skylake, Comet Lake, Cannon Lake, Ice Lake (client), Tiger Lake, Alder Lake, Arrow Lake, Panther Lake, Nova Lake, Skylake-SP, Cascade Lake, Cooper Lake, Ice Lake (server), Sapphire Rapids, Emerald Rapids, Granite Rapids, Diamond Rapids, Goldmont, Goldmont Plus, Tremont, Snow Ridge, Lakefield, Sierra Forest, Clearwater Forest, Knights Landing, Knights Mill, Bulldozer, Piledriver, Zen, Zen+, Zen 2, Zen 3, Zen 4, Zen 5, Zen 6 |
Sources
- Intel XED v2026.08.23 (commit
0bcb6237345c): forms, encodings, 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)
- Linux kernel documentation: Using FS and GS segments in user space applications
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.