summaryrefslogtreecommitdiffstats
path: root/StandaloneMmPkg/Library
Commit message (Collapse)AuthorAgeFilesLines
* StandaloneMmPkg: Add option to use FF-A calls for communication with SPMAchin Gupta2021-02-231-14/+74
| | | | | | | | | | | Add support for reporting completion of a MM request using either the Firmware Framework(FF-A) ABI transport or through the earlier used SVC calls. Signed-off-by: Achin Gupta <achin.gupta@arm.com> Co-developed-by: Sughosh Ganu <sughosh.ganu@linaro.org> Reviewed-by: Sami Mujawar <sami.mujawar@arm.com> Acked-by: Ard Biesheuvel <ardb@kernel.org>
* StandaloneMmPkg: Add option to use FF-A calls for getting SPM versionSughosh Ganu2021-02-232-10/+33
| | | | | | | | | | | | With the introduction of Firmware Framework(FF-A), a Secure Partition can get the SPM version either using FF-A calls or through the existing svc calls. Use a runtime check to use either of the two methods based on the Pcd feature flag value. Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org> Co-developed-by: Achin Gupta <achin.gupta@arm.com> Reviewed-by: Sami Mujawar <sami.mujawar@arm.com> Acked-by: Ard Biesheuvel <ardb@kernel.org>
* StandaloneMmPkg: Use macros for SPM version checkSughosh Ganu2021-02-231-5/+5
| | | | | | | | | | | Declare module wide variables for SPM major and minor versions to be used in checking the SPM version compatibility. Use the SPM major and minor version macros declared in the previous patch for the version check. Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org> Reviewed-by: Sami Mujawar <sami.mujawar@arm.com> Acked-by: Ard Biesheuvel <ardb@kernel.org>
* StandaloneMmPkg: Use FF-A header file in Standalone MM Core entry pointAchin Gupta2021-02-231-0/+1
| | | | | | | | | | Add the Firmware Framework(FF-A) header in the StandaloneMm entry point driver. Support for invoking the functions through FF-A will be added in a subsequent patch. Signed-off-by: Achin Gupta <achin.gupta@arm.com> Reviewed-by: Sami Mujawar <sami.mujawar@arm.com> Acked-by: Ard Biesheuvel <ardb@kernel.org>
* StandaloneMmPkg: StandaloneMmMemLib: Extends support for X64 architectureKun Qin2021-02-014-1/+246
| | | | | | | | | | | | | This change extends StandaloneMmMemLib library to support X64 architecture. The implementation is ported from MdePkg/Library/SmmMemLib. Cc: Ard Biesheuvel <ard.biesheuvel@arm.com> Cc: Sami Mujawar <sami.mujawar@arm.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Supreeth Venkatesh <supreeth.venkatesh@arm.com> Signed-off-by: Kun Qin <kun.q@outlook.com> Reviewed-by: Jiewen Yao <Jiewen.yao@intel.com>
* StandaloneMmPkg: StandaloneMmCoreMemoryAllocationLib: Fix compiler warningKun Qin2021-02-011-3/+3
| | | | | | | | | | | | | | | | Assigning MmramRangeCount from MmCorePrivate (UINT64) to local variable MmramRangeCount (UINT32) will cause compilation failure due to "warning C4244: '=': conversion from 'UINT64' to 'UINT32', possible loss of data". This changes defines local MmramRangeCount as UINTN type and adds type cast before value assignment. Cc: Ard Biesheuvel <ard.biesheuvel@arm.com> Cc: Sami Mujawar <sami.mujawar@arm.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Supreeth Venkatesh <supreeth.venkatesh@arm.com> Signed-off-by: Kun Qin <kun.q@outlook.com> Reviewed-by: Jiewen Yao <Jiewen.yao@intel.com>
* StandaloneMmPkg: StandaloneMmCoreHobLib: Extend support for x64 Mm CoreKun Qin2021-02-014-275/+597
| | | | | | | | | | | | | | | This change adds support of x64 version of StandaloneMmCoreHobLib. It brings in global variable "gHobList" through StandaloneMmCoreEntryPoint, imports implementation from DxeCoreHobLib.inf to support x64 Mm Core and moved shared functional plementations into a common file. Cc: Ard Biesheuvel <ard.biesheuvel@arm.com> Cc: Sami Mujawar <sami.mujawar@arm.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Supreeth Venkatesh <supreeth.venkatesh@arm.com> Signed-off-by: Kun Qin <kun.q@outlook.com> Reviewed-by: Jiewen Yao <Jiewen.yao@intel.com>
* StandaloneMmPkg: StandaloneMmCoreEntryPoint: Extends support for X64Kun Qin2021-02-012-0/+74
| | | | | | | | | | | | | This change extends StandaloneMmCoreEntryPoint library to support X64 architecture. Cc: Ard Biesheuvel <ard.biesheuvel@arm.com> Cc: Sami Mujawar <sami.mujawar@arm.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Supreeth Venkatesh <supreeth.venkatesh@arm.com> Signed-off-by: Kun Qin <kun.q@outlook.com> Reviewed-by: Jiewen Yao <Jiewen.yao@intel.com>
* StandaloneMmPkg: Remove dependency on ArmPlatformPkg.decSami Mujawar2021-01-071-2/+1
| | | | | | | | | | | Bugzilla: 3150 (https://bugzilla.tianocore.org/show_bug.cgi?id=3150) Update StandaloneMmCoreEntryPoint to remove the unnecessary dependency on ArmPlatformPkg.dec. Signed-off-by: Sami Mujawar <sami.mujawar@arm.com> Acked-by: Ard Biesheuvel <ard.biesheuvel@arm.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
* StandaloneMmPkg: Fix ECC error 8005 in StandaloneMmCoreEntryPointSami Mujawar2021-01-071-3/+3
| | | | | | | | | | | | | | | | | | | Bugzilla: 3150 (https://bugzilla.tianocore.org/show_bug.cgi?id=3150) The ECC tool reports error [8005] Variable name does not follow the rules: 1. First character should be upper case 2. Must contain lower case characters 3. No white space characters 4. Global variable name must start with a 'g' for the constants SPM_MAJOR_VER, SPM_MINOR_VER & BOOT_PAYLOAD_VERSION. Fix this by changing converting these constant variables to #defined values. 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: Fix ECC error 9002 in CoreMemoryAllocationLibSami Mujawar2021-01-071-3/+3
| | | | | | | | | | | | Bugzilla: 3150 (https://bugzilla.tianocore.org/show_bug.cgi?id=3150) Fix the ECC reported error "[9002] The function headers should follow Doxygen special documentation blocks in section 2.3.5". 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: Fix ECC error 9003 in StandaloneMmCoreEntryPointSami Mujawar2021-01-071-2/+3
| | | | | | | | | | | | | | Bugzilla: 3150 (https://bugzilla.tianocore.org/show_bug.cgi?id=3150) Fix the ECC reported error "[9003] The first line of text in a comment block should be a brief description of the element being documented and the brief description must end with a period. Comment description should end with period '.'". 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: Fix ECC error 9002 in StandaloneMmCoreEntryPointSami Mujawar2021-01-072-5/+8
| | | | | | | | | | | | Bugzilla: 3150 (https://bugzilla.tianocore.org/show_bug.cgi?id=3150) Fix the ECC reported error "[9002] The function headers should follow Doxygen special documentation blocks in section 2.3.5 in Comment". 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: Fix ECC error 9002 in StandaloneMmMemLibSami Mujawar2021-01-071-2/+2
| | | | | | | | | | | | Bugzilla: 3150 (https://bugzilla.tianocore.org/show_bug.cgi?id=3150) Fix the ECC reported error: "[9002] The function headers should follow Doxygen special documentation blocks in section 2.3.5". 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: Fix ECC error 4002 in StandaloneMmCoreEntryPointSami Mujawar2021-01-072-1/+61
| | | | | | | | | | | | | | | Bugzilla: 3150 (https://bugzilla.tianocore.org/show_bug.cgi?id=3150) Add doxygen style function headers to fix ECC reported errors "[4002] Function header doesn't exist Function". Also update the corresponding declaration to add IN/OUT doxygen style reference tags. 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: Fix ECC error 5007 in StandaloneMmCoreEntryPointSami Mujawar2021-01-071-2/+3
| | | | | | | | | | | | Bugzilla: 3150 (https://bugzilla.tianocore.org/show_bug.cgi?id=3150) Fix ECC error "[5007] There should be no initialization of a variable as part of its declaration Variable." 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: Fix spell check reported errorsSami Mujawar2021-01-074-9/+9
| | | | | | | | | | | | 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/StandaloneMmCoreEntryPoint: relocate StMM core on the flyArd Biesheuvel2020-06-162-3/+30
| | | | | | | | | | | | | | Apply PE/COFF fixups when starting up the standalone MM core, so that it can execute at any address regardless of the link time address. Note that this requires the PE/COFF image to be emitted with its relocation section preserved. Special care is taken to ensure that TE images are dealt with correctly as well. Signed-off-by: Ard Biesheuvel <ard.biesheuvel@arm.com> Acked-by: Jiewen Yao <Jiewen.yao@intel.com> Reviewed-by: Sami Mujawar <sami.mujawar@arm.com> Tested-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
* StandaloneMmPkg: generate position independent code for StMM coreArd Biesheuvel2020-06-161-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | The standalone MM core runs in a restricted environment that is set up by a higher privilege level, and which may not allow memory regions to be writable and executable at the same time. This means that making the StMM core self-relocatable requires that all the targets of the relocation fixups are outside of the executable region of the image, given that we cannot remap the executable code writable from the executable code itself without losing those execute permissions. So instead, use the existing toolchain support to ensure that position independent code is used where possible, and that all the remaining relocated quantities are emitted into the data section. (Note that staticallly initialized const pointers will be emitted into the .data.rel.ro section, which gets pulled into the .data section by our linker script) To ensure that we don't pick up any absolute references in executable code inadvertently (e.g., in assembler code), add the '-z text' linker option which will force the build to fail in this case. Signed-off-by: Ard Biesheuvel <ard.biesheuvel@arm.com> Acked-by: Jiewen Yao <Jiewen.yao@intel.com> Tested-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
* StandaloneMmPkg: Fix few typosAntoine Coeur2020-02-101-1/+1
| | | | | | | | | | | | | Fix few typos in comments. Cc: Achin Gupta <achin.gupta@arm.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Supreeth Venkatesh <supreeth.venkatesh@arm.com> Signed-off-by: Antoine Coeur <coeur@gmx.fr> Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com> Signed-off-by: Philippe Mathieu-Daude <philmd@redhat.com> Message-Id: <20200207010831.9046-76-philmd@redhat.com>
* StandaloneMmPkg: Replace BSD License with BSD+Patent LicenseMichael D Kinney2019-04-0923-154/+23
| | | | | | | | | | | | | | | | | | | | 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: remove redundant StandaloneMmDriverEntryPoint driverArd Biesheuvel2019-03-112-140/+0
| | | | | | | | | StandaloneMmDriverEntryPoint is implemented in MdePkg now, so let's drop the redundant StandaloneMmPkg version. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: "Yao, Jiewen" <jiewen.yao@intel.com>
* StandaloneMmPkg: drop unused PCD PcdStandaloneMmEnableArd Biesheuvel2019-03-111-3/+0
| | | | | | | | | | | | The PCD PcdStandaloneMmEnable is unused, and shouldn't exist in the first place since the value is implied by the context (it is never valid to set it to FALSE for standalone MM or TRUE for traditional MM). So drop it. 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/StandaloneMmCoreEntryPoint: drop explicit SerialPortLib callArd Biesheuvel2019-03-111-3/+0
| | | | | | | | | | | | | Sending DEBUG output to the serial port should only be done via DebugLib calls, which is in charge of initializing the serial port when appropriate. So drop the explicit SerialPortInitialize () invocation, and rely on normal constructor ordering to get the serial port into the appropriate state at the right time. 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/Library: Install Variable Arch ProtocolJagadeesh Ujja2019-03-112-0/+99
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In a system implementing the variable store in MM, there are no variable arch protocol and variable write arch protocol installed into the DXE_SMM protocol database. On such systems, it is not required to locate these protocols by the DXE runtime variable drivers because it can be assumed that these protocols are already installed in the MM context. But then such an implementation will deviate from the existing traditional MM based variable driver implementation. So in order to maintain consistency with the traditional MM variable driver implementation, allow platforms to install these protocols into the DXE protocol database but these protocol will not be consumed by non-secure variable service runtime driver. The Platform which uses StandaloneMM based secure variable storage have to include this library Example In edk2-platforms/Platform/ARM/SgiPkg/SgiPlatform.dsc ArmPkg/Drivers/MmCommunicationDxe/MmCommunication.inf { <LibraryClasses> NULL|StandaloneMmPkg/Library/VariableMmDependency/VariableMmDependency.inf } Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jagadeesh Ujja <jagadeesh.ujja@arm.com> Acked-by "Yao, Jiewen" <jiewen.yao@intel.com> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
* StandaloneMmPkg/StandaloneMmCoreEntryPoint: permit the use of TE imagesArd Biesheuvel2019-01-211-61/+46
| | | | | | | | | | | TE images take up less space when using 4 KB section alignment, since the FFS/FV generation code optimizes away the redundant, nested padding. This saves 4 KB of space, which is a worthwhile improvement for code that executes in place in secure context. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Achin Gupta <achin.gupta@arm.com>
* StandaloneMmPkg/StandaloneMmPeCoffExtraActionLib: ignore runtime attributeArd Biesheuvel2019-01-211-7/+2
| | | | | | | | | | | | | The special handling of the EFI_IMAGE_SUBSYSTEM_EFI_RUNTIME_DRIVER attribute is only necessary for images that are relocated twice, i.e., in the context of SetVirtualAddressMap (). This does not apply to standalone MM modules, so drop the check. Drop some redundant DEBUG output while at it. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Achin Gupta <achin.gupta@arm.com>
* StandaloneMmPkg/StandaloneMmCoreEntryPoint: remove bogus ASSERT_EFI_ERROR()sArd Biesheuvel2019-01-211-2/+0
| | | | | | | | | | | | | ASSERT_EFI_ERROR (x) is a shorthand for ASSERT(!EFI_ERROR(x)), and so it should only be used with EFI_STATUS type expressions. So drop two instances that operate on other types, since neither looks particularly useful. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Supreeth Venkatesh <supreeth.venkatesh@arm.com> Reviewed-by: Achin Gupta <achin.gupta@arm.com>
* StandaloneMmPkg/StandaloneMmCoreEntryPoint: use %a modifier for ASCII stringsArd Biesheuvel2019-01-211-1/+1
| | | | | | | | | PE/COFF section names are ASCII strings so use %a not %s. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Supreeth Venkatesh <supreeth.venkatesh@arm.com> Reviewed-by: Achin Gupta <achin.gupta@arm.com>
* StandaloneMmPkg/StandaloneMmCoreHobLib: restrict to MM_CORE_STANDALONEArd Biesheuvel2019-01-211-1/+1
| | | | | | | | | | | Remove MM_STANDALONE from the list of permitted modules for this library. It should only be used by the standalone MM core. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jagadeesh Ujja <jagadeesh.ujja@arm.com> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Achin Gupta <achin.gupta@arm.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
* StandaloneMmPkg: add MM_STANDALONE MemoryAllocationLib implementationArd Biesheuvel2019-01-212-0/+863
| | | | | | | | | | | | | | This MemoryAllocationLib code is based on the staging implementation of StandaloneMmPkg, with the following changes: - use correct MODULE_TYPE - include MmServicesTableLib instead of declaring gMmst directly - update code comments referring to the MM core Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jagadeesh Ujja <jagadeesh.ujja@arm.com> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Achin Gupta <achin.gupta@arm.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
* StandaloneMmPkg: add HobLib implementation for MM_STANDALONE modulesArd Biesheuvel2019-01-212-0/+694
| | | | | | | | | | | | | | This HobLib code is based on the staging implementation of StandaloneMmPkg, with the following changes: - drop the unused AArch64/StandaloneMmCoreHobLibInternal.c source file - remove hack from HobLibConstructor() - update code comments referring the MM core Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jagadeesh Ujja <jagadeesh.ujja@arm.com> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Achin Gupta <achin.gupta@arm.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
* StandaloneMM: Update permissions for Standalone MM drivers memory areaSughosh Ganu2018-12-092-0/+267
| | | | | | | | | | | | | | | | The StandaloneMM image executes in S-EL0 on reference Arm platforms and is deployed by the trusted firmware as BL32 image. Memory for the Standalone MM drivers is marked as RW+XN initially, allowing the drivers to be loaded into the memory. Once loaded, the memory attributes need to be changed to RO+XN for rodata sections and RO+X for code sections. Achieve this through the extra action 'UpdatePeCoffPermissions' to request the privileged firmware in EL3 to update the permissions. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Sughosh Ganu <sughosh.ganu@arm.com> Reviewed-by: Achin Gupta <achin.gupta@arm.com>
* StandaloneMM: Include the newly added library class for MMU functionsSughosh Ganu2018-12-091-1/+1
| | | | | | | | | | | The MMU functions needed for StandaloneMM image are now exported through a separate library class. Make the corresponding change in the core's entry point inf file so that it references the correct library class for modifying the MMU attributes. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Sughosh Ganu <sughosh.ganu@arm.com> Reviewed-by: Achin Gupta <achin.gupta@arm.com>
* StandaloneMmPkg: Zero data structure explicitlyAchin Gupta2018-12-091-1/+2
| | | | | | | | | | | | Introduction of the -mstrict-align flag results in GCC attempting to use memset to zero out the InitMmFoundationSvcArgs structure. In the absence of this C library function, this patch explicitly zeroes this data structure prior to use. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Achin Gupta <achin.gupta@arm.com> Signed-off-by: Sughosh Ganu <sughosh.ganu@arm.com> Reviewed-by: Achin Gupta <achin.gupta@arm.com>
* StandaloneMmPkg: Add an AArch64 specific entry point library.Supreeth Venkatesh2018-07-204-0/+859
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Standalone MM environment runs in S-EL0 in AArch64 on ARM Standard Platforms and is initialised during the SEC phase. ARM Trusted firmware in EL3 is responsible for initialising the architectural context for S-EL0 and loading the Standalone MM image. The memory allocated to this image is marked as RO+X. Heap memory is marked as RW+XN. Certain actions have to be completed prior to executing the generic code in the Standalone MM Core module. These are: 1. Memory permission attributes for each section of the Standalone MM Core module need to be changed prior to accessing any RW data. 2. A Hob list has to be created with information that allows the MM environment to initialise and dispatch drivers. Furthermore, this module is responsible for handing over runtime MM events to the Standalone MM CPU driver and returning control to ARM Trusted Firmware upon event completion. Hence it needs to know the CPU driver entry point. This patch implements an entry point module that ARM Trusted Firmware jumps to in S-EL0. It then performs the above actions before calling the Standalone MM Foundation entry point and handling subsequent MM events. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Sughosh Ganu <sughosh.ganu@arm.com> Signed-off-by: Achin Gupta <achin.gupta@arm.com> Signed-off-by: Supreeth Venkatesh <supreeth.venkatesh@arm.com> Reviewed-by: Achin Gupta <achin.gupta@arm.com>
* StandaloneMmPkg: MM driver entry point library.Supreeth Venkatesh2018-07-202-0/+140
| | | | | | | | | | | This patch implements module entry point library for Standalone management mode (MM) Drivers. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Supreeth Venkatesh <supreeth.venkatesh@arm.com> Reviewed-by: Achin Gupta <achin.gupta@arm.com> Reviewed-by: Jiewen Yao <Jiewen.yao@intel.com> Signed-off-by: Sughosh Ganu <sughosh.ganu@arm.com>
* StandaloneMmPkg/HobLib: Add HOB Library for management mode.Supreeth Venkatesh2018-07-203-0/+719
| | | | | | | | | | | | | | | | | The Standalone MM environment is initialized during the SEC phase on ARM Standard Platforms. The MM Core driver implements an entry point module which is architecture specific and runs prior to the generic core driver code. The former creates a Hob list that the latter consumes. This happens in the same phase. This patch implements a Hob library that can be used by the entry point module to produce a Hob list and by the core driver code to consume it. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Achin Gupta <achin.gupta@arm.com> Signed-off-by: Supreeth Venkatesh <supreeth.venkatesh@arm.com> Reviewed-by: Jiewen Yao <Jiewen.yao@intel.com> Signed-off-by: Sughosh Ganu <sughosh.ganu@arm.com>
* StandaloneMmPkg/MemoryAllocationLib: Add MM memory allocation library.Supreeth Venkatesh2018-07-203-0/+995
| | | | | | | | | | This patch implements management mode memory allocation services. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Supreeth Venkatesh <supreeth.venkatesh@arm.com> Reviewed-by: Achin Gupta <achin.gupta@arm.com> Reviewed-by: Jiewen Yao <Jiewen.yao@intel.com> Signed-off-by: Sughosh Ganu <sughosh.ganu@arm.com>
* StandaloneMmPkg/MemLib: Add Standalone MM instance of memory check library.Supreeth Venkatesh2018-07-203-0/+368
| | | | | | | | | | | | | | | | | | | | MM memory check library library implementation. This library consumes MM_ACCESS_PROTOCOL to get MMRAM information. In order to use this library instance, the platform should produce all MMRAM range via MM_ACCESS_PROTOCOL, including the range for firmware (like MM Core and MM driver) and/or specific dedicated hardware. This patch provides services for MM Memory Operation. The management mode Mem Library provides function for checking if buffer is outside MMRAM and valid. It also provides functions for copy data from MMRAM to non-MMRAM, from non-MMRAM to MMRAM, from non-MMRAM to non-MMRAM, or set data in non-MMRAM. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Supreeth Venkatesh <supreeth.venkatesh@arm.com> Reviewed-by: Achin Gupta <achin.gupta@arm.com> Reviewed-by: Jiewen Yao <Jiewen.yao@intel.com> Signed-off-by: Sughosh Ganu <sughosh.ganu@arm.com>
* StandaloneMmPkg/FvLib: Add a common FV Library for management mode.Supreeth Venkatesh2018-07-202-0/+442
This patch implements a firmware volume library that can be used by the Standalone management mode core module to parse the firmware volume. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Supreeth Venkatesh <supreeth.venkatesh@arm.com> Reviewed-by: Achin Gupta <achin.gupta@arm.com> Reviewed-by: Jiewen Yao <Jiewen.yao@intel.com> Signed-off-by: Sughosh Ganu <sughosh.ganu@arm.com>