Tom Lendacky
c330af0246
OvmfPkg/MemEncryptSevLib: Address range encryption state interface
...
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3108
Update the MemEncryptSevLib library to include an interface that can
report the encryption state on a range of memory. The values will
represent the range as being unencrypted, encrypted, a mix of unencrypted
and encrypted, and error (e.g. ranges that aren't mapped).
Cc: Jordan Justen <jordan.l.justen@intel.com >
Cc: Laszlo Ersek <lersek@redhat.com >
Cc: Ard Biesheuvel <ard.biesheuvel@arm.com >
Cc: Brijesh Singh <brijesh.singh@amd.com >
Acked-by: Laszlo Ersek <lersek@redhat.com >
Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com >
Message-Id: <0d98f4d42a2b67310c29bac7bcdcf1eda6835847.1610045305.git.thomas.lendacky@amd.com >
2021-01-07 19:34:39 +00:00
Tom Lendacky
a746ca5b47
OvmfPkg/MemEncryptSevLib: Make the MemEncryptSevLib available for SEC
...
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3108
In preparation for a new interface to be added to the MemEncryptSevLib
library that will be used in SEC, create an SEC version of the library.
This requires the creation of SEC specific files.
Some of the current MemEncryptSevLib functions perform memory allocations
which cannot be performed in SEC, so these interfaces will return an error
during SEC. Also, the current MemEncryptSevLib library uses some static
variables to optimize access to variables, which cannot be used in SEC.
Cc: Jordan Justen <jordan.l.justen@intel.com >
Cc: Laszlo Ersek <lersek@redhat.com >
Cc: Ard Biesheuvel <ard.biesheuvel@arm.com >
Cc: Brijesh Singh <brijesh.singh@amd.com >
Acked-by: Laszlo Ersek <lersek@redhat.com >
Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com >
Message-Id: <bc7fa76cc23784ab3f37356b6c10dfec61942c38.1610045305.git.thomas.lendacky@amd.com >
2021-01-07 19:34:39 +00:00
Tom Lendacky
60b195d257
OvmfPkg/MemEncryptSevLib: Coding style fixes in prep for SEC library
...
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3108
Creating an SEC version of the library requires renaming an existing file
which will result in the existing code failing ECC. Prior to renaming the
existing file, fix the coding style to avoid the ECC failure.
Cc: Jordan Justen <jordan.l.justen@intel.com >
Cc: Laszlo Ersek <lersek@redhat.com >
Cc: Ard Biesheuvel <ard.biesheuvel@arm.com >
Cc: Brijesh Singh <brijesh.singh@amd.com >
Reviewed-by: Laszlo Ersek <lersek@redhat.com >
Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com >
Message-Id: <f765d867da4a703e0a0db35e26515a911482fd40.1610045305.git.thomas.lendacky@amd.com >
2021-01-07 19:34:39 +00:00
Tom Lendacky
31f5ebd6db
OvmfPkg/VmgExitLib: Check for an explicit DR7 cached value
...
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3108
Check the DR7 cached indicator against a specific value. This makes it
harder for a hypervisor to just write random data into that field in an
attempt to use an invalid DR7 value.
Cc: Jordan Justen <jordan.l.justen@intel.com >
Cc: Laszlo Ersek <lersek@redhat.com >
Cc: Ard Biesheuvel <ard.biesheuvel@arm.com >
Cc: Brijesh Singh <brijesh.singh@amd.com >
Reviewed-by: Laszlo Ersek <lersek@redhat.com >
Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com >
Message-Id: <65157c1155a9c058c43678400dfc0b486e327a3e.1610045305.git.thomas.lendacky@amd.com >
2021-01-07 19:34:39 +00:00
Tom Lendacky
84cddd7082
OvmfPkg/AmdSevDxe: Clear encryption bit on PCIe MMCONFIG range
...
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3108
The PCIe MMCONFIG range should be treated as an MMIO range. However,
there is a comment in the code explaining why AddIoMemoryBaseSizeHob()
is not called. The AmdSevDxe walks the GCD map looking for MemoryMappedIo
or NonExistent type memory and will clear the encryption bit for these
ranges.
Since the MMCONFIG range does not have one of these types, the encryption
bit is not cleared for this range. Add support to detect the presence of
the MMCONFIG range and clear the encryption bit. This will be needed for
follow-on support that will validate that MMIO is not being performed to
an encrypted address range under SEV-ES.
Even though the encryption bit was set for this range, this still worked
under both SEV and SEV-ES because the address range is marked by the
hypervisor as MMIO in the nested page tables:
- For SEV, access to this address range triggers a nested page fault (NPF)
and the hardware supplies the guest physical address (GPA) in the VMCB's
EXITINFO2 field as part of the exit information. However, the encryption
bit is not set in the GPA, so the hypervisor can process the request
without any issues.
- For SEV-ES, access to this address range triggers a #VC. Since OVMF runs
identity mapped (VA == PA), the virtual address is used to avoid the
lookup of the physical address. The virtual address does not have the
encryption bit set, so the hypervisor can process the request without
any issues.
Cc: Jordan Justen <jordan.l.justen@intel.com >
Cc: Laszlo Ersek <lersek@redhat.com >
Cc: Ard Biesheuvel <ard.biesheuvel@arm.com >
Cc: Brijesh Singh <brijesh.singh@amd.com >
Reviewed-by: Laszlo Ersek <lersek@redhat.com >
Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com >
Message-Id: <711ae2dcb6cb29e4c60862c18330cff627269b81.1610045305.git.thomas.lendacky@amd.com >
2021-01-07 19:34:39 +00:00
Tom Lendacky
45388d046c
OvmfPkg: Obtain SEV encryption mask with the new MemEncryptSevLib API
...
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3108
The early assembler code performs validation for some of the SEV-related
information, specifically the encryption bit position. The new
MemEncryptSevGetEncryptionMask() interface provides access to this
validated value.
To ensure that we always use a validated encryption mask for an SEV-ES
guest, update all locations that use CPUID to calculate the encryption
mask to use the new interface.
Also, clean up some call areas where extra masking was being performed
and where a function call was being used instead of the local variable
that was just set using the function.
Cc: Jordan Justen <jordan.l.justen@intel.com >
Cc: Laszlo Ersek <lersek@redhat.com >
Cc: Ard Biesheuvel <ard.biesheuvel@arm.com >
Cc: Rebecca Cran <rebecca@bsdio.com >
Cc: Peter Grehan <grehan@freebsd.org >
Cc: Brijesh Singh <brijesh.singh@amd.com >
Cc: Anthony Perard <anthony.perard@citrix.com >
Cc: Julien Grall <julien@xen.org >
Reviewed-by: Laszlo Ersek <lersek@redhat.com >
Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com >
Message-Id: <9de678c0d66443c6cc33e004a4cac0a0223c2ebc.1610045305.git.thomas.lendacky@amd.com >
2021-01-07 19:34:39 +00:00
Tom Lendacky
b97dc4b92b
OvmfPkg/MemEncryptSevLib: Add an interface to retrieve the encryption mask
...
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3108
To ensure that we always use a validated encryption mask for an SEV-ES
guest, create a new interface in the MemEncryptSevLib library to return
the encryption mask. This can be used in place of the multiple locations
where CPUID is used to retrieve the value (which would require validation
again) and allows the validated mask to be returned.
The PEI phase will use the value from the SEV-ES work area. Since the
SEV-ES work area isn't valid in the DXE phase, the DXE phase will use the
PcdPteMemoryEncryptionAddressOrMask PCD which is set during PEI.
Cc: Jordan Justen <jordan.l.justen@intel.com >
Cc: Laszlo Ersek <lersek@redhat.com >
Cc: Ard Biesheuvel <ard.biesheuvel@arm.com >
Cc: Rebecca Cran <rebecca@bsdio.com >
Cc: Peter Grehan <grehan@freebsd.org >
Cc: Anthony Perard <anthony.perard@citrix.com >
Cc: Julien Grall <julien@xen.org >
Cc: Brijesh Singh <brijesh.singh@amd.com >
Acked-by: Laszlo Ersek <lersek@redhat.com >
Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com >
Message-Id: <e12044dc01b21e6fc2e9535760ddf3a38a142a71.1610045305.git.thomas.lendacky@amd.com >
2021-01-07 19:34:39 +00:00
Tom Lendacky
3b32be7e71
OvmfPkg/ResetVector: Save the encryption mask at boot time
...
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3108
The early assembler code performs validation for some of the SEV-related
information, specifically the encryption bit position. To avoid having to
re-validate the encryption bit position as the system proceeds through its
boot phases, save the validated encryption bit position in the SEV-ES work
area for use by later phases.
Cc: Jordan Justen <jordan.l.justen@intel.com >
Cc: Laszlo Ersek <lersek@redhat.com >
Cc: Ard Biesheuvel <ard.biesheuvel@arm.com >
Cc: Brijesh Singh <brijesh.singh@amd.com >
Reviewed-by: Laszlo Ersek <lersek@redhat.com >
Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com >
Message-Id: <2609724859cf21f0c6d45bc323e94465dca4e621.1610045305.git.thomas.lendacky@amd.com >
2021-01-07 19:34:39 +00:00
Tom Lendacky
bd0c1c8e22
OvmfPkg/ResetVector: Perform a simple SEV-ES sanity check
...
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3108
If a hypervisor incorrectly reports through CPUID that SEV-ES is not
active, ensure that a #VC exception was not taken. If it is found that
a #VC was taken, then the code enters a HLT loop.
Cc: Jordan Justen <jordan.l.justen@intel.com >
Cc: Laszlo Ersek <lersek@redhat.com >
Cc: Ard Biesheuvel <ard.biesheuvel@arm.com >
Cc: Brijesh Singh <brijesh.singh@amd.com >
Reviewed-by: Laszlo Ersek <lersek@redhat.com >
Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com >
Message-Id: <afa2030b95b852313b13982df82d472187e59b92.1610045305.git.thomas.lendacky@amd.com >
2021-01-07 19:34:39 +00:00
Tom Lendacky
7cb96c47a9
OvmfPkg/ResetVector: Validate the encryption bit position for SEV/SEV-ES
...
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3108
To help mitigate against ROP attacks, add some checks to validate the
encryption bit position that is reported by the hypervisor.
The first check is to ensure that the hypervisor reports a bit position
above bit 31. After extracting the encryption bit position from the CPUID
information, the code checks that the value is above 31. If the value is
not above 31, then the bit position is not valid, so the code enters a
HLT loop.
The second check is specific to SEV-ES guests and is a two step process.
The first step will obtain random data using RDRAND and store that data to
memory before paging is enabled. When paging is not enabled, all writes to
memory are encrypted. The random data is maintained in registers, which
are protected. The second step is that, after enabling paging, the random
data in memory is compared to the register contents. If they don't match,
then the reported bit position is not valid, so the code enters a HLT
loop.
The third check is after switching to 64-bit long mode. Use the fact that
instruction fetches are automatically decrypted, while a memory fetch is
decrypted only if the encryption bit is set in the page table. By
comparing the bytes of an instruction fetch against a memory read of that
same instruction, the encryption bit position can be validated. If the
compare is not equal, then SEV/SEV-ES is active but the reported bit
position is not valid, so the code enters a HLT loop.
To keep the changes local to the OvmfPkg, an OvmfPkg version of the
Flat32ToFlat64.asm file has been created based on the UefiCpuPkg file
UefiCpuPkg/ResetVector/Vtf0/Ia32/Flat32ToFlat64.asm.
Cc: Jordan Justen <jordan.l.justen@intel.com >
Cc: Laszlo Ersek <lersek@redhat.com >
Cc: Ard Biesheuvel <ard.biesheuvel@arm.com >
Cc: Brijesh Singh <brijesh.singh@amd.com >
Reviewed-by: Laszlo Ersek <lersek@redhat.com >
Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com >
Message-Id: <cb9c5ab23ab02096cd964ed64115046cc706ce67.1610045305.git.thomas.lendacky@amd.com >
2021-01-07 19:34:39 +00:00
Tom Lendacky
b78de543d8
OvmfPkg/Sec: Move SEV-ES SEC workarea definition to common header file
...
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3108
In order to allow for the SEV-ES workarea to be used for other purposes
and by other files, move the definition into the BaseMemEncryptSevLib
header file, MemEncryptSevLib.h.
Cc: Jordan Justen <jordan.l.justen@intel.com >
Cc: Laszlo Ersek <lersek@redhat.com >
Cc: Ard Biesheuvel <ard.biesheuvel@arm.com >
Cc: Brijesh Singh <brijesh.singh@amd.com >
Reviewed-by: Laszlo Ersek <lersek@redhat.com >
Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com >
Message-Id: <07d66f3384bd54da97d540e89b9f3473a6d17231.1610045305.git.thomas.lendacky@amd.com >
2021-01-07 19:34:39 +00:00
Tom Lendacky
a91b700e38
Ovmf/ResetVector: Simplify and consolidate the SEV features checks
...
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3108
Simplify and consolidate the SEV and SEV-ES checks into a single routine.
This new routine will use CPUID to check for the appropriate CPUID leaves
and the required values, as well as read the non-interceptable SEV status
MSR (0xc0010131) to check SEV and SEV-ES enablement.
Cc: Jordan Justen <jordan.l.justen@intel.com >
Cc: Laszlo Ersek <lersek@redhat.com >
Cc: Ard Biesheuvel <ard.biesheuvel@arm.com >
Cc: Brijesh Singh <brijesh.singh@amd.com >
Reviewed-by: Laszlo Ersek <lersek@redhat.com >
Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com >
Message-Id: <43a660624c32b5f6c2610bf42ee39101c21aff68.1610045305.git.thomas.lendacky@amd.com >
2021-01-07 19:34:39 +00:00
Nhi Pham
55ee36b0c4
EmbeddedPkg/RealTimeClockRuntimeDxe: Use helper functions from TimeBaseLib
...
This patch replaces all time checking functions and leverage the helper
functions in TimeBaseLib library.
Cc: Leif Lindholm <leif@nuviainc.com >
Cc: Ard Biesheuvel <ard.biesheuvel@arm.com >
Signed-off-by: Nhi Pham <nhi@os.amperecomputing.com >
Reviewed-by: Leif Lindholm <leif@nuviainc.com >
2021-01-07 16:43:48 +00:00
Nhi Pham
e31dc4717c
EmbeddedPkg/TimeBaseLib: Add function to check Timezone and Daylight
...
This adds two functions IsValidTimeZone() and IsValidDaylight() to check
the time zone and daylight value from EFI time. These functions are
retrieved from the RealTimeClockRuntimeDxe module as they reduce
duplicated code in RTC modules.
Cc: Leif Lindholm <leif@nuviainc.com >
Cc: Ard Biesheuvel <ard.biesheuvel@arm.com >
Signed-off-by: Nhi Pham <nhi@os.amperecomputing.com >
Reviewed-by: Leif Lindholm <leif@nuviainc.com >
2021-01-07 16:43:48 +00:00
Nhi Pham
ad16388d69
EmbeddedPkg/TimeBaseLib: Fix for minor code formatting
...
There is no functional modification in this change.
Cc: Leif Lindholm <leif@nuviainc.com >
Cc: Ard Biesheuvel <ard.biesheuvel@arm.com >
Signed-off-by: Nhi Pham <nhi@os.amperecomputing.com >
Reviewed-by: Leif Lindholm <leif@nuviainc.com >
2021-01-07 16:43:48 +00:00
Nhi Pham
48de23e548
EmbeddedPkg/TimeBaseLib: Update comment blocks for API functions
...
This updates Doxygen comment blocks for API library functions.
Cc: Leif Lindholm <leif@nuviainc.com >
Cc: Ard Biesheuvel <ard.biesheuvel@arm.com >
Signed-off-by: Nhi Pham <nhi@os.amperecomputing.com >
Reviewed-by: Leif Lindholm <leif@nuviainc.com >
2021-01-07 16:43:48 +00:00
Vijayenthiran Subramaniam
8015f3f6d4
ArmPlatformPkg: Enable support for flash in 64-bit address space
...
The existing NOR Flash DXE and StandaloneMm driver supports NOR flash
devices connected in the 32-bit address space. Extend these drivers to
allow NOR flash devices connected to 64-bit address space to be usable
as well. Also, convert the base address and size sanity check from
ASSERT() to if condition so that even if the firmware is build in
release mode, it can return error if the parameter(s) is/are invalid.
Signed-off-by: Vijayenthiran Subramaniam <vijayenthiran.subramaniam@arm.com >
Tested-by: Masahisa Kojima <masahisa.kojima@linaro.org >
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@arm.com >
2021-01-07 15:24:42 +00:00
Laszlo Ersek
e9c5ff3d27
OvmfPkg/VirtioFsDxe: call IsTimeValid() before EfiTimeToEpoch()
...
EmbeddedPkg/TimeBaseLib provides a verification function called
IsTimeValid(), for enforcing the UEFI spec requirements on an EFI_TIME
object.
When EFI_FILE_PROTOCOL.SetInfo() is called in order to update the
timestamps on the file, let's invoke IsTimeValid() first, before passing
the new EFI_FILE_INFO.{CreateTime,LastAccessTime,ModificationTime} values
to EfiTimeToEpoch().
This patch is not expected to make a practical difference, but it's better
to ascertain the preconditions of EfiTimeToEpoch() on the
EFI_FILE_PROTOCOL.SetInfo() caller. The FAT driver (EnhancedFatDxe) has a
similar check, namely in FatSetFileInfo() -> FatIsValidTime().
Cc: Ard Biesheuvel <ard.biesheuvel@arm.com >
Cc: Jordan Justen <jordan.l.justen@intel.com >
Cc: Philippe Mathieu-Daudé <philmd@redhat.com >
Signed-off-by: Laszlo Ersek <lersek@redhat.com >
Message-Id: <20210107095051.22715-1-lersek@redhat.com >
Acked-by: Ard Biesheuvel <ard.biesheuvel@arm.com >
2021-01-07 14:13:44 +00:00
Sami Mujawar
d8d1f6661d
.pytool: CI Settings to support StandaloneMmPkg
...
Bugzilla: 3150 (https://bugzilla.tianocore.org/show_bug.cgi?id=3150 )
Update pytools configuration to enable StandaloneMmPkg
and update package status in documentation.
Signed-off-by: Sami Mujawar <sami.mujawar@arm.com >
Reviewed-by: Bret Barkelew <bret.barkelew@microsoft.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 >
2021-01-07 11:13:39 +00:00
Sami Mujawar
d4a3490a00
.azurepipelines: Add StandaloneMmPkg to CI matrix
...
Bugzilla: 3150 (https://bugzilla.tianocore.org/show_bug.cgi?id=3150 )
Add StandaloneMmPkg to the Core CI matrix.
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 >
2021-01-07 11:13:39 +00:00
Sami Mujawar
6f68283991
StandaloneMmPkg: Add EDK2 Core CI support
...
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 >
2021-01-07 11:13:39 +00:00
Sami Mujawar
75d928ef29
StandaloneMmPkg: Remove dependency on ArmPlatformPkg.dec
...
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 >
2021-01-07 11:13:39 +00:00
Sami Mujawar
0527053262
StandaloneMmPkg: Fix ECC error 8005 in StandaloneMmCoreEntryPoint
...
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 >
2021-01-07 11:13:39 +00:00
Sami Mujawar
9a0f88b5fd
StandaloneMmPkg: Fix ECC error 4002 in StandaloneMmCpu
...
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 >
2021-01-07 11:13:39 +00:00
Sami Mujawar
0720bb7e4d
StandaloneMmPkg: Fix ECC error 9002 in CoreMemoryAllocationLib
...
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 >
2021-01-07 11:13:39 +00:00
Sami Mujawar
b2b02a4843
StandaloneMmPkg: Fix ECC error 9001 in Standalone MM Core
...
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 >
2021-01-07 11:13:39 +00:00
Sami Mujawar
6027747aae
StandaloneMmPkg: Fix ECC error 9001 in StandaloneMmCpu
...
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 >
2021-01-07 11:13:39 +00:00
Sami Mujawar
2da602fa1f
StandaloneMmPkg: Fix ECC error 4002 in StandaloneMmCpu
...
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 >
2021-01-07 11:13:39 +00:00
Sami Mujawar
561c363074
StandaloneMmPkg: Fix ECC error 9003 in StandaloneMmCoreEntryPoint
...
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 >
2021-01-07 11:13:39 +00:00
Sami Mujawar
4779bc6c0b
StandaloneMmPkg: Fix ECC error 9002 in StandaloneMmCoreEntryPoint
...
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 >
2021-01-07 11:13:39 +00:00
Sami Mujawar
3ae63c2c55
StandaloneMmPkg: Fix ECC error 9002 in StandaloneMmMemLib
...
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 >
2021-01-07 11:13:39 +00:00
Sami Mujawar
764942a2dd
StandaloneMmPkg: Fix ECC error 4002 in StandaloneMmCoreEntryPoint
...
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 >
2021-01-07 11:13:39 +00:00
Sami Mujawar
84096dccd6
StandaloneMmPkg: Fix ECC error 4002 and 9002 in StandaloneMmCore
...
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 >
2021-01-07 11:13:39 +00:00
Sami Mujawar
3efc2919d0
StandaloneMmPkg: Fix ECC error 10014 in StandaloneMmCpu
...
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 >
2021-01-07 11:13:39 +00:00
Sami Mujawar
eff8f7a9b4
StandaloneMmPkg: Fix ECC error 5007 in StandaloneMmCore
...
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 >
2021-01-07 11:13:39 +00:00
Sami Mujawar
eda1ffacf1
StandaloneMmPkg: Fix ECC error 5007 in StandaloneMmCpu
...
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 >
2021-01-07 11:13:39 +00:00
Sami Mujawar
7aa9d75211
StandaloneMmPkg: Fix ECC error 5007 in StandaloneMmCoreEntryPoint
...
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 >
2021-01-07 11:13:39 +00:00
Sami Mujawar
92df3ca898
StandaloneMmPkg: Fix ECC error 4002 in FwVol helper
...
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 >
2021-01-07 11:13:39 +00:00
Sami Mujawar
a9da96ac2a
StandaloneMmPkg: Fix ECC error 3002 in StandaloneMmCpu
...
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 >
2021-01-07 11:13:39 +00:00
Sami Mujawar
9ef62f5078
StandaloneMmPkg: Fix ECC error 1001 in SMM Memory pool management
...
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 >
2021-01-07 11:13:39 +00:00
Sami Mujawar
c6fa62aacc
StandaloneMmPkg: Fix ECC error 9002 in Core dispatcher
...
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 >
2021-01-07 11:13:39 +00:00
Sami Mujawar
da29388b53
StandaloneMmPkg: Fix spell check reported errors
...
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 >
2021-01-07 11:13:39 +00:00
Sami Mujawar
55ec21db57
StandaloneMmPkg: Add library files to DSC
...
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 >
2021-01-07 11:13:39 +00:00
Sami Mujawar
3325965cb3
StandaloneMmPkg: Add library header files to DEC
...
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 >
2021-01-07 11:13:39 +00:00
Michael D Kinney
248d08c598
MdeModulePkg/Library/VarCheckLib: Allow SetVariable from SMM
...
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3154
Update VarCheckLibSetVariableCheck() to allow locked variables
to be updated if the RequestSource is VarCheckFromTrusted even
if one or more variable check handlers return EFI_WRITE_PROTECTED.
RequestSource is only set to VarCheckFromTrusted if the request
is through the EFI_SMM_VARAIBLE_PROTOCOL.
Cc: Bret Barkelew <Bret.Barkelew@microsoft.com >
Cc: Hao A Wu <hao.a.wu@intel.com >
Cc: Liming Gao <gaoliming@byosoft.com.cn >
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com >
Reviewed-by: Bret Barkelew <bret.barkelew@microsoft.com >
Reviewed-by: Hao A Wu <hao.a.wu@intel.com >
2021-01-07 03:48:10 +00:00
Chasel Chiu
379e5098a4
IntelFsp2Pkg: Support FSP private temporary memory.
...
REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3153
In FSP the temporary memory provided by bootloader typically will be
totally given to PeiCore as Heap, but in some cases FSP may have to
reserve some more temporary memory for private usage.
This commit adds this flexibility for FSP to reserve some
temporary memory before giving them to PeiCore.
Cc: Maurice Ma <maurice.ma@intel.com >
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com >
Cc: Star Zeng <star.zeng@intel.com >
Signed-off-by: Chasel Chiu <chasel.chiu@intel.com >
Reviewed-by: Nate DeSimone <nathaniel.l.desimone@intel.com >
Reviewed-by: Star Zeng <star.zeng@intel.com >
2021-01-07 02:35:50 +00:00
Pierre Gondois
7785b38ac9
ArmPkg: Fix Ecc error 5007 in DefaultExceptionHandlerLib
...
This patch fixes the following Ecc reported error:
There should be no initialization of a variable as
part of its declaration
Fixing this error implies extracting the CpsrChar
array from CpsrString and making it a static variable.
Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com >
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@arm.com >
2021-01-06 16:22:54 +00:00
Pierre Gondois
0931171f54
ArmPkg: Fix Ecc error 5007 in StandaloneMmMmuLib
...
This patch fixes the following Ecc reported error:
There should be no initialization of a variable as
part of its declaration
Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com >
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@arm.com >
2021-01-06 16:22:54 +00:00
Pierre Gondois
58bba221b7
ArmPkg: Fix Ecc error 5007 in SemihostLib
...
This patch fixes the following Ecc reported error:
There should be no initialization of a variable as
part of its declaration
Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com >
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@arm.com >
2021-01-06 16:22:54 +00:00
Pierre Gondois
02c621f3f7
ArmPkg: Fix Ecc error 5007 in SemiHostingSerialPortLib
...
This patch fixes the following Ecc reported error:
There should be no initialization of a variable as
part of its declaration
Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com >
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@arm.com >
2021-01-06 16:22:54 +00:00