summaryrefslogtreecommitdiffstats
path: root/StandaloneMmPkg
Commit message (Collapse)AuthorAgeFilesLines
* StandaloneMmPkg: Consume MdeLibs.dsc.inc for RegisterFilterLibDandan Bi2021-03-311-1/+4
| | | | | | | | | | | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3246 MdeLibs.dsc.inc was added for some basic/default library instances provided by MdePkg and RegisterFilterLibNull Library was also added into it as the first version of MdeLibs.dsc.inc. So update platform dsc to consume MdeLibs.dsc.inc for RegisterFilterLibNull which will be consumed by IoLib and BaseLib. Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Cc: Sami Mujawar <sami.mujawar@arm.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Supreeth Venkatesh <supreeth.venkatesh@arm.com> Signed-off-by: Dandan Bi <dandan.bi@intel.com> Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> Acked-by: Ard Biesheuvel <ardb@kernel.org> Reviewed-by: Jiewen Yao <Jiewen.yao@intel.com> Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
* StandaloneMmPkg: Remove StandaloneMmDriverEntryPoint.hMichael Kubacki2021-02-262-145/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3235 The library for this header initially resided in StandaloneMmPkg but moved to MdePkg and now this file is a duplicate of the header file in MdePkg. This change removes the header file from StandaloneMmPkg. More details regarding the history of the library transitioning from StandaloneMmPkg to MdePkg are below. The following commit removed the library from StandaloneMmPkg: d6253d2f9a33 ("StandaloneMmPkg: remove redundant StandaloneMmDriverEntryPoint driver", 2019-03-11) The following commits added the library class & instance to MdePkg: 7df4764e6a81a ("MdePkg: introduce standalone MM entry point library class", 2019-01-14) 5866d4992396 ("MdePkg: introduce standalone MM entry point library implementation", 2019-01-14) Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com> Acked-by: Ard Biesheuvel <ardb@kernel.org> Acked-by: Laszlo Ersek <lersek@redhat.com>
* StandaloneMmPkg: Allow sending FFA Direct Request message to StandaloneMmIlias Apalodimas2021-02-231-1/+3
| | | | | | | | | | | Allow passing of a request to StandaloneMm Core through the Firmware Framework(FF-A) using FFA_MSG_SEND_DIRECT_REQ method. This method is used as a mechanism for requesting some service from StandaloneMm. Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> 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: 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/StandaloneMmCore: Fix compiler warningMichael Kubacki2021-02-111-4/+4
| | | | | | | | | | | | | | | | REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3204 Fixes the following compiler warning in VS2019 by changing defining the MmramRangeCount variable to be UINTN and type casting prior to value assignment. \edk2\StandaloneMmPkg\Core\StandaloneMmCore.c(570): error C2220: the following warning is treated as an error \edk2\StandaloneMmPkg\Core\StandaloneMmCore.c(570): warning C4244: '=': conversion from 'UINT64' to 'UINT32', possible loss of data Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com> Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
* StandaloneMmPkg: Add X64 build supportMichael Kubacki2021-02-111-3/+10
| | | | | | | | | | | REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3202 Several libraries have been added to the package to support X64 but the package itself does not support X64. This modifies the DSC to enable X64 build. Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com> Acked-by: Sami Mujawar <sami.mujawar@arm.com>
* StandaloneMmPkg/FvLib.h: Add EFIAPI to FfsFindSection()Michael Kubacki2021-02-101-0/+1
| | | | | | | | | | REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3203 The EFIAPI modifier is present in the function definition in FvLib.c but missing in FvLib.h. Causes a GCC build error. Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com> Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
* 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: Add EDK2 Core CI supportSami Mujawar2021-01-071-0/+84
| | | | | | | | | | | | | | | | | | | Bugzilla: 3150 (https://bugzilla.tianocore.org/show_bug.cgi?id=3150) The TianoCore EDKII project has introduced a Core CI infrastructure using TianoCore EDKII Tools PIP modules: * https://pypi.org/project/edk2-pytool-library/ * https://pypi.org/project/edk2-pytool-extensions/ The edk2\.pytool\Readme.md provides information to configure the environment and to run local builds. This patch defines the necessary settings for enabling the Core CI builds for StandaloneMmPkg. 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: 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 4002 in StandaloneMmCpuSami Mujawar2021-01-073-5/+58
| | | | | | | | | | | Bugzilla: 3150 (https://bugzilla.tianocore.org/show_bug.cgi?id=3150) Fix the ECC reported error "[4002] Function header doesn't exist". 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 9001 in Standalone MM CoreSami Mujawar2021-01-071-4/+5
| | | | | | | | | | | | Bugzilla: 3150 (https://bugzilla.tianocore.org/show_bug.cgi?id=3150) Fix the ECC reported error "[9001] The file 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 9001 in StandaloneMmCpuSami Mujawar2021-01-071-4/+2
| | | | | | | | | | | | Bugzilla: 3150 (https://bugzilla.tianocore.org/show_bug.cgi?id=3150) Fix the ECC reported error "[9001] The file 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 StandaloneMmCpuSami Mujawar2021-01-071-0/+21
| | | | | | | | | | | Bugzilla: 3150 (https://bugzilla.tianocore.org/show_bug.cgi?id=3150) Fix the ECC reported error "[4002] Function header doesn't exist". 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-073-10/+16
| | | | | | | | | | | | 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-073-18/+78
| | | | | | | | | | | | | | | 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 4002 and 9002 in StandaloneMmCoreSami Mujawar2021-01-071-5/+18
| | | | | | | | | | | | | | | Bugzilla: 3150 (https://bugzilla.tianocore.org/show_bug.cgi?id=3150) Add doxygen style function documentation headers to fix the ECC reported errors: - [4002] Function header doesn't exist. - [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 10014 in StandaloneMmCpuSami Mujawar2021-01-071-1/+2
| | | | | | | | | | | | | Bugzilla: 3150 (https://bugzilla.tianocore.org/show_bug.cgi?id=3150) Fix ECC error "[10014] No used module files found. The source file [StandaloneMmCpu.h] is existing in module directory but it is not described in INF file." 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 StandaloneMmCoreSami Mujawar2021-01-071-2/+4
| | | | | | | | | | | | 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 ECC error 5007 in StandaloneMmCpuSami Mujawar2021-01-071-2/+5
| | | | | | | | | | | | 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 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 ECC error 4002 in FwVol helperSami Mujawar2021-01-071-13/+14
| | | | | | | | | | | | | Bugzilla: 3150 (https://bugzilla.tianocore.org/show_bug.cgi?id=3150) Fix ECC Error "[4002] Function header doesn't exist Function [MmCoreFfsFindMmDriver] has NO comment immediately preceding it." 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 3002 in StandaloneMmCpuSami Mujawar2021-01-072-10/+20
| | | | | | | | | | | | | | | | | | | Bugzilla: 3150 (https://bugzilla.tianocore.org/show_bug.cgi?id=3150) Fix the ECC tool reported error "[3002] Non-Boolean comparisons should use a compare operator". Also fix the following: - add curly braces for 'if' condition statements to comply with the coding standard. - The value returned by GET_GUID_HOB_DATA() is stored in *HobData. Therefore, check *HobData against NULL. The original code was checking HobData which is incorrect. 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 1001 in SMM Memory pool managementSami Mujawar2021-01-071-3/+3
| | | | | | | | | | | | | Bugzilla: 3150 (https://bugzilla.tianocore.org/show_bug.cgi?id=3150) Fix the following error reported by the Ecc tool: [1001] 'TAB' character is not allowed in source code, please replace each 'TAB' with two spaces. 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 Core dispatcherSami Mujawar2021-01-071-10/+6
| | | | | | | | | | | | 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 spell check reported errorsSami Mujawar2021-01-0713-51/+52
| | | | | | | | | | | | 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: Add library files to DSCSami Mujawar2021-01-071-1/+14
| | | | | | | | | | | | | | Bugzilla: 3150 (https://bugzilla.tianocore.org/show_bug.cgi?id=3150) The Core CI reports a critical error if the library files are not included in the DSC. Therefore, add the missing library files to the package DSC. 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: Add library header files to DECSami Mujawar2021-01-071-1/+19
| | | | | | | | | | | | Bugzilla: 3150 (https://bugzilla.tianocore.org/show_bug.cgi?id=3150) Declare the library header files in the package DEC file to fix errors reported by 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-163-3/+34
| | | | | | | | | | | | | | 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-162-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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/Core: add missing GUID referenceArd Biesheuvel2020-06-161-0/+1
| | | | | | | | | | The Standalone core uses gEfiHobMemoryAllocModuleGuid, but failed to declare this in its INF. Signed-off-by: Ard Biesheuvel <ard.biesheuvel@arm.com> Reviewed-by: Jiewen Yao <Jiewen.yao@intel.com> Reviewed-by: Sami Mujawar <sami.mujawar@arm.com> Tested-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
* StandaloneMmPkg/Core: fix bogus FV pointer in DEBUG stringArd Biesheuvel2020-06-161-1/+1
| | | | | | | | | | | FvIsBeingProcessed () emits a DEBUG print with the intent to print the memory address of the FV that is being processed, but instead, it prints the contents of an uninitialized stack variable. Signed-off-by: Ard Biesheuvel <ard.biesheuvel@arm.com> Reviewed-by: Jiewen Yao <Jiewen.yao@intel.com> Reviewed-by: Sami Mujawar <sami.mujawar@arm.com> Tested-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
* StandaloneMmPkg: switch to MM communicate 2 protocolArd Biesheuvel2020-05-122-2/+2
| | | | | | | | | | 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: Fix few typosAntoine Coeur2020-02-104-4/+4
| | | | | | | | | | | | | 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: Fix a typoPhilippe Mathieu-Daudé2020-02-101-1/+1
| | | | | | | | | | | Fix a typo in a comment. Cc: Achin Gupta <achin.gupta@arm.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Supreeth Venkatesh <supreeth.venkatesh@arm.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com> Signed-off-by: Philippe Mathieu-Daude <philmd@redhat.com> Message-Id: <20200207010831.9046-75-philmd@redhat.com>
* StandaloneMmPkg: Fix build failure - Bug 2253Sami Mujawar2019-11-251-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | The StandaloneMmPkg currently has code for supporting Arm architecture only. Support for X64 and IA32 is currently under development on a separate branch. However, StandaloneMmPkg/StandaloneMmPkg.dsc is indicating that support for X64 and IA32 is available which is causing build failures. This has been reported in https://bugzilla.tianocore.org/show_bug.cgi?id=2253 This issue has been discussed earlier on the list: (1) https://edk2.groups.io/g/devel/message/47276 (2) https://edk2.groups.io/g/devel/message/47283 In light of the above, this patch removes IA32 and X64 from SUPPORTED_ARCHITECTURES, until support for the respective architectures is merged into StandaloneMmPkg. Cc: Achin Gupta <achin.gupta@arm.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Supreeth Venkatesh <supreeth.venkatesh@arm.com> Cc: Laszlo Ersek <lersek@redhat.com> Signed-off-by: Sami Mujawar <sami.mujawar@arm.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
* StandaloneMmPkg/Core: Fix typo in function namePhilippe Mathieu-Daude2019-10-172-4/+4
| | | | | | | | | An extra 's' slipped into the FvIsBeingProcessed function name. Drop it to fix the typo. Reviewed-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com> Signed-off-by: Philippe Mathieu-Daude <philmd@redhat.com>
* StandaloneMmPkg/Core: stop abusing EFI_HANDLE for FwVolHeader trackingLaszlo Ersek2019-10-093-46/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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: make package .DSC file build againArd Biesheuvel2019-09-171-8/+11
| | | | | | | | | | | The StandaloneMmPkg .DSC file went out of sync with the changes applied to the package when I enabled this code on the Synquacer platform in edk2-platforms. So apply the necessary changes to make this package build in isolation. Reviewed-by: Jiewen Yao <jiewen.yao@intel.com> Build-tested-by: Laszlo Ersek <lersek@redhat.com> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
* StandaloneMmPkg: Replace BSD License with BSD+Patent LicenseMichael D Kinney2019-04-0953-364/+53
| | | | | | | | | | | | | | | | | | | | 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>