]> git.proxmox.com Git - mirror_edk2.git/log
mirror_edk2.git
2 years agoBaseTools: Remove hard-coded strings for target and tools_def
Pierre Gondois [Thu, 23 Sep 2021 08:59:03 +0000 (16:59 +0800)]
BaseTools: Remove hard-coded strings for target and tools_def

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3653

The "target.txt" and "tools_def.txt" filenames are hard-coded
at some places when global definitions are available at:
BaseTools/Source/Python/Common/TargetTxtClassObject.py:
DefaultTargetTxtFile
and
BaseTools/Source/Python/Common/ToolDefClassObject.py:
DefaultToolsDefFile

Use these global definitions instead.

Also remove the unused gBuildConfiguration and gToolsDefinition
variables from build.py

Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com>
Reviewed-by: Chris Jones <christopher.jones@arm.com>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
Reviewed-by: Bob Feng <bob.c.feng@intel.com>
2 years agoBaseTools: Remove Makefile/MakefileName fields
Pierre Gondois [Thu, 23 Sep 2021 08:59:02 +0000 (16:59 +0800)]
BaseTools: Remove Makefile/MakefileName fields

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3653

The Makefile and MakefilName fields are never set/used. Remove them.
To check this, the following commands can be used:
- grep -rIn "\.Makefile"
- grep -rIn "\.MakefileName"

Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com>
Reviewed-by: Chris Jones <christopher.jones@arm.com>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
Reviewed-by: Bob Feng <bob.c.feng@intel.com>
2 years agoBaseTools/build: Set MakefileName
Pierre Gondois [Thu, 23 Sep 2021 08:59:01 +0000 (16:59 +0800)]
BaseTools/build: Set MakefileName

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3653

Running the following command:
  python3 build/build.py -a AARCH64 -t GCC5
  -p ArmPlatformPkg/ArmPlatformPkg.dsc -b DEBUG libraries
triggers the following error:
  make: *** Build/ArmPlatform/DEBUG_GCC5/AARCH64/MdePkg/Library/
  BasePcdLibNull/BasePcdLibNull: Is a directory.  Stop.

Indeed, MakefileName is set to en empty string. Setting MakefileName
resolves the error.

Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com>
Reviewed-by: Chris Jones <christopher.jones@arm.com>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
Reviewed-by: Bob Feng <bob.c.feng@intel.com>
2 years agoBaseTools/GenMake: Use ToolDefinition as fallback option
Pierre Gondois [Thu, 23 Sep 2021 08:59:00 +0000 (16:59 +0800)]
BaseTools/GenMake: Use ToolDefinition as fallback option

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3653

Use the value set in tools_def.txt when the makefile type is
not explicitly set via BuildOption. This allows to have a
valid default makefile name instead of an empty string.

Also use GMAKE_FILETYPE instead of hard-coded "gmake".

Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com>
Reviewed-by: Chris Jones <christopher.jones@arm.com>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
Reviewed-by: Bob Feng <bob.c.feng@intel.com>
2 years agoBaseTools: Switch to downloading the AARCH64 compiler from Arm's site
Rebecca Cran [Mon, 30 Aug 2021 05:14:50 +0000 (13:14 +0800)]
BaseTools: Switch to downloading the AARCH64 compiler from Arm's site

Linaro no longer do gcc releases - they're done by Arm now.

Update gcc_aarch64_linux_ext_dep.yaml to fetch the latest AARCH64 gcc
release (10.3-2021.07) from their site and fix LinuxGcc5ToolChain.py with the
new GCC_AARCH64_PREFIX.

Signed-off-by: Rebecca Cran <rebecca@bsdio.com>
Acked-by: Leif Lindholm <leif@nuviainc.com>
Acked-by: Liming Gao <gaoliming@byosoft.com.cn>
Acked-by: Ard Biesheuvel <ardb@kernel.org>
Reviewed-by: Pierre Gondois <Pierre.Gondois@arm.com>
Acked-by: Bob Feng <bob.c.feng@intel.com>
2 years agoBaseTools: Switch to downloading the ARM compiler from Arm's site
Rebecca Cran [Mon, 30 Aug 2021 05:14:49 +0000 (13:14 +0800)]
BaseTools: Switch to downloading the ARM compiler from Arm's site

Linaro no longer do gcc releases - they're done by Arm now.
Update gcc_arm_linux_ext_dep.yaml to fetch the latest ARM gcc release
(10.3-2021.07) from their site and fix LinuxGcc5ToolChain.py with the
new GCC_ARM_PREFIX.

Signed-off-by: Rebecca Cran <rebecca@bsdio.com>
Acked-by: Leif Lindholm <leif@nuviainc.com>
Acked-by: Liming Gao <gaoliming@byosoft.com.cn>
Acked-by: Ard Biesheuvel <ardb@kernel.org>
Reviewed-by: Pierre Gondois <Pierre.Gondois@arm.com>
Acked-by: Bob Feng <bob.c.feng@intel.com>
2 years agoUefiPayloadPkg: Add ".upld_info" in universal payload
Guo Dong [Fri, 24 Sep 2021 21:14:28 +0000 (14:14 -0700)]
UefiPayloadPkg: Add ".upld_info" in universal payload

V2: Use LittleEndianStructure by review comment.

From the universal scalable firmware payload requirement V0.75,
Payload must have Universal Payload Information Section ".upld_info"
So update the build tool to add this section.

Cc: Ray Ni <ray.ni@intel.com>
Cc: Maurice Ma <maurice.ma@intel.com>
Cc: Benjamin You <benjamin.you@intel.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
Signed-off-by: Guo Dong <guo.dong@intel.com>
2 years agoUefiPayloadPkg: Use dummy constructor for PlatformHookLib
Guo Dong [Fri, 24 Sep 2021 04:56:16 +0000 (21:56 -0700)]
UefiPayloadPkg: Use dummy constructor for PlatformHookLib

The Library constructor is only used for library dependency.
So use a dummy function to make it clear instead of using an
actual function.

Cc: Ray Ni <ray.ni@intel.com>
Cc: Maurice Ma <maurice.ma@intel.com>
Cc: Benjamin You <benjamin.you@intel.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
Signed-off-by: Guo Dong <guo.dong@intel.com>
2 years agoUefiPayloadPkg: Build a HOB from bootloader ACPI table
Guo Dong [Tue, 28 Sep 2021 16:38:53 +0000 (09:38 -0700)]
UefiPayloadPkg: Build a HOB from bootloader ACPI table

V2: Update BuildHobFromAcpi() to return a HOB pointer.

For universal UEFI payload, build a HOB from the ACPI table, so that
other modules could use this info from HOB at very early DXE phase.
This code are shared by universal payload and non universal payload.

Cc: Ray Ni <ray.ni@intel.com>
Cc: Maurice Ma <maurice.ma@intel.com>
Cc: Benjamin You <benjamin.you@intel.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
Signed-off-by: Guo Dong <guo.dong@intel.com>
2 years agoMdePkg: Fix DEVICE_SECURITY_EVENT_DATA_HEADER version definition
yi1 li [Thu, 23 Sep 2021 01:57:08 +0000 (09:57 +0800)]
MdePkg: Fix DEVICE_SECURITY_EVENT_DATA_HEADER version definition

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3646

According to latest TCG PFP spec 1.05 revision 23,
(https://trustedcomputinggroup.org/resource/pc-client-specific
-platform-firmware-profile-specification/),
10.2.7 DEVICE_SECURITY_EVENT_DATA Structure,
the version should be 1.

Signed-off-by: yi1 li <yi1.li@intel.com>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
2 years agoMdeModulePkg/BootManagerMenuApp: Limit string drawing within one line
Zhichao Gao [Thu, 9 Sep 2021 06:17:04 +0000 (14:17 +0800)]
MdeModulePkg/BootManagerMenuApp: Limit string drawing within one line

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3590

Limit the draw box always within the screen's column and row.
Limit the string drawing within one line.
For the incompleted string the last 3 characters in one line would
be replaced with "...".

Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Ray Ni <ray.ni@intel.com>
Signed-off-by: Zhichao Gao <zhichao.gao@intel.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
2 years agoMdeModulePkg/PciBusDxe: Improve the flow of testing support attributes
xueshengfeng [Fri, 24 Sep 2021 06:30:45 +0000 (14:30 +0800)]
MdeModulePkg/PciBusDxe: Improve the flow of testing support attributes

https://bugzilla.tianocore.org/show_bug.cgi?id=3635

Currently, in order to test the supported attributes,
the PciTestSupportedAttribute() will set the command register
to 0x27 (EFI_PCI_COMMAND_IO_SPACE, EFI_PCI_COMMAND_MEMORY_SPACE,
EFI_PCI_COMMAND_BUS_MASTER, EFI_PCI_COMMAND_VGA_PALETTE_SNOOP) firstly,
and then read back to check whether these attributes are
set successfully in the device.
This will cause the other enabled bits
 (other than EFI_PCI_COMMAND_IO_SPACE,EFI_PCI_COMMAND_MEMORY_SPACE,
 EFI_PCI_COMMAND_BUS_MASTER,EFI_PCI_COMMAND_VGA_PALETTE_SNOOP)
 be cleared for a short of time
 This patch fixes this issue by keeping the origina
 enabled bits when setting 0x27.

Signed-off-by: xueshengfeng <xueshengfeng@byosoft.com.cn>
Reviewed-by: Ray <ray.ni@intel.com>
2 years agoUefiPayloadPkg: Add Macro to enable or disable some drivers.
Zhiguang Liu [Sat, 18 Sep 2021 07:10:29 +0000 (15:10 +0800)]
UefiPayloadPkg: Add Macro to enable or disable some drivers.

Add Macro to enable or disable RamDiskDxe and SioBusDxe drivers.

Cc: Guo Dong <guo.dong@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Maurice Ma <maurice.ma@intel.com>
Cc: Benjamin You <benjamin.you@intel.com>
Reviewed-by: Maurice Ma <maurice.ma@intel.com>
Signed-off-by: Zhiguang Liu <zhiguang.liu@intel.com>
2 years agoEmbeddedPkg: Add LoadFile2 for linux initrd
Jeff Brasen [Mon, 13 Sep 2021 23:18:51 +0000 (23:18 +0000)]
EmbeddedPkg: Add LoadFile2 for linux initrd

Add support under a pcd feature for using the new interface to pass
initrd to the linux kernel instead of via device tree.
This feature is also enabled if ACPI tables are present, and will skip
locating and installation of device tree.

Signed-off-by: Jeff Brasen <jbrasen@nvidia.com>
Reviewed-by: Leif Lindholm <leif@nuviainc.com>
2 years agoEmbeddedPkg: Install FDT if UpdateDtb is not present
Jeff Brasen [Mon, 13 Sep 2021 23:18:50 +0000 (23:18 +0000)]
EmbeddedPkg: Install FDT if UpdateDtb is not present

Currently if mAndroidBootImg->UpdateDtb is not supported on the platform
the device tree updates of the initrd are not made.

Signed-off-by: Jeff Brasen <jbrasen@nvidia.com>
Reviewed-by: Leif Lindholm <leif@nuviainc.com>
2 years agoEmbeddedPkg: AndroidBootImgBoot error handling updates
Jeff Brasen [Mon, 13 Sep 2021 23:18:49 +0000 (23:18 +0000)]
EmbeddedPkg: AndroidBootImgBoot error handling updates

Update AndroidBootImgBoot to use a single return point
Make sure Kernel args are freed and Image is unloaded.

Signed-off-by: Jeff Brasen <jbrasen@nvidia.com>
Reviewed-by: Leif Lindholm <leif@nuviainc.com>
2 years agoEmbeddedPkg: Remove duplicate libfdt.h include
Jeff Brasen [Mon, 13 Sep 2021 23:18:48 +0000 (23:18 +0000)]
EmbeddedPkg: Remove duplicate libfdt.h include

Remove duplicate libfdt.h include statement in AndroidBootImgLib

Signed-off-by: Jeff Brasen <jbrasen@nvidia.com>
Reviewed-by: Leif Lindholm <leif@nuviainc.com>
2 years agoOvmfPkg: set a default value for the WorkAreaHeader PCD
Corvin Köhne [Fri, 17 Sep 2021 05:37:24 +0000 (07:37 +0200)]
OvmfPkg: set a default value for the WorkAreaHeader PCD

SEC checks in IsSevGuest if the PCD defined WorkAreaHeader size
matches the size of the WorkAreaHeader struct definition. Set a
default value for the PCD to avoid unnecessary DSC/FDF file
changes in all OVMF DSC/FDF files.

Signed-off-by: Corvin Köhne <c.koehne@beckhoff.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
2 years agoIntelFsp2WrapperPkg: Make PcdFspModeSelection dynamic
Zhang Xiaoqiang [Thu, 16 Sep 2021 03:44:47 +0000 (11:44 +0800)]
IntelFsp2WrapperPkg: Make PcdFspModeSelection dynamic

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3632

PcdFspModeSelection will be used to set FSP mode.
Make PcdFspModeSelection dynamic and set it accordingly.

Signed-off-by: Zhang Xiaoqiang <xiaoqiang.zhang@intel.com>
Cc: Chasel Chiu <chasel.chiu@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Reviewed-by: Chasel Chiu <chasel.chiu@intel.com>
2 years agoSecurityPkg: Add debug log for indicating IBB verified OBB successfully
Yang, Longlong [Fri, 17 Sep 2021 02:50:55 +0000 (10:50 +0800)]
SecurityPkg: Add debug log for indicating IBB verified OBB successfully

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3615

Debug message should be added for indicating IBB is successfully verifying
the OBB.

Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Min M Xu <min.m.xu@intel.com>
Cc: Qi Zhang <qi1.zhang@intel.com>
Signed-off-by: Longlong Yang <longlong.yang@intel.com>
Reviewed-by: Min M Xu <min.m.xu@intel.com>
Reviewed-by: Jian J Wang <jian.j.wang@intel.com>
2 years agoUefiCpuPkg: SecCoreNative without ResetVector
S, Ashraf Ali [Thu, 16 Sep 2021 14:26:37 +0000 (22:26 +0800)]
UefiCpuPkg: SecCoreNative without ResetVector

REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3492

Currently SecCore.inf having the resetvector code under IA32. if the
user wants to use both SecCore and UefiCpuPkg ResetVector it's not
possible, since SecCore and ResetVector(VTF0.INF/ResetVector.inf)
are sharing the same GUID which is BFV. to overcome this issue we can
create the Duplicate version of the SecCore.inf as SecCoreNative.inf
which contains pure SecCore Native functionality without resetvector.
SecCoreNative.inf should have the Unique GUID so that it can be used
along with UefiCpuPkg ResetVector in there implementation.

Reviewed-by: Ray Ni <ray.ni@intel.com>
Cc: Rahul Kumar <rahul1.kumar@intel.com>
Cc: Debkumar De <debkumar.de@intel.com>
Cc: Harry Han <harry.han@intel.com>
Cc: Catharine West <catharine.west@intel.com>
Cc: Digant H Solanki <digant.h.solanki@intel.com>
Cc: Sangeetha V <sangeetha.v@intel.com>
Signed-off-by: Ashraf Ali S <ashraf.ali.s@intel.com>
2 years agoArmPkg/ProcessorSubClassDxe: Fix the format of ProcessorId
Nhi Pham [Wed, 15 Sep 2021 13:55:32 +0000 (20:55 +0700)]
ArmPkg/ProcessorSubClassDxe: Fix the format of ProcessorId

According to SMBIOS 3.4, section 7.5.3.3 ARM64-class CPUs, if
SMCCC_ARCH_SOC_ID is supported, the first DWORD is the JEP-106 code and
the second DWORD is the SoC revision value. But in the current
implementation, they are set in reverse. This patch is to correct it.

Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Rebecca Cran <rebecca@nuviainc.com>
Signed-off-by: Nhi Pham <nhi@os.amperecomputing.com>
Reviewed-by: Rebecca Cran <rebecca@nuviainc.com>
Acked-by: Leif Lindholm <leif@nuviainc.com>
2 years agoUefiCpuPkg: VTF0 Linear-Address Translation to a 1-GByte Page till 512GB
Ashraf Ali S [Sat, 11 Sep 2021 11:25:51 +0000 (16:55 +0530)]
UefiCpuPkg: VTF0 Linear-Address Translation to a 1-GByte Page till 512GB

REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3473

X64 Reset Vector Code can access the memory range till 4GB using the
Linear-Address Translation to a 2-MByte Page, when user wants to use
more than 4G using 2M Page it will leads to use more number of Page
table entries. using the 1-GByte Page table user can use more than
4G Memory by reducing the page table entries using 1-GByte Page,
this patch attached can access memory range till 512GByte via Linear-
Address Translation to a 1-GByte Page.

Build Tool: if the nasm is not found it will throw Build errors like
FileNotFoundError: [WinError 2]The system cannot find the file specified
run the command wil try except block to get meaningful error message

Test Result: Tested in both Simulation environment and Hardware
both works fine without any issues.

Reviewed-by: Ray Ni <ray.ni@intel.com>
Cc: Rahul Kumar <rahul1.kumar@intel.com>
Cc: Debkumar De <debkumar.de@intel.com>
Cc: Harry Han <harry.han@intel.com>
Cc: Catharine West <catharine.west@intel.com>
Cc: Sangeetha V <sangeetha.v@intel.com>
Cc: Rangasai V Chaganty <rangasai.v.chaganty@intel.com>
Cc: Sahil Dureja <sahil.dureja@intel.com>
Signed-off-by: Ashraf Ali S <ashraf.ali.s@intel.com>
2 years agoUefiCpuPkg: Prevent from re-initializing CPU features during S3 resume
Lou, Yun [Thu, 16 Sep 2021 09:27:12 +0000 (17:27 +0800)]
UefiCpuPkg: Prevent from re-initializing CPU features during S3 resume

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3621
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3631

Current CPU feature initialization design:
During normal boot, CpuFeaturesPei module (inside FSP) initializes the
CPU features. During S3 boot, CpuFeaturesPei module does nothing, and
CpuSmm driver (in SMRAM) initializes CPU features instead.

This code change prevents CpuSmm driver from re-initializing CPU
features during S3 resume if CpuFeaturesPei module has done the same
initialization.

In addition, EDK2 contains DxeIpl PEIM that calls S3RestoreConfig2 PPI
during S3 boot and this PPI eventually calls CpuSmm driver (in SMRAM) to
initialize the CPU features, so "EDK2 + FSP" does not have the CPU
feature initialization issue during S3 boot. But "coreboot" does not
contain DxeIpl PEIM and the issue appears, unless
"PcdCpuFeaturesInitOnS3Resume" is set to TRUE.

Signed-off-by: Jason Lou <yun.lou@intel.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Rahul Kumar <rahul1.kumar@intel.com>
2 years agoUefiCpuPkg: Refactor initialization of CPU features during S3 resume
Lou, Yun [Thu, 16 Sep 2021 09:27:11 +0000 (17:27 +0800)]
UefiCpuPkg: Refactor initialization of CPU features during S3 resume

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3621
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3631

Refactor initialization of CPU features during S3 resume.

In addition, the macro ACPI_CPU_DATA_STRUCTURE_UPDATE is used to fix
incompatibility issue caused by ACPI_CPU_DATA structure update. It will
be removed after all the platform code uses new ACPI_CPU_DATA structure.

Signed-off-by: Jason Lou <yun.lou@intel.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Rahul Kumar <rahul1.kumar@intel.com>
2 years agoUefiPayloadPkg: Fix the warning when building UefiPayloadPkg with IA32+X64
Tan, Dun [Tue, 14 Sep 2021 07:39:07 +0000 (15:39 +0800)]
UefiPayloadPkg: Fix the warning when building UefiPayloadPkg with IA32+X64

REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3603

Move the unspecified PCDs from .common section. to .X64 section in .dsc file.
The corresponding PCDs are not used in IA32.

Cc: Guo Dong <guo.dong@intel.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
Cc: Maurice Ma <maurice.ma@intel.com>
Cc: Benjamin You <benjamin.you@intel.com>
Signed-off-by: Dun Tan <dun.tan@intel.com>
2 years agoUefiPayloadPkg: Add script to build UniversalPayload in UefiPayloadPkg
Tan, Dun [Thu, 16 Sep 2021 09:12:51 +0000 (17:12 +0800)]
UefiPayloadPkg: Add script to build UniversalPayload in UefiPayloadPkg

V1: Add script to build UniversalPayload, which can be used after edksetup rebuild
The final UPL.elf will be located at root folder of edk2

V2: Revise the ouput directory of generated files and coding style in the script

Cc: Guo Dong <guo.dong@intel.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
Cc: Maurice Ma <maurice.ma@intel.com>
Cc: Benjamin You <benjamin.you@intel.com>
Cc: Zhiguang Liu <zhiguang.liu@intel.com>
Cc: Bob Feng <bob.c.feng@intel.com>
Signed-off-by: Dun Tan <dun.tan@intel.com>
2 years agoMdeModulePkg/Core/Pei: Fix pointer size mismatch in EvacuateTempRam()
Michael Kubacki [Thu, 9 Sep 2021 03:46:01 +0000 (11:46 +0800)]
MdeModulePkg/Core/Pei: Fix pointer size mismatch in EvacuateTempRam()

REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3512

In 32-bit PEI, the local variable pointers MigratedFvHeader and
RawDataFvHeader in EvacuateTempRam() will be 32-bit in size. The
pointers are currently passed to PeiServicesAllocatePages() which
expects a 64-bit output buffer of type EFI_PHYSICAL_ADDRESS.

When PeiServicesAllocatePages() writes to the buffer, the data
can overflow.

Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Dandan Bi <dandan.bi@intel.com>
Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
2 years agoMdeModulePkg/Core/Pei: Make migrated PEIM message verbose
Michael Kubacki [Thu, 9 Sep 2021 03:46:00 +0000 (11:46 +0800)]
MdeModulePkg/Core/Pei: Make migrated PEIM message verbose

Currently, the debug message that prints the name of a PEIM
being migrated is DEBUG_INFO while similar messages are
DEBUG_VERBOSE. This change updates the print level to
DEBUG_VERBOSE for consistency.

Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Dandan Bi <dandan.bi@intel.com>
Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
2 years agoMdeModulePkg/Core/Pei: Fix typo in function descriptions
Michael Kubacki [Thu, 9 Sep 2021 03:45:59 +0000 (11:45 +0800)]
MdeModulePkg/Core/Pei: Fix typo in function descriptions

Corrects a typo in the return value description of MigratePeim() and
EvacuateTempRam():
  "Succesfully" to "Successfully"

Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Dandan Bi <dandan.bi@intel.com>
Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
2 years agoSecurityPkg: Add references to header and inf files to SecurityPkg
Stefan Berger [Mon, 13 Sep 2021 14:21:06 +0000 (22:21 +0800)]
SecurityPkg: Add references to header and inf files to SecurityPkg

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
2 years agoSecurityPkg/Tcg: Make Tcg2PlatformPei buildable and fix style issues
Stefan Berger [Mon, 13 Sep 2021 14:21:04 +0000 (22:21 +0800)]
SecurityPkg/Tcg: Make Tcg2PlatformPei buildable and fix style issues

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
2 years agoSecurityPkg/Tcg: Import Tcg2PlatformPei from edk2-platforms
Stefan Berger [Mon, 13 Sep 2021 14:21:03 +0000 (22:21 +0800)]
SecurityPkg/Tcg: Import Tcg2PlatformPei from edk2-platforms

Import Tcg2PlatformPei from edk2-platforms without any modifications.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
2 years agoSecurityPkg: Introduce new PCD PcdRandomizePlatformHierarchy
Stefan Berger [Mon, 13 Sep 2021 14:21:01 +0000 (22:21 +0800)]
SecurityPkg: Introduce new PCD PcdRandomizePlatformHierarchy

Introduce the new PCD
gEfiSecurityPkgTokenSpaceGuid.PcdRandomizePlatformHierarchy.
We need it for TpmPlatformHierarchyLib.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
2 years agoSecurityPkg/Tcg: Make Tcg2PlatformDxe buildable and fix style issues
Stefan Berger [Mon, 13 Sep 2021 14:21:00 +0000 (22:21 +0800)]
SecurityPkg/Tcg: Make Tcg2PlatformDxe buildable and fix style issues

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
2 years agoSecrutiyPkg/Tcg: Import Tcg2PlatformDxe from edk2-platforms
Stefan Berger [Mon, 13 Sep 2021 14:20:59 +0000 (22:20 +0800)]
SecrutiyPkg/Tcg: Import Tcg2PlatformDxe from edk2-platforms

Import Tcg2PlatformDxe from edk2-platforms without any modifications.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
2 years agoSecurityPkg/TPM: Fix bugs in imported PeiDxeTpmPlatformHierarchyLib
Stefan Berger [Mon, 13 Sep 2021 14:20:58 +0000 (22:20 +0800)]
SecurityPkg/TPM: Fix bugs in imported PeiDxeTpmPlatformHierarchyLib

Fix some bugs in the original PeiDxeTpmPlatformHierarchyLib.c.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
2 years agoSecurityPkg/TPM: Import PeiDxeTpmPlatformHierarchyLib.c from edk2-platforms
Stefan Berger [Mon, 13 Sep 2021 14:20:57 +0000 (22:20 +0800)]
SecurityPkg/TPM: Import PeiDxeTpmPlatformHierarchyLib.c from edk2-platforms

Import PeiDxeTpmPlatformHierarchyLib from edk2-platforms without any
modifications.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2 years agoUefiPayloadPkg: Dump hob info from gEdkiiBootManagerMenuFileGuid
duntan [Fri, 10 Sep 2021 08:01:11 +0000 (16:01 +0800)]
UefiPayloadPkg: Dump hob info from gEdkiiBootManagerMenuFileGuid

V1: Dump this hob infomation from gEdkiiBootManagerMenuFileGuid
V2: Delete the duplicated assertions
V3: Add input parameter in Comment

Cc: Guo Dong <guo.dong@intel.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
Cc: Maurice Ma <maurice.ma@intel.com>
Cc: Benjamin You <benjamin.you@intel.com>
Reviewed-by: Zhiguang Liu <zhiguang.liu@intel.com>
Signed-off-by: Dun Tan <dun.tan@intel.com>
2 years agoUefiPayloadPkg: Fix the bug in dump guid HOB info functions
duntan [Fri, 10 Sep 2021 08:01:10 +0000 (16:01 +0800)]
UefiPayloadPkg: Fix the bug in dump guid HOB info functions

The input HobLength of PrintHandler should be data size instead of whole length of HOB

Cc: Guo Dong <guo.dong@intel.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
Cc: Maurice Ma <maurice.ma@intel.com>
Cc: Benjamin You <benjamin.you@intel.com>
Reviewed-by: Zhiguang Liu <zhiguang.liu@intel.com>
Signed-off-by: Dun Tan <dun.tan@intel.com>
2 years agoUefiCpuPkg: ResetVector Tool additional debug prints
Ashraf Ali S [Fri, 23 Jul 2021 08:32:23 +0000 (14:02 +0530)]
UefiCpuPkg: ResetVector Tool additional debug prints

REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3506

Before executing the nasm command, added print statement to know what
commands are executing.
before printing the output file need check the status of command which
is executed. if the status is 0 then only print the output file name.

Reviewed-by: Ray Ni <ray.ni@intel.com>
Cc: Rahul Kumar <rahul1.kumar@intel.com>
Cc: Debkumar De <debkumar.de@intel.com>
Cc: Harry Han <harry.han@intel.com>
Cc: Catharine West <catharine.west@intel.com>
Cc: Sangeetha V <sangeetha.v@intel.com>
Signed-off-by: Ashraf Ali S <ashraf.ali.s@intel.com>
2 years agoUefiCpuPkg: ResetVector Tool Support for Python 3
Ashraf Ali S [Fri, 23 Jul 2021 08:25:30 +0000 (13:55 +0530)]
UefiCpuPkg: ResetVector Tool Support for Python 3

REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3506

Build Scrips for Reset Vector currently based on Python 2
which is already EOL, needs to modify the build script based on
Python 3

Reviewed-by: Ray Ni <ray.ni@intel.com>
Cc: Rahul Kumar <rahul1.kumar@intel.com>
Cc: Debkumar De <debkumar.de@intel.com>
Cc: Harry Han <harry.han@intel.com>
Cc: Catharine West <catharine.west@intel.com>
Cc: Sangeetha V <sangeetha.v@intel.com>
Signed-off-by: Ashraf Ali S <ashraf.ali.s@intel.com>
2 years agoUefiPayloadPkg: Include Network modules in UefiPayloadPkg.
Sravanthi [Thu, 9 Sep 2021 10:12:46 +0000 (18:12 +0800)]
UefiPayloadPkg: Include Network modules in UefiPayloadPkg.

Include Network modules in UefiPayloadPkg.dsc and UefiPayloadPkg.fdf

Cc: Guo Dong <guo.dong@intel.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
Cc: Maurice Ma <maurice.ma@intel.com>
Cc: Benjamin You <benjamin.you@intel.com>
Cc: Zhiguang Liu <zhiguang.liu@intel.com>
Signed-off-by: Sravanthi <k.kavyax.sravanthi@intel.com>
2 years agoUefiPayloadPkg: Include more modules in UefiPayloadPkg.
Sravanthi [Thu, 9 Sep 2021 10:11:27 +0000 (18:11 +0800)]
UefiPayloadPkg: Include more modules in UefiPayloadPkg.

Include core modules in UefiPayloadPkg.dsc and UefiPayloadPkg.fdf

Cc: Guo Dong <guo.dong@intel.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
Cc: Maurice Ma <maurice.ma@intel.com>
Cc: Benjamin You <benjamin.you@intel.com>
Cc: Zhiguang Liu <zhiguang.liu@intel.com>
Signed-off-by: Sravanthi <k.kavyax.sravanthi@intel.com>
2 years agoRedfishPkg: Fix various typos
Abner Chang [Tue, 7 Sep 2021 03:25:46 +0000 (11:25 +0800)]
RedfishPkg: Fix various typos

Fix various typos in comments and documentation.

Signed-off-by: Cheng Zhou <zhoucheng@phytium.com.cn>
Reviewed-by: Nickle Wang <nickle.wang@hpe.com>
Cc: Abner Chang <abner.chang@hpe.com>
Reviewed-by: Abner Chang <abner.chang@hpe.com>
2 years agoOvmfPkg/OvmfXen: Fix build with QemuKernelLoaderFsDxe
Anthony PERARD [Mon, 6 Sep 2021 14:02:42 +0000 (15:02 +0100)]
OvmfPkg/OvmfXen: Fix build with QemuKernelLoaderFsDxe

VerifyBlob() has been added recently to QemuKernelLoaderFsDxe, also
QemuKernelLoaderFsDxe has been added recently to OvmfXen but without an
implementation of VerifyBlob().

Fix this by adding the same runes that have been added to
OvmfPkgX64.dsc.

Fixes: 9f3eda177a4b ("OvmfPkg/OvmfXen: add QemuKernelLoaderFsDxe")
Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
2 years agoSecurityPkg/MemoryOverwriteControl: Add missing argument to DEBUG print
Michael Kubacki [Fri, 3 Sep 2021 19:58:21 +0000 (03:58 +0800)]
SecurityPkg/MemoryOverwriteControl: Add missing argument to DEBUG print

REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3605

The error message is missing the argument for the status code
print specifier.

Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Qi Zhang <qi1.zhang@intel.com>
Cc: Rahul Kumar <rahul1.kumar@intel.com>
Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
2 years agoMaintainers.txt: Update maintainer/reviewer roles in MdeModulePkg
Hao A Wu [Fri, 20 Aug 2021 05:36:56 +0000 (13:36 +0800)]
Maintainers.txt: Update maintainer/reviewer roles in MdeModulePkg

Remove Hao A Wu as the MdeModulePkg maintainer.
Add Liming Gao as the MdeModulePkg maintainer.
Remove Hao A Wu as the MdeModulePkg: Firmware Update modules reviewer.
Remove Hao A Wu as the MdeModulePkg: Serial modules reviewer.

Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Guomin Jiang <guomin.jiang@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Zhichao Gao <zhichao.gao@intel.com>
Signed-off-by: Hao A Wu <hao.a.wu@intel.com>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
Reviewed-by: Zhichao Gao <zhichao.gao@intel.com>
2 years agoMdeModulePkg: Fix typo of "memory" in RamDiskDxe debug message
Rebecca Cran [Mon, 30 Aug 2021 22:36:36 +0000 (06:36 +0800)]
MdeModulePkg: Fix typo of "memory" in RamDiskDxe debug message

Fix a typo of "memory" in a debug message in RamDiskProtocol.c.

Signed-off-by: Rebecca Cran <rebecca@bsdio.com>
Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com>
2 years agoMdeModulePkg/HiiDatabaseDxe:remove dead code block
Wenyi Xie [Thu, 26 Aug 2021 01:16:03 +0000 (09:16 +0800)]
MdeModulePkg/HiiDatabaseDxe:remove dead code block

As the if statement outside has confirmed that
BlockData->Name == NULL, so the if statement inside
is always false.

Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Hao A Wu <hao.a.wu@intel.com>
Cc: Dandan Bi <dandan.bi@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Signed-off-by: Wenyi Xie <xiewenyi2@huawei.com>
Reviewed-by: Dandan Bi <dandan.bi@intel.com>
2 years ago.azurepipelines: Add UefiPayloadPkg in gate-build-job.yml and CISetting.py
duntan [Fri, 20 Aug 2021 06:43:37 +0000 (14:43 +0800)]
.azurepipelines: Add UefiPayloadPkg in gate-build-job.yml and CISetting.py

Add UefiPayloadPkg in gate-build-job.yml to enable Core ci for UefiPayloadPkg.
Add UefiPayloadPkg to supported Packages in CISettings.

Cc: Sean Brogan <sean.brogan@microsoft.com>
Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Signed-off-by: DunTan <dun.tan@intel.com>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
2 years agoUefiPayloadPkg: Create .yaml file in UefiPayloadPkg
duntan [Fri, 20 Aug 2021 06:43:36 +0000 (14:43 +0800)]
UefiPayloadPkg: Create .yaml file in UefiPayloadPkg

Create .yaml file in UefiPayloadPkg to enable Core ci for UefiPayloadPkg

Cc: Guo Dong <guo.dong@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Maurice Ma <maurice.ma@intel.com>
Cc: Benjamin You <benjamin.you@intel.com>
Signed-off-by: DunTan <dun.tan@intel.com>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
2 years agoIntelFsp2Pkg: Support Config File and Binary delta comparison
Loo, Tung Lun [Tue, 17 Aug 2021 07:43:12 +0000 (15:43 +0800)]
IntelFsp2Pkg: Support Config File and Binary delta comparison

BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3567

This patch is to enable config editor to have a new feature that
can spell out the delta between the default configuration files'
data, such as YAML and BSF, against the data stored in the binary.
This can help users understand and track the difference when
modifications are made.

Cc: Maurice Ma <maurice.ma@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Chasel Chiu <chasel.chiu@intel.com>
Signed-off-by: Loo Tung Lun <tung.lun.loo@intel.com>
Reviewed-by: Chasel Chiu <chasel.chiu@intel.com>
2 years agoUefiCpuPkg: Clean up save state boundary checks and comments.
Mark Wilson [Fri, 13 Nov 2020 00:05:18 +0000 (08:05 +0800)]
UefiCpuPkg: Clean up save state boundary checks and comments.

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2956

In functions ReadSaveStateRegisterByIndex and WriteSaveStateRegister:
* check width > 4 instead of >= 4 when writing upper 32 bytes.
  - This improves the code but will not affect functionality.

Cc: Eric Dong <eric.dong@intel.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
Signed-off-by: Mark Wilson <Mark.Wilson@amd.com>
2 years agoMdeModulePkg/PiSmmCore: Drop deprecated image profiling commands
Marvin H?user [Mon, 9 Aug 2021 06:09:25 +0000 (14:09 +0800)]
MdeModulePkg/PiSmmCore: Drop deprecated image profiling commands

The legacy codebase allowed SMM images to be registered for profiling
from DXE. Support for this has been dropped entirely, so remove the
remaining handlers.

Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Hao A Wu <hao.a.wu@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
Cc: Vitaly Cheptsov <vit9696@protonmail.com>
Signed-off-by: Marvin H?user <mhaeuser@posteo.de>
2 years agoUefiPayloadPkg/UefiPayloadEntry: Fix memory corruption
Marvin H?user [Sun, 8 Aug 2021 19:39:53 +0000 (03:39 +0800)]
UefiPayloadPkg/UefiPayloadEntry: Fix memory corruption

UefiPayloadEntry's AllocatePool() applies the "sizeof" operator to
HOB index rather than the HOB header structure. This yields 4 Bytes
compared to the 8 Bytes the structure header requires. Fix the call
to allocate the required space instead.

Reviewed-by: Guo Dong <guo.dong@intel.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
Cc: Maurice Ma <maurice.ma@intel.com>
Cc: Benjamin You <benjamin.you@intel.com>
Cc: Vitaly Cheptsov <vit9696@protonmail.com>
Signed-off-by: Marvin H?user <mhaeuser@posteo.de>
2 years agoUefiCpuPkg/PiSmmCpuDxeSmm: Update mPatchCetSupported set condition
Wenxing Hou [Tue, 24 Aug 2021 08:11:11 +0000 (16:11 +0800)]
UefiCpuPkg/PiSmmCpuDxeSmm: Update mPatchCetSupported set condition

REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3584

Function AsmCpuid should first check the value for Basic CPUID Information.
The fix is to update the mPatchCetSupported judgment statement.

Signed-off-by: Wenxing Hou <wenxing.hou@intel.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Rahul Kumar <rahul1.kumar@intel.com>
Cc: Sheng W <w.sheng@intel.com>
Cc: Yao Jiewen <jiewen.yao@intel.com>
2 years agoUefiPayloadPkg: Fix the build error when enable Core ci for UefiPayloadPkg
duntan [Fri, 20 Aug 2021 05:04:29 +0000 (13:04 +0800)]
UefiPayloadPkg: Fix the build error when enable Core ci for UefiPayloadPkg

V1: Add quotes when using $(ARCH) in .dsc and .fdf file.
The quotes are added due to the way by which Core ci parse the .dsc file.
Add UINTN in Hob.c to fix cast from pointer to integer of different size error.
V2: Delete lines which reference ShellBinPkg.The pkg doesn't exist in edk2.

Cc: Guo Dong <guo.dong@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Maurice Ma <maurice.ma@intel.com>
Cc: Benjamin You <benjamin.you@intel.com>
Signed-off-by: DunTan <dun.tan@intel.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
2 years agoOvmfPkg/OvmfXen: add QemuKernelLoaderFsDxe
Lin, Gary (HPS OE-Linux) [Tue, 31 Aug 2021 01:29:48 +0000 (09:29 +0800)]
OvmfPkg/OvmfXen: add QemuKernelLoaderFsDxe

Without QemuKernelLoaderFsDxe, QemuLoadKernelImage() couldn't download
the kernel, initrd, and kernel command line from QEMU's fw_cfg.

Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3574
Signed-off-by: Gary Lin <gary.lin@hpe.com>
Acked-by: Anthony PERARD <anthony.perard@citrix.com>
Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com>
Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>
Tested-by: Jim Fehlig <jfehlig@suse.com>
2 years agoOvmfPkg/SmmControl2Dxe: use PcdAcpiS3Enable to detect S3 support
Lin, Gary (HPS OE-Linux) [Tue, 31 Aug 2021 01:31:15 +0000 (09:31 +0800)]
OvmfPkg/SmmControl2Dxe: use PcdAcpiS3Enable to detect S3 support

To avoid the potential inconsistency between PcdAcpiS3Enable and
QemuFwCfgS3Enabled(), this commit modifies SmmControl2Dxe to detect
S3 support by PcdAcpiS3Enable as modules in MdeModulePkg do.

Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3573
Signed-off-by: Gary Lin <gary.lin@hpe.com>
Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Jiewen Yao <Jiewen.yao@intel.com>
Tested-by: Jim Fehlig <jfehlig@suse.com>
2 years agoOvmfPkg/PlatformBootManagerLib: use PcdAcpiS3Enable to detect S3 support
Lin, Gary (HPS OE-Linux) [Tue, 31 Aug 2021 01:31:14 +0000 (09:31 +0800)]
OvmfPkg/PlatformBootManagerLib: use PcdAcpiS3Enable to detect S3 support

To avoid the potential inconsistency between PcdAcpiS3Enable and
QemuFwCfgS3Enabled(), this commit modifies PlatformBootManagerLib to
detect S3 support by PcdAcpiS3Enable as modules in MdeModulePkg do.

Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3573
Signed-off-by: Gary Lin <gary.lin@hpe.com>
Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Jiewen Yao <Jiewen.yao@intel.com>
Tested-by: Jim Fehlig <jfehlig@suse.com>
2 years agoOvmfPkg/LockBoxLib: use PcdAcpiS3Enable to detect S3 support
Lin, Gary (HPS OE-Linux) [Tue, 31 Aug 2021 01:31:13 +0000 (09:31 +0800)]
OvmfPkg/LockBoxLib: use PcdAcpiS3Enable to detect S3 support

To avoid the potential inconsistency between PcdAcpiS3Enable and
QemuFwCfgS3Enabled(), this commit modifies LockBoxLib to detect
S3 support by PcdAcpiS3Enable as modules in MdeModulePkg do.

Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3573
Signed-off-by: Gary Lin <gary.lin@hpe.com>
Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com>
Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Jiewen Yao <Jiewen.yao@intel.com>
Tested-by: Jim Fehlig <jfehlig@suse.com>
2 years agoOvmfPkg/OvmfXen: set PcdAcpiS3Enable at initialization
Lin, Gary (HPS OE-Linux) [Tue, 31 Aug 2021 01:31:12 +0000 (09:31 +0800)]
OvmfPkg/OvmfXen: set PcdAcpiS3Enable at initialization

There are several functions in OvmfPkg/Library using
QemuFwCfgS3Enabled() to detect the S3 support status. However, in
MdeModulePkg, PcdAcpiS3Enable is used to check S3 support. Since
InitializeXenPlatform() didn't set PcdAcpiS3Enable as
InitializePlatform() did, this made the inconsistency between
drivers/functions.

For example, S3SaveStateDxe checked PcdAcpiS3Enable and skipped
S3BootScript because the default value is FALSE. On the other hand,
PlatformBootManagerBeforeConsole() from OvmfPkg/Library called
QemuFwCfgS3Enabled() and found it returned TRUE, so it invoked
SaveS3BootScript(). However, S3SaveStateDxe skipped S3BootScript, so
SaveS3BootScript() asserted due to EFI_NOT_FOUND.

This issue mainly affects "HVM Direct Kernel Boot". When used,
"fw_cfg" is enabled in QEMU and QemuFwCfgS3Enabled() returns true in
that case.

Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3573
Signed-off-by: Gary Lin <gary.lin@hpe.com>
Reviewed-by: Anthony PERARD <anthony.perard@citrix.com>
Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Jiewen Yao <Jiewen.yao@intel.com>
Tested-by: Jim Fehlig <jfehlig@suse.com>
2 years agoArmPkg: Enable boot discovery policy for ARM package.
Grzegorz Bernacki [Mon, 30 Aug 2021 12:08:05 +0000 (14:08 +0200)]
ArmPkg: Enable boot discovery policy for ARM package.

This commit adds code which check BootDiscoveryPolicy variable and
calls Boot Policy Manager Protocol to connect device specified by
the variable. To enable that mechanism for platform
EfiMdeModulePkgTokenSpaceGuid.PcdBootDiscoveryPolicy PCD must be
added to DSC file and BootDiscoveryPolicyUiLib should be added to
UiApp libraries.

Signed-off-by: Grzegorz Bernacki <gjb@semihalf.com>
Reviewed-by: Sunny Wang <sunny.wang@arm.com>
Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
2 years agoMdeModulePkg:Increase Nvme capacity display
zhoucheng [Thu, 19 Aug 2021 07:30:56 +0000 (15:30 +0800)]
MdeModulePkg:Increase Nvme capacity display

Displays the Nvme total capacity.

Signed-off-by: Cheng Zhou <zhoucheng@phytium.com.cn>
Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Hao A Wu <hao.a.wu@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
2 years agoMdePkg:Update IndustryStandard/Nvme.h with Nvme amdin controller data
zhoucheng [Thu, 19 Aug 2021 07:30:55 +0000 (15:30 +0800)]
MdePkg:Update IndustryStandard/Nvme.h with Nvme amdin controller data

Update Nvme data structure

Signed-off-by: Cheng Zhou <zhoucheng@phytium.com.cn>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Zhiguang Liu <zhiguang.liu@intel.com>
2 years agoMdeModulePkg: Add BootDiscoveryPolicyOld variable.
Grzegorz Bernacki [Wed, 18 Aug 2021 07:36:00 +0000 (15:36 +0800)]
MdeModulePkg: Add BootDiscoveryPolicyOld variable.

This variable is needed to track the change to
BootDiscoveryPolicy variable. Boot options should
be refreshed only if BootDiscoveryPolicy has been
changed.

Signed-off-by: Grzegorz Bernacki <gjb@semihalf.com>
Reviewed-by: Samer El-Haj-Mahmoud <Samer.El-Haj-Mahmoud@arm.com>
Acked-by: Hao A Wu <hao.a.wu@intel.com>
2 years agoMdeModulePkg/EbcDxe: Mitigate memcpy intrinsics
Marvin H?user [Sun, 15 Aug 2021 20:11:56 +0000 (04:11 +0800)]
MdeModulePkg/EbcDxe: Mitigate memcpy intrinsics

Assignments of structure values cause the emission of memcpy()
intrinsics by the CLANG38 toolchain. Substitute the assignments with
calls to CopyMem() to mitigate the issue.

Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Hao A Wu <hao.a.wu@intel.com>
Cc: Vitaly Cheptsov <vit9696@protonmail.com>
Signed-off-by: Marvin H?user <mhaeuser@posteo.de>
Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
2 years agoOvmfPkg/VirtioMmioDeviceLib: enable virtio 1.0
Gerd Hoffmann [Fri, 27 Aug 2021 13:44:59 +0000 (21:44 +0800)]
OvmfPkg/VirtioMmioDeviceLib: enable virtio 1.0

Now with everything in place for virtio 1.0 devices we can let
VirtioMmioInit() return SUCCESS.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
2 years agoOvmfPkg/VirtioMmioDeviceLib: virtio 1.0: Adapt feature bit handling
Gerd Hoffmann [Fri, 27 Aug 2021 13:44:58 +0000 (21:44 +0800)]
OvmfPkg/VirtioMmioDeviceLib: virtio 1.0: Adapt feature bit handling

virtio 1.0 has 64 feature bits instead of 32.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
2 years agoOvmfPkg/VirtioMmioDeviceLib: virtio 1.0: Add default QueueNum
Gerd Hoffmann [Fri, 27 Aug 2021 13:44:57 +0000 (21:44 +0800)]
OvmfPkg/VirtioMmioDeviceLib: virtio 1.0: Add default QueueNum

Use QueueNumMax as QueueNum default for drivers which do not
explicitly call VIRTIO_DEVICE_PROTOCOL->SetQueueSize().

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
2 years agoOvmfPkg/VirtioMmioDeviceLib: virtio 1.0: Fix SetQueueAddress
Gerd Hoffmann [Fri, 27 Aug 2021 13:44:56 +0000 (21:44 +0800)]
OvmfPkg/VirtioMmioDeviceLib: virtio 1.0: Fix SetQueueAddress

Virtio 1.0 allows a more flexible virtio ring layout, so we have to set
addresses for descriptors avail flags and use flags separately.  We
continue to use a ring layout compatible with virtio 0.9.5 though, so no
other changes are needed to setup the virtio queues.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
2 years agoOvmfPkg/VirtioMmioDeviceLib: virtio 1.0: Fix SetPageSize.
Gerd Hoffmann [Fri, 27 Aug 2021 13:44:55 +0000 (21:44 +0800)]
OvmfPkg/VirtioMmioDeviceLib: virtio 1.0: Fix SetPageSize.

Nothing to do here for virtio 1.0 devices.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
2 years agoOvmfPkg/VirtioMmioDeviceLib: Add virtio 1.0 detection.
Gerd Hoffmann [Fri, 27 Aug 2021 13:44:54 +0000 (21:44 +0800)]
OvmfPkg/VirtioMmioDeviceLib: Add virtio 1.0 detection.

Add #defines for the Version field.  Read and store the version,
log the version found as info message.

Continue to return UNSUPPORTED for now, we need some more patches
to complete virtio 1.0 support first.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
2 years agoOvmfPkg/Virtio10: Add virtio-mmio 1.0 defines
Gerd Hoffmann [Fri, 27 Aug 2021 13:44:53 +0000 (21:44 +0800)]
OvmfPkg/Virtio10: Add virtio-mmio 1.0 defines

Add defines for the config space offsets for virtio 1.0 mmio transport.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
2 years agoArmPkg/GicV3Dxe: Don't signal EOI on arbitrary interrupts
Ard Biesheuvel [Tue, 24 Aug 2021 15:09:04 +0000 (17:09 +0200)]
ArmPkg/GicV3Dxe: Don't signal EOI on arbitrary interrupts

Currently, at ExitBootServices() time, the GICv3 driver signals
End-Of-Interrupt (EOI) on all interrupt lines that are supported by the
interrupt controller. This appears to have been carried over from the
GICv2 version, but has been turned into something that violates the GIC
spec, and may trigger SError exceptions on some implementations.

Marc puts it as follows:

  The GIC interrupt state machine is pretty strict. An interrupt can
  only be deactivated (with or without prior priority drop) if it has
  been acknowledged first. In GIC speak, this means that only the
  following sequences are valid:

  With EOImode==0:
  x = ICC_IAR{0,1}_EL1;
  ICC_EOIR{0,1}_EL1 = x;

  With EOImode==1:
  x = ICC_IAR{0,1}_EL1;
  ICC_EOIR{0,1}_EL1 = x;
  ICC_DIR_EL1 = x;

  Any write to ICC_EOIR{0,1}_EL1 that isn't the direct consequence of
  the same value being read from ICC_IAR{0,1}_EL1, and with the correct
  nesting, breaks the state machine and leads to unpredictable results
  that affects *all* interrupts in the system (most likely, the priority
  system is dead). See Figure 4-3 ("Interrupt handling state machine")
  in Arm IHI 0069F for a description of the acceptable transitions.

  Additionally, on implementations that have ICC_CTLR_EL1.SEIS==1, a
  SError may be generated to signal the error. See the various

  <quote>
  IMPLEMENTATION_DEFINED "SError ....";
  </quote>

  that are all over the pseudocode contained in the same architecture
  spec. Needless to say, this is pretty final for any SW that would do
  silly things on such implementations (which do exist).

Given that in our implementation, every signalled interrupt is acked,
handled and EOId in sequence, there is no reason to EOI all interrupts
at ExitBootServices() time in the first place, so let's just drop this
code. This fixes an issue reported by Marc where an SError is triggered
by this code, bringing down the system.

Reported-by: Marc Zyngier <maz@kernel.org>
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Acked-by: Marc Zyngier <maz@kernel.org>
Tested-by: Marc Zyngier <maz@kernel.org>
Reviewed-by: Leif Lindholm <leif@nuviainc.com>
2 years agoOvmfPkg/ResetVector: move the GHCB page setup in AmdSev.asm
Brijesh Singh [Tue, 17 Aug 2021 13:46:51 +0000 (21:46 +0800)]
OvmfPkg/ResetVector: move the GHCB page setup in AmdSev.asm

BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3429

While build the initial page table, the SetCr3ForPageTables64 checks
whether SEV-ES is enabled. If so, clear the page encryption mask from the
GHCB page. Move the logic to clear the page encryption mask in the
AmdSev.asm.

Cc: James Bottomley <jejb@linux.ibm.com>
Cc: Min Xu <min.m.xu@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Tom Lendacky <thomas.lendacky@amd.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Erdem Aktas <erdemaktas@google.com>
Signed-off-by: Brijesh Singh <brijesh.singh@amd.com>
Reviewed-by: Min Xu <min.m.xu@intel.com>
Reviewed-by: Jiewen Yao <Jiewen.yao@intel.com>
2 years agoOvmfPkg/ResetVector: update SEV support to use new work area format
Brijesh Singh [Tue, 17 Aug 2021 13:46:50 +0000 (21:46 +0800)]
OvmfPkg/ResetVector: update SEV support to use new work area format

BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3429

Update the SEV support to switch to using the newer work area format.

Cc: James Bottomley <jejb@linux.ibm.com>
Cc: Min Xu <min.m.xu@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Tom Lendacky <thomas.lendacky@amd.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Erdem Aktas <erdemaktas@google.com>
Signed-off-by: Brijesh Singh <brijesh.singh@amd.com>
Reviewed-by: Min Xu <min.m.xu@intel.com>
Reviewed-by: Jiewen Yao <Jiewen.yao@intel.com>
2 years agoOvmfPkg: introduce a common work area
Brijesh Singh [Tue, 17 Aug 2021 13:46:49 +0000 (21:46 +0800)]
OvmfPkg: introduce a common work area

BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3429

Both the TDX and SEV support needs to reserve a page in MEMFD as a work
area. The page will contain meta data specific to the guest type.
Currently, the SEV-ES support reserves a page in MEMFD
(PcdSevEsWorkArea) for the work area. This page can be reused as a TDX
work area when Intel TDX is enabled.

Based on the discussion [1], it was agreed to rename the SevEsWorkArea
to the OvmfWorkArea, and add a header that can be used to indicate the
work area type.

[1] https://edk2.groups.io/g/devel/message/78262?p=,,,20,0,0,0::\
    created,0,SNP,20,2,0,84476064

Cc: James Bottomley <jejb@linux.ibm.com>
Cc: Min Xu <min.m.xu@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Tom Lendacky <thomas.lendacky@amd.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Erdem Aktas <erdemaktas@google.com>
Signed-off-by: Brijesh Singh <brijesh.singh@amd.com>
Reviewed-by: Min Xu <min.m.xu@intel.com>
Reviewed-by: Jiewen Yao <Jiewen.yao@intel.com>
2 years agoMaintainers: Add kraxel as Reviewer to ArmVirtPkg and OvmfPkg
Gerd Hoffmann [Mon, 16 Aug 2021 07:18:00 +0000 (15:18 +0800)]
Maintainers: Add kraxel as Reviewer to ArmVirtPkg and OvmfPkg

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Jiewen Yao <Jiewen.yao@intel.com>
Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com>
Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
2 years agoMdeModulePkg/PeiCore: Remove MigrateSecModulesInFv()
Michael Kubacki [Fri, 13 Aug 2021 20:01:32 +0000 (04:01 +0800)]
MdeModulePkg/PeiCore: Remove MigrateSecModulesInFv()

REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3564

This function has not been called since it was added in commit
9bedaec. If the function were to remain, it would need to be
re-evaluated and tested. This change removes the function since
it is not being used.

Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Hao A Wu <hao.a.wu@intel.com>
Cc: Dandan Bi <dandan.bi@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Debkumar De <debkumar.de@intel.com>
Cc: Harry Han <harry.han@intel.com>
Cc: Catharine West <catharine.west@intel.com>
Cc: Marvin H?user <mhaeuser@posteo.de>
Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
2 years agoCryptoPkg: BaseCryptLib fix incorrect param order edk2-stable202108
Stewart, Chris (SW Architect) via groups.io [Tue, 17 Aug 2021 12:47:44 +0000 (20:47 +0800)]
CryptoPkg: BaseCryptLib fix incorrect param order

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3550

Function ConvertAsn1TimeToEfiTime initializes timestamp to zeroes with
SetMem, but the actual parameters are out of order. The result is
the SetMem operation has no effect. The fix is to put the actual
parameters in the correct order.

Signed-off-by: Chris Stewart <chris.stewart@hp.com>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
Reviewed-by: Jiewen Yao <Jiewen.yao@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Xiaoyu Lu <xiaoyux.lu@intel.com>
Cc: Guomin Jiang <guomin.jiang@intel.com>
2 years agoUefiCpuPkg/CpuCacheInfoLib: Correct logical for identifying cache type
Jason [Fri, 13 Aug 2021 02:05:28 +0000 (10:05 +0800)]
UefiCpuPkg/CpuCacheInfoLib: Correct logical for identifying cache type

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3265

Correct the logical for identifying "Direct mapped" cache type.

Signed-off-by: Jason Lou <yun.lou@intel.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Rahul Kumar <rahul1.kumar@intel.com>
2 years agoEmbeddedPkg/NonCoherentDmaLib: Avoid dereferencing unset Map field
Jeremy Linton [Fri, 13 Aug 2021 05:05:08 +0000 (00:05 -0500)]
EmbeddedPkg/NonCoherentDmaLib: Avoid dereferencing unset Map field

Map->Operation is used to select whether a DMA region that
is being bounced has the source buffer copied to it. Except
Map->Operation isn't yet set, so the behavior is somewhat
random. Instead use the passed in Operation parameter.

Signed-off-by: Jeremy Linton <jeremy.linton@arm.com>
Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
2 years agoMdeModulePkg PCD: Reinstall PCD service PPIS when memory available
Yeh, GregX [Thu, 12 Aug 2021 07:22:05 +0000 (15:22 +0800)]
MdeModulePkg PCD: Reinstall PCD service PPIS when memory available

https://bugzilla.tianocore.org/show_bug.cgi?id=3525

After PciSegmentLib using Dynamic PCD for Pcie base address such
long delay found in FSP. The root cause is some of the PCD service
PPIs not shadowed to memory and flash cache may have been disabled
in NotifyPhase stage. Solution is to shadow all PCD service PPIs
to memory.

Signed-off-by: GregX Yeh <gregx.yeh@intel.com>
Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Hao A Wu <hao.a.wu@intel.com>
Cc: Dandan Bi <dandan.bi@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Reviewed-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Jian J Wang <jian.j.wang@intel.com>
2 years agoMdeModulePkg/UefiSortLib:Add UefiSortLib unit test
Wenyi Xie [Wed, 11 Aug 2021 06:35:39 +0000 (14:35 +0800)]
MdeModulePkg/UefiSortLib:Add UefiSortLib unit test

Adding two unit test case for UefiSortLib. One is a test on
sorting an array of UINT32 by using PerformQuickSort, another
is a test on comparing the same buffer by using StringCompare.
Add 'main' function name to ECC exception list to avoid ECC
error.

Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Hao A Wu <hao.a.wu@intel.com>
Signed-off-by: Wenyi Xie <xiewenyi2@huawei.com>
Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
2 years agoStandaloneMmPkg: build for 32bit arm machines
Etienne Carriere [Mon, 9 Aug 2021 15:19:46 +0000 (17:19 +0200)]
StandaloneMmPkg: build for 32bit arm machines

This change allows to build StandaloneMmPkg components for 32bit Arm
StandaloneMm firmware.

This change mainly moves AArch64/ source files to Arm/ side directory
for several components:  StandaloneMmCpu, StandaloneMmCoreEntryPoint
and StandaloneMmMemLib. The source file is built for both 32b and 64b
Arm targets.

Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
2 years agoStandaloneMmPkg: fix pointer/int casts against 32bit architectures
Etienne Carriere [Mon, 9 Aug 2021 15:19:45 +0000 (17:19 +0200)]
StandaloneMmPkg: fix pointer/int casts against 32bit architectures

Use intermediate (UINTN) cast when casting int from/to pointer. This
is needed as UINT64 values cast from/to 32bit pointer for 32bit
architectures.

Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
Acked-by: Jiewen Yao <Jiewen.yao@intel.com>
Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
2 years agoGenFv: Arm: support images entered in Thumb mode
Etienne Carriere [Mon, 9 Aug 2021 15:19:44 +0000 (17:19 +0200)]
GenFv: Arm: support images entered in Thumb mode

Change GenFv for Arm architecture to generate a specific jump
instruction as image entry instruction, when the target entry label
is assembled with Thumb instruction set. This is possible since
SecCoreEntryAddress value fetched from the PE32 has its LSBit set when
the entry instruction executes in Thumb mode.

Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
Acked-by: Liming Gao <gaoliming@byosoft.com.cn>
Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
2 years agoArmPkg: prepare 32bit ARM build of StandaloneMmPkg
Etienne Carriere [Mon, 9 Aug 2021 15:19:43 +0000 (17:19 +0200)]
ArmPkg: prepare 32bit ARM build of StandaloneMmPkg

Changes in ArmPkg to prepare building StandaloneMm firmware for
32bit Arm architectures.

Adds ArmmmuStandaloneMmLib library to the list of the standard
components build for ArmPkg on when ARM architectures.

Changes path of source file AArch64/ArmMmuStandaloneMmLib.c
and compile it for both 32bit and 64bit architectures.

Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
2 years agoArmPkg/IndustryStandard: 32b/64b agnostic FF-A, Mm SVC and Std SMC IDs
Etienne Carriere [Mon, 9 Aug 2021 15:19:42 +0000 (17:19 +0200)]
ArmPkg/IndustryStandard: 32b/64b agnostic FF-A, Mm SVC and Std SMC IDs

Defines ARM_SVC_ID_FFA_* and ARM_SVC_ID_SP_* identifiers for 32bit
function IDs as per SMCCC specification. Defines also generic ARM
SVC identifier macros to wrap 32bit or 64bit identifiers upon target
built architecture.

Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
2 years agoRedfishPkg/RefishCrtLib: Public RefishCrtLib
Abner Chang [Tue, 10 Aug 2021 16:07:23 +0000 (00:07 +0800)]
RedfishPkg/RefishCrtLib: Public RefishCrtLib

Public the header file, move RefishCrtLib.h from PrivateInclude/
to Include/.
RefishCrtLib.lib will be public later. (Moved out from PrivateLibrary/)

Signed-off-by: Abner Chang <abner.chang@hpe.com>
Cc: Nickle Wang <nickle.wang@hpe.com>
Reviewed-by: Nickle Wang <nickle.wang@hpe.com>
2 years agoMdePkg: Fix broken coding style in Acpi64.h
Chris Jones [Thu, 29 Jul 2021 10:10:24 +0000 (11:10 +0100)]
MdePkg: Fix broken coding style in Acpi64.h

Bugzilla: 3516 (https://bugzilla.tianocore.org/show_bug.cgi?id=3516)

Fix a coding style issue raised by EccCheck. This issue (error code
7008) has been fixed by moving a nested union out of its structure.

Also add Acpi64.h to the "IgnoreFiles" list to stop the CI flagging
naming errors present prior to ACPI 64.

Signed-off-by: Chris Jones <christopher.jones@arm.com>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
2 years agoMdePkg: Add Cache ID to PPTT
Chris Jones [Wed, 21 Jul 2021 10:50:21 +0000 (11:50 +0100)]
MdePkg: Add Cache ID to PPTT

Bugzilla: 3516 (https://bugzilla.tianocore.org/show_bug.cgi?id=3516)

Make changes to ACPI 6.4 header according to the latest specification:
- ACPI 6.4 January 2021, Table 5.137, Table 5.140, Table 5.141
- Mantis ID 2138 (https://mantis.uefi.org/mantis/view.php?id=2138)

Signed-off-by: Chris Jones <christopher.jones@arm.com>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
2 years agoMdePkg: Add Secure Access Components in the SDEV table
Chris Jones [Wed, 21 Jul 2021 10:44:21 +0000 (11:44 +0100)]
MdePkg: Add Secure Access Components in the SDEV table

Bugzilla: 3516 (https://bugzilla.tianocore.org/show_bug.cgi?id=3516)

Make changes to ACPI 6.4 header according to the latest specification:
- ACPI 6.4 January 2021, Section 5.2.26.1.1
- Mantis ID 2111 (https://mantis.uefi.org/mantis/view.php?id=2111)

Signed-off-by: Chris Jones <christopher.jones@arm.com>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
2 years agoMdePkg: Add the Platform Health Assessment Table (PHAT)
Chris Jones [Wed, 21 Jul 2021 10:35:06 +0000 (11:35 +0100)]
MdePkg: Add the Platform Health Assessment Table (PHAT)

Bugzilla: 3516 (https://bugzilla.tianocore.org/show_bug.cgi?id=3516)

Make changes to ACPI 6.4 header according to the latest specification:
- ACPI 6.4 January 2021, Table 5.5, Section 5.2.30
- Mantis ID 2094 (https://mantis.uefi.org/mantis/view.php?id=2094)

Signed-off-by: Chris Jones <christopher.jones@arm.com>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
2 years agoMdePkg: Add Multiprocessor Wakeup structure
Chris Jones [Wed, 21 Jul 2021 10:28:32 +0000 (11:28 +0100)]
MdePkg: Add Multiprocessor Wakeup structure

Bugzilla: 3516 (https://bugzilla.tianocore.org/show_bug.cgi?id=3516)

Make changes to ACPI 6.4 header according to the latest specification:
- ACPI 6.4 January 2021, Table 5.21, Section 5.2.12.19
- Mantis ID 2087 (https://mantis.uefi.org/mantis/view.php?id=2087)

Signed-off-by: Chris Jones <christopher.jones@arm.com>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
2 years agoMdePkg: Add 'Type 5' PCC structure
Chris Jones [Wed, 21 Jul 2021 10:14:50 +0000 (11:14 +0100)]
MdePkg: Add 'Type 5' PCC structure

Bugzilla: 3516 (https://bugzilla.tianocore.org/show_bug.cgi?id=3516)

Make changes to ACPI 6.4 header according to the latest specification:
- ACPI 6.4 January 2021, Section 14.1.7, Section 14.4
- Mantis ID 2010 (https://mantis.uefi.org/mantis/view.php?id=2010)

Signed-off-by: Chris Jones <christopher.jones@arm.com>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
2 years agoMdePkg: Add flags and MinTransferSize to Generic Initiator
Chris Jones [Wed, 21 Jul 2021 10:08:00 +0000 (11:08 +0100)]
MdePkg: Add flags and MinTransferSize to Generic Initiator

Bugzilla: 3516 (https://bugzilla.tianocore.org/show_bug.cgi?id=3516)

Make changes to ACPI 6.4 header according to the latest specification:
- ACPI 6.4 January 2021, Table 5.59, Section 5.2.27.1 & Section 5.2.27.4
- Mantis ID 1991 (https://mantis.uefi.org/mantis/view.php?id=1991)

Signed-off-by: Chris Jones <christopher.jones@arm.com>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
2 years agoMdePkg: Remove DPPT table
Chris Jones [Wed, 21 Jul 2021 09:21:57 +0000 (10:21 +0100)]
MdePkg: Remove DPPT table

Bugzilla: 3516 (https://bugzilla.tianocore.org/show_bug.cgi?id=3516)

Make changes to ACPI 6.4 header according to the latest specification:
- ACPI 6.4 January 2021, Table 5.5
- Mantis ID 2133 (https://mantis.uefi.org/mantis/view.php?id=2133)

Signed-off-by: Chris Jones <christopher.jones@arm.com>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>