8.10 DXE SMM Driver

This module type is used by SMM Drivers that are loaded into SMRAM. As a result, this module type is only available for IA-32 and x64 CPUs. These modules are dispatched by SMM Foundation and are never destroyed. This means the services that these modules produce are available after ExitBootServices().

The lifecycle of SMM drivers can be divided into two phases, which have different constraints. SMM Initialization:

This is the phase of SMM Driver initialization that starts with the call to the driver's entry point and ends with the return from the driver's entry point.

SMM Runtime:

This is the phase of SMM Driver initialization that starts after the return from the driver's entry point.

8.10.1 INF File

Following is the example of [Defines] section for a driver named

SampleDriverDxeSmm. For a SMM driver, the MODULE_TYPE is DXE_SMM_DRIVER.

[Defines]
INF_VERSION = 0x00010005
BASE_NAME = SampleDriverDxeSmm
FILE_GUID = XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
MODULE_TYPE = DXE_SMM_DRIVER
PI_SPECIFICATION_VERSION = 0x0001000A
ENTRY_POINT = SampleDxeSmmDriverEntryPoint
‚Äč
[Depex]
gSampleProtocolGuid

Note: PISPECIFICATIONVERSION should be definitely set to 0x0001000A for PI

1.1 compliant SMM drivers.

8.10.2 Constraints

The SMM driver model has constraints similar to those of DXE Runtime Drivers.

Inside of SMM Runtime, the drivers may not be able to use core protocol services.

There are SMST-based services, which the drivers can access, but the UEFI System Table and other protocols installed during boot services may not necessarily be available.

Inside of SMM Initialization, the full collection of UEFI Boot Services, UEFI Runtime Services and SMST-based services are available.

8.10.2.1 SMM Driver Initialization

An SMM Driver's initialization phase begins when the driver is loaded into SMRAM, and its entry point is called. An SMM Driver's initialization phase ends when the entry point returns.

During SMM Driver initialization, SMM Drivers have access to two sets of protocols:

UEFI protocols and SMM protocols.

UEFI protocols are those installed and discovered using UEFI Boot Services. UEFI protocols can be located and used by SMM drivers only during SMM Initialization.

SMM protocols are those installed and discovered using the System Management Services Table (SMST). SMM protocols can be discovered by SMM drivers during initialization phase and SMM runtime phase.

SMM Drivers must not use the UEFI Boot Services Exit() and ExitBootServices() during SMM Driver Initialization.

8.10.2.2 SMM Driver Runtime

During SMM Driver runtime, SMM drivers only have access to SMST-based services. In addition, depending on the platform architecture, memory areas outside of SMRAM may not be accessible to SMM Drivers. Likewise, memory areas inside of SMRAM may not be accessible to UEFI drivers.

These SMM Driver Runtime characteristics lead to several restrictions regarding the usage of UEFI services:

  • UEFI interfaces and services located during SMM Driver Initialization must not be called or referenced during SMM Driver Runtime. This includes the EFI System Table, the UEFI Boot Services, and the UEFI Runtime Services.

  • Events created during SMM Driver Initialization must be closed before exiting the driver entry point.