summaryrefslogtreecommitdiffstats
path: root/StandaloneMmPkg
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* 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-113-9/+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/Core: remove legacy boot supportArd Biesheuvel2019-03-112-113/+33
| | | | | | | | | 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-113-69/+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: dispatch all drivers at init timeArd Biesheuvel2019-03-112-93/+0
| | | | | | | | | | | | | Instead of deferring dispatch of the remaining MM drivers once the CPU driver has been dispatched, proceed and dispatch all drivers. This makes sense for standalone MM, since all dispatchable drivers should be present in the initial firmware volume anyway: dispatch of additional FVs originating in the non-secure side is not supported. 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: permit encapsulated firmware volumesArd Biesheuvel2019-03-112-9/+91
| | | | | | | | | | | | | | | Standalone MM requires 4 KB section alignment for all images, so that strict permissions can be applied. Unfortunately, this results in a lot of wasted space, which is usually costly in the secure world environment that standalone MM is expected to operate in. So let's permit the standalone MM drivers (but not the core) to be delivered in a compressed 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/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: switch to NULL DebugLib resolutionArd Biesheuvel2019-03-111-10/+1
| | | | | | | | | | | Building StandaloneMmPkg from its .DSC is mainly intended for build coverage, and so platform specific configuration such as UART addresses don't belong here. 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: drop redundant definition of gEfiMmConfigurationProtocolGuidArd Biesheuvel2019-03-111-3/+0
| | | | | | | | | gEfiMmConfigurationProtocolGuid is already defined in MdePkg, so drop the duplicate definition from StandaloneMmPkg. 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/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>