Jiewen Yao 285a682c78 MdeModulePkg/PiSmmCore: Add MemoryAttributes support.
The SMM memory attribute table concept is similar to UEFI
memory attribute table.

The new file MdeModulePkg/Core/PiSmmCore/MemoryAttributesTable.c
and the new code in MdeModulePkg/Core/PiSmmCore/Page.c
are based on the algorithms and implementation from
MdeModulePkg/Core/Dxe/Misc/MemoryAttributesTable.c
and MdeModulePkg/Core/Dxe/Mem/Page.c.

These new components are based on the Memory Attributes Table
feature from the UEFI Specification and the existing DXE Core
implementation that supports that feature.

This SMM MemoryAttributes table is produced at SmmEndOfDxe event.
So that the consumer (PiSmmCpu) may consult this table
to set memory attribute in page table.

This patch also installs LoadedImage protocol to SMM
protocol database, so that the SMM image info can be
got easily to construct the PiSmmMemoryAttributes table.

Cc: Jeff Fan <jeff.fan@intel.com>
Cc: Feng Tian <feng.tian@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiewen Yao <jiewen.yao@intel.com>
Tested-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>
Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
2016-11-17 16:30:04 +08:00

104 lines
3.9 KiB
INI

## @file
# This module provide an SMM CIS compliant implementation of SMM Core.
#
# Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.<BR>
#
# This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
# which accompanies this distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#
##
[Defines]
INF_VERSION = 0x00010005
BASE_NAME = PiSmmCore
MODULE_UNI_FILE = PiSmmCore.uni
FILE_GUID = E94F54CD-81EB-47ed-AEC3-856F5DC157A9
MODULE_TYPE = SMM_CORE
VERSION_STRING = 1.0
PI_SPECIFICATION_VERSION = 0x0001000A
ENTRY_POINT = SmmMain
# VALID_ARCHITECTURES = IA32 X64
[Sources]
PiSmmCore.c
PiSmmCore.h
PiSmmCorePrivateData.h
Page.c
Pool.c
Handle.c
Locate.c
Notify.c
Dependency.c
Dispatcher.c
Smi.c
InstallConfigurationTable.c
SmramProfileRecord.c
MemoryAttributesTable.c
[Packages]
MdePkg/MdePkg.dec
MdeModulePkg/MdeModulePkg.dec
[LibraryClasses]
UefiDriverEntryPoint
BaseLib
BaseMemoryLib
PeCoffLib
PeCoffGetEntryPointLib
CacheMaintenanceLib
DebugLib
ReportStatusCodeLib
DevicePathLib
UefiLib
UefiBootServicesTableLib
MemoryAllocationLib
PcdLib
SmmCorePlatformHookLib
PerformanceLib
TimerLib
HobLib
SmmMemLib
[Protocols]
gEfiDxeSmmReadyToLockProtocolGuid ## UNDEFINED # SmiHandlerRegister
gEfiSmmReadyToLockProtocolGuid ## PRODUCES
gEfiSmmCpuIo2ProtocolGuid ## CONSUMES
gEfiFirmwareVolume2ProtocolGuid ## CONSUMES
gEfiSmmEndOfDxeProtocolGuid ## PRODUCES
gEfiSecurityArchProtocolGuid ## SOMETIMES_CONSUMES
gEfiSecurity2ArchProtocolGuid ## SOMETIMES_CONSUMES
gEfiLoadedImageProtocolGuid ## PRODUCES
gEfiDevicePathProtocolGuid ## CONSUMES
gEdkiiSmmExitBootServicesProtocolGuid ## SOMETIMES_PRODUCES
gEdkiiSmmLegacyBootProtocolGuid ## SOMETIMES_PRODUCES
gEdkiiSmmReadyToBootProtocolGuid ## PRODUCES
[Pcd]
gEfiMdeModulePkgTokenSpaceGuid.PcdLoadFixAddressSmmCodePageNumber ## SOMETIMES_CONSUMES
gEfiMdeModulePkgTokenSpaceGuid.PcdLoadModuleAtFixAddressEnable ## CONSUMES
gEfiMdeModulePkgTokenSpaceGuid.PcdMemoryProfileMemoryType ## CONSUMES
gEfiMdeModulePkgTokenSpaceGuid.PcdMemoryProfilePropertyMask ## CONSUMES
gEfiMdeModulePkgTokenSpaceGuid.PcdMemoryProfileDriverPath ## CONSUMES
[Guids]
gAprioriGuid ## SOMETIMES_CONSUMES ## File
gEfiEventDxeDispatchGuid ## PRODUCES ## GUID # SmiHandlerRegister
gEfiEventLegacyBootGuid ## PRODUCES ## GUID # SmiHandlerRegister
gEfiEventExitBootServicesGuid ## PRODUCES ## GUID # SmiHandlerRegister
gEfiEventReadyToBootGuid ## PRODUCES ## GUID # SmiHandlerRegister
gEfiEndOfDxeEventGroupGuid ## PRODUCES ## GUID # SmiHandlerRegister
## SOMETIMES_CONSUMES ## GUID # Locate protocol
## SOMETIMES_PRODUCES ## GUID # SmiHandlerRegister
gEdkiiMemoryProfileGuid
## SOMETIMES_PRODUCES ## GUID # Install protocol
gEdkiiSmmMemoryProfileGuid
gEdkiiPiSmmMemoryAttributesTableGuid ## SOMETIMES_PRODUCES ## SystemTable
[UserExtensions.TianoCore."ExtraFiles"]
PiSmmCoreExtra.uni