Definition
Mode Switch
A Mode Switch is the atomic hardware transition of the CPU privilege level between user mode and kernel mode.
Latency
A mode switch is lightweight compared to a process switch. It requires saving/restoring only the execution flow context (Program Counter, Flags), but does not invalidate memory mappings (TLB) or switch the address space.
Triggers
It is initiated by:
- System Calls: Explicit requests from the program.
- Exceptions: Errors like division by zero.
- Interrupts: External hardware signals.