summaryrefslogtreecommitdiffstats
path: root/StandaloneMmPkg/Core/StandaloneMmCore.h
Commit message (Collapse)AuthorAgeFilesLines
* StandaloneMmPkg/Core: Remove dead codeRay Ni2023-12-251-1/+0
| | | | | | | | | | | Load-module-at-fixed-address feature does not work in standalone MM core. The patch removes the 2 dead functions and related global variables that are related to the feature. Signed-off-by: Ray Ni <ray.ni@intel.com> Reviewed-by: Ard Biesheuvel <ardb@kernel.org> Cc: Sami Mujawar <sami.mujawar@arm.com>
* StandaloneMmPkg/Core: Limit FwVol encapsulation section recursionWei6 Xu2023-12-191-0/+26
| | | | | | | | | | | | | | | MmCoreFfsFindMmDriver() is called recursively for encapsulation sections. Currently this recursion is not limited. Introduce a new PCD (fixed-at-build, or patchable-in-module), and make MmCoreFfsFindMmDriver() track the section nesting depth against that PCD. Cc: Laszlo Ersek <lersek@redhat.com> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Cc: Sami Mujawar <sami.mujawar@arm.com> Cc: Ray Ni <ray.ni@intel.com> Signed-off-by: Wei6 Xu <wei6.xu@intel.com> Reviewed-by: Ray Ni <ray.ni@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
* StandaloneMmPkg: Apply uncrustify changesMichael Kubacki2021-12-071-138/+138
| | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3737 Apply uncrustify changes to .c/.h files in the StandaloneMmPkg package Cc: Andrew Fish <afish@apple.com> Cc: Leif Lindholm <leif@nuviainc.com> Cc: Michael D Kinney <michael.d.kinney@intel.com> Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com> Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
* StandaloneMmPkg: Change OPTIONAL keyword usage styleMichael D Kinney2021-12-071-10/+10
| | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3760 Update all use of ', OPTIONAL' to ' OPTIONAL,' for function params. Cc: Andrew Fish <afish@apple.com> Cc: Leif Lindholm <leif@nuviainc.com> Cc: Michael Kubacki <michael.kubacki@microsoft.com> Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
* StandaloneMmPkg: Fix spell check reported errorsSami Mujawar2021-01-071-6/+6
| | | | | | | | | | | | Bugzilla: 3150 (https://bugzilla.tianocore.org/show_bug.cgi?id=3150) Fix the spelling mistakes reported by the spell check utility that is run as part of the Core CI. Signed-off-by: Sami Mujawar <sami.mujawar@arm.com> Acked-by: Jiewen Yao <Jiewen.yao@intel.com> Acked-by: Ard Biesheuvel <ard.biesheuvel@arm.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
* StandaloneMmPkg: switch to MM communicate 2 protocolArd Biesheuvel2020-05-121-1/+1
| | | | | | | | | | Update the reference to MM communicate to refer to the MM communicate 2 protocol instead. This makes no difference for the MM side of the implementation, but is more accurate nonetheless, since the original MM protocol does not work in combination with standalone MM. Signed-off-by: Ard Biesheuvel <ard.biesheuvel@arm.com> Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
* StandaloneMmPkg/Core: stop abusing EFI_HANDLE for FwVolHeader trackingLaszlo Ersek2019-10-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The FvHasBeenProcessed() and FvIsBeingProcesssed() functions make sure that every firmware volume is processed only once (every driver in every firmware volume should be discovered only once). For this, the functions use a linked list. In MdeModulePkg's DXE Core and SMM Core, the key used for identifying those firmware volumes that have been processed is the EFI_HANDLE on which the DXE or SMM firmware volume protocol is installed. In the StandaloneMmPkg core however, the key is the address of the firmware volume header; that is, it has type (EFI_FIRMWARE_VOLUME_HEADER*). (EFI_FIRMWARE_VOLUME_HEADER*) has nothing to do with EFI_HANDLE. EFI_HANDLE just happens to be specified as (VOID*), and therefore the conversion between (EFI_FIRMWARE_VOLUME_HEADER*) and EFI_HANDLE is silent. (The FvHasBeenProcessed() and FvIsBeingProcesssed() functions were likely copied verbatim from MdeModulePkg's DXE Core and/or the SMM Core, and not flagged by the compiler in StandaloneMmPkg due to UEFI regrettably specifying EFI_HANDLE as (VOID*), thereby enabling the above implicit conversion.) We should not exploit this circumstance. Represent the key type faithfully instead. This is a semantic fix; there is no change in operation. Cc: Achin Gupta <achin.gupta@arm.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Supreeth Venkatesh <supreeth.venkatesh@arm.com> Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Jiewen Yao <Jiewen.yao@intel.com> Reviewed-by: Achin Gupta <achin.gupta@arm.com>
* StandaloneMmPkg: Replace BSD License with BSD+Patent LicenseMichael D Kinney2019-04-091-7/+1
| | | | | | | | | | | | | | | | | | | | 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 <michael.d.kinney@intel.com> Reviewed-by: Jiewen Yao <Jiewen.yao@intel.com>
* StandaloneMmPkg/Core: remove legacy boot supportArd Biesheuvel2019-03-111-22/+0
| | | | | | | | | Remove the support for booting 'legacy' (i.e., non-UEFI boot) OSes. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: "Yao, Jiewen" <jiewen.yao@intel.com> Reviewed-by: Achin Gupta <achin.gupta@arm.com>
* StandaloneMmPkg/Core: drop support for dispatching FVs into MMArd Biesheuvel2019-03-111-22/+0
| | | | | | | | | | | Remove the support that permits calls into the MM context to dispatch firmware volumes that are not part of the initial standalone MM firmware volume. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: "Yao, Jiewen" <jiewen.yao@intel.com> Reviewed-by: Achin Gupta <achin.gupta@arm.com>
* StandaloneMmPkg/Core: Implementation of Standalone MM Core Module.Supreeth Venkatesh2018-07-201-0/+903
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>