Extensions
Forms
1 (1 Legacy)
Data
Intel XED v2026.08.23

WRMSR writes EDX:EAX into the model-specific register whose number is in ECX, the high half from EDX; bits 63:32 of RCX, RAX and RDX do not count. It is how a kernel sets up much of the processor: EFER, the SYSCALL targets in STAR and LSTAR, the FS, GS and kernel GS bases that SWAPGS exchanges, the memory type ranges. RDMSR reads them back.

What it checks

WRMSR runs only at CPL 0 (or in real mode) and raises #GP(0) elsewhere: Zen 5 recorded that at CPL 3 for EFER and the time stamp counter, and changed nothing. At CPL 0 it also raises #GP(0) for an MSR that does not exist, for a value that sets a reserved bit, and, for the MSRs that hold addresses, for an address that is not canonical: Intel’s manual names the FS, GS and kernel GS bases, LSTAR, the SYSENTER entry point and stack, and the debug store area. AMD’s manual says that SWAPGS relies on this check and does none of its own. Intel’s manual asks that undefined and reserved bits be written with the values read before, so a write usually follows a read.

A serializing write

WRMSR is serializing in both manuals: everything before it completes, and its buffered stores reach memory, before anything after it starts. Each manual makes exceptions. Intel’s names IA32_TSC_DEADLINE and the x2APIC MSRs; AMD’s names SPEC_CTRL, PRED_CMD, FLUSH_CMD and the x2APIC MSRs, and some AVIC ones. A write to a memory type range register also invalidates the TLBs, global entries included (Intel’s manual). Code that used WRMSR to serialize can use SERIALIZE instead, Intel’s manual suggests, and writes that need no serializing can use WRMSRNS or, for up to 64 MSRs from a table, WRMSRLIST, neither of them serializing. All three, Intel’s manual says, keep instructions before them from using the new value and make those after them use it.

Writes from user mode

UWRMSR writes, at any CPL, only the MSRs that the OS allows in a bitmap, today IA32_UARCH_MISC_CTL alone, and without serializing. Under VMX and SVM, the hypervisor’s MSR bitmap or permissions map decides which writes of a guest exit to it. AMD’s Zen 5 guide lists WRMSR as microcoded and names it among the serializing instructions that close write combining.

Vulnerability mitigations

Mitigations of these processor vulnerabilities use WRMSR:

Forms

Every encoding of WRMSR that Intel XED knows, one row per XED instruction form (iform). How to read the notation.
InstructionEncodingRequires
WRMSR WRMSR0F 30Base instruction set

Latency and throughput

What the scheduling models of LLVM 23.1.2 give for each form, not measurements: latency / reciprocal throughput in cycles, the ports under them. A row is a model, or models that agree; a dash, a form that its processors lack. Memory forms: latency from the address, ports without the load and store units. Which processors each model covers.
ModelWRMSR
Sandy Bridge100 / 0.33p015
Haswell, Broadwell, Skylake, Skylake-SP, Ice Lake100 / 0.25p0156
Alder Lake, Sapphire Rapids100 / 35.5p01456789
Lunar Lake100 / 21V0 V1 V2 V3 p0 p1 p10 p11 p2 p25 p26 p27 p3 p4 p5
Bonnell202 / 101p01
Silvermont100 / 1FPC0
Piledriver100 / 0.5EX0 EX1
Zen, Zen 2100 / 0.25
Zen 3, Zen 4100 / 25ALU0 ALU1 ALU2 ALU3
Jaguar100 / 0.5ALU0 ALU1

Operation

What the forms do, in pseudocode that our tests run against results recorded on real processors. How to read.

if CPL > 0:
    fault(GP, 0)
n = ecx                          # bits 63:32 of RCX, RAX and RDX do
v = edx << 32 | eax              # not count
if not msr_allows(n, v):
    fault(GP, 0)                 # an MSR it lacks, a reserved bit
                                 # set, or an address that is not
                                 # canonical
msr[n] = v
# serializing: the instructions after it wait until it is done; a
# write to an MTRR also flushes the TLBs

Run on AMD Zen 5 (EPYC 9645): 2 cases. Every one raised an exception, at CPL 3, where the probe runs.

Operands

What each form reads and writes, as Intel XED records it: the operands of its syntax, in order, and the implicit ones that the syntax does not name. How to read.
OperandKindAction
WRMSR
EAXimplicitread
EDXimplicitread
ECXimplicitread
MSRsimplicitwrite

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
privileged: CPL 0 only; 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.

CPUID requirements and processors of the XED ISA sets above. Alternatives are separated by “or”; processors follow XED’s chip model, whose AMD processors end with Zen 2, and the CPU data of this site for Zen 3 to Zen 6.
ISA setCPUIDProcessors
PENTIUMREAL

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

  1. Intel XED v2026.08.23 (commit 0bcb6237345c): forms, encodings, operands, flags, exception classes, attributes, ISA sets, CPUID bits and chip model.
  2. The CPU data of x86-64.net: Zen 3 to Zen 6, from GCC’s -march feature sets and AMD’s Processor Programming References, which the page of each processor cites.
  3. LLVM 23.1.2's x86 scheduling models (commit 85ac56026243): the latency, reciprocal throughput and ports of each form, as llvm-mca reports them.
  4. Intel 64 and IA-32 Architectures Software Developer's Manual, Volume 2 (325383-093, September 2026): Volume 2D, page 6-8 (WRMSR)
  5. Intel 64 and IA-32 Architectures Software Developer's Manual, Volume 3 (325384-093, September 2026)
  6. AMD64 Architecture Programmer's Manual, Volume 2: System Programming (24593, rev. 3.46, October 2026)
  7. AMD64 Architecture Programmer's Manual, Volume 3: General-Purpose and System Instructions (24594, rev. 3.39, October 2026)
  8. Software Optimization Guide for the AMD Zen5 Microarchitecture (58455, rev. 1.00, August 2024), Wayback Machine copy of AMD's ZIP

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.