12 Commits
Author SHA1 Message Date
Antoine Coeur 4be497df49 MdeModulePkg/Core/PiSmmCore: Fix various typos
Fix various typos in comments and documentation.

Cc: Jian J Wang <[email protected]>
Cc: Hao A Wu <[email protected]>
Signed-off-by: Antoine Coeur <[email protected]>
Reviewed-by: Philippe Mathieu-Daude <[email protected]>
Reviewed-by: Hao A Wu <[email protected]>
Signed-off-by: Philippe Mathieu-Daude <[email protected]>
Message-Id: <[email protected]>
2020-02-10 22:30:07 +00:00
Michael D Kinney 9d510e61fc MdeModulePkg: Replace BSD License with BSD+Patent License
https://bugzilla.tianocore.org/show_bug.cgi?id=1373

Replace BSD 2-Clause License with BSD+Patent License.  This change is
based on the following emails:

  https://lists.01.org/pipermail/edk2-devel/2019-February/036260.html
  https://lists.01.org/pipermail/edk2-devel/2018-October/030385.html

RFCs with detailed process for the license change:

  V3: https://lists.01.org/pipermail/edk2-devel/2019-March/038116.html
  V2: https://lists.01.org/pipermail/edk2-devel/2019-March/037669.html
  V1: https://lists.01.org/pipermail/edk2-devel/2019-March/037500.html

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Michael D Kinney <[email protected]>
Reviewed-by: Hao Wu <[email protected]>
Reviewed-by: Jian J Wang <[email protected]>
2019-04-09 10:58:08 -07:00
Ard Biesheuvel 05cfd73f01 MdeModulePkg: remove PE/COFF header workaround for ELILO on IPF
Now that Itanium support has been dropped, we can remove the various
occurrences of the ELILO on Itanium PE/COFF header workaround.

Link: https://bugzilla.tianocore.org/show_bug.cgi?id=816
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ard Biesheuvel <[email protected]>
Reviewed-by: Jiewen Yao <[email protected]>
Reviewed-by: Laszlo Ersek <[email protected]>
Reviewed-by: Star Zeng <[email protected]>
2018-09-24 16:56:32 +02:00
shenglei d637282efe MdeModulePkg PiSmmCore: Remove redundant functions
The functions that are never called have been removed.
They are IsImageInsideSmram,FindImageRecord,SmmRemoveImageRecord,
SmmMemoryAttributesTableConsistencyCheck,DumpSmmMemoryMapEntry,
SmmMemoryMapConsistencyCheckRange,SmmMemoryMapConsistencyCheck,
DumpSmmMemoryMap,ClearGuardMapBit,SetGuardMapBit,AdjustMemoryA,
AdjustMemoryS,IsHeadGuard and IsTailGuard.
FindImageRecord() is called by SmmRemoveImageRecord(); however,
nothing calls SmmRemoveImageRecord().
SmmMemoryMapConsistencyCheckRange() is called by
SmmMemoryMapConsistencyCheck(); however, nothing calls
SmmMemoryMapConsistencyCheck().
https://bugzilla.tianocore.org/show_bug.cgi?id=1062

v2:append the following to the commit message.
- FindImageRecord() is called by SmmRemoveImageRecord(); however,
nothing calls SmmRemoveImageRecord().
- SmmMemoryMapConsistencyCheckRange() is called by
SmmMemoryMapConsistencyCheck(); however, nothing calls
SmmMemoryMapConsistencyCheck().

Cc: Star Zeng <[email protected]>
Cc: Eric Dong <[email protected]>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: shenglei <[email protected]>
Reviewed-by: Jian J Wang <[email protected]>
Reviewed-by: Laszlo Ersek <[email protected]>
Reviewed-by: Star Zeng <[email protected]>
2018-08-21 16:29:04 +08:00
Jian J Wang 3d817fd11a MdeModulePkg/Core: Fix incorrect memory map generated in a rare case
The root cause is that mImagePropertiesPrivateData.CodeSegmentCountMax was
not updated with correct value due to the fact that SortImageRecord() called
before might change the content of current ImageRecord. This will in turn
cause incorrect memory map entries generated in SplitTable().

Cc: Star Zeng <[email protected]>
Cc: Eric Dong <[email protected]>
Cc: Jiewen Yao <[email protected]>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jian J Wang <[email protected]>
Reviewed-by: Jiewen Yao <[email protected]>
2017-12-19 15:19:46 +08:00
Ard Biesheuvel 115d97539d MdeModulePkg/PiSmmCore: switch to MdePkg allocation granularity macros
Remove the local definitions for the default and runtime page allocation
granularity macros, and switch to the new MdePkg versions.

Note that this replaces a reference to the 'default' version with the
more correct 'runtime' version, but this matters little in practice.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <[email protected]>
Reviewed-by: Jiewen Yao <[email protected]>
Reviewed-by: Liming Gao <[email protected]>
2017-03-06 11:29:25 +01:00
Liming Gao 2464854888 MdeModulePkg: Fix some typos of "according"
Cc: Feng Tian <[email protected]>
Cc: Star Zeng <[email protected]>
Cc: Siyuan Fu <[email protected]>
Cc: Jiaxin Wu <[email protected]>
Cc: Liming Gao <[email protected]>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Rebecca Cran <[email protected]>
Reviewed-by: Liming Gao <[email protected]>
Reviewed-by: Star Zeng <[email protected]>
Reviewed-by: Feng Tian <[email protected]>
Reviewed-by: He Junjie <[email protected]>
Reviewed-by: Fu Siyuan <[email protected]>
Reviewed-by: Wu Jiaxin <[email protected]>
2017-02-08 14:48:02 +08:00
Dandan Bi 11ee1bc93d MdeModulePkg: Make the comments align with the function
Cc: Jiewen Yao <[email protected]>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <[email protected]>
Reviewed-by: Jiewen Yao <[email protected]>
2016-12-14 21:34:45 +08:00
Jiewen Yao f1afa0a92d MdeModulePkg/PiSmmCore: use EfiPagesToSize to prevent build error.
EFI_PAGES_TO_SIZE only handles UINTN, so we use EfiPagesToSize
to handle UINT64.

Cc: Jeff Fan <[email protected]>
Cc: Michael D Kinney <[email protected]>
Cc: Laszlo Ersek <[email protected]>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiewen Yao <[email protected]>
Reviewed-by: Jeff Fan <[email protected]>
Regression-tested-by: Laszlo Ersek <[email protected]>
2016-12-07 13:13:54 +08:00
Jiewen Yao 92b126ae3d MdeModulePkg/PiSmmCore; Use DEBUG_WARN for non 4k aligned image.
Cc: Jeff Fan <[email protected]>
Cc: Michael D Kinney <[email protected]>
Cc: Laszlo Ersek <[email protected]>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiewen Yao <[email protected]>
Reviewed-by: Jeff Fan <[email protected]>
Regression-tested-by: Laszlo Ersek <[email protected]>
2016-12-07 13:13:53 +08:00
Jiewen Yao 026e2ca2c3 MdeModulePkg/PiSmmCore: MemoryAttributeTable need keep non-PE record.
Current memory attribute table implementation will only mark PE code
to be EfiRuntimeServicesCode, and mark rest to be EfiRuntimeServicesData.

However, there might be a case that a SMM code wants to allocate
EfiRuntimeServicesCode explicitly to let page table protect this region
to be read only. It is unsupported.

This patch enhances the current solution so that MemoryAttributeTable
does not touch non PE image record.
Only the PE image region is forced to be EfiRuntimeServicesCode for
code and EfiRuntimeServicesData for data.

Cc: Jeff Fan <[email protected]>
Cc: Michael D Kinney <[email protected]>
Cc: Laszlo Ersek <[email protected]>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiewen Yao <[email protected]>
Reviewed-by: Jeff Fan <[email protected]>
Regression-tested-by: Laszlo Ersek <[email protected]>
2016-12-07 13:13:51 +08:00
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 <[email protected]>
Cc: Feng Tian <[email protected]>
Cc: Star Zeng <[email protected]>
Cc: Michael D Kinney <[email protected]>
Cc: Laszlo Ersek <[email protected]>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiewen Yao <[email protected]>
Tested-by: Laszlo Ersek <[email protected]>
Reviewed-by: Jeff Fan <[email protected]>
Reviewed-by: Michael D Kinney <[email protected]>
2016-11-17 16:30:04 +08:00