StandaloneMmPkg/Core: Implementation of Standalone MM Core Module.
Management Mode (MM) is a generic term used to describe a secure
execution environment provided by the CPU and related silicon that is
entered when the CPU detects a MMI. For x86 systems, this can be
implemented with System Management Mode (SMM). For ARM systems, this can
be implemented with TrustZone (TZ).
A MMI can be a CPU instruction or interrupt. Upon detection of a MMI, a
CPU will jump to the MM Entry Point and save some portion of its state
(the "save state") such that execution can be resumed.
The MMI can be generated synchronously by software or asynchronously by
a hardware event. Each MMI source can be detected, cleared and disabled.
Some systems provide for special memory (Management Mode RAM or MMRAM)
which is set aside for software running in MM. Usually the MMRAM is
hidden during normal CPU execution, but this is not required. Usually,
after MMRAM is hidden it cannot be exposed until the next system reset.
The MM Core Interface Specification describes three pieces of the PI
Management Mode architecture:
1. MM Dispatch
During DXE, the DXE Foundation works with the MM Foundation to
schedule MM drivers for execution in the discovered firmware volumes.
2. MM Initialization
MM related code opens MMRAM, creates the MMRAM memory map, and
launches the MM Foundation, which provides the necessary services to
launch MM-related drivers. Then, sometime before boot, MMRAM is
closed and locked. This piece may be completed during the
SEC, PEI or DXE phases.
3. MMI Management
When an MMI generated, the MM environment is created and then the MMI
sources are detected and MMI handlers called.
This patch implements the MM Core.
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Sughosh Ganu <sughosh.ganu@arm.com>
Signed-off-by: Supreeth Venkatesh <supreeth.venkatesh@arm.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
2018-07-13 17:05:27 +02:00
|
|
|
/** @file
|
|
|
|
Module entry point library for STANDALONE MM core.
|
|
|
|
|
|
|
|
Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
|
|
|
|
Copyright (c) 2016 - 2018, ARM Limited. All rights reserved.<BR>
|
|
|
|
|
2019-04-04 01:07:12 +02:00
|
|
|
SPDX-License-Identifier: BSD-2-Clause-Patent
|
StandaloneMmPkg/Core: Implementation of Standalone MM Core Module.
Management Mode (MM) is a generic term used to describe a secure
execution environment provided by the CPU and related silicon that is
entered when the CPU detects a MMI. For x86 systems, this can be
implemented with System Management Mode (SMM). For ARM systems, this can
be implemented with TrustZone (TZ).
A MMI can be a CPU instruction or interrupt. Upon detection of a MMI, a
CPU will jump to the MM Entry Point and save some portion of its state
(the "save state") such that execution can be resumed.
The MMI can be generated synchronously by software or asynchronously by
a hardware event. Each MMI source can be detected, cleared and disabled.
Some systems provide for special memory (Management Mode RAM or MMRAM)
which is set aside for software running in MM. Usually the MMRAM is
hidden during normal CPU execution, but this is not required. Usually,
after MMRAM is hidden it cannot be exposed until the next system reset.
The MM Core Interface Specification describes three pieces of the PI
Management Mode architecture:
1. MM Dispatch
During DXE, the DXE Foundation works with the MM Foundation to
schedule MM drivers for execution in the discovered firmware volumes.
2. MM Initialization
MM related code opens MMRAM, creates the MMRAM memory map, and
launches the MM Foundation, which provides the necessary services to
launch MM-related drivers. Then, sometime before boot, MMRAM is
closed and locked. This piece may be completed during the
SEC, PEI or DXE phases.
3. MMI Management
When an MMI generated, the MM environment is created and then the MMI
sources are detected and MMI handlers called.
This patch implements the MM Core.
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Sughosh Ganu <sughosh.ganu@arm.com>
Signed-off-by: Supreeth Venkatesh <supreeth.venkatesh@arm.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
2018-07-13 17:05:27 +02:00
|
|
|
|
|
|
|
**/
|
|
|
|
|
|
|
|
#ifndef __MODULE_ENTRY_POINT_H__
|
|
|
|
#define __MODULE_ENTRY_POINT_H__
|
|
|
|
|
|
|
|
///
|
|
|
|
/// Global variable that contains a pointer to the Hob List passed into the STANDALONE MM Core entry point.
|
|
|
|
///
|
|
|
|
extern VOID *gHobList;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
The entry point of PE/COFF Image for the STANDALONE MM Core.
|
|
|
|
|
|
|
|
This function is the entry point for the STANDALONE MM Core. This function is required to call
|
|
|
|
ProcessModuleEntryPointList() and ProcessModuleEntryPointList() is never expected to return.
|
|
|
|
The STANDALONE MM Core is responsible for calling ProcessLibraryConstructorList() as soon as the EFI
|
|
|
|
System Table and the image handle for the STANDALONE MM Core itself have been established.
|
|
|
|
If ProcessModuleEntryPointList() returns, then ASSERT() and halt the system.
|
|
|
|
|
|
|
|
@param HobStart Pointer to the beginning of the HOB List passed in from the PEI Phase.
|
|
|
|
|
|
|
|
**/
|
|
|
|
VOID
|
|
|
|
EFIAPI
|
|
|
|
_ModuleEntryPoint (
|
|
|
|
IN VOID *HobStart
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
Required by the EBC compiler and identical in functionality to _ModuleEntryPoint().
|
|
|
|
|
|
|
|
This function is required to call _ModuleEntryPoint() passing in HobStart.
|
|
|
|
|
|
|
|
@param HobStart Pointer to the beginning of the HOB List passed in from the PEI Phase.
|
|
|
|
|
|
|
|
**/
|
|
|
|
VOID
|
|
|
|
EFIAPI
|
|
|
|
EfiMain (
|
|
|
|
IN VOID *HobStart
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
Auto generated function that calls the library constructors for all of the module's dependent libraries.
|
|
|
|
|
|
|
|
This function must be called by _ModuleEntryPoint().
|
|
|
|
This function calls the set of library constructors for the set of library instances
|
|
|
|
that a module depends on. This includes library instances that a module depends on
|
|
|
|
directly and library instances that a module depends on indirectly through other
|
|
|
|
libraries. This function is auto generated by build tools and those build tools are
|
|
|
|
responsible for collecting the set of library instances, determine which ones have
|
|
|
|
constructors, and calling the library constructors in the proper order based upon
|
|
|
|
each of the library instances own dependencies.
|
|
|
|
|
|
|
|
@param ImageHandle The image handle of the STANDALONE MM Core.
|
|
|
|
@param SystemTable A pointer to the EFI System Table.
|
|
|
|
|
|
|
|
**/
|
|
|
|
VOID
|
|
|
|
EFIAPI
|
|
|
|
ProcessLibraryConstructorList (
|
|
|
|
IN EFI_HANDLE ImageHandle,
|
|
|
|
IN EFI_MM_SYSTEM_TABLE *MmSystemTable
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
Autogenerated function that calls a set of module entry points.
|
|
|
|
|
|
|
|
This function must be called by _ModuleEntryPoint().
|
|
|
|
This function calls the set of module entry points.
|
|
|
|
This function is auto generated by build tools and those build tools are responsible
|
|
|
|
for collecting the module entry points and calling them in a specified order.
|
|
|
|
|
|
|
|
@param HobStart Pointer to the beginning of the HOB List passed in from the PEI Phase.
|
|
|
|
|
|
|
|
**/
|
|
|
|
VOID
|
|
|
|
EFIAPI
|
|
|
|
ProcessModuleEntryPointList (
|
|
|
|
IN VOID *HobStart
|
|
|
|
);
|
|
|
|
|
|
|
|
#endif
|