# 系统管理模式

**系统管理模式**（System Management Mode，SMM）是 x86 与 x86-64 架构中的一种专用处理器运行模式，其执行特权高于操作系统或虚拟机监控器，固件在该模式下运行处理程序代码，以管理电源管理、热控制、传统设备模拟等底层系统功能。<sup>[1](https://www.intel.com/content/www/us/en/developer/articles/technical/software-security-guidance/technical-documentation/host-firmware-speculative-side-channel-mitigation.html)</sup><sup> • </sup><sup>[2](https://wiki.osdev.org/System_Management_Mode)</sup> 它是英特尔 IA-32 与英特尔 64 处理器的标准架构特性，在 AMD64 架构中亦有实现。<sup>[3](https://www.manualshelf.com/manual/intel/architecture-ia-32/computer-accessories-users-manual/page-58.html)</sup><sup> • </sup><sup>[4](https://www.scs.stanford.edu/~zyedidia/docs/x86/amd-manual.pdf)</sup>

| 关键事实 | 详情 |
|---|---|
| 是什么 | x86 架构上一种独立的 CPU 执行模式，区别于实模式、保护模式和长模式<sup>[1](https://www.intel.com/content/www/us/en/developer/articles/technical/software-security-guidance/technical-documentation/host-firmware-speculative-side-channel-mitigation.html)</sup> |
| 进入机制 | 由芯片组、SMI 引脚或本地 APIC 触发的系统管理中断（SMI），透明地挂起正在运行的代码，保存处理器状态，并跳转到固件定义的处理程序<sup>[5](https://smmsok.github.io/)</sup><sup> • </sup><sup>[6](https://www.intel.com/content/dam/www/public/us/en/documents/reference-guides/efi-smm-cis-v09.pdf)</sup> |
| 工作内存 | 处理程序代码与数据驻留在 SMRAM（系统管理 RAM）中，该区域是从主机 DRAM 中隔离出来的 DRAM，其可缓存性由 SMRR 模型特定寄存器控制<sup>[1](https://www.intel.com/content/www/us/en/developer/articles/technical/software-security-guidance/technical-documentation/host-firmware-speculative-side-channel-mitigation.html)</sup> |
| 退出机制 | RSM 指令恢复已保存的状态，并恢复被中断的程序<sup>[7](https://techyorker.com/system-management-mode-explained-how-smm-interrupts-and-resumes-cpu-work/)</sup> |
| 典型职责 | 电源管理、热控制、传统设备模拟，以及安全启动、认证变量、S3 恢复等安全关键的固件服务<sup>[5](https://smmsok.github.io/)</sup> |
| 特权范围 | 完全访问物理内存、SMRAM、模型特定寄存器、存放 BIOS 变量的 SPI 闪存区域以及 I/O 操作<sup>[8](https://docs.samsungknox.com/admin/fundamentals/whitepaper/samsung-knox-for-pc/protecting-the-smm/)</sup> |
| 文档 | 英特尔在《英特尔 64 与 IA-32 架构软件开发人员手册》第 3C 卷第 32 章中记述了 SMM<sup>[7](https://techyorker.com/system-management-mode-explained-how-smm-interrupts-and-resumes-cpu-work/)</sup> |

## 进入与退出

SMM 通过系统管理中断进入。[芯片组](https://www.edgepedia.org/zh/chipset)检测到已配置的事件（例如热阈值或电源管理请求）后发出 SMI 信号；也可以通过激活基板上的 SMI 逻辑引脚或经由本地 APIC 进入 SMI。<sup>[2](https://wiki.osdev.org/System_Management_Mode)</sup><sup> • </sup><sup>[6](https://www.intel.com/content/dam/www/public/us/en/documents/reference-guides/efi-smm-cis-v09.pdf)</sup> 处理器收到 SMI 后，会透明地挂起当前正在运行的任何内容，将其当前上下文保存到 SMRAM，并开始执行 SMI 处理程序。<sup>[5](https://smmsok.github.io/)</sup><sup> • </sup><sup>[9](https://cdrdv2-public.intel.com/812380/252046-sdm-change-document.pdf)</sup> 处理器在程序执行中架构定义的“可中断”点处理 SMI，通常是在 IA-32 指令边界处。<sup>[9](https://cdrdv2-public.intel.com/812380/252046-sdm-change-document.pdf)</sup>

处理程序完成后，执行 RSM 指令，该指令从 SMRAM 恢复被中断的状态，并在中断到达之处精确恢复执行。<sup>[7](https://techyorker.com/system-management-mode-explained-how-smm-interrupts-and-resumes-cpu-work/)</sup> 对操作系统而言，除了流逝的时间之外，整个过程通常是不可见的。

## SMM 执行环境与 SMRAM

系统管理软件执行体（即 SMI 处理程序）在专用环境中开始执行，其关键代码和数据驻留在一个称为 SMRAM 的物理内存区域中，该区域位于独立的地址空间内。<sup>[10](https://cdrdv2-public.intel.com/789585/326019-sdm-vol-3c.pdf)</sup> 固件指定用作 SMRAM 的 RAM 区域，并指定发生 SMI 时 CPU 跳转到的入口点。<sup>[2](https://wiki.osdev.org/System_Management_Mode)</sup>

SMRAM 通常与主机 DRAM 隔离，其可缓存性属性由系统管理模式范围寄存器（SMRR）描述。<sup>[1](https://www.intel.com/content/www/us/en/developer/articles/technical/software-security-guidance/technical-documentation/host-firmware-speculative-side-channel-mitigation.html)</sup> 芯片组的支持决定了 SMRAM 可以位于何处。例如，英特尔 82925X/82925XE 内存控制器中枢提供了三种 SMRAM 选项：支持兼容 SMI 处理程序的 1MB 以下选项，地址为 000A_0000h 至 000B_FFFFh；“高”选项，地址为 FEDA_0000h 至 FEDB_FFFFh；以及从 TOLUD（低端可用 DRAM 顶部）值以下可用 DRAM 顶部划出的 TSEG 选项。<sup>[11](https://www.manualowl.com/m/Intel/925/Manual/360592?page=167)</sup>

## SMM 的用途

SMM 是为电源管理等系统控制活动而设计的。<sup>[4](https://www.scs.stanford.edu/~zyedidia/docs/x86/amd-manual.pdf)</sup> 在实践中，它处理电源管理、热控制、传统设备模拟，以及包括安全启动、认证变量和从睡眠中 S3 恢复在内的安全关键固件服务。<sup>[5](https://smmsok.github.io/)</sup> 它旨在供固件在操作系统运行时执行底层系统管理操作；没有操作系统直接使用它。<sup>[2](https://wiki.osdev.org/System_Management_Mode)</sup>

由于该模式在运行时以极高特权执行固件代码，它也被提议作为一种防御工具。EPA-RIMM 等运行时完整性度量框架利用 SMM 检测操作系统和虚拟机监控器在运行期间的意外变化，将长时间运行的度量分解为较短的任务，使恶意代码难以检测或规避度量。<sup>[12](https://arxiv.org/abs/1805.03755)</sup>

## SMM 与虚拟化

在支持 VMX（虚拟机扩展）的处理器上，SMI 和 SMM 可以以两种方式之一使用，Intel SDM 在系统管理模式与 VMX 操作的论述中对此作了描述。<sup>[9](https://cdrdv2-public.intel.com/812380/252046-sdm-change-document.pdf)</sup>

该模式为 x86 所特有。在安腾架构中，没有为可管理性中断设置专门的处理器模式。<sup>[6](https://www.intel.com/content/dam/www/public/us/en/documents/reference-guides/efi-smm-cis-v09.pdf)</sup> 在 x86 内部，AMD64 与旧式英特尔架构对 SMM 的实现方式相似；在 SMM 机制中，AMD64 架构与旧式架构之间只有 SMRAM 保存状态区域的格式不同，而模型特定的细节记录在各处理器系列的 BKDG 或处理器编程参考中。<sup>[4](https://www.scs.stanford.edu/~zyedidia/docs/x86/amd-manual.pdf)</sup>

## 安全暴露面

SMM 的强大之处也正是它的问题所在。它可以完全访问物理内存、SMRAM、模型特定寄存器、存储 BIOS 变量的 SPI 闪存区域以及 I/O 操作，而 SMM 中的安全关键数据结构仍然容易受到未经授权的写入攻击。<sup>[8](https://docs.samsungknox.com/admin/fundamentals/whitepaper/samsung-knox-for-pc/protecting-the-smm/)</sup> 由于 SMM 运行在操作系统内核之下，其中的漏洞可能难以被传统安全工具发现或禁用。<sup>[13](https://www.tomshardware.com/pc-components/motherboards/critical-uefi-vulnerabilities-found-in-gigabyte-motherboards-allow-attackers-to-bypass-secure-boot-and-install-firmware-backdoors)</sup>

**SMI 处理程序验证。** 一个反复出现的弱点是通信缓冲区接口。SMI 处理程序依赖特定的通信缓冲区来处理来自操作系统的数据；当处理程序不验证这些数据时，攻击者可以在操作系统加载之前于 SMM 中执行任意代码。<sup>[13](https://www.tomshardware.com/pc-components/motherboards/critical-uefi-vulnerabilities-found-in-gigabyte-motherboards-allow-attackers-to-bypass-secure-boot-and-install-firmware-backdoors)</sup> 2025 年，固件安全研究公司 Binarly 在多块技嘉主板的 UEFI 固件中发现了四个漏洞——CVE-2025-7029、CVE-2025-7028、CVE-2025-7027 和 CVE-2025-7026，每个漏洞的 CVSS 评分均为 8.2（高）。其中三个涉及未检查的寄存器或指针解引用，可导致任意 SMRAM 写入；另一个则通过未验证的函数指针让攻击者控制闪存操作。根据 CERT 的报告，拥有管理访问权限的攻击者可以利用这些缺陷在 SMM 中执行任意代码、绕过[安全启动](https://www.edgepedia.org/zh/secure-boot)并安装隐蔽的固件植入物，攻击可从操作系统内部或早期启动、睡眠或恢复状态期间触发。<sup>[13](https://www.tomshardware.com/pc-components/motherboards/critical-uefi-vulnerabilities-found-in-gigabyte-motherboards-allow-attackers-to-bypass-secure-boot-and-install-firmware-backdoors)</sup>

**基于缓存的攻击。** SMRAM 保护模型本身也遭到了攻击。由于 SMRAM 地址空间可以是可缓存的，SMM 之外的代码可以绕过芯片组对 DRAM 芯片的保护，覆写处理器缓存中保存的 SMRAM 内容。<sup>[14](https://ittc.ku.edu/~bluo/pubs/Lin2016Secure.pdf)</sup> 研究还探索了从该模式之外检测 SMM 攻击的方法，即使用隔离的协处理器对运行时执行的高特权固件代码进行基于事件的行为监控。<sup>[15](https://arxiv.org/abs/1803.02700)</sup>

**缓解措施。** 平台厂商已通过加固特性作出回应。微软的固件攻击面缩减文档描述了 SMM IPL 代码如何配置控制寄存器以限制对存放 SMM 代码和数据的内存区域的访问。<sup>[16](https://learn.microsoft.com/is-is/windows-hardware/drivers/bringup/firmware-attack-surface-reduction)</sup> 英特尔也记录了针对触及主机固件的推测执行侧信道的缓解措施，这是一类特定于 SMM 执行上下文的攻击。<sup>[1](https://www.intel.com/content/www/us/en/developer/articles/technical/software-security-guidance/technical-documentation/host-firmware-speculative-side-channel-mitigation.html)</sup>

## References

1. [Host Firmware Speculative Execution Side Channel Mitigation, Intel Software Security Guidance](https://www.intel.com/content/www/us/en/developer/articles/technical/software-security-guidance/technical-documentation/host-firmware-speculative-side-channel-mitigation.html)
2. [System Management Mode, OSDev Wiki](https://wiki.osdev.org/System_Management_Mode)
3. [Intel Architecture IA-32 User's Manual, Modes of Operation](https://www.manualshelf.com/manual/intel/architecture-ia-32/computer-accessories-users-manual/page-58.html)
4. [AMD64 Architecture Programmer's Manual, Volume 2: System Programming](https://www.scs.stanford.edu/~zyedidia/docs/x86/amd-manual.pdf)
5. [SMM SoK: Offensive landscape of x86 System Management Mode](https://smmsok.github.io/)
6. [Intel Platform Innovation Framework for EFI SMM Core Interface Specification (SMM CIS)](https://www.intel.com/content/dam/www/public/us/en/documents/reference-guides/efi-smm-cis-v09.pdf)
7. [What Is System Management Mode (SMM)? Intel CPU Basics, TechYorker](https://techyorker.com/system-management-mode-explained-how-smm-interrupts-and-resumes-cpu-work/)
8. [Protecting the SMM, Samsung Knox Documentation](https://docs.samsungknox.com/admin/fundamentals/whitepaper/samsung-knox-for-pc/protecting-the-smm/)
9. [Intel 64 and IA-32 Architectures SDM Documentation Changes (SMM and VMX Operation)](https://cdrdv2-public.intel.com/812380/252046-sdm-change-document.pdf)
10. [Intel 64 and IA-32 Architectures Software Developer's Manual, Volume 3C: System Programming Guide, Part 3](https://cdrdv2-public.intel.com/789585/326019-sdm-vol-3c.pdf)
11. [Intel 925X/925XE MCH Datasheet, SMM Space Definition](https://www.manualowl.com/m/Intel/925/Manual/360592?page=167)
12. [EPA-RIMM: A Framework for Dynamic SMM-based Runtime Integrity Measurement, arXiv](https://arxiv.org/abs/1805.03755)
13. [Critical UEFI vulnerabilities found in Gigabyte motherboards, Tom's Hardware (15 July 2025)](https://www.tomshardware.com/pc-components/motherboards/critical-uefi-vulnerabilities-found-in-gigabyte-motherboards-allow-attackers-to-bypass-secure-boot-and-install-firmware-backdoors)
14. [Secure Computing Using Registers and Caches: The Problem, Challenges, and Solutions](https://ittc.ku.edu/~bluo/pubs/Lin2016Secure.pdf)
15. [Co-processor-based Behavior Monitoring: Application to the Detection of Attacks Against the System Management Mode, arXiv](https://arxiv.org/abs/1803.02700)
16. [Firmware Attack Surface Reduction (FASR), Microsoft Learn](https://learn.microsoft.com/is-is/windows-hardware/drivers/bringup/firmware-attack-surface-reduction)

---
*Initially written Oct 15, 2026*

Topic: 技术与人造世界 › 计算技术与数字系统 › 计算机硬件 › Processors & processor engineering › Instruction set architectures › CPU operating modes and ISA-support mechanisms

Copyright 2026 Edgepedia

License: Edgepedia Community License 1.0, https://www.edgepedia.org/edgepedia/license

Source: https://www.edgepedia.org/zh/system-management-mode

English original: https://www.edgepedia.org/system-management-mode
