TianoCore EDK2 master
Loading...
Searching...
No Matches
SmmBaseHob.h File Reference

Go to the source code of this file.

Data Structures

struct  SMM_BASE_HOB_DATA
 

Macros

#define SMM_BASE_HOB_DATA_GUID
 

Variables

EFI_GUID gSmmBaseHobGuid
 

Detailed Description

The Smm Base HOB is used to store the information of: The relocated SmBase address in array for each processor.

The default Smbase for the x86 processor is 0x30000. When SMI happens, processor runs the SMI handler at Smbase+0x8000. Also, the SMM save state area is within Smbase+0x10000. Since it's the start address to store the processor save state and code for the SMI entry point, those info are tiled within an SMRAM allocated or reserved buffer. This tile size shall be enough to cover 3 parts:

  1. Processor SMRAM Save State Map starts at Smbase + 0xfc00
  2. Extra processor specific context start starts at Smbase + 0xfb00
  3. SMI entry point starts at Smbase + 0x8000. Besides, This size should be rounded up to nearest power of 2. The Smm Base HOB producer should be responsible for reserving enough size.

One of the SMM initialization from processor perspective is to relocate and program the new Smbase (in TSEG range) for each processor thread. When the Smbase relocation happens in a PEI module, the PEI module shall produce the SMM_BASE_HOB in HOB database which tells the PiSmmCpuDxeSmm driver (which runs at a later phase) about the new Smbase for each processor. PiSmmCpuDxeSmm driver installs the SMI handler at the SMM_BASE_HOB.Smbase[Index]+0x8000 for processor index. When the HOB doesn't exist, PiSmmCpuDxeSmm driver shall relocate and program the new Smbase itself.

Note:

  1. Smbase relocation process needs to program the vender specific hardware interface to set Smbase, it might be in the thread scope. It's doable to program the hardware interface using DXE MP service protocol in PiSmmCpuDxeSmm entry point. But, considering the standalone MM environment where the CpuMm driver runs in a isolated environment and it cannot invoke any DXE or PEI MP service, we recommend to put the hardware interface programming in a separate PEI module instead of in the PiSmmCpuDxeSmm driver.
  2. There is the hard requirement that SMI Entry Size <= 0x1000, data Size <= 0x1000 in PiSmmCpuDxeSmm. So, this require the allocated or reserved buffer in SMRAM should be >= 0x2000.

Copyright (c) 2023, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file SmmBaseHob.h.

Macro Definition Documentation

◆ SMM_BASE_HOB_DATA_GUID

#define SMM_BASE_HOB_DATA_GUID
Value:
{ \
0xc2217ba7, 0x03bb, 0x4f63, {0xa6, 0x47, 0x7c, 0x25, 0xc5, 0xfc, 0x9d, 0x73} \
}

Definition at line 45 of file SmmBaseHob.h.