IT lexicon › Hardware › Machine mode (M-mode)

Machine mode (M-mode)

Hardware På svenska → Updated: 2026-11-04

The top privilege level in RISC-V — the only one every core must implement, and where nearly all microcontroller firmware actually lives.

The privileged spec defines three levels: machine (M), supervisor (S) and user (U). Only M is mandatory. A small microcontroller can get by with M alone and run its firmware bare metal, while a core meant for Linux needs all three: OpenSBI in M, the kernel in S, applications in U. The hypervisor extension stacks virtualised flavours of S and U on top.

Code in M-mode can touch every CSR whose name starts with m — mstatus, mtvec, mcause — and every trap lands here unless it has been explicitly delegated downwards. It is roughly Cortex-M's privileged handler mode, minus the architecture's opinions about which stack pointer you should be using.

← Back to the lexicon