ArticleslgStudy

science

System Management Mode

System Management Mode is a science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand System Management Mode rather than just read about it. In short: System Management Mode (SMM, sometimes called ring −2 in reference to protection rings) is an operating mode of x86 central processor units (CPUs) in which all normal execution, including the operating system, is suspended. An alternate software system which usually resides in the computer's firmware, or a hardware-assisted debugger, is then executed with high privileges.

Key takeaways

  • System Management Mode belongs to science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect System Management Mode to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of System Management Mode from memory before moving on to harder problems.

Reference excerpt

System Management Mode (SMM, sometimes called ring −2 in reference to protection rings) is an operating mode of x86 central processor units (CPUs) in which all normal execution, including the operating system, is suspended. An alternate software system which usually resides in the computer's firmware, or a hardware-assisted debugger, is then executed with high privileges. It was first released with the Intel 386SL. While initially special SL versions were required for SMM, Intel incorporated SMM in its mainline 486 and Pentium processors in 1993. AMD implemented Intel's SMM with the Am386 processors in 1991. It is available in all later microprocessors in the x86 architecture. In ARM architecture the Exception Level 3 (EL3) mode is also referred as Secure Monitor Mode or System Management Mode.

Operation SMM is a special-purpose operating mode provided for handling system-wide functions like power management, system hardware control, or proprietary OEM designed code. It is intended for use only by system firmware (BIOS or UEFI), not by applications software or general-purpose systems software. The main benefit of SMM is that it offers a distinct and easily isolated processor environment that operates transparently to the operating system or executive and software applications. In order to achieve transparency, SMM imposes certain rules. The SMM can only be entered through SMI (System Management Interrupt). The processor executes the SMM code in a separate address space (SMRAM) that has to be made inaccessible to other operating modes of the CPU by the firmware. System Management Mode can address up to 4 GB memory as huge real mode. In x86-64 processors, SMM can address > 4 GB memory as real address mode.

Usage Initially, System Management Mode was used for implementing power management and hardware control features like Advanced Power Management (APM). However, BIOS manufacturers and OEMs have relied on SMM for newer functionality like Advanced Configuration and Power Interface (ACPI). Some uses of the System Management Mode are:

Handle system events like memory or chipset errors Manage system safety functions, such as shutdown on high CPU temperature System Management BIOS (SMBIOS) Advanced Configuration and Power Interface Control power management operations, such as managing the voltage regulator module and LPCIO (super I/O or embedded controller) Emulate USB mouse/keyboard as PS/2 mouse/keyboard (often referred to as USB legacy support) Centralize system configuration, such as on Toshiba and IBM/Lenovo notebook computers Managing the Trusted Platform Module (TPM) BIOS-specific hardware control programs, including USB hotswap and Thunderbolt hotswap in operating system runtime BIOS-based security features such as antivirus and backup in MS-DOS and Windows 9x era (With the succession of Windows 2000 and Windows XP (Windows NT based), such features are invalid in Windows NT and operations switched to Windows NT drivers) System Management Mode can also be abused to run high-privileged rootkits, as demonstrated at Black Hat 2008 and 2015.

Entering SMM SMM is entered via the SMI (system management interrupt), which is invoked by:

Motherboard hardware or chipset signaling via a designated pin SMI# of the processor chip. This signal can be an independent event. Software SMI triggered by the system software via an I/O access to a location considered special by the motherboard logic (port 0B2h is common). An I/O write to a location which the firmware has requested that the processor chip act on. By entering SMM, the processor looks for the first instruction at the address SMBASE (SMBASE register content) + 8000h (by default 38000h), using registers CS = 3000h and EIP = 8000h. The CS register value (3000h) is due to the use of real-mode memory addresses by the processor when in SMM. In this case, the CS is internally appended with 0h on its rightmost end.

Problems By design, the operating system cannot override or disable the SMI. Due to this fact, it is a target for malicious rootkits to reside in, including NSA's "implants", which have individual code names for specific hardware, like SOUFFLETROUGH for Juniper Networks firewalls, SCHOOLMONTANA for J-series routers of the same company, DEITYBOUNCE for DELL, or IRONCHEF for HP Proliant servers. Improperly designed and insufficiently tested SMM BIOS code can make the wrong assumptions and not work properly when interrupting some other x86 operating modes like PAE or 64-bit long mode. According to the documentation of the Linux kernel, around 2004, such buggy implementations of the USB legacy support feature were a common cause of crashes, for example, on motherboards based on the Intel E7505 chipset. Since the SMM code (SMI handler) is installed by the system firmware (BIOS), the OS and the SMM code may have expectations about hardware settings that are incompatible, such as different ideas of how the Advanced Programmable Interrupt Controller (APIC) should be set up. Operations in SMM take CPU time away from the applications, operating-system kernel and hypervisor, with the effects magnified for multicore processors, since each SMI causes all cores to switch modes. There is also some overhead involved with switching in and out of SMM, since the CPU state must be stored to memory (SMRAM) and any write-back caches must be flushed. This can destroy real-time behavior and cause clock ticks to get lost. The Windows and Linux kernels define an "SMI Timeout" setting – a period within which SMM handlers must return control to the operating system, or it will "hang" or "crash". The SMM may disrupt the behavior of real-time applications with constrained timing requirements. A logic analyzer may be required to determine whether the CPU has entered SMM (checking state of SMIACT# pin of CPU). Recovering the SMI handler code to analyze it for bugs, vulnerabilities and secrets requires a logic analyzer or disassembly of the system firmware.

See also Coreboot – includes an open-source SMM/SMI handler implementation for some chipsets Intel 80486SL LOADALL MediaGX – a processor which emulates nonexistent hardware via SMM Ring −3 Unified Extensible Firmware Interface (UEFI) Basic Input/Output System (BIOS) Speculative execution CPU vulnerabilities

References

… excerpt ends here. Continue reading the full article.

Worked examples

Example 1 — a first encounter with System Management Mode

Start with the simplest possible case. Write down what System Management Mode claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to System Management Mode before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about System Management Mode ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of System Management Mode

In research
System Management Mode appears in science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses System Management Mode in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
System Management Mode is common in secondary-school and first-year university syllabi. It links to neighbouring topics ARM architecture, BIOS, Rootkits, so understanding it makes those chapters shorter.
In everyday life
Look for System Management Mode outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “System Management Mode” →

How to study System Management Mode in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what System Management Mode means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain System Management Mode out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is System Management Mode in simple terms?

System Management Mode (SMM, sometimes called ring −2 in reference to protection rings) is an operating mode of x86 central processor units (CPUs) in which all normal execution, including the operating system, is suspended. An alternate software system which usually resides in the computer's firmwa…

Why does System Management Mode matter?

Because it connects several science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study System Management Mode?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on System Management Mode.

Tags

  • ARM architecture
  • BIOS
  • Rootkits
  • X86 operating modes

Keep exploring