]> xenbits.xensource.com Git - ovmf.git/log
ovmf.git
2 years agoBaseTools: Remove BUILDRULEFAMILY from CLANGDWARF in tools_def.template
Rebecca Cran [Tue, 9 May 2023 22:30:28 +0000 (16:30 -0600)]
BaseTools: Remove BUILDRULEFAMILY from CLANGDWARF in tools_def.template

There's only a single rule in build_rule.template for CLANGGCC, and it's
incorrect. We should instead just use the rules for GCC, so remove the
BUILDRULEFAMILY line for the CLANGDWARF toolchain definition.

Signed-off-by: Rebecca Cran <rebecca@bsdio.com>
Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
Tested-by: Michael D Kinney <michael.d.kinney@intel.com>
2 years agoCryptoPkg: Delete CLANG35 and CLANG38 build flags; add CLANGDWARF flags
Rebecca Cran [Fri, 5 May 2023 13:32:19 +0000 (07:32 -0600)]
CryptoPkg: Delete CLANG35 and CLANG38 build flags; add CLANGDWARF flags

Since CLANG35 and CLANG38 toolchains have been deleted from
tools_def.template, delete the build flags for them from CryptoPkg.

Since CLANGDWARF has replaced CLANG38, add build flags for it to the
CryptoPkg .inf files.

Signed-off-by: Rebecca Cran <rebecca@bsdio.com>
Reviewed-by: Jiewen Yao <Jiewen.yao@intel.com>
2 years agoMdePkg: Add more HobLib/PeiServicesLib gmock support
Gua Guo [Mon, 8 May 2023 23:58:14 +0000 (07:58 +0800)]
MdePkg: Add more HobLib/PeiServicesLib gmock support

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

Add Google Mock Library for HobLib
Add Google Mock Library for PeiServicesLib

Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Zhiguang Liu <zhiguang.liu@intel.com>
Cc: Chris Johnson <chris.n.johnson@intel.com>
Signed-off-by: Gua Guo <gua.guo@intel.com>
Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
2 years agoMdeModulePkg: Add more PciHostBridgeLib gmock support
Gua Guo [Fri, 5 May 2023 01:16:56 +0000 (09:16 +0800)]
MdeModulePkg: Add more PciHostBridgeLib gmock support

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

Add Google Mock Library for PciHostBridgeLib

Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Hao A Wu <hao.a.wu@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Chris Johnson <chris.n.johnson@intel.com>
Signed-off-by: Gua Guo <gua.guo@intel.com>
Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
2 years agoOvmfPkg: Relax assertion that interrupts do not occur at TPL_HIGH_LEVEL
Michael Brown [Tue, 9 May 2023 12:09:33 +0000 (12:09 +0000)]
OvmfPkg: Relax assertion that interrupts do not occur at TPL_HIGH_LEVEL

At TPL_HIGH_LEVEL, CPU interrupts are disabled (as per the UEFI
specification) and so we should never encounter a situation in which
an interrupt occurs at TPL_HIGH_LEVEL.  The specification also
restricts usage of TPL_HIGH_LEVEL to the firmware itself.

However, nothing actually prevents a UEFI application from calling
gBS->RaiseTPL(TPL_HIGH_LEVEL) and then violating the invariant by
enabling interrupts via the STI or equivalent instruction.  Some
versions of the Microsoft Windows bootloader are known to do this.

NestedInterruptTplLib maintains the invariant that interrupts are
disabled at TPL_HIGH_LEVEL (even when performing the dark art of
deliberately manipulating the stack so that IRET will return with
interrupts still disabled), but does not itself rely on external code
maintaining this invariant.

Relax the assertion that the interrupted TPL is below TPL_HIGH_LEVEL
to an error message, to allow UEFI applications such as these versions
of the Microsoft Windows bootloader to continue to function.

Debugged-by: Gerd Hoffmann <kraxel@redhat.com>
Debugged-by: Laszlo Ersek <lersek@redhat.com>
Ref: https://bugzilla.redhat.com/show_bug.cgi?id=2189136
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Acked-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>
2 years agoOvmfPkg: Clarify invariants for NestedInterruptTplLib
Michael Brown [Tue, 9 May 2023 12:09:30 +0000 (12:09 +0000)]
OvmfPkg: Clarify invariants for NestedInterruptTplLib

NestedInterruptTplLib relies on CPU interrupts being disabled to
guarantee exclusive (and hence atomic) access to the shared state in
IsrState.  Nothing in the calling interrupt handler should have
re-enabled interrupts before calling NestedInterruptRestoreTPL(), and
the loop in NestedInterruptRestoreTPL() itself maintains the invariant
that interrupts are disabled at the start of each iteration.

Add assertions to clarify this invariant, and expand the comments
around the calls to RestoreTPL() and DisableInterrupts() to clarify
the expectations around enabling and disabling interrupts.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
Acked-by: Laszlo Ersek <lersek@redhat.com>
2 years agoBaseTools: Update toolsetup.bat and Tests/PythonTest.py to check ver
Rebecca Cran [Mon, 24 Apr 2023 17:10:54 +0000 (11:10 -0600)]
BaseTools: Update toolsetup.bat and Tests/PythonTest.py to check ver

Update toolsetup.bat and Tests/PythonTest.py to check if we're running a
version of Python that's compatible with BaseTools and the Pip
BaseTools.

BaseTools uses syntax from Python 3.6 or newer, so set that as the minimum
version EDK2 requires.

Signed-off-by: Rebecca Cran <rebecca@bsdio.com>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
2 years agoedksetup.bat: if toolsetup.bat fails, just exit
Rebecca Cran [Mon, 24 Apr 2023 17:06:52 +0000 (11:06 -0600)]
edksetup.bat: if toolsetup.bat fails, just exit

If toolsetup.bat fails (i.e. exits with a non-zero %ERRORLEVEL%), don't
try and carry on but just quit.

Signed-off-by: Rebecca Cran <rebecca@bsdio.com>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
2 years agoBaseTools: use threading.current_thread in NmakeSubdirs.py
Rebecca Cran [Mon, 24 Apr 2023 16:44:24 +0000 (10:44 -0600)]
BaseTools: use threading.current_thread in NmakeSubdirs.py

threading.currentThread is a deprecated alias for
threading.current_thread, and causes a warning to be displayed when it's
called. Update NmakeSubdirs.py to use the latter method instead.

Signed-off-by: Rebecca Cran <rebecca@bsdio.com>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
2 years agoBaseTools: Remove Python2/Python3 detection from toolset.bat
Rebecca Cran [Mon, 24 Apr 2023 13:18:59 +0000 (07:18 -0600)]
BaseTools: Remove Python2/Python3 detection from toolset.bat

Since Python3 is now required, we can remove the checks for PYTHON3_ENABLE
and PYTHON3 and simplify the code in toolsetup.bat. Also, remove the
leftover from when we supported freezing Python code.

While here, fix a couple of typos and improve error messages.

Signed-off-by: Rebecca Cran <rebecca@bsdio.com>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
2 years agoRedfishPkg: Fix compile issue on Linux
Vu Nguyen [Thu, 20 May 2021 03:38:24 +0000 (10:38 +0700)]
RedfishPkg: Fix compile issue on Linux

It requires a fixed size array to store the content of device path PCD.
Add the array size to solve this issue.

Signed-off-by: Minh Nguyen <minhnguyen1@os.amperecomputing.com>
Cc: Abner Chang <abner.chang@amd.com>
Cc: Igor Kulchytskyy <igork@ami.com>
Cc: Nick Ramirez <nramirez@nvidia.com>
Reviewed-by: Abner Chang <Abner.Chang@amd.com>
2 years agoRedfishPkg: Add missing newline character
Nhi Pham [Thu, 6 Apr 2023 01:22:44 +0000 (08:22 +0700)]
RedfishPkg: Add missing newline character

This adds a missing newline character to make the error log
readable in case the module is failed.

Signed-off-by: Minh Nguyen <minhnguyen1@os.amperecomputing.com>
Cc: Abner Chang <abner.chang@amd.com>
Cc: Igor Kulchytskyy <igork@ami.com>
Cc: Nick Ramirez <nramirez@nvidia.com>
Reviewed-by: Nickle Wang <nicklew@nvidia.com>
2 years agoRedfishPkg: Create RestEx child on selected interface
Vu Nguyen [Mon, 28 Jun 2021 10:26:55 +0000 (17:26 +0700)]
RedfishPkg: Create RestEx child on selected interface

When a MAC address matching interface is found, a RestEx child will be
created to provide the Redfish communication on that interface.
Currently, It will try to locate all RestEx binding services and choose
the first satisfied instance without taking care about current selected
interface. This might raise an issue on the system with multiple network
devices that the RestEx child was installed on wrong interface.

Signed-off-by: Minh Nguyen <minhnguyen1@os.amperecomputing.com>
Cc: Abner Chang <abner.chang@amd.com>
Cc: Igor Kulchytskyy <igork@ami.com>
Cc: Nick Ramirez <nramirez@nvidia.com>
Reviewed-by: Abner Chang <Abner.Chang@amd.com>
2 years agoRedfishPkg: Fix condition checking of error status
Vu Nguyen [Wed, 30 Jun 2021 01:41:21 +0000 (08:41 +0700)]
RedfishPkg: Fix condition checking of error status

This change fixes condition checking of error status, the condition
should be compared with TRUE status to be identical with an error message.

Signed-off-by: Minh Nguyen <minhnguyen1@os.amperecomputing.com>
Cc: Abner Chang <abner.chang@amd.com>
Cc: Igor Kulchytskyy <igork@ami.com>
Cc: Nick Ramirez <nramirez@nvidia.com>
Reviewed-by: Nickle Wang <nicklew@nvidia.com>
2 years agoRedfishPkg: Correct variable type to prevent memory corruption
Vu Nguyen [Thu, 13 Apr 2023 09:24:49 +0000 (16:24 +0700)]
RedfishPkg: Correct variable type to prevent memory corruption

Id will be casted by CoreOpenProtocol, declare this variable with a
wrong type might result in the corruption of other local variables.

Signed-off-by: Minh Nguyen <minhnguyen1@os.amperecomputing.com>
Cc: Abner Chang <abner.chang@amd.com>
Cc: Igor Kulchytskyy <igork@ami.com>
Cc: Nick Ramirez <nramirez@nvidia.com>
Reviewed-by: Nickle Wang <nicklew@nvidia.com>
2 years agoSecuritypkg/hddpassword: Update HddPasswordDxeInit to use Variable Policy
Linus Liu [Mon, 8 May 2023 04:20:51 +0000 (12:20 +0800)]
Securitypkg/hddpassword: Update HddPasswordDxeInit to use Variable Policy

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

Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Maggie Chu <maggie.chu@intel.com>
Cc: Kumar Rahul <rahul.r.kumar@intel.com>
Signed-off-by: Linus Liu <linus.liu@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
2 years agoAdd volatile keyword to NvmExpressPei's Passthru CQ
Oliver Smith-Denny [Thu, 27 Apr 2023 17:36:22 +0000 (01:36 +0800)]
Add volatile keyword to NvmExpressPei's Passthru CQ

This applies the volatile keyword and appropriate casts
to the NvmExpressPei's Passthru CQ.

Cc: Hao A Wu <hao.a.wu@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Michael Kubacki <mikuback@linux.microsoft.com>
Cc: Sean Brogan <sean.brogan@microsoft.com>
Signed-off-by: Oliver Smith-Denny <osde@linux.microsoft.com>
Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
Acked-by: Michael Kubacki <michael.kubacki@microsoft.com>
2 years agoAdd the volatile keyword to NvmExpressDxe's Passthru CQ
Oliver Smith-Denny [Thu, 27 Apr 2023 17:36:21 +0000 (01:36 +0800)]
Add the volatile keyword to NvmExpressDxe's Passthru CQ

This updates the relevant functions that expect a non-volatile
structure to be passed to them to take casts of the CQ
now that it is volatile.

Cc: Hao A Wu <hao.a.wu@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Michael Kubacki <mikuback@linux.microsoft.com>
Cc: Sean Brogan <sean.brogan@microsoft.com>
Signed-off-by: Oliver Smith-Denny <osde@linux.microsoft.com>
Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
Acked-by: Michael Kubacki <michael.kubacki@microsoft.com>
2 years agoBaseTools/Conf: Add quotes to ADDDEBUGFLAG in tools_def.txt
Michael D Kinney [Sat, 6 May 2023 02:45:07 +0000 (19:45 -0700)]
BaseTools/Conf: Add quotes to ADDDEBUGFLAG in tools_def.txt

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

Update tools_def.txt to add quotes around the file target in
OBJCOPY_ADDDEBUGFLAGS for compatibility with GCC like tool
chains used on Windows.

Cc: Rebecca Cran <rebecca@bsdio.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Yuwei Chen <yuwei.chen@intel.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Rebecca Cran <rebecca@bsdio.com>
2 years agoBaseTools/Conf: Align CLANGDWARF and CLANGPDB warning overrides
Michael D Kinney [Fri, 5 May 2023 23:36:44 +0000 (16:36 -0700)]
BaseTools/Conf: Align CLANGDWARF and CLANGPDB warning overrides

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

Fix build error related to use of DEBUG_CODE_BEGIN() and
DEBUG_CODE_END(). CLANGPDB requires extra warning disables
for use of DebugLib.h macros.  This change aligns the warning
disables between CLANGDWARF and CLANGPDB.

Cc: Rebecca Cran <rebecca@bsdio.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Yuwei Chen <yuwei.chen@intel.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Rebecca Cran <rebecca@bsdio.com>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
2 years agoMdeModulePkg/CapsuleApp: Add EFIAPI to CompareFileNameInAlphabet()
Michael D Kinney [Fri, 5 May 2023 16:51:11 +0000 (09:51 -0700)]
MdeModulePkg/CapsuleApp: Add EFIAPI to CompareFileNameInAlphabet()

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

CompareFileNameInAlphabet() is passed as a function pointer
parameter and typecast to type SORT_COMPARE that is declared
with EFIAPI.  Add EFIAPI to CompareFileNameInAlphabet() to match
SORT_COMPARE type.

Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Guomin Jiang <guomin.jiang@intel.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
2 years agoOvmfPkg: move OvmfTpmDxe.fdf.inc to Include/Fdf
Gerd Hoffmann [Fri, 5 May 2023 11:06:24 +0000 (19:06 +0800)]
OvmfPkg: move OvmfTpmDxe.fdf.inc to Include/Fdf

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
2 years agoOvmfPkg: move OvmfTpmPei.fdf.inc to Include/Fdf
Gerd Hoffmann [Fri, 5 May 2023 11:06:23 +0000 (19:06 +0800)]
OvmfPkg: move OvmfTpmPei.fdf.inc to Include/Fdf

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
2 years agoBaseSynchronizationLib: Fix LoongArch64 synchronization functions
Dongyan Qian [Thu, 27 Apr 2023 12:57:12 +0000 (20:57 +0800)]
BaseSynchronizationLib: Fix LoongArch64 synchronization functions

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

There is a return value bug:
The sc.w/sc.d instruction will destroy the reg_t0,
use reg_t1 to avoid context reg_t0 being corrupted.
Adjust Check that ptr align is UINT16.
Optimize function SyncIncrement and SyncDecrement.

Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Zhiguang Liu <zhiguang.liu@intel.com>
Cc: Chao Li <lichao@loongson.cn>
Signed-off-by: Dongyan Qian <qiandongyan@loongson.cn>
Reviewed-by: Chao Li <lichao@loongson.cn>
2 years agoBaseTools/Conf/tools_def.template: Bump VERSION to 3.00
Rebecca Cran [Sun, 16 Apr 2023 15:01:43 +0000 (09:01 -0600)]
BaseTools/Conf/tools_def.template: Bump VERSION to 3.00

Bump VERSION to 3.00 and explain the changes made to the toolchains.

Signed-off-by: Rebecca Cran <rebecca@bsdio.com>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
Tested-by: Michael D Kinney <michael.d.kinney@intel.com>
2 years agoBaseTools: Delete CLANG38 from tools_def.template
Rebecca Cran [Mon, 1 May 2023 13:36:16 +0000 (07:36 -0600)]
BaseTools: Delete CLANG38 from tools_def.template

Clang 3.8 is a very old release and is no longer relevant. Delete the
CLANG38 toolchain from tools_def.template.

Signed-off-by: Rebecca Cran <rebecca@bsdio.com>
Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
Tested-by: Michael D Kinney <michael.d.kinney@intel.com>
2 years agoBaseTools: Remove CLANG35 toolchain from tools_def.template
Rebecca Cran [Mon, 1 May 2023 13:29:57 +0000 (07:29 -0600)]
BaseTools: Remove CLANG35 toolchain from tools_def.template

Clang 3.5 is a very old release and is no longer relevant. Remove the
CLANG35 toolchain from tools_def.template.

Signed-off-by: Rebecca Cran <rebecca@bsdio.com>
Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
Tested-by: Michael D Kinney <michael.d.kinney@intel.com>
2 years agoBaseTools: As with CLANGDWARF IA32 and X64, use lld for ARM and AARCH64
Rebecca Cran [Mon, 1 May 2023 13:50:37 +0000 (07:50 -0600)]
BaseTools: As with CLANGDWARF IA32 and X64, use lld for ARM and AARCH64

As with the IA32 and X64 CLANGDWARF toolchain definitions, use ld.lld
for ARM and AARCH64.

Add -Wl,--no-pie,--no-relax to the command line to fix linking when
using lld.

Signed-off-by: Rebecca Cran <rebecca@bsdio.com>
Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
Tested-by: Michael D Kinney <michael.d.kinney@intel.com>
2 years agoBaseTools: Add ARM and AARCH64 CLANGDWARF support in tools_def.template
Rebecca Cran [Mon, 1 May 2023 13:44:50 +0000 (07:44 -0600)]
BaseTools: Add ARM and AARCH64 CLANGDWARF support in tools_def.template

Add ARM and AARCH64 support to CLANGDWARF in tools_def.template, copying
the CLANG38 definitions.

Signed-off-by: Rebecca Cran <rebecca@bsdio.com>
Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
Tested-by: Michael D Kinney <michael.d.kinney@intel.com>
2 years agoBaseTools/Conf/tools_def.template: Add section for deprecated toolchains
Rebecca Cran [Sun, 16 Apr 2023 12:55:25 +0000 (06:55 -0600)]
BaseTools/Conf/tools_def.template: Add section for deprecated toolchains

In order to make it clear for anyone reading tools_def.template, add
a section for deprecated tool chains and move GCC48, GCC49 and GCC5
into it.

Signed-off-by: Rebecca Cran <rebecca@bsdio.com>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
Tested-by: Michael D Kinney <michael.d.kinney@intel.com>
2 years agoAdd GCC and GCCNOLTO toolchains to tools_def.txt and update packages
Rebecca Cran [Wed, 12 Apr 2023 18:35:11 +0000 (12:35 -0600)]
Add GCC and GCCNOLTO toolchains to tools_def.txt and update packages

Add a 'GCC' toolchain that's a copy of the existing GCC5 definition.
Add a 'GCCNOLTO' toolchain that's a copy of the existing GCC49
toolchain.

Signed-off-by: Rebecca Cran <rebecca@bsdio.com>
Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
Tested-by: Michael D Kinney <michael.d.kinney@intel.com>
2 years agoBaseTools: Update VS toolchain descriptions in tools_def.txt.template
Rebecca Cran [Sun, 2 Apr 2023 15:36:16 +0000 (09:36 -0600)]
BaseTools: Update VS toolchain descriptions in tools_def.txt.template

Update the Visual Studio toolchain descriptions in
tools_def.txt.template:

- The WinDDK is no longer needed.
- Update 3 is required for VS 2015.
- VS 2005 has been removed.

Signed-off-by: Rebecca Cran <rebecca@bsdio.com>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
Tested-by: Michael D Kinney <michael.d.kinney@intel.com>
2 years agoBaseTools: Remove EBC (EFI Byte Code) compiler definitions
Rebecca Cran [Tue, 21 Mar 2023 22:49:24 +0000 (16:49 -0600)]
BaseTools: Remove EBC (EFI Byte Code) compiler definitions

The edk2-stable202302 release was the last to support building
EFI Byte Code drivers. Since the Intel EFI Byte Code Compiler is no
longer available, a decision has been made to remove support for EBC
from edk2.

Remove the definitions for Intel's EBC compiler from
Conf/tools_def.template.

Signed-off-by: Rebecca Cran <rebecca@bsdio.com>
Reviewed-by: Oliver Smith-Denny <osd@smith-denny.com>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
Tested-by: Michael D Kinney <michael.d.kinney@intel.com>
2 years agoBaseTools: Remove unused IPHONE_TOOLS and SOURCERY_CYGWIN_TOOLS defs
Rebecca Cran [Tue, 21 Mar 2023 22:47:51 +0000 (16:47 -0600)]
BaseTools: Remove unused IPHONE_TOOLS and SOURCERY_CYGWIN_TOOLS defs

Remove the unused IPHONE_TOOLS and SOURCERY_CYGWIN_TOOLS definitions
from Conf/tools_def.template.

Signed-off-by: Rebecca Cran <rebecca@bsdio.com>
Reviewed-by: Oliver Smith-Denny <osd@smith-denny.com>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
Tested-by: Michael D Kinney <michael.d.kinney@intel.com>
2 years agoedksetup.bat: Remove VS2008-VS2013 remnants
Rebecca Cran [Tue, 21 Mar 2023 22:45:58 +0000 (16:45 -0600)]
edksetup.bat: Remove VS2008-VS2013 remnants

Since Visual Studio versions older than VS2015 are no longer supported,
remove mention of them from edksetup.bat.

Signed-off-by: Rebecca Cran <rebecca@bsdio.com>
Reviewed-by: Oliver Smith-Denny <osd@smith-denny.com>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
Reviewed-by: Leif Lindholm <quic_llindhol@quicinc.com>
Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
Tested-by: Michael D Kinney <michael.d.kinney@intel.com>
2 years agoMdePkg: Remove VS2008-VS2013 remnants
Rebecca Cran [Tue, 21 Mar 2023 22:45:35 +0000 (16:45 -0600)]
MdePkg: Remove VS2008-VS2013 remnants

Since Visual Studio versions older than VS2015 are no longer supported,
remove mention of them from MdePkg.

Signed-off-by: Rebecca Cran <rebecca@bsdio.com>
Reviewed-by: Oliver Smith-Denny <osd@smith-denny.com>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
Tested-by: Michael D Kinney <michael.d.kinney@intel.com>
2 years agoBaseTools: Remove VS2008-VS2013 remnants
Rebecca Cran [Tue, 21 Mar 2023 22:45:23 +0000 (16:45 -0600)]
BaseTools: Remove VS2008-VS2013 remnants

Remove remnants of Visual Studio 2008-2013 support from
Conf/tools_def.txt and various batch scripts.

Signed-off-by: Rebecca Cran <rebecca@bsdio.com>
Reviewed-by: Oliver Smith-Denny <osd@smith-denny.com>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
Tested-by: Michael D Kinney <michael.d.kinney@intel.com>
2 years agoBaseTools: Remove VS2008, 2010, 2012 and 2013 toolchain definitions
Rebecca Cran [Tue, 21 Mar 2023 22:29:43 +0000 (16:29 -0600)]
BaseTools: Remove VS2008, 2010, 2012 and 2013 toolchain definitions

With recent changes, Visual Studio versions older than VS2015 are
unable to build EDK2 code.

To avoid confusion, remove VS2008, 2010, 2012 and 2013 toolchain
definitions from Conf/tools_def.template, leaving only versions that can
be used to successfully build firmware.

Signed-off-by: Rebecca Cran <rebecca@bsdio.com>
Reviewed-by: Oliver Smith-Denny <osd@smith-denny.com>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
Tested-by: Michael D Kinney <michael.d.kinney@intel.com>
2 years agoMdePkg/BasePeCoffLib: Deal with broken debug directories
Ard Biesheuvel [Thu, 4 May 2023 14:40:18 +0000 (16:40 +0200)]
MdePkg/BasePeCoffLib: Deal with broken debug directories

Older versions of GenFw put the wrong value in the debug directory size
field in the PE/COFF header: instead of putting the combined size of all
the entries, it puts the size of the only entry it creates, but adds the
size of the NB10 payload that the entry points to. This confuses the
loader now that we started using additional debug directory entries to
describe DLL characteristics.

GenFw was fixed in commit 60e85a39fe49071, but the binaries that were
generated with it still need to be supported.

So let's detect this condition, and check whether the size of the debug
directory is consistent with the NB10 payload: if we should expect
additional directory entries where we observe the NB10 payload, the size
field is clearly wrong, and we can break from the loop.

BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=4425
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
Tested-by: Liming Gao <gaoliming@byosoft.com.cn>
Acked-by: Michael Kubacki <michael.kubacki@microsoft.com>
2 years ago.pytool: Support FDT library.
Benny Lin [Thu, 4 May 2023 23:48:12 +0000 (16:48 -0700)]
.pytool: Support FDT library.

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4392
Add FDT support in EDK2 by submodule 3rd party libfdt
(https://github.com/devicetree-org/pylibfdt/tree/main/libfdt)

Add RequiredSubmodule object for CI setting.

Cc: Sean Brogan <sean.brogan@microsoft.com>
Cc: Michael Kubacki <mikuback@linux.microsoft.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Signed-off-by: Benny Lin <benny.lin@intel.com>
Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
2 years agoMdePkg: Support FDT library.
Benny Lin [Thu, 4 May 2023 23:48:11 +0000 (16:48 -0700)]
MdePkg: Support FDT library.

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4392
Add FDT support in EDK2 by submodule 3rd party libfdt
(https://github.com/devicetree-org/pylibfdt/tree/main/libfdt)
and refer to LibcLib implementation by Pedro.

Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Zhiguang Liu <zhiguang.liu@intel.com>
Signed-off-by: Benny Lin <benny.lin@intel.com>
Acked-by: Pedro Falcato <pedro.falcato@gmail.com>
Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
2 years agoTianocore: Support FDT library.
Benny Lin [Thu, 4 May 2023 23:48:10 +0000 (16:48 -0700)]
Tianocore: Support FDT library.

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4392
Add FDT support in EDK2 by submodule 3rd party libfdt
(https://github.com/devicetree-org/pylibfdt/tree/main/libfdt)

Add submodule libfdt and update ReadMe for the license.

Cc: Andrew Fish <afish@apple.com>
Cc: Leif Lindholm <quic_llindhol@quicinc.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Signed-off-by: Benny Lin <benny.lin@intel.com>
Reviewed-by: Leif Lindholm <quic_llindhol@quicinc.com>
Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
2 years agoMaintainers.txt: Update for IntelFsp2Pkg and IntelFsp2WrapperPkg.
Chasel Chiu [Mon, 24 Apr 2023 18:07:50 +0000 (11:07 -0700)]
Maintainers.txt: Update for IntelFsp2Pkg and IntelFsp2WrapperPkg.

Add more maintainers and reviewers for these 2 packages.

Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Duggapu Chinni B <chinni.b.duggapu@intel.com>
Cc: Ray Han Lim Ng <ray.han.lim.ng@intel.com>
Cc: Chen Gang C <gang.c.chen@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Ted Kuo <ted.kuo@intel.com>
Cc: Ashraf Ali S <ashraf.ali.s@intel.com>
Cc: Susovan Mohapatra <susovan.mohapatra@intel.com>
Signed-off-by: Chasel Chiu <chasel.chiu@intel.com>
Reviewed-by: Duggapu Chinni B <chinni.b.duggapu@intel.com>
Reviewed-by: Ng Ray Han Lim <ray.han.lim.ng@intel.com>
Reviewed-by: Chen Gang C <gang.c.chen@intel.com>
Reviewed-by: Kuo Ted <ted.kuo@intel.com>
Reviewed-by: Mohapatra Susovan <susovan.mohapatra@intel.com>
Reviewed-by: S Ashraf Ali <ashraf.ali.s@intel.com>
2 years agoOvmfPkg/PlatformBootManagerLib: setup virtio serial console
Gerd Hoffmann [Thu, 4 May 2023 13:12:01 +0000 (15:12 +0200)]
OvmfPkg/PlatformBootManagerLib: setup virtio serial console

In case a virtio-serial device is present in the system register the
first serial port as console.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2 years agoOvmfPkg/VirtioSerialDxe: wire up in OvmfPkg*
Gerd Hoffmann [Thu, 4 May 2023 13:12:00 +0000 (15:12 +0200)]
OvmfPkg/VirtioSerialDxe: wire up in OvmfPkg*

Add the driver to the ovmf builds.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2 years agoOvmfPkg/VirtioSerialDxe: add driver
Gerd Hoffmann [Thu, 4 May 2023 13:11:59 +0000 (15:11 +0200)]
OvmfPkg/VirtioSerialDxe: add driver

Add a driver for the virtio serial device.

The virtio serial device also known as virtio console device because
initially it had only support for a single tty, intended to be used as
console.  Support for multiple streams and named data ports has been
added later on.

The driver supports tty ports only, they are registered as SerialIo
UART in the system.

Named ports are detected and logged, but not exposed as devices.  They
are usually used by guest agents to communicate with the host.  It's not
clear whenever it makes sense for the firmware to run such agents and if
so which efi protocol could be to expose the ports.  So leaving that for
another day.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2 years agoOvmfPkg: add IndustryStandard/VirtioSerial.h
Gerd Hoffmann [Thu, 4 May 2023 13:11:58 +0000 (15:11 +0200)]
OvmfPkg: add IndustryStandard/VirtioSerial.h

Add header files with structs and defines for the virtio serial device.

The virtio serial device also known as virtio console device because
initially it had only support for a single tty, intended to be used as
console.  Support for multiple streams and named data ports has been
added later on.

https://docs.oasis-open.org/virtio/virtio/v1.2/cs01/virtio-v1.2-cs01.html#x1-2900003

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2 years agoOvmfPkg: replace SECURE_BOOT_FEATURE_ENABLED with PcdSecureBootSupported
Gerd Hoffmann [Fri, 21 Apr 2023 06:55:44 +0000 (08:55 +0200)]
OvmfPkg: replace SECURE_BOOT_FEATURE_ENABLED with PcdSecureBootSupported

Drop the '-D SECURE_BOOT_FEATURE_ENABLED' compile time option,
use a new FeaturePcd instead.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2 years agoArmVirtPkg: allow setting Firmware Version from build command line
Oliver Steffen [Fri, 14 Apr 2023 08:33:23 +0000 (10:33 +0200)]
ArmVirtPkg: allow setting Firmware Version from build command line

ArmVirtXen.dsc initializes
gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVersionString with with the
value of the variable "FIRMWARE_VER".

Move that functionality to ArmVirt.dsc.inc to make it available to all
ArmVirt packages, and make it conditional: only set the PCD string if
FIRMWARE_VER is actually defined.

This allows specifying the firmware version string on the build command
line with -D FIRMARE_VER=...

Signed-off-by: Oliver Steffen <osteffen@redhat.com>
Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
2 years agoOvmfPkg: allow setting Firmware Version from build command line
Oliver Steffen [Fri, 14 Apr 2023 08:33:22 +0000 (10:33 +0200)]
OvmfPkg: allow setting Firmware Version from build command line

Initialize gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVersionString with
with the value of the variable "FIRMWARE_VER", if is is defined. Applies
to all flavors of OvmfPkg.

This behavior is already implemented in ArmVirtXen.dsc. It allows
specifying the firmware version string on the build command line with
-D FIRMARE_VER=...

Introduce a common include file to be used in the .dsc files for the
different OVMF flavors, and add the changes there.  (ArmVirtPkg already
has such a file).

Signed-off-by: Oliver Steffen <osteffen@redhat.com>
2 years agoArmPkg/PlatformBootManagerLib: Add path to boot UEFI Shell over UiApp
Pierre Gondois [Tue, 25 Apr 2023 11:27:16 +0000 (13:27 +0200)]
ArmPkg/PlatformBootManagerLib: Add path to boot UEFI Shell over UiApp

The UEFI Shell is a non-active boot option, at the opposite of UiApp.
If no valid boot option is found, UiApp is selected. UiApp requires a
human interaction. When installing a new EDKII image in CIs or when
scripting is required, this is problematic.

If no valid boot option is discovered, add a path to directly go to
the UEFI Shell where the startup.nsh script is automatically executed.
The UEFI Shell is launched after connecting possible devices, but
before the reset that is meant to automatically make them visible.

The new PcdUefiShellDefaultBootEnable must be set to TRUE to enable
this behaviour. The Pcd is set to false by default.

Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
Tested-by: Patrik Berglund <patrik.berglund@arm.com>
2 years agoSecurityPkg: add TIS sanity check (tpm12)
Gerd Hoffmann [Wed, 26 Apr 2023 16:24:05 +0000 (00:24 +0800)]
SecurityPkg: add TIS sanity check (tpm12)

The code blindly assumes a TIS interface is present in case both CRB and
FIFO checks fail.  Check the InterfaceType for TIS instead and only
return PtpInterfaceTis in case it matches, PtpInterfaceMax otherwise.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
2 years agoSecurityPkg: add TIS sanity check (tpm2)
Gerd Hoffmann [Wed, 26 Apr 2023 16:24:04 +0000 (00:24 +0800)]
SecurityPkg: add TIS sanity check (tpm2)

The code blindly assumes a TIS interface is present in case both CRB and
FIFO checks fail.  Check the InterfaceType for TIS instead and only
return Tpm2PtpInterfaceTis in case it matches, Tpm2PtpInterfaceMax
otherwise.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
2 years agoUefiPayloadPkg: Fix issues when MULTIPLE_DEBUG_PORT_SUPPORT is true
PaytonX Hsieh [Wed, 26 Apr 2023 12:36:56 +0000 (20:36 +0800)]
UefiPayloadPkg: Fix issues when MULTIPLE_DEBUG_PORT_SUPPORT is true

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

1. Since UART speed is slower than CPU, BIOS need to check the write
   buffer is empty, to avoid overwrite the buffer content.
2. LPSS UART might disable MMIO space for Windows debug usage during
   ExitBootServices event. BIOS need to avoid access the MMIO space
   after ExitBootServices.

Cc: Guo Dong <guo.dong@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Sean Rhodes <sean@starlabs.systems>
Cc: James Lu <james.lu@intel.com>
Reviewed-by: Gua Guo <gua.guo@intel.com>
Signed-off-by: PaytonX Hsieh <paytonx.hsieh@intel.com>
2 years agoRedfishPkg: Add Redfish Platform Config Protocol to RedfishPkg
Nickle Wang [Mon, 10 Apr 2023 13:25:39 +0000 (21:25 +0800)]
RedfishPkg: Add Redfish Platform Config Protocol to RedfishPkg

Add RedfishPlatformConfigDxe driver and corresponding library to
RedfishPkg.

Signed-off-by: Nickle Wang <nicklew@nvidia.com>
Cc: Abner Chang <abner.chang@amd.com>
Cc: Igor Kulchytskyy <igork@ami.com>
Cc: Nick Ramirez <nramirez@nvidia.com>
Reviewed-by: Abner Chang <abner.chang@amd.com>
Reviewed-by: Igor Kulchytskyy <igork @ami.com>
2 years agoRedfishPkg: Helper library of EDKII_REDFISH_PLATFORM_CONFIG_PROTOCOL
Nickle Wang [Mon, 10 Apr 2023 13:18:42 +0000 (21:18 +0800)]
RedfishPkg: Helper library of EDKII_REDFISH_PLATFORM_CONFIG_PROTOCOL

This is the helper library for using
EDKII_REDFISH_PLATFORM_CONFIG_PROTOCOL.

Signed-off-by: Nickle Wang <nicklew@nvidia.com>
Cc: Abner Chang <abner.chang@amd.com>
Cc: Igor Kulchytskyy <igork@ami.com>
Cc: Nick Ramirez <nramirez@nvidia.com>
Reviewed-by: Abner Chang <abner.chang@amd.com>
Reviewed-by: Igor Kulchytskyy <igork @ami.com>
2 years agoRedfishPkg: Implementation of EDKII_REDFISH_PLATFORM_CONFIG_PROTOCOL
Nickle Wang [Mon, 10 Apr 2023 13:14:41 +0000 (21:14 +0800)]
RedfishPkg: Implementation of EDKII_REDFISH_PLATFORM_CONFIG_PROTOCOL

This is the Implementation of EDKII_REDFISH_PLATFORM_CONFIG_PROTOCOL,
which is the EDKII Redfish Platform Config driver instance that accesses
EDK2 HII configuration format and storage.

Signed-off-by: Nickle Wang <nicklew@nvidia.com>
Cc: Abner Chang <abner.chang@amd.com>
Cc: Igor Kulchytskyy <igork@ami.com>
Cc: Nick Ramirez <nramirez@nvidia.com>
Reviewed-by: Abner Chang <abner.chang@amd.com>
Reviewed-by: Igor Kulchytskyy <igork @ami.com>
2 years agoRedfishPkg: introduce HII utility helper library
Nickle Wang [Mon, 10 Apr 2023 13:12:03 +0000 (21:12 +0800)]
RedfishPkg: introduce HII utility helper library

HiiUtilityLib is a helper library that provides the
functions to manipulate HII options.

Signed-off-by: Nickle Wang <nicklew@nvidia.com>
Cc: Abner Chang <abner.chang@amd.com>
Cc: Igor Kulchytskyy <igork@ami.com>
Cc: Nick Ramirez <nramirez@nvidia.com>
Reviewed-by: Abner Chang <abner.chang@amd.com>
Reviewed-by: Igor Kulchytskyy <igork @ami.com>
2 years agoRedfishPkg: introduce EDKII_REDFISH_PLATFORM_CONFIG_PROTOCOL
Nickle Wang [Mon, 10 Apr 2023 13:09:14 +0000 (21:09 +0800)]
RedfishPkg: introduce EDKII_REDFISH_PLATFORM_CONFIG_PROTOCOL

EDKII Redfish Platform Config Protocol defines the protocol
interfaces that abstracts the platform configuration format
and storage from EDK2 Redfish Feature driver. This protocol
provides the interfaces to get and set platform configuration
with the format and configuration storage agnostic to the
Redfish feature driver.

Signed-off-by: Nickle Wang <nicklew@nvidia.com>
Cc: Abner Chang <abner.chang@amd.com>
Cc: Igor Kulchytskyy <igork@ami.com>
Cc: Nick Ramirez <nramirez@nvidia.com>
Reviewed-by: Abner Chang <abner.chang@amd.com>
Reviewed-by: Igor Kulchytskyy <igork @ami.com>
2 years agoMdeModulePkg/RegularExpressionDxe: Fix Arm build error
Nickle Wang [Fri, 21 Apr 2023 06:48:30 +0000 (14:48 +0800)]
MdeModulePkg/RegularExpressionDxe: Fix Arm build error

Arm CI build error:
- ArmPkg/Library/CompilerIntrinsicsLib/memset.c:39:1: warning: type of
‘memset’ does not match original declaration [-Wlto-type-mismatch]
MdeModulePkg/Universal/RegularExpressionDxe/OnigurumaUefiPort.c:123:1:
note: type ‘char’ should match type ‘int’
- multiple definition of `memcpy'; OnigurumaUefiPort.obj (symbol from
plugin):(.text+0x0): first defined here

Fix:
- Update memset() implementation to match memset() definition in
ArmPkg/Library/CompilerIntrinsicsLib.
- memcpy() is supported by ArmPkg/Library/CompilerIntrinsicsLib. Exclude
it in OnigurumaUefiPort.c.

Signed-off-by: Nickle Wang <nicklew@nvidia.com>
Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Nick Ramirez <nramirez@nvidia.com>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
2 years agoSecurityPkg/DxeImageVerificationLib: Add AUTH_SIG_NOT_FOUND Action
Nhi Pham [Wed, 12 Apr 2023 09:21:49 +0000 (17:21 +0800)]
SecurityPkg/DxeImageVerificationLib: Add AUTH_SIG_NOT_FOUND Action

Add the AUTH_SIG_NOT_FOUND Action to the Image Execution Info Table
when the Image is signed but signature is not allowed by DB and the
hash of image is not found in DB/DBX.

This is documented in the UEFI spec 2.10, table 32.5.

This issue is found by the SIE SCT with the error message as follows:
SecureBoot - TestImage1.bin in Image Execution Info Table with
SIG_NOT_FOUND. --FAILURE
B3A670AA-0FBA-48CA-9D01-0EE9700965A9
SctPkg/TestCase/UEFI/EFI/RuntimeServices/SecureBoot/BlackBoxTest/
ImageLoadingBBTest.c:1079:Status Success

Signed-off-by: Nhi Pham <nhi@os.amperecomputing.com>
Reviewed-by: Min Xu <min.m.xu@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
2 years agoUefiPayloadPkg: Clang dependency removal
BruceX Wang [Wed, 26 Apr 2023 06:32:01 +0000 (14:32 +0800)]
UefiPayloadPkg: Clang dependency removal

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

Use Python to replace llvm-objcopy in UniversalPayloadBuild.py.
1. AddSection32() and AddSection64(): Make a section named
<section> with the contents of <file>.
2. RemoveSection32() and RemoveSection64(): Remove <section>.
3. ReplaceFv (): remove the section before add the section
if the file exists.

Cc: Guo Dong <guo.dong@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Sean Rhodes <sean@starlabs.systems>
Cc: James Lu <james.lu@intel.com>
Signed-off-by: BruceX Wang <brucex.wang@intel.com>
Reviewed-by: Gua Guo <gua.guo@intel.com>
2 years ago.azurepipelines: Switch linux image default to Fedora-37
Gua Guo [Thu, 27 Apr 2023 05:07:02 +0000 (13:07 +0800)]
.azurepipelines: Switch linux image default to Fedora-37

Switch default linux build image from Fedora-35 to Fedora-37

Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Sean Brogan <sean.brogan@microsoft.com>
Cc: Michael Kubacki <mikuback@linux.microsoft.com>
Cc: Oliver Steffen <osteffen@redhat.com>
Cc: Chris Fernald <chfernal@microsoft.com>
Signed-off-by: Gua Guo <gua.guo@intel.com>
Reviewed-by: Michael Kubacki <mikuback@linux.microsoft.com>
2 years ago.azurepipelines: Choose container that have installed lcov
Gua Guo [Sun, 23 Apr 2023 01:17:51 +0000 (09:17 +0800)]
.azurepipelines: Choose container that have installed lcov

Azure should install code coverage tool (lcov), it didn't
exist on Fedora and Ubuntu by default.

Update docker setting, pick below solution between 47addc9 and 3b3eb8f
3b3eb8f Fixes and improvements to dev containers (#69)
54e5bd1 Enable GTK on Fedora QEMU (#63)
f1c7a20 Fedora: install code coverage tools for GCC (#62)
2ce82af Ubuntu-22: Add initial Ubuntu-22 image (#61)
14d2aba Add Fedora 37 image with gcc12 (#60)
5b8a008 Add dotnet runtime to fedora build (#57)
f5c874a Fix platform build file name for EDK2 change (#58)
48540ad Ubuntu-20: Fix dev image entrypoint (#55)
98e849d Fedora-35: Add Powershell to build image (#52)

Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Sean Brogan <sean.brogan@microsoft.com>
Cc: Michael Kubacki <mikuback@linux.microsoft.com>
Cc: Oliver Steffen <osteffen@redhat.com>
Cc: Chris Fernald <chfernal@microsoft.com>
Signed-off-by: Gua Guo <gua.guo@intel.com>
Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Michael Kubacki <mikuback@linux.microsoft.com>
Reviewed-by: Chris Fernald <chfernal@microsoft.com>
2 years agoBaseTools/Plugin: Report error if code coverage failure
Gua Guo [Sun, 23 Apr 2023 01:14:22 +0000 (09:14 +0800)]
BaseTools/Plugin: Report error if code coverage failure

If code coverage exist failure, CI/CD need to catch it

Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Sean Brogan <sean.brogan@microsoft.com>
Cc: Michael Kubacki <mikuback@linux.microsoft.com>
Signed-off-by: Gua Guo <gua.guo@intel.com>
Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Michael Kubacki <mikuback@linux.microsoft.com>
2 years agoOvmfPkg/CcExitLib: Use documented XSave area base size for SEV-SNP
Roth, Michael via groups.io [Tue, 25 Apr 2023 20:32:58 +0000 (04:32 +0800)]
OvmfPkg/CcExitLib: Use documented XSave area base size for SEV-SNP

Currently OVMF tries to rely on the base size advertised via the CPUID
table entries corresponding to leaf 0xD, sub-leafs 0x0/0x1. This will
generally work for KVM guests, but might not for other SEV-SNP
hypervisor implementations. Make the handling more robust by simply
using the base area size documented by the APM.

Reviewed-by: Tom Lendacky <thomas.lendacky@amd.com>
Acked-by: Jiewen Yao <jiewen.yao@intel.com>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Michael Roth <michael.roth@amd.com>
2 years agoOvmfPkg/CcExitLib: Fix SEV-SNP XSave area size calculation
Roth, Michael via groups.io [Tue, 25 Apr 2023 20:32:57 +0000 (04:32 +0800)]
OvmfPkg/CcExitLib: Fix SEV-SNP XSave area size calculation

CPUID leaf 0xD sub-leafs 0x0 and 0x1 contain cumulative sizes for the
enabled XSave areas. Those sizes are calculated by tallying up all the
other sub-leafs that contain per-area size information for XSave areas
that are currently enabled in XCr0/XSS. The current check has the logic
inverted. Fix that.

This doesn't seem to cause problems currently, but could in the future
if OVMF made more extensive use of XSave areas. It was noticed while
implementing SNP-related tests for KVM Unit Tests, which re-uses the
OVMF #VC handler in some cases.

Reported-by: Pavan Kumar Paluri <papaluri@amd.com>
Cc: Pavan Kumar Paluri <papaluri@amd.com>
Reviewed-by: Tom Lendacky <thomas.lendacky@amd.com>
Acked-by: Jiewen Yao <jiewen.yao@intel.com>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Michael Roth <michael.roth@amd.com>
2 years agoOvmfPkg/AmdSevDxe: Update ConfidentialComputing blob struct definition
Roth, Michael via groups.io [Tue, 25 Apr 2023 20:32:56 +0000 (04:32 +0800)]
OvmfPkg/AmdSevDxe: Update ConfidentialComputing blob struct definition

The Confidential Computing blob defined here is intended to match the
definition defined by linux guest kernel. Previously, both definitions
relied on natural alignment, but that relies on both OVMF and kernel
being compiled as 64-bit. While there aren't currently any plans to
enable SNP support for 32-bit compilations, the kernel definition has
since been updated to use explicit padding/reserved fields to avoid
this dependency. Update OVMF to match that definition.

While at it, also fix up the Reserved fields to match the numbering
used in the kernel.

No functional changes (for currently-supported environments, at least).

Reviewed-by: Tom Lendacky <thomas.lendacky@amd.com>
Acked-by: Jiewen Yao <jiewen.yao@intel.com>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Michael Roth <michael.roth@amd.com>
2 years agoOvmfPkg/AmdSevDxe: Allocate SEV-SNP CC blob as EfiACPIReclaimMemory
Michael Roth [Tue, 25 Apr 2023 20:32:55 +0000 (04:32 +0800)]
OvmfPkg/AmdSevDxe: Allocate SEV-SNP CC blob as EfiACPIReclaimMemory

The SEV-SNP Confidential Computing blob contains metadata that should
remain accessible for the life of the guest. Allocate it as
EfiACPIReclaimMemory to ensure the memory isn't overwritten by the guest
operating system later.

Reported-by: Dov Murik <dovmurik@linux.ibm.com>
Suggested-by: Dov Murik <dovmurik@linux.ibm.com>
Reviewed-by: Dov Murik <dovmurik@linux.ibm.com>
Reviewed-by: Tom Lendacky <thomas.lendacky@amd.com>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Michael Roth <michael.roth@amd.com>
2 years agoUefiCpuPkg: Update PT code to support enable collect performance
Dun Tan [Tue, 25 Apr 2023 08:33:30 +0000 (16:33 +0800)]
UefiCpuPkg: Update PT code to support enable collect performance

Update ProcTrace feature code to support enable collect performance
data by generating CYC and TSC packets. Add a new dynamic
PCD to indicate if enable performance collecting. In ProcTrace.c
code, if this new PCD is true, after check cpuid, CYC and TSC
packets will be generated by setting the corresponding MSR bits
feilds if supported.

Bugzila: https://bugzilla.tianocore.org/show_bug.cgi?id=4423
Signed-off-by: Dun Tan <dun.tan@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
Cc: Rahul Kumar <rahul1.kumar@intel.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Xiao X Chen <xiao.x.chen@intel.com>
2 years agoUefiCpuPkg: Update code to support enable ProcTrace only on BSP
Dun Tan [Tue, 25 Apr 2023 04:47:05 +0000 (12:47 +0800)]
UefiCpuPkg: Update code to support enable ProcTrace only on BSP

Update code to support enable ProcTrace only on BSP. Add a new
dynamic PCD to indicate if enable ProcTrace only on BSP. In
ProcTrace.c code, if this new PCD is true, only allocate buffer
and set CtrlReg.Bits.TraceEn to 1 for BSP.

Bugzila: https://bugzilla.tianocore.org/show_bug.cgi?id=4423
Signed-off-by: Dun Tan <dun.tan@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
Cc: Rahul Kumar <rahul1.kumar@intel.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Xiao X Chen <xiao.x.chen@intel.com>
2 years agoRedfishPkg: Remove the Discover Token global variables
Igor Kulchytskyy [Thu, 20 Apr 2023 18:36:38 +0000 (14:36 -0400)]
RedfishPkg: Remove the Discover Token global variables

gRedfishDiscoveredToken may be allocated several times,
if multiple NIC installed on the system.
To avoid this issue Discover Token related global variables
replaced with the local variables.

Cc: Abner Chang <abner.chang@amd.com>
Cc: Nickle Wang <nicklew@nvidia.com>
Cc: Igor Kulchytskyy <igork@ami.com>
Signed-off-by: Igor Kulchytskyy <igork@ami.com>
Reviewed-by: Abner Chang <abner.chang@amd.com>
2 years agoDynamicTablesPkg/SsdtCpuTopology: Allow multi-packages topologies
Pierre Gondois [Thu, 9 Mar 2023 15:32:49 +0000 (16:32 +0100)]
DynamicTablesPkg/SsdtCpuTopology: Allow multi-packages topologies

The topology of a platform is represented in ACPI using the PPTT
table. It is possible to append information to CPUs/processor
containers using their associated AML nodes in a SSDT
table.
A platform might have multiple 'physical packages' (or top-level
nodes) in their PPTT topology representation. It can be assumed
from [1] that a 'physical packages' is always a 'top-level node',
and conversely.

The SSDT topology generator doesn't support having multiple top-level
nodes. The top-level node is also not generated in the SSDT topology
representation.
Add support to generate multiple top-level nodes in the SSDT topology
generator and generate an AML node for this top-level node. This will
allow to have matching PPTT and SSDT topology representations. Prior
to this patch, this top-level AML node was not generated.

Also factorize the flag checking in CheckProcNode() and add more
checks.

This patch takes inspiration from the discussion at:
- v1: https://edk2.groups.io/g/devel/message/99410
- v2: https://edk2.groups.io/g/devel/message/99615

[1]
ACPI 6.5, 5.2.30.1 Processor hierarchy node structure (Type 0):
- "Multiple trees may be described, covering for example multiple
  packages. For the root of a tree, the parent pointer should be 0.""
- "Each valid processor must belong to exactly one package. That is,
  the leaf must itself be a physical package or have an ancestor
  marked as a physical package."

Suggested-by: Jeff Brasen <jbrasen@nvidia.com>
Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
Reviewed-by: Jeff Brasen <jbrasen@nvidia.com>
Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
2 years agoBaseTools: Add quotes around OBJCOPY cmd in build_rule.template
Rebecca Cran [Mon, 24 Apr 2023 13:39:59 +0000 (07:39 -0600)]
BaseTools: Add quotes around OBJCOPY cmd in build_rule.template

Add quotes around the OBJCOPY command in build_rule.template to fix the
case where LLVM is installed on Windows in a path with spaces such as
C:\Program Files\LLVM.

Signed-off-by: Rebecca Cran <rebecca@bsdio.com>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
Reviewed-by: Bob Feng <bob.c.feng@intel.com>
2 years agoArmPkg: add ArmCpuInfo EFI application
Marcin Juszkiewicz [Fri, 21 Apr 2023 15:51:16 +0000 (17:51 +0200)]
ArmPkg: add ArmCpuInfo EFI application

App goes through ID_AA64*_EL1 system registers and decode their values.

Signed-off-by: Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>
Reviewed-by: Leif Lindholm <quic_llindhol@quicinc.com>
2 years agoArmLib: add functions to read system registers
Marcin Juszkiewicz [Fri, 21 Apr 2023 15:51:15 +0000 (17:51 +0200)]
ArmLib: add functions to read system registers

ArmCpuInfo uses those to read system registers and other parts of EDK2
may find them useful.

Signed-off-by: Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>
Reviewed-by: Leif Lindholm <quic_llindhol@quicinc.com>
2 years agoMdePkg: Add DEBUG_MANAGEABILITY print error level
Abner Chang [Sun, 16 Apr 2023 07:11:21 +0000 (15:11 +0800)]
MdePkg: Add DEBUG_MANAGEABILITY print error level

Bug #4414

Add DEBUG_MANAGEABILITY print error lever to
output debug message of detailed manageability
related module information, such as
- RedfishPkg:
  - HTTP header/request/response
  - JSON plain text
  - Refish resource
  - Redfish Host interface information
  - Redfish credential information
  - Platform configuration to Redfish mapping
  - etc.
- ManageabilityPKg
  - Protocol payload of MCTP/PLDM/IPMI
  - Payload of transport interface transfers
  - IPMI BLOB transfer
  - etc.
- RedfishClinetPkg
  - Redfish feature driver dispatcher
  - Redfish BIOS attributes
  - Platform configuration (HII) to
    Redfish property information
  - Redfish C structure information
  - etc.

Signed-off-by: Abner Chang <abner.chang@amd.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Zhiguang Liu <zhiguang.liu@intel.com>
Cc: Nickle Wang <nicklew@nvidia.com>
Cc: Igor Kulchytskyy <igork@ami.com>
Cc: Isaac Oram <isaac.w.oram@intel.com>
Cc: Abdul Lateef Attar <AbdulLateef.Attar@amd.com>
Cc: Tinh Nguyen <tinhnguyen@os.amperecomputing.com>
2 years agoBaseTools/Plugin: Clarify code coverage failure message
Michael Kubacki [Tue, 18 Apr 2023 15:00:22 +0000 (11:00 -0400)]
BaseTools/Plugin: Clarify code coverage failure message

HostBasedUnitTestRunner.py is a build plugin responsible for locating
and executing host-based unit tests.

Recently, commit 6bb00aa introduced support for the plugin to
generate code coverage reports via lcov and OpenCppCoverage.

The plugin has discovered unit tests by searching for executables
with "Test" in the name for a while. However, the test coverage
change makes assumptions about test presence when crafting the
OpenCppCoverage command that ultimately fails with an ambiguous error
message if no host-based unit tests are discovered (see "ERROR").

```
SECTION - Run Host based Unit Tests
SUBSECTION - Testing for architecture: X64
ERROR - UnitTest Coverage: Failed to generate cobertura format xml in
        single package.
PROGRESS - --->Test Success: Host Unit Test Compiler Plugin NOOPT
```

This change preempts that message with a check in the plugin to
determine if any host-based tests were discovered. If not, a message
is printed with more guidance about how the developer should proceed
to either (1) fix their tests so code coverage is generated as
expected or (2) prevent the error message.

New message:

```
SECTION - Run Host based Unit Tests
SUBSECTION - Testing for architecture: X64
WARNING - UnitTest Coverage:
  No unit tests discovered. Test coverage will not be generated.

  Prevent this message by:
  1. Adding host-based unit tests to this package
  2. Ensuring tests have the word "Test" in their name
  3. Disabling HostUnitTestCompilerPlugin in the package CI YAML file
PROGRESS - --->Test Success: Host Unit Test Compiler Plugin NOOPT
```

Cc: Rebecca Cran <rebecca@bsdio.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Yuwei Chen <yuwei.chen@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Sean Brogan <sean.brogan@microsoft.com>
Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
Reviewed-by: Rebecca Cran <rebecca@bsdio.com>
2 years agoMdePkg/Include: Add DMTF PLDM SMBIOS definitions
Abner Chang [Sun, 2 Apr 2023 01:40:14 +0000 (09:40 +0800)]
MdePkg/Include: Add DMTF PLDM SMBIOS definitions

BZ #4396
This change adds definitions for DMTF PLDM
SMBIOS Transfer specification.

Spec ref:
https://www.dmtf.org/sites/default/files/standards/documents/DSP0246_1.0.1.pdf

Signed-off-by: Abner Chang <abner.chang@amd.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Zhiguang Liu <zhiguang.liu@intel.com>
Cc: Nickle Wang <nicklew@nvidia.com>
Cc: Igor Kulchytskyy <igork@ami.com>
Cc: Isaac Oram <isaac.w.oram@intel.com>
Cc: Abdul Lateef Attar <AbdulLateef.Attar@amd.com>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
2 years agoArmPkg: older assemblers may lack ID_AA64ISAR2_EL1
Marcin Juszkiewicz [Thu, 20 Apr 2023 19:45:32 +0000 (21:45 +0200)]
ArmPkg: older assemblers may lack ID_AA64ISAR2_EL1

ArmCpuInfo needs to be able to read ID_AA64ISAR2_EL1 system register.
Older toolchains do not know it.

Same solution as one for QEMU:
https://www.mail-archive.com/qemu-devel@nongnu.org/msg929586.html

Signed-off-by: Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>
Reviewed-by: Leif Lindholm <quic_llindhol@quicinc.com>
2 years agoUefiPayloadPkg: Move Network modules from Dxe FV to Network FV in elf
Linus Wu [Thu, 20 Apr 2023 06:44:34 +0000 (14:44 +0800)]
UefiPayloadPkg: Move Network modules from Dxe FV to Network FV in elf

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

Since UefiPayload had supported multiple FV,
move Network.fdf.inc to new firmware volume and
add this network FV into elf file.

Cc: Guo Dong <guo.dong@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Sean Rhodes <sean@starlabs.systems>
Cc: James Lu <james.lu@intel.com>
Signed-off-by: Linus Wu <linusx.wu@intel.com>
Reviewed-by: Gua Guo <gua.guo@intel.com>
2 years agoMdePkg/Include: Add DMTF PLDM Base definitions
Abner Chang [Sun, 2 Apr 2023 01:35:29 +0000 (09:35 +0800)]
MdePkg/Include: Add DMTF PLDM Base definitions

BZ #4396
This change adds definitions for DMTF PLDM
base specification.

Spec ref:
https://www.dmtf.org/sites/default/files/standards/documents/DSP0240_1.1.0.pdf

Signed-off-by: Abner Chang <abner.chang@amd.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Zhiguang Liu <zhiguang.liu@intel.com>
Cc: Nickle Wang <nicklew@nvidia.com>
Cc: Igor Kulchytskyy <igork@ami.com>
Cc: Isaac Oram <isaac.w.oram@intel.com>
Cc: Abdul Lateef Attar <AbdulLateef.Attar@amd.com>
Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
2 years agoArmPkg/ArmMmuLib: Fix ArmReplaceLiveTranslationEntry() alignment
Marvin Häuser [Thu, 20 Apr 2023 15:24:15 +0000 (15:24 +0000)]
ArmPkg/ArmMmuLib: Fix ArmReplaceLiveTranslationEntry() alignment

As the ASM_FUNC() macro performs a section switch, the preceding
.balign directive applies the alignment constraint to the current
location in the previous section. As the linker may not merge the
sections in-order, ArmReplaceLiveTranslationEntry() may be left
unaligned.

Replace the explicit invocation of .balign with the ASM_FUNC_ALIGN()
macro, which guarantees the alignment constraint is applied correctly.
To make sure related issues are reliably caught in the future, align the
end of the function before checking the total occupied size. This
ensures crossing a 0x200 boundary will cause a compilation error.

Signed-off-by: Marvin Häuser <mhaeuser@posteo.de>
Reviewed-by: Leif Lindholm <quic_llindhol@quicinc.com>
Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
2 years agoArmPkg/AsmMacroIoLibV8: Introduce ASM_FUNC_ALIGN()
Marvin Häuser [Thu, 20 Apr 2023 15:24:14 +0000 (15:24 +0000)]
ArmPkg/AsmMacroIoLibV8: Introduce ASM_FUNC_ALIGN()

With the current ASM_FUNC() macro, there is no good way to declare an
alignment constraint for a function. As ASM_FUNC() switches sections,
declaring the constraint before the macro invocation applies it to the
current location in the previous section. Declaring the constraint after
the macro invocation lets the function label point to the location prior
to alignment. Depending on toolchain behaviour, this may cause the label
to point to alignment padding preceding the actual function definition.

To address these issues, introduce the ASM_FUNC_ALIGN() macro, which
declares the alignment constraint right before the function label.

Signed-off-by: Marvin Häuser <mhaeuser@posteo.de>
Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
2 years agoCryptoPkg: Enable DXE_CORE support in DxeCryptLib.inf
Yi Li [Fri, 14 Apr 2023 07:33:16 +0000 (15:33 +0800)]
CryptoPkg: Enable DXE_CORE support in DxeCryptLib.inf

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

Make the DXE_CORE module able to call the crypto protocol,
which can reduce FV size on platforms using the Crypto Binaries.

Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Xiaoyu Lu <xiaoyu1.lu@intel.com>
Cc: Guomin Jiang <guomin.jiang@intel.com>
Signed-off-by: Yi Li <yi1.li@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
2 years agoIntelFsp2Pkg/Tools: Enhance PathFv.py to patch Fd file directly
Duggapu, Chinni B [Mon, 17 Apr 2023 04:22:56 +0000 (21:22 -0700)]
IntelFsp2Pkg/Tools: Enhance PathFv.py to patch Fd file directly

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

After shrinking the FSP (FV) component using FMMT, Image size
in FSP info header is not in sync with the FV length in FV header.
This enhancement helps to patch the FSP image size offset with
correct length & can be used to patch any offset directly on
the FSP Component Fd.

Cc: Chasel Chiu <chasel.chiu@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Ted Kuo <ted.kuo@intel.com>
Signed-off-by: Duggapu Chinni B <chinni.b.duggapu@intel.com>
Reviewed-by: Ted Kuo <ted.kuo@intel.com>
Reviewed-by: Chasel Chiu <chasel.chiu@intel.com>
2 years agoedk2: Add .git-blame-ignore-revs file
Pedro Falcato [Fri, 16 Dec 2022 20:31:27 +0000 (20:31 +0000)]
edk2: Add .git-blame-ignore-revs file

Add a .git-blame-ignore-revs file containing the hashes of every
uncrustify format commit as retrieved in:
git log --oneline --no-abbrev-commit  | grep "uncrustify"

This file can be used by tools (such as GitHub[1]) to ignore
certain revisions when git blame-ing a file.

It can also be trivially usable locally by doing something akin
to:
git config blame.ignoreRevsFile .git-blame-ignore-revs

It may also be desirable in the future to add more commits to it.

Signed-off-by: Pedro Falcato <pedro.falcato@gmail.com>
Cc: Andrew Fish <afish@apple.com>
Cc: Leif Lindholm <quic_llindhol@quicinc.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
[1]: https://github.blog/changelog/2022-03-24-ignore-commits-in-the-blame-view-beta/

2 years agoBaseTools: Update SetupGit.py to add new 'fp' alias for patch formatting
Rebecca Cran [Thu, 6 Apr 2023 23:58:54 +0000 (17:58 -0600)]
BaseTools: Update SetupGit.py to add new 'fp' alias for patch formatting

To help people format patches with the correct options, add an alias
named 'fp' to SetupGit.py that runs format-patch with '-M --stat=1000
--stat-graph-width=20'.

Signed-off-by: Rebecca Cran <rebecca@bsdio.com>
Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
2 years agoBaseTools: Update PatchCheck.py to check for __FUNCTION__
Rebecca Cran [Thu, 6 Apr 2023 23:36:32 +0000 (17:36 -0600)]
BaseTools: Update PatchCheck.py to check for __FUNCTION__

New code should use the C99 macro __func__ instead of the pre-Standard
macro __FUNCTION__. Update PatchCheck.py to reject patches with the
latter.

Signed-off-by: Rebecca Cran <rebecca@bsdio.com>
Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
2 years agoMdeModulePkg/RegularExpressionDxe: Fix GCC build error
devel@edk2.groups.io [Thu, 1 Dec 2022 12:41:58 +0000 (04:41 -0800)]
MdeModulePkg/RegularExpressionDxe: Fix GCC build error

Fix GCC build error on AARCH64 system.

Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Nick Ramirez <nramirez@nvidia.com>
Signed-off-by: Nickle Wang <nicklew@nvidia.com>
Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
2 years agoMaintainer.txt: add myself as reviewer for bhyve's OvmfPkg
Corvin Köhne [Tue, 6 Dec 2022 07:29:08 +0000 (08:29 +0100)]
Maintainer.txt: add myself as reviewer for bhyve's OvmfPkg

Signed-off-by: Corvin Köhne <corvink@FreeBSD.org>
Reviewed-by: Rebecca Cran <rebecca@bsdio.com>
Reviewed-by: Peter Grehan <grehan@freebsd.org>
Cc: Andrew Fish <afish@apple.com>
Cc: Leif Lindholm <quic_llindhol@quicinc.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
2 years agoShellPkg: UefiShellDebug1CommandsLib: Uefi Config Tables in Dmem.c
Sam Kaynor [Tue, 4 Apr 2023 20:11:16 +0000 (04:11 +0800)]
ShellPkg: UefiShellDebug1CommandsLib: Uefi Config Tables in Dmem.c

Added entries for UEFI Config Tables not present in current
Dmem output.

Cc: Ray Ni <ray.ni@intel.com>
Cc: Zhichao Gao <zhichao.gao@intel.com>
Signed-off-by: Sam Kaynor <Sam.Kaynor@arm.com>
Reviewed-by: Sunny Wang <sunny.wang@arm.com>
Reviewed-by: Zhichao Gao <zhichao.gao@intel.com>
Reviewed-by: Samer El-Haj-Mahmoud <Samer.El-Haj-Mahmoud@arm.com>
2 years agoMdePkg: Add new JedecJep106Lib to fetch JEDEC JEP106 manufacturer
Rebecca Cran [Tue, 14 Feb 2023 16:58:29 +0000 (09:58 -0700)]
MdePkg: Add new JedecJep106Lib to fetch JEDEC JEP106 manufacturer

Add a new library, JedecJep106Lib which provides a service to return the
JEDEC JEP106 manufacturer string given the code and continuation bytes
values.

Signed-off-by: Rebecca Cran <rebecca@quicinc.com>
Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
2 years agoOvmfPkg/VirtioMmioDeviceLib: virtio 1.0: Fix SetQueueAlignment.
Jeff Brasen [Fri, 24 Mar 2023 01:42:17 +0000 (01:42 +0000)]
OvmfPkg/VirtioMmioDeviceLib: virtio 1.0: Fix SetQueueAlignment.

Nothing to do here for virtio 1.0 devices

Signed-off-by: Jeff Brasen <jbrasen@nvidia.com>
Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>
2 years agoUefiPayloadPkg: Update default memory type information for S4
Sean Rhodes [Tue, 4 Apr 2023 19:30:30 +0000 (20:30 +0100)]
UefiPayloadPkg: Update default memory type information for S4

Copied values from OVMF, these are sufficient for a debug build.

Cc: Guo Dong <guo.dong@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Sean Rhodes <sean@starlabs.systems>
Cc: James Lu <james.lu@intel.com>
Cc: Gua Guo <gua.guo@intel.com>
Reviewed-by: Sean Rhodes <sean@starlabs.systems>
Signed-off-by: Benjamin Doron <benjamin.doron00@gmail.com>
Signed-off-by: Sean Rhodes <sean@starlabs.systems>
2 years agoUefiPayloadPkg: Always build MemoryTypeInformation HOB for DXE GCD
Benjamin Doron [Fri, 31 Mar 2023 20:41:25 +0000 (16:41 -0400)]
UefiPayloadPkg: Always build MemoryTypeInformation HOB for DXE GCD

MemoryType information assists GCD with defragmenting the memory map.
When the DXE core starts, GCD adds memory descriptors for the resource
descriptors HOBs. This allocates heap space which can be reused later
as the bins by memory type. It seems memory allocation prefers low
ranges.

It seems "below 4G" is an artifact of this heap reuse. However, the
memory type information determines the DXE core's
`MinimalMemorySizeNeeded`, determining which system memory descriptor
HOB may be used by DXE. Furthermore, it's important that the memory
type information be correct, for an S4 memory map.

Therefore, follow other bootloaders, such as [MinPlatform][1], and do
this unconditionally. As of [edk2-stable202011][2], it was.

[1]: https://github.com/tianocore/edk2-platforms/blob/b6f96743891be51541184bf61dd2970c008e2c43/Platform/Intel/MinPlatformPkg/PlatformInit/PlatformInitPei/PlatformInitPreMem.c#L164-L201
[2]: https://github.com/tianocore/edk2/blob/edk2-stable202011/UefiPayloadPkg/BlSupportPei/BlSupportPei.c#L462-L466

Cc: Guo Dong <guo.dong@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Sean Rhodes <sean@starlabs.systems>
Cc: James Lu <james.lu@intel.com>
Cc: Gua Guo <gua.guo@intel.com>
Reviewed-by: Sean Rhodes <sean@starlabs.systems>
Signed-off-by: Benjamin Doron <benjamin.doron00@gmail.com>
2 years agoUefiCpuLib: Remove UefiCpuLib.
Yu Pu [Tue, 1 Nov 2022 07:58:42 +0000 (15:58 +0800)]
UefiCpuLib: Remove UefiCpuLib.

Because UefiCpuPkg/UefiCpuLib is merged to MdePkg/CpuLib and all modules
are updated to not depend on this library, remove it completely.

Cc: Eric Dong <eric.dong@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Rahul Kumar <rahul1.kumar@intel.com>
Signed-off-by: Yu Pu <yu.pu@intel.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
Signed-off-by: Zhiguang Liu <zhiguang.liu@intel.com>
2 years agoShellPkg: Update smbiosview type 0/4/17/41 with SMBIOS 3.5 fields
Lin, MillerX [Mon, 10 Apr 2023 03:41:01 +0000 (11:41 +0800)]
ShellPkg: Update smbiosview type 0/4/17/41 with SMBIOS 3.5 fields

Signed-off-by: MillerX Lin <millerx.lin@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Zhichao Gao <zhichao.gao@intel.com>
Reviewed-by: Zhichao Gao <zhichao.gao@intel.com>
2 years agoFmpDevicePkg: Update code to be more C11 compliant by using __func__
Rebecca Cran [Thu, 6 Apr 2023 19:54:35 +0000 (13:54 -0600)]
FmpDevicePkg: Update code to be more C11 compliant by using __func__

__FUNCTION__ is a pre-standard extension that gcc and Visual C++ among
others support, while __func__ was standardized in C99.

Since it's more standard, replace __FUNCTION__ with __func__ throughout
FmpDevicePkg.

Signed-off-by: Rebecca Cran <rebecca@bsdio.com>
Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
Reviewed-by: Wei6 Xu <wei6.xu@intel.com>
2 years agoUefiPayloadPkg: Update code to be more C11 compliant by using __func__
Rebecca Cran [Thu, 6 Apr 2023 19:54:18 +0000 (13:54 -0600)]
UefiPayloadPkg: Update code to be more C11 compliant by using __func__

__FUNCTION__ is a pre-standard extension that gcc and Visual C++ among
others support, while __func__ was standardized in C99.

Since it's more standard, replace __FUNCTION__ with __func__ throughout
UefiPayloadPkg.

Signed-off-by: Rebecca Cran <rebecca@bsdio.com>
Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
Reviewed-by: Gua Guo <gua.guo@intel.com>
Reviewed-by: James Lu <james.lu@intel.com>