]> git.proxmox.com Git - mirror_edk2.git/log
mirror_edk2.git
2 years agoEmbeddedPkg: Change OPTIONAL keyword usage style
Michael D Kinney [Fri, 3 Dec 2021 02:00:41 +0000 (18:00 -0800)]
EmbeddedPkg: Change OPTIONAL keyword usage style

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

Update all use of ', OPTIONAL' to ' OPTIONAL,' for function params.

Cc: Andrew Fish <afish@apple.com>
Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Michael Kubacki <michael.kubacki@microsoft.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Andrew Fish <afish@apple.com>
2 years agoDynamicTablesPkg: Change OPTIONAL keyword usage style
Michael D Kinney [Fri, 3 Dec 2021 02:00:40 +0000 (18:00 -0800)]
DynamicTablesPkg: Change OPTIONAL keyword usage style

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

Update all use of ', OPTIONAL' to ' OPTIONAL,' for function params.

Cc: Andrew Fish <afish@apple.com>
Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Michael Kubacki <michael.kubacki@microsoft.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
2 years agoCryptoPkg: Change OPTIONAL keyword usage style
Michael D Kinney [Fri, 3 Dec 2021 02:00:39 +0000 (18:00 -0800)]
CryptoPkg: Change OPTIONAL keyword usage style

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

Update all use of ', OPTIONAL' to ' OPTIONAL,' for function params.

Cc: Andrew Fish <afish@apple.com>
Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Michael Kubacki <michael.kubacki@microsoft.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Jian J Wang <jian.j.wang@intel.com>
2 years agoArmVirtPkg: Change OPTIONAL keyword usage style
Michael D Kinney [Fri, 3 Dec 2021 02:00:39 +0000 (18:00 -0800)]
ArmVirtPkg: Change OPTIONAL keyword usage style

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

Update all use of ', OPTIONAL' to ' OPTIONAL,' for function params.

Cc: Andrew Fish <afish@apple.com>
Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Michael Kubacki <michael.kubacki@microsoft.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
2 years agoArmPlatformPkg: Change OPTIONAL keyword usage style
Michael D Kinney [Fri, 3 Dec 2021 02:00:38 +0000 (18:00 -0800)]
ArmPlatformPkg: Change OPTIONAL keyword usage style

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

Update all use of ', OPTIONAL' to ' OPTIONAL,' for function params.

Cc: Andrew Fish <afish@apple.com>
Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Michael Kubacki <michael.kubacki@microsoft.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Andrew Fish <afish@apple.com>
2 years agoArmPkg: Change OPTIONAL keyword usage style
Michael D Kinney [Fri, 3 Dec 2021 02:00:37 +0000 (18:00 -0800)]
ArmPkg: Change OPTIONAL keyword usage style

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

Update all use of ', OPTIONAL' to ' OPTIONAL,' for function params.

Cc: Andrew Fish <afish@apple.com>
Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Michael Kubacki <michael.kubacki@microsoft.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Andrew Fish <afish@apple.com>
2 years agoUefiCpuPkg: Change use of EFI_D_* to DEBUG_*
Michael D Kinney [Wed, 17 Nov 2021 03:21:42 +0000 (19:21 -0800)]
UefiCpuPkg: Change use of EFI_D_* to DEBUG_*

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

Update all use of EFI_D_* defines in DEBUG() macros to DEBUG_* defines.

Cc: Andrew Fish <afish@apple.com>
Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Michael Kubacki <michael.kubacki@microsoft.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
2 years agoSourceLevelDebugPkg: Change use of EFI_D_* to DEBUG_*
Michael D Kinney [Wed, 17 Nov 2021 03:21:40 +0000 (19:21 -0800)]
SourceLevelDebugPkg: Change use of EFI_D_* to DEBUG_*

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

Update all use of EFI_D_* defines in DEBUG() macros to DEBUG_* defines.

Cc: Andrew Fish <afish@apple.com>
Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Michael Kubacki <michael.kubacki@microsoft.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
2 years agoShellPkg: Change use of EFI_D_* to DEBUG_*
Michael D Kinney [Wed, 17 Nov 2021 03:21:37 +0000 (19:21 -0800)]
ShellPkg: Change use of EFI_D_* to DEBUG_*

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

Update all use of EFI_D_* defines in DEBUG() macros to DEBUG_* defines.

Cc: Andrew Fish <afish@apple.com>
Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Michael Kubacki <michael.kubacki@microsoft.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
2 years agoSecurityPkg: Change use of EFI_D_* to DEBUG_*
Michael D Kinney [Wed, 17 Nov 2021 03:21:36 +0000 (19:21 -0800)]
SecurityPkg: Change use of EFI_D_* to DEBUG_*

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

Update all use of EFI_D_* defines in DEBUG() macros to DEBUG_* defines.

Cc: Andrew Fish <afish@apple.com>
Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Michael Kubacki <michael.kubacki@microsoft.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Jian J Wang <jian.j.wang@intel.com>
2 years agoPcAtChipsetPkg: Change use of EFI_D_* to DEBUG_*
Michael D Kinney [Wed, 17 Nov 2021 03:21:34 +0000 (19:21 -0800)]
PcAtChipsetPkg: Change use of EFI_D_* to DEBUG_*

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

Update all use of EFI_D_* defines in DEBUG() macros to DEBUG_* defines.

Cc: Andrew Fish <afish@apple.com>
Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Michael Kubacki <michael.kubacki@microsoft.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
2 years agoOvmfPkg: Change use of EFI_D_* to DEBUG_*
Michael D Kinney [Wed, 17 Nov 2021 03:21:33 +0000 (19:21 -0800)]
OvmfPkg: Change use of EFI_D_* to DEBUG_*

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

Update all use of EFI_D_* defines in DEBUG() macros to DEBUG_* defines.

Cc: Andrew Fish <afish@apple.com>
Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Michael Kubacki <michael.kubacki@microsoft.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
2 years agoNetworkPkg: Change use of EFI_D_* to DEBUG_*
Michael D Kinney [Wed, 17 Nov 2021 03:21:32 +0000 (19:21 -0800)]
NetworkPkg: Change use of EFI_D_* to DEBUG_*

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

Update all use of EFI_D_* defines in DEBUG() macros to DEBUG_* defines.

Cc: Andrew Fish <afish@apple.com>
Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Michael Kubacki <michael.kubacki@microsoft.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Maciej Rabeda <maciej.rabeda@linux.intel.com>
2 years agoMdePkg: Change use of EFI_D_* to DEBUG_*
Michael D Kinney [Wed, 17 Nov 2021 03:21:31 +0000 (19:21 -0800)]
MdePkg: Change use of EFI_D_* to DEBUG_*

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

Update all use of EFI_D_* defines in DEBUG() macros to DEBUG_* defines.

Cc: Andrew Fish <afish@apple.com>
Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Michael Kubacki <michael.kubacki@microsoft.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
2 years agoMdeModulePkg: Change use of EFI_D_* to DEBUG_*
Michael D Kinney [Wed, 17 Nov 2021 03:21:29 +0000 (19:21 -0800)]
MdeModulePkg: Change use of EFI_D_* to DEBUG_*

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

Update all use of EFI_D_* defines in DEBUG() macros to DEBUG_* defines.

Cc: Andrew Fish <afish@apple.com>
Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Michael Kubacki <michael.kubacki@microsoft.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
2 years agoFatPkg: Change use of EFI_D_* to DEBUG_*
Michael D Kinney [Wed, 17 Nov 2021 03:21:22 +0000 (19:21 -0800)]
FatPkg: Change use of EFI_D_* to DEBUG_*

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

Update all use of EFI_D_* defines in DEBUG() macros to DEBUG_* defines.

Cc: Andrew Fish <afish@apple.com>
Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Michael Kubacki <michael.kubacki@microsoft.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
2 years agoEmulatorPkg: Change use of EFI_D_* to DEBUG_*
Michael D Kinney [Wed, 17 Nov 2021 03:21:21 +0000 (19:21 -0800)]
EmulatorPkg: Change use of EFI_D_* to DEBUG_*

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

Update all use of EFI_D_* defines in DEBUG() macros to DEBUG_* defines.

Cc: Andrew Fish <afish@apple.com>
Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Michael Kubacki <michael.kubacki@microsoft.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
2 years agoEmbeddedPkg: Change use of EFI_D_* to DEBUG_*
Michael D Kinney [Wed, 17 Nov 2021 03:21:20 +0000 (19:21 -0800)]
EmbeddedPkg: Change use of EFI_D_* to DEBUG_*

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

Update all use of EFI_D_* defines in DEBUG() macros to DEBUG_* defines.

Cc: Andrew Fish <afish@apple.com>
Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Michael Kubacki <michael.kubacki@microsoft.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
2 years agoArmVirtPkg: Change use of EFI_D_* to DEBUG_*
Michael D Kinney [Wed, 17 Nov 2021 03:21:15 +0000 (19:21 -0800)]
ArmVirtPkg: Change use of EFI_D_* to DEBUG_*

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

Update all use of EFI_D_* defines in DEBUG() macros to DEBUG_* defines.

Cc: Andrew Fish <afish@apple.com>
Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Michael Kubacki <michael.kubacki@microsoft.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
2 years agoArmPlatformPkg: Change use of EFI_D_* to DEBUG_*
Michael D Kinney [Wed, 17 Nov 2021 03:21:14 +0000 (19:21 -0800)]
ArmPlatformPkg: Change use of EFI_D_* to DEBUG_*

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

Update all use of EFI_D_* defines in DEBUG() macros to DEBUG_* defines.

Cc: Andrew Fish <afish@apple.com>
Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Michael Kubacki <michael.kubacki@microsoft.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
2 years agoArmPkg: Change use of EFI_D_* to DEBUG_*
Michael D Kinney [Wed, 17 Nov 2021 03:21:13 +0000 (19:21 -0800)]
ArmPkg: Change use of EFI_D_* to DEBUG_*

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

Update all use of EFI_D_* defines in DEBUG() macros to DEBUG_* defines.

Cc: Andrew Fish <afish@apple.com>
Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Michael Kubacki <michael.kubacki@microsoft.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
2 years agoMdeModulePkg/DxeCorePerformanceLib:Variable Initial
wenyi,xie via groups.io [Tue, 30 Nov 2021 01:51:10 +0000 (09:51 +0800)]
MdeModulePkg/DxeCorePerformanceLib:Variable Initial

SmmBootRecordDataSize is initialized in InternalGetSmmPerData,
but this function may fail. so to avoid using SmmBootRecordDataSize
without intialization, set it to 0 at first.

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: Wenyi Xie <xiewenyi2@huawei.com>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
Reviewed-by: Dandan Bi <dandan.bi@intel.com>
2 years agoUnitTestFrameworkPkg: Update YAML to ignore specific ECC files/errors
Michael D Kinney [Tue, 23 Nov 2021 21:04:28 +0000 (13:04 -0800)]
UnitTestFrameworkPkg: Update YAML to ignore specific ECC files/errors

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

Update package YAML files to ignore ECC errors that are
already present.  These issues must be fixed in the future,
but should not block source code changes for these known
issues.

Cc: Sean Brogan <sean.brogan@microsoft.com>
Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Michael Kubacki <michael.kubacki@microsoft.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Bret Barkelew <bret.barkelew@microsoft.com>
2 years agoUefiPayloadPkg: Update YAML to ignore specific ECC files/errors
Michael D Kinney [Tue, 23 Nov 2021 21:03:45 +0000 (13:03 -0800)]
UefiPayloadPkg: Update YAML to ignore specific ECC files/errors

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

Update package YAML files to ignore ECC errors that are
already present.  These issues must be fixed in the future,
but should not block source code changes for these known
issues.

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>
Cc: Sean Brogan <sean.brogan@microsoft.com>
Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Michael Kubacki <michael.kubacki@microsoft.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Guo Dong <guo.dong@intel.com>
2 years agoStandaloneMmPkg: Update YAML to ignore specific ECC files/errors
Michael D Kinney [Tue, 23 Nov 2021 21:02:55 +0000 (13:02 -0800)]
StandaloneMmPkg: Update YAML to ignore specific ECC files/errors

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

Update package YAML files to ignore ECC errors that are
already present.  These issues must be fixed in the future,
but should not block source code changes for these known
issues.

Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Sami Mujawar <sami.mujawar@arm.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Supreeth Venkatesh <supreeth.venkatesh@arm.com>
Cc: Sean Brogan <sean.brogan@microsoft.com>
Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Michael Kubacki <michael.kubacki@microsoft.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Acked-by: Ard Biesheuvel <ardb+tianocore@kernel.org>
Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
2 years agoShellPkg: Update YAML to ignore specific ECC files/errors
Michael D Kinney [Tue, 23 Nov 2021 21:02:07 +0000 (13:02 -0800)]
ShellPkg: Update YAML to ignore specific ECC files/errors

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

Update package YAML files to ignore ECC errors that are
already present.  These issues must be fixed in the future,
but should not block source code changes for these known
issues.

Cc: Ray Ni <ray.ni@intel.com>
Cc: Zhichao Gao <zhichao.gao@intel.com>
Cc: Sean Brogan <sean.brogan@microsoft.com>
Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Michael Kubacki <michael.kubacki@microsoft.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
Acked-by: Zhichao Gao <zhichao.gao@intel.com>
2 years agoSecurityPkg: Update YAML to ignore specific ECC files/errors
Michael D Kinney [Tue, 23 Nov 2021 21:01:29 +0000 (13:01 -0800)]
SecurityPkg: Update YAML to ignore specific ECC files/errors

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

Update package YAML files to ignore ECC errors that are
already present.  These issues must be fixed in the future,
but should not block source code changes for these known
issues.

Cc: Qi Zhang <qi1.zhang@intel.com>
Cc: Rahul Kumar <rahul1.kumar@intel.com>
Cc: Sean Brogan <sean.brogan@microsoft.com>
Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Michael Kubacki <michael.kubacki@microsoft.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Qi Zhang <qi1.zhang@intel.com>
2 years agoMdePkg: Update YAML to ignore specific ECC files/errors
Michael D Kinney [Tue, 23 Nov 2021 21:00:36 +0000 (13:00 -0800)]
MdePkg: Update YAML to ignore specific ECC files/errors

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

Update package YAML files to ignore ECC errors that are
already present.  These issues must be fixed in the future,
but should not block source code changes for these known
issues.

Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Zhiguang Liu <zhiguang.liu@intel.com>
Cc: Sean Brogan <sean.brogan@microsoft.com>
Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Michael Kubacki <michael.kubacki@microsoft.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
2 years agoMdeModulePkg: Update YAML to ignore specific ECC files/errors
Michael D Kinney [Tue, 23 Nov 2021 20:59:50 +0000 (12:59 -0800)]
MdeModulePkg: Update YAML to ignore specific ECC files/errors

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

Update package YAML files to ignore ECC errors that are
already present.  These issues must be fixed in the future,
but should not block source code changes for these known
issues.

Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Sean Brogan <sean.brogan@microsoft.com>
Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
Cc: Michael Kubacki <michael.kubacki@microsoft.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
2 years agoEmulatorPkg: Update YAML to ignore specific ECC files/errors
Michael D Kinney [Tue, 23 Nov 2021 20:59:07 +0000 (12:59 -0800)]
EmulatorPkg: Update YAML to ignore specific ECC files/errors

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

Update package YAML files to ignore ECC errors that are
already present.  These issues must be fixed in the future,
but should not block source code changes for these known
issues.

Cc: Andrew Fish <afish@apple.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Sean Brogan <sean.brogan@microsoft.com>
Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Michael Kubacki <michael.kubacki@microsoft.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
2 years agoCryptoPkg: Update YAML to ignore specific ECC files/errors
Michael D Kinney [Tue, 23 Nov 2021 20:58:22 +0000 (12:58 -0800)]
CryptoPkg: Update YAML to ignore specific ECC files/errors

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

Update package YAML files to ignore ECC errors that are
already present.  These issues must be fixed in the future,
but should not block source code changes for these known
issues.

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>
Cc: Sean Brogan <sean.brogan@microsoft.com>
Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Michael Kubacki <michael.kubacki@microsoft.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Jian J Wang <jian.j.wang@intel.com>
Reviewed-by: Jiewen Yao <Jiewen.yao@intel.com>
2 years agoArmVirtPkg: Update YAML to ignore specific ECC files/errors
Michael D Kinney [Tue, 23 Nov 2021 20:57:30 +0000 (12:57 -0800)]
ArmVirtPkg: Update YAML to ignore specific ECC files/errors

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

Update package YAML files to ignore ECC errors that are
already present.  These issues must be fixed in the future,
but should not block source code changes for these known
issues.

Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Sami Mujawar <sami.mujawar@arm.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Sean Brogan <sean.brogan@microsoft.com>
Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Michael Kubacki <michael.kubacki@microsoft.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Acked-by: Ard Biesheuvel <ardb@kernel.org>
Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
Reviewed-by: Leif Lindholm <leif@nuviainc.com>
2 years agoArmPlatformPkg: Update YAML to ignore specific ECC files/errors
Michael D Kinney [Tue, 23 Nov 2021 20:56:46 +0000 (12:56 -0800)]
ArmPlatformPkg: Update YAML to ignore specific ECC files/errors

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

Update package YAML files to ignore ECC errors that are
already present.  These issues must be fixed in the future,
but should not block source code changes for these known
issues.

Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Sean Brogan <sean.brogan@microsoft.com>
Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Michael Kubacki <michael.kubacki@microsoft.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Acked-by: Ard Biesheuvel <ardb@kernel.org>
Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
Reviewed-by: Leif Lindholm <leif@nuviainc.com>
2 years agoArmPkg: Update YAML to ignore specific ECC files/errors
Michael D Kinney [Wed, 17 Nov 2021 17:18:53 +0000 (09:18 -0800)]
ArmPkg: Update YAML to ignore specific ECC files/errors

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

Update package YAML files to ignore ECC errors that are
already present.  These issues must be fixed in the future,
but should not block source code changes for these known
issues.

Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Sean Brogan <sean.brogan@microsoft.com>
Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Michael Kubacki <michael.kubacki@microsoft.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Acked-by: Ard Biesheuvel <ardb@kernel.org>
Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
Reviewed-by: Leif Lindholm <leif@nuviainc.com>
2 years ago.azurepipelines/templates: Update max pipeline job time to 2 hours
Michael D Kinney [Fri, 19 Nov 2021 19:53:00 +0000 (11:53 -0800)]
.azurepipelines/templates: Update max pipeline job time to 2 hours

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

Large patches that modify a large number of files(e.g uncrustify)
take longer to process through CI checks such as ECC.  Increase
the max job time from 1 hour to 2 hours to accommodate larger patch
series.

Cc: Sean Brogan <sean.brogan@microsoft.com>
Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Michael Kubacki <michael.kubacki@microsoft.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Michael Kubacki <michael.kubacki@microsoft.com>
Reviewed-by: Sean Brogan <sean.brogan@microsoft.com>
2 years ago.pytools/Plugin/LicenseCheck: Use temp directory for git diff output
Michael D Kinney [Sun, 21 Nov 2021 04:51:47 +0000 (20:51 -0800)]
.pytools/Plugin/LicenseCheck: Use temp directory for git diff output

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

Use --output option in git diff command to remove code diffs
from build log on stdout when LicenseCheck plugin is run.
Instead, create a temp directory for the diff output file and
remove the temp directory after the diff output is processed.

Cc: Sean Brogan <sean.brogan@microsoft.com>
Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Michael Kubacki <michael.kubacki@microsoft.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Acked-by: Michael Kubacki <michael.kubacki@microsoft.com>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
Reviewed-by: Sean Brogan <sean.brogan@microsoft.com>
2 years ago.pytool/Plugin/EccCheck: Add performance optimizations
Michael D Kinney [Tue, 23 Nov 2021 05:29:38 +0000 (21:29 -0800)]
.pytool/Plugin/EccCheck: Add performance optimizations

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

Improve the performance of EccCheck by using a temp file
instead of stdout to capture the results of the git diff
commands. If a large patch set is passed into EccCheck,
using stdout could be slow and also added the large diff
content to the build log that is redundant information.

A second performance improvement is to filter the
modified directories to remove duplicate directories.
Complex libraries and modules that have subdirectories
with sources would be scanned twice if there were source
changes in both the main directory and subdirectories.
Filter out the subdirectories from the modified directory
list when this case is detected.

Cc: Sean Brogan <sean.brogan@microsoft.com>
Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Michael Kubacki <michael.kubacki@microsoft.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Acked-by: Sean Brogan <sean.brogan@microsoft.com>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
2 years ago.pytool/Plugin/EccCheck: Remove temp directory on exception
Michael D Kinney [Tue, 23 Nov 2021 05:20:48 +0000 (21:20 -0800)]
.pytool/Plugin/EccCheck: Remove temp directory on exception

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

Add try/except to RunBuildPlugin() to remove temporary
directory if a KeyboardInterrupt exception or an unexpected
exception is detected.

Cc: Sean Brogan <sean.brogan@microsoft.com>
Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Michael Kubacki <michael.kubacki@microsoft.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Acked-by: Sean Brogan <sean.brogan@microsoft.com>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
2 years ago.pytool/Plugin/EccCheck: Remove RevertCode()
Michael D Kinney [Tue, 23 Nov 2021 05:13:41 +0000 (21:13 -0800)]
.pytool/Plugin/EccCheck: Remove RevertCode()

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

The RevertCode() method uses git reset which can remove
local changes. Instead of modifying the local files, a
copy of the package passed into the EccCheck tool is
copied to a temp directory in Build/ecctemp.  This same
temp directory is also used for exception.xml. The working
directory used by ECC is also set to this same temp
directory. The combination of these changes eliminates
operations that that modified the git state.

Cc: Sean Brogan <sean.brogan@microsoft.com>
Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Michael Kubacki <michael.kubacki@microsoft.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Acked-by: Sean Brogan <sean.brogan@microsoft.com>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
2 years agoEmulatorPkg/Win/Host: Update CC_FLAGS
Michael D Kinney [Mon, 15 Nov 2021 01:50:12 +0000 (17:50 -0800)]
EmulatorPkg/Win/Host: Update CC_FLAGS

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

* Remove deprecated option /Gm that generates a warning.
* Remove /Zi and use '=' instead of '== to let DEBUG/RELEASE/NOOPT
  profile from tools_def.txt enable debug information
* Remove /Gs8192 option that is overriding the larger setting of
  /GS32768 from tools_def.txt that generates a warning.

Cc: Andrew Fish <afish@apple.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Michael Kubacki <michael.kubacki@microsoft.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Michael Kubacki <michael.kubacki@microsoft.com>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
Reviewed-by: Ray Ni <ray.ni@Intel.com>
2 years agoNetworkPkg: Fix invalid pointer for DNS response token on error
Liming Gao [Thu, 25 Nov 2021 16:11:06 +0000 (00:11 +0800)]
NetworkPkg: Fix invalid pointer for DNS response token on error

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

This issue is introduced by the commit 43d7e607.
Token->RspData.H2AData is de-allocated on error but it is not
set to NULL. HTTP module attempts to free again and cause assert.

Signed-off-by: Baraneedharan Anbazhagan <anbazhagan@hp.com>
Reviewed-by: Wu Jiaxin <jiaxin.wu@intel.com>
2 years agoMdeModulePkg AtaAtapiPassThru: Skip the potential NULL pointer access
Liming Gao [Tue, 16 Nov 2021 02:52:07 +0000 (10:52 +0800)]
MdeModulePkg AtaAtapiPassThru: Skip the potential NULL pointer access

BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3732
Recent change c9742578 exposes this potential issue.

Signed-off-by: Liming Gao <gaoliming@byosoft.com.cn>
Acked-by: Rebecca Cran <rebecca@nuviainc.com>
Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
2 years agoOvmfPkg/Library/ResetSystemLib: Fix Microvm VS2019 NOOPT build issue
Michael D Kinney [Thu, 11 Nov 2021 19:20:50 +0000 (11:20 -0800)]
OvmfPkg/Library/ResetSystemLib: Fix Microvm VS2019 NOOPT build issue

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

Fix VS2019 NOOPT build issues with OvmfPkg/Microvm/MicrovmX64.dsc
by fixing typecast of MICROVM_GED_MMIO_BASE_REGS to a VOID *.

Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>
2 years agoUefiCpuPkg/PiSmmCpuDxeSmm: Use SMM Interrupt Shadow Stack
Sheng, W [Fri, 12 Nov 2021 01:40:28 +0000 (09:40 +0800)]
UefiCpuPkg/PiSmmCpuDxeSmm: Use SMM Interrupt Shadow Stack

When CET shadow stack feature is enabled, it needs to use IST for the
 exceptions, and uses interrupt shadow stack for the stack switch.
Shadow stack should be 32 bytes aligned.
Check IST field, when clear shadow stack token busy bit when using retf.

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

Signed-off-by: Sheng Wei <w.sheng@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Rahul Kumar <rahul1.kumar@intel.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
2 years agoMdeModulePkg/FPDT: Lock boot performance table address variable at EndOfDxe
Dandan Bi [Mon, 28 Jun 2021 11:50:22 +0000 (19:50 +0800)]
MdeModulePkg/FPDT: Lock boot performance table address variable at EndOfDxe

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

1. Allocate performance data table at EndOfDxe and then lock the varible
   which store the table address at EndOfDxe.

2. Enlarge PCD gEfiMdeModulePkgTokenSpaceGuid.PcdExtFpdtBootRecordPadSize
   from 0x20000 to 0x30000 in order to hold the Delta performance data
   between EndOfDxe and ReadyToBoot.

3. SMM performance data is collected by DXE modules through SMM communication
   at ReadyToBoot before.
   Now to do SMM communication twice, one for allocating the performance
   size at EndOfDxe, another is at ReadyToBoot to get SMM performance data.

4. Make SmmCorePerformanceLib rather than FirmwarePerformanceSmm to communicate
   with DxeCorePerformanceLib for SMM performance data and size.

Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Hao A Wu <hao.a.wu@intel.com>
Cc: Jian J Wang <jian.j.wang@intel.com>
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
2 years agoOvmfPkg/Bhyve/PlatformPei: Fix VS2019 X64 NOOPT build issue
Michael D Kinney [Tue, 9 Nov 2021 03:13:08 +0000 (19:13 -0800)]
OvmfPkg/Bhyve/PlatformPei: Fix VS2019 X64 NOOPT build issue

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

Add typecast to fix build error with VS2019 X64 NOOPT converting
a UINT64 value to UINT32 value.

Cc: Rebecca Cran <rebecca@bsdio.com>
Cc: Peter Grehan <grehan@freebsd.org>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Rebecca Cran <rebecca@bsdio.com>
Acked-by: Peter Grehan <grehan@freebsd.org>
2 years agoOvmfPkg/Xen: Fix VS2019 build issues
Michael D Kinney [Mon, 8 Nov 2021 16:10:56 +0000 (08:10 -0800)]
OvmfPkg/Xen: Fix VS2019 build issues

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

Fix VS2019 NOOPT build issues related to converting
a larger integer value to a smaller integer value.

Cc: Anthony Perard <anthony.perard@citrix.com>
Cc: Julien Grall <julien@xen.org>
Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Jiewen Yao <Jiewen.yao@intel.com>
2 years agoBaseTools: Add authenticated variable store support
Chen, Lin Z [Thu, 4 Nov 2021 11:28:53 +0000 (19:28 +0800)]
BaseTools: Add authenticated variable store support

In order to support secure boot with authenticated type variable store
and non secure boot with normal type variable store, add one flag to
switch them.

User can append '-D VPD_AUTHENTICATED_VARIABLE_STORE' to build command
to enable authenticated type varaible store.

Also, user can add 'VPD_AUTHENTICATED_VARIABLE_STORE = TRUE/FALSE' to the
defines section of Dsc file to switch authenticated/normal type variable
store.

VPD_AUTHENTICATED_VARIABLE_STORE is a new reserved key word for this function.

Signed-off-by: Chen Lin Z <lin.z.chen@intel.com>
Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Reviewed-by: Bob Feng <bob.c.feng@intel.com>
2 years agoMdeModulePkg/DxeCapsuleLibFmp: Use new Variable Lock interface
Yang Jie [Wed, 10 Nov 2021 02:00:00 +0000 (10:00 +0800)]
MdeModulePkg/DxeCapsuleLibFmp: Use new Variable Lock interface

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D3699
The code in MdeModulePkg\Library\DxeCapsuleLibFmp call the deprecated=20
interface VariableLockRequestToLock.c. So I changed the code in
FmpDevicePkg using RegisterBasicVariablePolicy, instead of the=20
deprecated interface.

Signed-off-by: Yang Jie <jie.yang@intel.com>
Cc: Guomin Jiang <guomin.jiang@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Jian J Wang <jian.j.wang@intel.com>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
Reviewed-by: Jian J Wang <jian.j.wang@intel.com>
2 years agoUefiCpuPkg/UefiCpuLib: Add GetCpuFamilyModel and GetCpuSteppingId
Ni, Ray [Tue, 19 Oct 2021 06:42:21 +0000 (14:42 +0800)]
UefiCpuPkg/UefiCpuLib: Add GetCpuFamilyModel and GetCpuSteppingId

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

Lots of code relies on CPU Family/Model/Stepping for different logics.

The change adds two APIs for such needs.

Signed-off-by: Ray Ni <ray.ni@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
Cc: Rahul Kumar <rahul1.kumar@intel.com>
2 years agoMdeModulePkg\UfsBlockIoPei: UFS MMIO address size support both 32/64 bits
Ian Chiu [Fri, 5 Nov 2021 09:46:09 +0000 (17:46 +0800)]
MdeModulePkg\UfsBlockIoPei: UFS MMIO address size support both 32/64 bits

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

MMIO base address size will overflow while finding two or more Host
controller in the system. Correct it and support 32 and 64 bits address
space.

Signed-off-by: Ian Chiu <ian.chiu@intel.com>
Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
Cc: Maggie Chu <maggie.chu@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Hao A Wu <hao.a.wu@intel.com>
2 years agoMdeModulePkg/DxeCapsuleLibFmp: Capsule on Disk file name capsule
Bob Morgan [Tue, 2 Nov 2021 20:40:23 +0000 (04:40 +0800)]
MdeModulePkg/DxeCapsuleLibFmp: Capsule on Disk file name capsule

Enhance RelocateCapsuleToRam() to skip creation of the Capsule on Disk
file name capsule if PcdSupportUpdateCapsuleReset feature is not enabled.
This avoids an EFI_UNSUPPORTED return status from UpdateCapsule() when the
file name capsule is encountered and PcdSupportUpdateCapsuleReset is FALSE.

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: Bob Morgan <bobm@nvidia.com>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
2 years agoMdeModulePkg AtaAtapiPassThru: Always do S.M.A.R.T. check if device support
Liming Gao [Mon, 1 Nov 2021 09:44:22 +0000 (17:44 +0800)]
MdeModulePkg AtaAtapiPassThru: Always do S.M.A.R.T. check if device support

If S.M.A.R.T. is supported, it can be checked.

Signed-off-by: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Hao A Wu <hao.a.wu@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
2 years agoMdePkg: Fix ACPI memory aggregator/device type mismatch
Chris Jones [Wed, 6 Oct 2021 10:11:54 +0000 (18:11 +0800)]
MdePkg: Fix ACPI memory aggregator/device type mismatch

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

Since the Common Memory Device (formerly Memory Aggregator Device) was
introduced in ACPI 5.0, the edk2 type values have not matched the
values defined in the ACPI specification.

Fix this discrepancy by aligning the code to match the specification.

Signed-off-by: Chris Jones <christopher.jones@arm.com>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
2 years agoShellPkg: Add comment that ItemPtr is set after validation
Chris Jones [Wed, 20 Oct 2021 10:47:18 +0000 (18:47 +0800)]
ShellPkg: Add comment that ItemPtr is set after validation

Add a comment to clarify that in Acpiview the ItemPtr is not set until
after the FieldValidator has been called.

Signed-off-by: Chris Jones <christopher.jones@arm.com>
Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
Reviewed-by: Zhichao Gao <zhichao.gao@intel.com>
2 years agoOvmfPkg: Reproduce builds across source format changes
Michael D Kinney [Tue, 12 Oct 2021 23:41:22 +0000 (16:41 -0700)]
OvmfPkg: Reproduce builds across source format changes

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

Use DEBUG_LINE_NUMBER instead of __LINE__.

Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Michael Kubacki <michael.kubacki@microsoft.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Jiewen Yao <Jiewen.yao@intel.com>
Tested-by: Michael Kubacki <michael.kubacki@microsoft.com>
2 years agoSecurityPkg: Reproduce builds across source format changes
Michael D Kinney [Tue, 12 Oct 2021 23:41:35 +0000 (16:41 -0700)]
SecurityPkg: Reproduce builds across source format changes

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

Use DEBUG_LINE_NUMBER instead of __LINE__.

Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Michael Kubacki <michael.kubacki@microsoft.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Jiewen Yao <Jiewen.yao@intel.com>
Tested-by: Michael Kubacki <michael.kubacki@microsoft.com>
2 years agoNetworkPkg: Reproduce builds across source format changes
Michael D Kinney [Tue, 12 Oct 2021 23:41:50 +0000 (16:41 -0700)]
NetworkPkg: Reproduce builds across source format changes

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

Use DEBUG_LINE_NUMBER instead of __LINE__.

Cc: Maciej Rabeda <maciej.rabeda@linux.intel.com>
Cc: Jiaxin Wu <jiaxin.wu@intel.com>
Cc: Siyuan Fu <siyuan.fu@intel.com>
Cc: Michael Kubacki <michael.kubacki@microsoft.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Maciej Rabeda <maciej.rabeda@linux.intel.com>
Tested-by: Michael Kubacki <michael.kubacki@microsoft.com>
2 years agoMdeModulePkg: Reproduce builds across source format changes
Michael D Kinney [Tue, 12 Oct 2021 23:40:39 +0000 (16:40 -0700)]
MdeModulePkg: Reproduce builds across source format changes

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

Use DEBUG_LINE_NUMBER instead of __LINE__.

Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Michael Kubacki <michael.kubacki@microsoft.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
Tested-by: Michael Kubacki <michael.kubacki@microsoft.com>
2 years agoArmPkg: Reproduce builds across source format changes
Michael D Kinney [Tue, 12 Oct 2021 23:40:17 +0000 (16:40 -0700)]
ArmPkg: Reproduce builds across source format changes

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

Use DEBUG_LINE_NUMBER instead of __LINE__.

Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Michael Kubacki <michael.kubacki@microsoft.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Leif Lindholm <leif@nuviainc.com>
Tested-by: Michael Kubacki <michael.kubacki@microsoft.com>
2 years agoMdePkg: Reproduce builds across source format changes
Michael D Kinney [Mon, 1 Nov 2021 20:39:13 +0000 (13:39 -0700)]
MdePkg: Reproduce builds across source format changes

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

* Use DEBUG_LINE_NUMBER instead of __LINE__.
* Use DEBUG_EXPRESSION_STRING instead of #Expression.

Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Zhiguang Liu <zhiguang.liu@intel.com>
Cc: Michael Kubacki <michael.kubacki@microsoft.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Tested-by: Michael Kubacki <michael.kubacki@microsoft.com>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
2 years agoMdePkg/Include: Enhance DebugLib to support reproduce builds
Michael D Kinney [Tue, 12 Oct 2021 23:42:28 +0000 (16:42 -0700)]
MdePkg/Include: Enhance DebugLib to support reproduce builds

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

* Add DEBUG_LINE_NUMBER define to DebugLib.h that is
  by default mapped to __LINE__.  A build can define
  DEBUG_LINE_NUMBER to use a fixed value.
* Add DEBUG_EXPRESSION_STRING(Expression) macros to
  DebugLib.h that is by default mapped to #Expression.
  A build can define DEBUG_EXPRESSION_STRING_VALUE to
  set all expression strings to a fixed string value.

Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Zhiguang Liu <zhiguang.liu@intel.com>
Cc: Michael Kubacki <michael.kubacki@microsoft.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Tested-by: Michael Kubacki <michael.kubacki@microsoft.com>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
2 years agoMdeModulePkg/XhciSched: Fix missing DEBUG arguments
Michael Kubacki [Wed, 3 Nov 2021 15:16:25 +0000 (23:16 +0800)]
MdeModulePkg/XhciSched: Fix missing DEBUG arguments

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

Two DEBUG macros in XhciDxe/XhciSched.c are missing the argument
that should be passed for the print specifier.

In addition, this change updates the print level to "DEBUG_ERROR"
and prints the status as well.

Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Hao A Wu <hao.a.wu@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
2 years agoBaseTools: Fix StructurePcd offset error.
Yuwei Chen [Wed, 27 Oct 2021 10:00:03 +0000 (18:00 +0800)]
BaseTools: Fix StructurePcd offset error.

Currently when parse VFR files to get the struct info,
BOOLEAN type struct is ignored, which caused offset errors.
This patch fixed these bugs.

Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Signed-off-by: Yuwei Chen <yuwei.chen@intel.com>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
Reviewed-by: Bob Feng <bob.c.feng@intel.com>
2 years agoMdeModulePkg/Variable/RuntimeDxeUnitTest: Fix 32-bit GCC builds
Michael D Kinney [Tue, 2 Nov 2021 16:15:26 +0000 (09:15 -0700)]
MdeModulePkg/Variable/RuntimeDxeUnitTest: Fix 32-bit GCC builds

When using will_return() on a pointer value, it must be
cast to UINTN to be compatible with 32-bit GCC builds.
This uses the same approach in samples provided in the
UnitTestFramworkPkg when passing pointer values to
UT_ASSERT_EQUAL().

Cc: Hao A Wu <hao.a.wu@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com>
Reviewed-by: Bret Barkelew <bret.barkelew@microsoft.com>
Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
2 years agoUefiCpuPkg/MtrrLib/UnitTest: Fix 32-bit GCC build issues
Michael D Kinney [Tue, 2 Nov 2021 16:08:18 +0000 (09:08 -0700)]
UefiCpuPkg/MtrrLib/UnitTest: Fix 32-bit GCC build issues

When using UT_ASSERT_EQUAL() on a pointer value, it must be
cast to UINTN.  This follows the samples provided with the
UnitTestFrameworkPkg.

Cc: Eric Dong <eric.dong@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Rahul Kumar <rahul1.kumar@intel.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
2 years agoSignedCapsulePkg/SignedCapsulePkg.dsc: Add RngLib mapping
Michael D Kinney [Tue, 2 Nov 2021 01:27:30 +0000 (18:27 -0700)]
SignedCapsulePkg/SignedCapsulePkg.dsc: Add RngLib mapping

Fix build breaks for all architectures by adding RngLib mapping.

Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Abner Chang <abner.chang@hpe.com>
Cc: Daniel Schaefer <daniel.schaefer@hpe.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Daniel Schaefer <daniel.schaefer@hpe.com>
Acked-by: Abner Chang <abner.chang@hpe.com>
2 years agoSecurityPkg/SecurityPkg.dsc: Add missing RngLib for ARM and RISCV64
Michael D Kinney [Tue, 2 Nov 2021 01:10:50 +0000 (18:10 -0700)]
SecurityPkg/SecurityPkg.dsc: Add missing RngLib for ARM and RISCV64

Fix SecurityPkg build breaks for ARM and RISCV64 by adding RngLib
mapping.

Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Abner Chang <abner.chang@hpe.com>
Cc: Daniel Schaefer <daniel.schaefer@hpe.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Acked-by: Jiewen Yao <Jiewen.yao@intel.com>
Acked-by: Abner Chang <abner.chang@hpe.com>
Reviewed-by: Daniel Schaefer <daniel.schaefer@hpe.com>
2 years agoNetworkPkg/NetworkPkg.dsc: Add RngLib mapping for ARM and RISCV64
Michael D Kinney [Tue, 2 Nov 2021 01:10:26 +0000 (18:10 -0700)]
NetworkPkg/NetworkPkg.dsc: Add RngLib mapping for ARM and RISCV64

Fix NetworkPkg build breaks for ARM and RISCV64 by adding RngLib
mapping.

Cc: Maciej Rabeda <maciej.rabeda@linux.intel.com>
Cc: Jiaxin Wu <jiaxin.wu@intel.com>
Cc: Siyuan Fu <siyuan.fu@intel.com>
Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Abner Chang <abner.chang@hpe.com>
Cc: Daniel Schaefer <daniel.schaefer@hpe.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Daniel Schaefer <daniel.schaefer@hpe.com>
Reviewed-by: Maciej Rabeda <maciej.rabeda@linux.intel.com>
Acked-by: Abner Chang <abner.chang@hpe.com>
2 years agoDynamicTablesPkg: Add missing BaseStackCheckLib instance
Michael D Kinney [Mon, 1 Nov 2021 23:31:37 +0000 (16:31 -0700)]
DynamicTablesPkg: Add missing BaseStackCheckLib instance

Fix ARM and AARCH64 build issues by adding the BaseStackCheckLib
instance.

Cc: Sami Mujawar <Sami.Mujawar@arm.com>
Cc: Alexei Fedorov <Alexei.Fedorov@arm.com>
Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
2 years agoBaseTools/VrfCompile: Fix uninitialized field from unnamed field
Michael D Kinney [Mon, 4 Oct 2021 23:04:41 +0000 (16:04 -0700)]
BaseTools/VrfCompile: Fix uninitialized field from unnamed field

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

If a C structure parsed by the VFR compiler contains an unnamed
field, then mFieldName is left uninitialized, which generates
random data in the VFR compiler output file.

If the FieldName is NULL, then initialize pNewField->mFieldName
to a Null-terminated empty string.

Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Yuwei Chen <yuwei.chen@intel.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
Reviewed-by: Bob Feng <bob.c.feng@intel.com>
2 years agoNetworkPkg/HttpDxe: Enable wildcard host name matching for HTTP+TLS.
Vineel Kovvuri [Fri, 15 Oct 2021 00:54:50 +0000 (17:54 -0700)]
NetworkPkg/HttpDxe: Enable wildcard host name matching for HTTP+TLS.

The current UEFI implementation of HTTPS during its TLS configuration
uses
EFI_TLS_VERIFY_FLAG_NO_WILDCARDS for host name verification. As per the
spec
this flag does is "to disable the match of any wildcards in the host
name". So,
certificates which are issued with wildcards(*.dm.corp.net etc) in it
will fail
the TLS host name matching. On the other hand,
EFI_TLS_VERIFY_FLAG_NONE(misnomer) means "no additional flags set for
hostname
validation. Wildcards are supported and they match only in the left-most
label."
this behavior/definition is coming from openssl's X509_check_host() api
https://www.openssl.org/docs/man1.1.0/man3/X509_check_host.html

Without EFI_TLS_VERIFY_FLAG_NONE any UEFI application using certificates
issued
with wildcards in them would fail to match while trying to communicate
with
HTTPS endpoint.

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

Signed-off-by: Vineel Kovvuri <vineelko@microsoft.com>
Cc: Maciej Rabeda <maciej.rabeda@linux.intel.com>
Cc: Jiaxin Wu <jiaxin.wu@intel.com>
Cc: Siyuan Fu <siyuan.fu@intel.com>
Reviewed-by: Jiewen Yao <Jiewen.yao@intel.com>
Reviewed-by: Jiaxin Wu <jiaxin.wu@intel.com>
Reviewed-by: Maciej Rabeda <maciej.rabeda@linux.intel.com>
2 years agoIntelFsp2Pkg SplitFspBin.py: Correct file name in file header
Zeng, Star [Wed, 27 Oct 2021 11:59:51 +0000 (19:59 +0800)]
IntelFsp2Pkg SplitFspBin.py: Correct file name in file header

Cc: Maurice Ma <maurice.ma@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Chasel Chiu <chasel.chiu@intel.com>
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Chasel Chiu <chasel.chiu@intel.com>
Reviewed-by: Nate DeSimone <nathaniel.l.desimone@intel.com>
2 years agoSecurityPkg/FvReportPei: Remove the ASSERT to allow neither M nor V
Guomin Jiang [Fri, 15 Oct 2021 03:54:14 +0000 (11:54 +0800)]
SecurityPkg/FvReportPei: Remove the ASSERT to allow neither M nor V

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

M mean that Measured Boot, V mean that Verified Boot.

The FvReport do below:
1. Do nothing if neither M nor V
2. Allocate pages to save the firmware volume and use it to install
   firmware info Ppi
3. Install PreHashFv Ppi if the FV need measurement.
4. Verify the Hash if the FV need verification

Notes:
1. The component is used to verify the FV or measure the FV
2. Copy action is just for security purpose but not main purpose.
3. If you use this component, Doesn't need to copy in other compoent
   which result time consumption.

Signed-off-by: Guomin Jiang <guomin.jiang@intel.com>
Reviewed-by: Jian J Wang <jian.j.wang@intel.com>
2 years agoRedfishPkg: Add more information to Readme.md
Abner Chang [Sat, 30 Oct 2021 03:20:53 +0000 (11:20 +0800)]
RedfishPkg: Add more information to Readme.md

Add more information of network settings for EDK2
Redfish service on EmulatorPkg.

Signed-off-by: Abner Chang <abner.chang@hpe.com>
Cc: Nickle Wang <nickle.wang@hpe.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Reviewed-by: Nickle Wang <nickle.wang@hpe.com>
2 years agoUefiPayloadPkg: Remove SystemTableInfo GUID.
Kesavan Balakrishnan, ThiyaguX [Wed, 20 Oct 2021 06:05:19 +0000 (23:05 -0700)]
UefiPayloadPkg: Remove SystemTableInfo GUID.

SystemTableInfo GUID is not a Spec defined GUID.
The latest SBL and CBL produces ACPI and SMBIOS table information.
So removing the SystemTableInfo GUID implementation.

Cc: Maurice Ma <maurice.ma@intel.com>
Cc: Guo Dong <guo.dong@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Benjamin You <benjamin.you@intel.com>
Cc: Zhiguang Liu <zhiguang.liu@intel.com>
Signed-off-by: Guo Dong <guo.dong@intel.com>
Signed-off-by: Thiyagu Kesavan Balakrishnan <thiyagux.kesavan.balakrishnan@intel.com>
Reviewed-by: Guo Dong <guo.dong@intel.com>
2 years agoRedfishPkg: Update link to staging/RedfishClientPkg in Readme.md
Nickle Wang [Fri, 29 Oct 2021 02:02:16 +0000 (10:02 +0800)]
RedfishPkg: Update link to staging/RedfishClientPkg in Readme.md

Redfish feature DXE drivers are contributed to staging/RedfishClientPkg.
Add link to Readme.md in staging/RedfishClientPkg.

Signed-off-by: Nickle Wang <nickle.wang@hpe.com>
Cc: Abner Chang <abner.chang@hpe.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Reviewed-by: Abner Chang <abner.chang@hpe.com>
2 years agoMdePkg Cpuid.h: Define CPUID.(EAX=7,ECX=0):EDX[30]
Zeng, Star [Thu, 21 Oct 2021 03:28:20 +0000 (11:28 +0800)]
MdePkg Cpuid.h: Define CPUID.(EAX=7,ECX=0):EDX[30]

This patch follows new Intel SDM to define CPUID.(EAX=7,ECX=0):EDX[30].

Signed-off-by: Star Zeng <star.zeng@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>
Cc: Ray Ni <ray.ni@intel.com>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
Reviewed-by: Ray Ni <ray.ni@intel.com>
2 years agoIntelFsp2Pkg/SplitFspBin.py: adopt FSP 2.3 specification.
Chasel Chiu [Tue, 26 Oct 2021 07:53:37 +0000 (15:53 +0800)]
IntelFsp2Pkg/SplitFspBin.py: adopt FSP 2.3 specification.

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

FSP 2.3 has updated FSP_INFO_HEADER to support ExtendedImageRevision
and SplitFspBin.py needs to support it.

Also updated script to display integer value basing on length.

Cc: Maurice Ma <maurice.ma@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Signed-off-by: Chasel Chiu <chasel.chiu@intel.com>
Reviewed-by: Maurice Ma <maurice.ma@intel.com>
Reviewed-by: Nate DeSimone <nathaniel.l.desimone@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
2 years agoFmpDevicePkg/FmpDxe: Use new Variable Lock interface
Yang Jie [Tue, 19 Oct 2021 03:11:04 +0000 (11:11 +0800)]
FmpDevicePkg/FmpDxe: Use new Variable Lock interface

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3655
The code in FmpDevicePkg call the deprecated interface
VariableLockRequestToLockc. So I changed the code in
FmpDevicePkg using RegisterBasicVariablePolicy, instead
of the deprecated interface.

Signed-off-by: Yang Jie <jie.yang@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Guomin Jiang <guomin.jiang@intel.com>
Cc: Wei6 Xu <wei6.xu@intel.com>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
Reviewed-by: Wei6 Xu <wei6.xu@intel.com>
2 years agoUefiPayloadPkg: Add SMM support and SMM variable support
Guo Dong [Fri, 24 Sep 2021 04:54:23 +0000 (21:54 -0700)]
UefiPayloadPkg: Add SMM support and SMM variable support

Add SMM variable support for universal UEFI payload.
By default they are disabled.

Signed-off-by: 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: Ray Ni <ray.ni@intel.com>
Reviewed-by: Benjamin You <benjamin.you@intel.com>
2 years agoUefiPayloadPkg: Add a SMM dispatch module
Guo Dong [Wed, 22 Sep 2021 21:45:55 +0000 (14:45 -0700)]
UefiPayloadPkg: Add a SMM dispatch module

PCH SMM module would install SMM SW dispatch2 protocol.
And it supports to register SMI handlers based on SMI APM
interrupt from the bootloader information gSmmRegisterInfoGuid.
It is possible to extend bootloader HOB to pass other information
to support more SMI sources.
If this module is not required by bootloader for some reason, the
bootloader could skip this HOB or build a HOB without EOS info.

Signed-off-by: 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: Ray Ni <ray.ni@intel.com>
Reviewed-by: Benjamin You <benjamin.you@intel.com>
2 years agoUefiPayloadPkg: Add a common FVB SMM module
Guo Dong [Wed, 22 Sep 2021 21:42:50 +0000 (14:42 -0700)]
UefiPayloadPkg: Add a common FVB SMM module

This FVB module is used to initialize NV variable region
and provide SMM FVB protocol to read/write SPI variable region.

This module consume HOB gNvVariableInfoGuid and depends on
FlashDeviceLib for the actual SPI device operate.

During FVB initialization, it will initialize the variable region
if the variable region is not valid. And it support to write initial
variable data from FFS file if it is found.

Signed-off-by: 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: Ray Ni <ray.ni@intel.com>
Reviewed-by: Benjamin You <benjamin.you@intel.com>
2 years agoUefiPayloadPkg: Add FlashDeviceLib
Guo Dong [Wed, 22 Sep 2021 21:32:30 +0000 (14:32 -0700)]
UefiPayloadPkg: Add FlashDeviceLib

This library provides FlashDeviceLib APIs based on
SpiFlashLib and consumed by FVB driver.

Signed-off-by: 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: Ray Ni <ray.ni@intel.com>
Reviewed-by: Benjamin You <benjamin.you@intel.com>
2 years agoUefiPayloadPkg: Add SpiFlashLib
Guo Dong [Wed, 22 Sep 2021 21:31:29 +0000 (14:31 -0700)]
UefiPayloadPkg: Add SpiFlashLib

This is a common SPI Flash library used for the Intel platform that
supports SPI hardware sequence. This library provides actual SPI flash
operation via Intel PCH SPI controller.

Signed-off-by: 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: Ray Ni <ray.ni@intel.com>
Reviewed-by: Benjamin You <benjamin.you@intel.com>
2 years agoUefiPayloadPkg: Add bootloader SMM support module
Guo Dong [Wed, 22 Sep 2021 21:27:21 +0000 (14:27 -0700)]
UefiPayloadPkg: Add bootloader SMM support module

This module is only used for SMM S3 support for the bootloader that
doesn't support SMM.
The payload would save SMM rebase info to SMM communication area in
normal boot and expect the bootloader in S3 path to rebase the SMM
and trigger SMI by writing 0xB2 port with the given value from SMM
communication area. The payload SMM handler would get chance to
restore some registers in S3 path.

Signed-off-by: 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: Ray Ni <ray.ni@intel.com>
Reviewed-by: Benjamin You <benjamin.you@intel.com>
2 years agoUefiPayloadPkg: Add a common SMM control Runtime DXE module
Guo Dong [Wed, 22 Sep 2021 21:22:42 +0000 (14:22 -0700)]
UefiPayloadPkg: Add a common SMM control Runtime DXE module

This module consumes SMM Registers HOB (SMI_GBL_EN and SMI_APM_EN) to
install SMM control 2 protocol gEfiSmmControl2ProtocolGuid.
The protocol activate() would set SMI_GBL_EN and SMI_APM_EN and trigger
SMI by writing to IO port 0xB3 and 0xB2.

Signed-off-by: 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: Ray Ni <ray.ni@intel.com>
Reviewed-by: Benjamin You <benjamin.you@intel.com>
2 years agoUefiPayloadPkg: Add a common SmmAccessDxe module
Guo Dong [Wed, 22 Sep 2021 21:16:41 +0000 (14:16 -0700)]
UefiPayloadPkg: Add a common SmmAccessDxe module

SmmAccessDxe module would consume EFI_SMRAM_HOB_DESCRIPTOR_BLOCK HOB to
produce SMM access protocol gEfiSmmAccess2ProtocolGuid (open, close, lock,
and GetCapabilities.)

Signed-off-by: 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: Ray Ni <ray.ni@intel.com>
Reviewed-by: Benjamin You <benjamin.you@intel.com>
2 years agoOvmfPkg: Enable TDX in ResetVector
Min Xu [Tue, 28 Sep 2021 02:55:59 +0000 (10:55 +0800)]
OvmfPkg: Enable TDX in ResetVector

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

Intel's Trust Domain Extensions (Intel TDX) refers to an Intel technology
that extends Virtual Machines Extensions (VMX) and Multi-Key Total Memory
Encryption (MKTME) with a new kind of virutal machines guest called a
Trust Domain (TD). A TD is desinged to run in a CPU mode that protects the
confidentiality of TD memory contents and the TD's CPU state from other
software, including the hosting Virtual-Machine Monitor (VMM), unless
explicitly shared by the TD itself.

Note: Intel TDX is only available on X64, so the Tdx related changes are
in X64 path. In IA32 path, there may be null stub to make the build
success.

This patch includes below major changes.

1. Ia32/IntelTdx.asm
IntelTdx.asm includes below routines used in ResetVector
 - IsTdx
   Check if the running system is Tdx guest.

 - InitTdxWorkarea
   It initialize the TDX_WORK_AREA. Because it is called by both BSP and
   APs and to avoid the race condition, only BSP can initialize the
   WORK_AREA. AP will wait until the field of TDX_WORK_AREA_PGTBL_READY
   is set.

 - ReloadFlat32
   After reset all CPUs in TDX are initialized to 32-bit protected mode.
   But GDT register is not set. So this routine loads the GDT then jump
   to Flat 32 protected mode again.

 - InitTdx
   This routine wrap above 3 routines together to do Tdx initialization
   in ResetVector phase.

 - IsTdxEnabled
   It is a OneTimeCall to probe if TDX is enabled by checking the
   CC_WORK_AREA.

 - CheckTdxFeaturesBeforeBuildPagetables
   This routine is called to check if it is Non-TDX guest, TDX-Bsp or
   TDX-APs. Because in TDX guest all the initialization is done by BSP
   (including the page tables). APs should not build the tables.

 - TdxPostBuildPageTables
   It is called after Page Tables are built by BSP.
   byte[TDX_WORK_AREA_PGTBL_READY] is set by BSP to indicate APs can
   leave spin and go.

2. Ia32/PageTables64.asm
As described above only the TDX BSP build the page tables. So
PageTables64.asm is updated to make sure only TDX BSP build the
PageTables. TDX APs will skip the page table building and set Cr3
directly.

3. Ia16/ResetVectorVtf0.asm
In Tdx all CPUs "reset" to run on 32-bit protected mode with flat
descriptor (paging disabled). But in Non-Td guest the initial state of
CPUs is 16-bit real mode. To resolve this conflict, BITS 16/32 is used
in the ResetVectorVtf0.asm. It checks the 32-bit protected mode or 16-bit
real mode, then jump to the corresponding entry point.

Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Brijesh Singh <brijesh.singh@amd.com>
Cc: Erdem Aktas <erdemaktas@google.com>
Cc: James Bottomley <jejb@linux.ibm.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Tom Lendacky <thomas.lendacky@amd.com>
Signed-off-by: Min Xu <min.m.xu@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
2 years agoOvmfPkg: Add IntelTdxMetadata.asm
Min Xu [Tue, 28 Sep 2021 02:47:29 +0000 (10:47 +0800)]
OvmfPkg: Add IntelTdxMetadata.asm

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

In TDX when host VMM creates a new guest TD, some initial set of
TD-private pages are added using the TDH.MEM.PAGE.ADD function. These
pages typically contain Virtual BIOS code and data along with some clear
pages for stacks and heap. In the meanwhile, some configuration data
need be measured by host VMM. Tdx Metadata is designed for this purpose
to indicate host VMM how to do the above tasks.

More detailed information of Metadata is in [TDVF] Section 11.

Tdx Metadata describes the information about the image for VMM use.
For example, the base address and length of the TdHob, Bfv, Cfv, etc.
The offset of the Metadata is stored in a GUID-ed structure which is
appended in the GUID-ed chain from a fixed GPA (0xffffffd0).

In this commit there are 2 new definitions of BFV & CFV.
Tdx Virtual Firmware (TDVF) includes one Firmware Volume (FV) known
as the Boot Firmware Volume (BFV). The FV format is defined in the
UEFI Platform Initialization (PI) spec. BFV includes all TDVF
components required during boot.

TDVF also include a configuration firmware volume (CFV) that is
separated from the BFV. The reason is because the CFV is measured in
RTMR, while the BFV is measured in MRTD.

In practice BFV is the code part of Ovmf image (OVMF_CODE.fd). CFV is
the vars part of Ovmf image (OVMF_VARS.fd).

Since AMD SEV has already defined some SEV specific memory region in
MEMFD. TDX re-uses some of the memory regions defined by SEV.
 - MailBox : PcdOvmfSecGhcbBackupBase|PcdOvmfSecGhcbBackupSize
 - TdHob   : PcdOvmfSecGhcbBase|PcdOvmfSecGhcbSize

[TDVF] https://software.intel.com/content/dam/develop/external/us/en/
documents/tdx-virtual-firmware-design-guide-rev-1.pdf

Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Brijesh Singh <brijesh.singh@amd.com>
Cc: Erdem Aktas <erdemaktas@google.com>
Cc: James Bottomley <jejb@linux.ibm.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Tom Lendacky <thomas.lendacky@amd.com>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Min Xu <min.m.xu@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
2 years agoOvmfPkg: Clear WORK_AREA_GUEST_TYPE in Main.asm
Min Xu [Mon, 27 Sep 2021 00:29:01 +0000 (08:29 +0800)]
OvmfPkg: Clear WORK_AREA_GUEST_TYPE in Main.asm

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

Previously WORK_AREA_GUEST_TYPE was cleared in SetCr3ForPageTables64.
This is workable for Legacy guest and SEV guest. But it doesn't work
after Intel TDX is introduced. It is because all TDX CPUs (BSP and APs)
start to run from 0xfffffff0, thus WORK_AREA_GUEST_TYPE will be cleared
multi-times if it is TDX guest. So the clearance of WORK_AREA_GUEST_TYPE
is moved to Main16 entry point in Main.asm.
Note: WORK_AREA_GUEST_TYPE is only defined for ARCH_X64.

For Intel TDX, its corresponding entry point is Main32 (which will be
introduced in next commit in this patch-set). WORK_AREA_GUEST_TYPE will
be cleared there.

Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Brijesh Singh <brijesh.singh@amd.com>
Cc: Erdem Aktas <erdemaktas@google.com>
Cc: James Bottomley <jejb@linux.ibm.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Tom Lendacky <thomas.lendacky@amd.com>
Signed-off-by: Min Xu <min.m.xu@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
2 years agoOvmfPkg: Copy Main.asm from UefiCpuPkg to OvmfPkg's ResetVector
Min Xu [Thu, 23 Sep 2021 03:09:00 +0000 (11:09 +0800)]
OvmfPkg: Copy Main.asm from UefiCpuPkg to OvmfPkg's ResetVector

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

Previously OvmfPkg/ResetVector uses the Main.asm in
UefiCpuPkg/ReseteVector/Vtf0. In this Main.asm there is only Main16
entry point.

This patch-set is to introduce Intel TDX into Ovmf. Main32 entry point
is needed in Main.asm by Intel TDX. To reduce the complexity of Main.asm
in UefiCpuPkg, OvmfPkg create its own Main.asm to meet the requirement
of Intel TDX. This Main.asm is an unmodified copy (so no functional
change) and the actual changes for tdx come as incremental patches.

UefiCpuPkg/ResetVector/Vtf0/main.asm -> OvmfPkg/ResetVector/Main.asm

Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Brijesh Singh <brijesh.singh@amd.com>
Cc: Erdem Aktas <erdemaktas@google.com>
Cc: James Bottomley <jejb@linux.ibm.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Tom Lendacky <thomas.lendacky@amd.com>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Min Xu <min.m.xu@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
2 years agoArmPkg: Implement PlatformBootManagerLib for LinuxBoot
Nhi Pham [Sat, 23 Oct 2021 07:32:41 +0000 (14:32 +0700)]
ArmPkg: Implement PlatformBootManagerLib for LinuxBoot

LinuxBoot is a firmware that replaces specific firmware functionality
like the UEFI DXE phase with a Linux kernel and runtime. It is built-in
UEFI image like an application, which is executed at the end of DXE
phase.

To achieve the LinuxBoot boot flow "SEC->PEI->DXE->BDS->LinuxBoot",
today we use the common well-known GUID of UEFI Shell for LinuxBoot
payload, so LinuxBoot developers can effortlessly find the UEFI Shell
Application and replace it with the LinuxBoot payload without
recompiling platform EDK2 (There might be an issue with a few systems
that don't have a UEFI Shell). Also, we have a hard requirement to force
the BDS to boot into the LinuxBoot as it is essentially required that
only the LinuxBoot boot option is permissible and UEFI is an
intermediate bootstrap phase. Considering all the above, it is
reasonable to just have a new GUID for LinuxBoot and require a LinuxBoot
specific BDS implementation. In addition, with making the BDS
implementation simpler, we can reduce many DXE drivers which we think it
is not necessary for LinuxBoot booting.

This patch adds a new PlatformBootManagerLib implementation which
registers only the gArmTokenSpaceGuid.PcdLinuxBootFileGuid for LinuxBoot
payload as an active boot option. It allows BDS to jump to the LinuxBoot
quickly by skipping the UiApp and UEFI Shell.

The PlatformBootManagerLib library derived from
ArmPkg/Library/PlatformBootManagerLib.

Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Signed-off-by: Nhi Pham <nhi@os.amperecomputing.com>
Acked-by: Ard Biesheuvel <ardb@kernel.org>
Acked-by: Samer El-Haj-Mahmoud <Samer.El-Haj-Mahmoud@arm.com>
Acked-by: Moritz Fischer <moritzf@google.com>
2 years agoNetworkPkg/HttpBootDxe: make file extension check case-insensitive
Lin, Gary (HPS OE-Linux) [Mon, 18 Oct 2021 07:21:43 +0000 (15:21 +0800)]
NetworkPkg/HttpBootDxe: make file extension check case-insensitive

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

HttpBootCheckImageType() was using the case-sensitive AsciiStrCmp() to
check the file extensions and this could reject the images with
upper-case file names. Using the case-insensitive AsciiStriCmp() to
avoid the issue.

Cc: Maciej Rabeda <maciej.rabeda@linux.intel.com>
Cc: Jiaxin Wu <jiaxin.wu@intel.com>
Cc: Siyuan Fu <siyuan.fu@intel.com>
Signed-off-by: Gary Lin <gary.lin@hpe.com>
Reviewed-by: Maciej Rabeda <maciej.rabeda@linux.intel.com>
2 years agoShellPkg: Parse I/O APIC and x2APIC structure
Abdul Lateef Attar [Tue, 24 Aug 2021 15:30:13 +0000 (23:30 +0800)]
ShellPkg: Parse I/O APIC and x2APIC structure

Parse and print the below interrupt structures
  - I/O APIC Structure
  - Interrupt Source Override Structure
  - Processor Local x2APIC Structure
  - Local x2APIC NMI Structure

Signed-off-by: Abdul Lateef Attar <AbdulLateef.Attar@amd.com>
Reviewed-by: Zhichao Gao <zhichao.gao@intel.com>
2 years agoUefiCpuPkg/CpuCacheInfoLib: Add QuickSort function on BaseLib
IanX Kuo [Sat, 16 Oct 2021 22:30:46 +0000 (06:30 +0800)]
UefiCpuPkg/CpuCacheInfoLib: Add QuickSort function on BaseLib

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

Remove MdeModulePkg dependency

Cc: Eric Dong <eric.dong@intel.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
Cc: Rahul Kumar <rahul1.kumar@intel.com>
Signed-off-by: IanX Kuo <ianx.kuo@intel.com>
2 years agoMdeModulePkg/SortLib: Add QuickSort function on BaseLib
IanX Kuo [Fri, 15 Oct 2021 22:52:31 +0000 (06:52 +0800)]
MdeModulePkg/SortLib: Add QuickSort function on BaseLib

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

Use QuickSort instead of QuickSortWorker

Cc: Ray Ni <ray.ni@intel.com>
Reviewed-by: Jian J Wang <jian.j.wang@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Signed-off-by: IanX Kuo <ianx.kuo@intel.com>
2 years agoDynamicTablesPkg: Fix void pointer arithmetic
Pierre Gondois [Thu, 14 Oct 2021 14:59:22 +0000 (15:59 +0100)]
DynamicTablesPkg: Fix void pointer arithmetic

Building the DynamicTablesPkg with the additional
-Wpointer-arith flag triggers the following error:
  "pointer of type ‘void *’ used in arithmetic
  [-Werror=pointer-arith]"

Cast the void pointer to fix the error.

Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com>
Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
2 years agoDynamicTablesPkg: Fix unitialized variable use
Moritz Fischer [Wed, 20 Oct 2021 05:21:18 +0000 (22:21 -0700)]
DynamicTablesPkg: Fix unitialized variable use

In the success case we should return EFI_SUCCESS rather than returning
a potentially unitialized value of Status.

Cc: Sami Mujawar <Sami.Mujawar@arm.com>
Cc: Alexei Fedorov <Alexei.Fedorov@arm.com>
Signed-off-by: Moritz Fischer <moritzf@google.com>
2 years agoUefiCpuPkg: Cpu feature data stored in memory may be migrated
Lou, Yun [Thu, 30 Sep 2021 06:26:24 +0000 (14:26 +0800)]
UefiCpuPkg: Cpu feature data stored in memory may be migrated

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

The memory allocated through "PeiAllocatePool" is located in HOB, and
in DXE phase, the HOB will be migrated to a different location.
After the migration, the data stored in the HOB stays the same, but the
address of pointer to the memory(such as the pointers in ACPI_CPU_DATA
structure) changes, which may cause "PiSmmCpuDxeSmm" driver can't find
the memory(the pointers in ACPI_CPU_DATA structure) that allocated in
"PeiRegisterCpuFeaturesLib", so use "PeiAllocatePages" to allocate
memory instead.

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>