]> git.proxmox.com Git - mirror_edk2.git/log
mirror_edk2.git
23 months agoCryptoPkg: Update process_files.pl to automatically add PCD config option
Yi Li [Tue, 10 May 2022 07:19:05 +0000 (15:19 +0800)]
CryptoPkg: Update process_files.pl to automatically add PCD config option

Recommend from Gerd:
(2) Keep the EC config option, but update process_files.pl to
  automatically add the PcdEcEnabled config option handling
  to the files it generates.

When remove 'no-ec' from openssl configure list, will automatically remove
'OPENSSL_NO_EC', 'OPENSSL_NO_ECDH', 'OPENSSL_NO_ECDSA', 'OPENSSL_NO_TLS1_3',
form header, and add '/ec/.', '/sm2/.' files to INF files.

Signed-off-by: Yi Li <yi1.li@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Xiaoyu Lu <xiaoyu1.lu@intel.com>
Cc: Guomin Jiang <guomin.jiang@intel.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
23 months agoCryptoPkg: Separate auto-generated openssl config and edk2 openssl config
Yi Li [Tue, 10 May 2022 07:19:04 +0000 (15:19 +0800)]
CryptoPkg: Separate auto-generated openssl config and edk2 openssl config

Move auto-generated openssl config to openssl/opensslconf_generated,
 And openssl/opensslconf.h will contain both edk2 conditional openssl
 feature and openssl/opensslconf_generated.
Will make two part more clear.
New conditional feture code in opensslconf.h will look like:

/* Autogenerated conditional openssl feature list starts here */
[.....]
/* Autogenerated conditional openssl feature list ends here */

Signed-off-by: Yi Li <yi1.li@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Xiaoyu Lu <xiaoyu1.lu@intel.com>
Cc: Guomin Jiang <guomin.jiang@intel.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
23 months agoCryptoPkg: Rename PCD about openssl EC configuration
Yi Li [Tue, 10 May 2022 07:19:03 +0000 (15:19 +0800)]
CryptoPkg: Rename PCD about openssl EC configuration

PcdOpensslXXXEnabled is a more appropriate choice.

Signed-off-by: Yi Li <yi1.li@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Xiaoyu Lu <xiaoyu1.lu@intel.com>
Cc: Guomin Jiang <guomin.jiang@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
23 months ago.pytool: Fix python command error in self introduction doc
Chao Li [Fri, 22 Apr 2022 07:44:27 +0000 (15:44 +0800)]
.pytool: Fix python command error in self introduction doc

Fix misspelling of word "Prerequisites".

In the step 5 of the Prerequisites section, the python command was missing
the "-r" option, what the command really meant was to install from the given
requirements file, so fix that.

Cc: sean.brogan@microsoft.com
Cc: Bret.Barkelew@microsoft.com
Cc: michael.d.kinney@intel.com
Cc: gaoliming@byosoft.com.cn
Signed-off-by: Chao Li <lichao@loongson.cn>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
23 months agoMdeModulePkg/PCD: Pcd initialize DXE have assert
Gua Guo [Thu, 5 May 2022 21:29:51 +0000 (05:29 +0800)]
MdeModulePkg/PCD: Pcd initialize DXE have assert

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

When PlatformPkg.dsc has multiple SKU IDs but didn't exist delta PCD,
System will hang on BuildPcdDxeDataBase.

Ideally, if didn't exist delta PCD by different SKU ID,
UpdatePcdDatabase () shouldn't return EFI_NOT_FOUND.

Signed-off-by: Gua Guo <gua.guo@intel.com>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
23 months agoPcAtChipsetPkg: Change the flow of PcRtcInit()
Chao, Zhuoran [Sat, 7 May 2022 09:39:37 +0000 (17:39 +0800)]
PcAtChipsetPkg: Change the flow of PcRtcInit()

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

The original flow of PcRtcInit() is like:
1. Guarantee atomic accesses to the RTC time registers and
   read out the value.
2. Program RTC register B. (adopt 12h mode or 24h mode. Current
   bios code sets RTC to 24h mode by default).
3. Then function ConvertRtcTimeToEfiTime converts the RTC time
   value to their 24h mode by checking the hour format bit
   (1:24h mode,0:12h mode).
And here lies the problem: Step3 will fail to adjust the value
if Step2 already sets RTC to 24h mode. The hour value in 12h mode
will not be converted to its 24h mode.
The solution is to program RTC register B a little later when all
the original RTC registers' value is retrieved, adjusted
and validated.

ConvertRtcTimeToEfiTime is modified to be more robust.

Reviewed-by: Ray Ni <ray.ni@intel.com>
Signed-off-by: Zhuoran Chao <zhuoran.chao@intel.com>
23 months agoUefiPayloadPkg: Fix the UPL build failure
Tan, Dun [Sat, 7 May 2022 03:57:32 +0000 (11:57 +0800)]
UefiPayloadPkg: Fix the UPL build failure

Add double quotes to LlvmObjcopyPath.
Blank space in LlvmObjcopyPath will cause build failure.
This build failure is introduced by 2306555bf908 (
"UefiPayloadPkg: Fix IA32 entry build failure").

Signed-off-by: Dun Tan <dun.tan@intel.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
Reviewed-by: Guo Dong <guo.dong@intel.com>
Cc: Benjamin You <benjamin.you@intel.com>
Cc: Sean Rhodes <sean@starlabs.systems>
23 months agoMdePkg: add SmmCpuRendezvousLib.h and SmmCpuRendezvousLibNull implement.
Li, Zhihao [Mon, 25 Apr 2022 08:47:27 +0000 (16:47 +0800)]
MdePkg: add SmmCpuRendezvousLib.h and SmmCpuRendezvousLibNull implement.

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

UefiCpuPkg define a new Protocol with the new services
SmmWaitForAllProcessor(), which can be used by SMI handler
to optionally wait for other APs to complete SMM rendezvous in
relaxed AP mode.

VariableSmm and VariableStandaloneMM driver in MdeModulePkg need
to use this services but MdeModulePkg can't depend on UefiCpuPkg.

Thus, the solution is moving SmmCpuRendezvouslib.h from UefiCpuPkg
to MdePkg and creating SmmCpuRendezvousLib NullLib version
implementation in MdePkg as dependency for the pkg that can't
depend on UefiCpuPkg.

Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Eric Dong <eric.dong@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Michael Kubacki <mikuback@linux.microsoft.com>
Cc: Siyuan Fu <siyuan.fu@intel.com>
Signed-off-by: Zhihao Li <zhihao.li@intel.com>
Acked-by: Liming Gao <gaoliming@byosoft.com.cn>
23 months agoOvmfPkg: Add README for TDVF
Min Xu [Wed, 4 May 2022 00:13:50 +0000 (08:13 +0800)]
OvmfPkg: Add README for TDVF

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

Add README for TDVF.

Cc: Brijesh Singh <brijesh.singh@amd.com>
Cc: Erdem Aktas <erdemaktas@google.com>
Cc: Gerd Hoffmann <kraxel@redhat.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>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
23 months agoUefiPayloadPkg: Add CpuLib to module INFs that depend on UefiCpuLib.
Yu Pu [Mon, 28 Mar 2022 15:33:22 +0000 (23:33 +0800)]
UefiPayloadPkg: Add CpuLib to module INFs that depend on UefiCpuLib.

There are two libraries: MdePkg/CpuLib and UefiCpuPkg/UefiCpuLib and
UefiCpuPkg/UefiCpuLib will be merged to MdePkg/CpuLib. To avoid build
failure, add CpuLib dependency to all modules that depend on UefiCpuLib.

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 Rhodes <sean@starlabs.systems>
Signed-off-by: Yu Pu <yu.pu@intel.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
23 months agoUefiCpuPkg: Add CpuLib to module INFs that depend on UefiCpuLib.
Yu Pu [Mon, 28 Mar 2022 15:29:18 +0000 (23:29 +0800)]
UefiCpuPkg: Add CpuLib to module INFs that depend on UefiCpuLib.

There are two libraries: MdePkg/CpuLib and UefiCpuPkg/UefiCpuLib and
UefiCpuPkg/UefiCpuLib will be merged to MdePkg/CpuLib. To avoid build
failure, add CpuLib dependency to all modules that depend on UefiCpuLib.

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>
23 months agoOvmfPkg: Add CpuLib to module INFs that depend on UefiCpuLib.
Yu Pu [Mon, 28 Mar 2022 15:16:27 +0000 (23:16 +0800)]
OvmfPkg: Add CpuLib to module INFs that depend on UefiCpuLib.

There are two libraries: MdePkg/CpuLib and UefiCpuPkg/UefiCpuLib and
UefiCpuPkg/UefiCpuLib will be merged to MdePkg/CpuLib. To avoid build
failure, add CpuLib dependency to all modules that depend on UefiCpuLib.

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: Yu Pu <yu.pu@intel.com>
Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>
23 months agoIntelFsp2WrapperPkg: Add CpuLib to module INFs that depend on UefiCpuLib.
Yu Pu [Mon, 28 Mar 2022 15:05:57 +0000 (23:05 +0800)]
IntelFsp2WrapperPkg: Add CpuLib to module INFs that depend on UefiCpuLib.

There are two libraries: MdePkg/CpuLib and UefiCpuPkg/UefiCpuLib and
UefiCpuPkg/UefiCpuLib will be merged to MdePkg/CpuLib. To avoid build
failure, add CpuLib dependency to all modules that depend on UefiCpuLib.

Cc: Chasel Chiu <chasel.chiu@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Signed-off-by: Yu Pu <yu.pu@intel.com>
Reviewed-by: Chasel Chiu <chasel.chiu@intel.com>
23 months agoIntelFsp2Pkg: Add CpuLib to module INFs that depend on UefiCpuLib
Yu Pu [Mon, 28 Mar 2022 14:44:47 +0000 (22:44 +0800)]
IntelFsp2Pkg: Add CpuLib to module INFs that depend on UefiCpuLib

There are two libraries: MdePkg/CpuLib and UefiCpuPkg/UefiCpuLib and
UefiCpuPkg/UefiCpuLib will be merged to MdePkg/CpuLib. To avoid build
failure, add CpuLib dependency to all modules that depend on UefiCpuLib.

Cc: Chasel Chiu <chasel.chiu@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Signed-off-by: Yu Pu <yu.pu@intel.com>
Reviewed-by: Chasel Chiu <chasel.chiu@intel.com>
23 months agoMdePkg: Add CpuLib to module INFs that depend on UefiCpuLib.
Yu Pu [Mon, 28 Mar 2022 15:12:08 +0000 (23:12 +0800)]
MdePkg: Add CpuLib to module INFs that depend on UefiCpuLib.

There are two libraries: MdePkg/CpuLib and UefiCpuPkg/UefiCpuLib and
UefiCpuPkg/UefiCpuLib will be merged to MdePkg/CpuLib. To avoid build
failure, add CpuLib dependency to all modules that depend on UefiCpuLib.

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: Yu Pu <yu.pu@intel.com>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
23 months agoUefiPayloadPkg: Add definition for PayloadCommandLine HOB
duntan [Thu, 28 Apr 2022 06:45:47 +0000 (14:45 +0800)]
UefiPayloadPkg: Add definition for PayloadCommandLine HOB

Add definition for UNIVERSAL_PAYLOAD_COMMAND_LINE Hob.
This Hob is used to pass command Line to Payload.

Signed-off-by: Dun Tan <dun.tan@intel.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
Reviewed-by: Guo Dong <guo.dong@intel.com>
Cc: Benjamin You <benjamin.you@intel.com>
Cc: Sean Rhodes <sean@starlabs.systems>
Cc: Zhiguang Liu <zhiguang.liu@intel.com>
23 months agoBaseTools: Add FMMT Python Tool
Chen, Christine [Thu, 28 Apr 2022 12:49:37 +0000 (20:49 +0800)]
BaseTools: Add FMMT Python Tool

The FMMT python tool is used for firmware files operation, which has
the Fv/FFs-based 'View'&'Add'&'Delete'&'Replace' operation function:

1.Parse a FD(Firmware Device) / FV(Firmware Volume) / FFS(Firmware Files)
2.Add a new FFS into a FV file (both included in a FD file or not)
3.Replace an FFS in a FV file with a new FFS file
4.Delete an FFS in a FV file (both included in a FD file or not)
5.Extract the FFS from a FV file (both included in a FD file or not)

This version of FMMT Python tool does not support PEIM rebase feature,
this feature will be added in future update.

Currently the FMMT C tool is saved in edk2-staging repo, but its
quality and coding style can't meet the Edk2 quality, which is hard to
maintain (Hard/Duplicate Code; Regression bugs; Restrict usage).

The new Python version keeps same functions with origin C version. It
has higher quality and better coding style, and it is much easier to
extend new functions and to maintain.

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1847
Link: https://edk2.groups.io/g/devel/message/82877
Link: https://github.com/tianocore/edk2-staging/tree/PyFMMT
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: Bob Feng <bob.c.feng@intel.com>
Acked-by: Liming Gao <gaoliming@byosoft.com.cn>
23 months agoArmPlatformPkg: Fix EDK2_DSC check in Scripts/Makefile
Rebecca Cran [Mon, 11 Apr 2022 01:16:59 +0000 (19:16 -0600)]
ArmPlatformPkg: Fix EDK2_DSC check in Scripts/Makefile

With GNU Make 4.2.1, ifeq ($(EDK2_DSC),"") doesn't catch the case where
EDK2_DSC isn't defined. So, switch to using ifndef.

Signed-off-by: Rebecca Cran <rebecca@bsdio.com>
Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
23 months agoArmPlatformPkg: Fix target initialisation in cmd_load_symbols.py
Rebecca Cran [Mon, 11 Apr 2022 01:16:58 +0000 (19:16 -0600)]
ArmPlatformPkg: Fix target initialisation in cmd_load_symbols.py

The debugger in Arm Development Studio 2021.2 doesn't work with
"ec = debugger.getExecutionContext(0)" because it's subsequently unable
to access memory. Fix it by switching to
"ec = debugger.getCurrentExecutionContext()".

The documentation for waitForStop() says:

"It is not needed after a call to stop() because stop() is blocking."

So, remove the call to waitForStop.

Signed-off-by: Rebecca Cran <rebecca@bsdio.com>
Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
23 months agoArmPlatformPkg: Fix error message in Scripts/Ds5/edk2_debugger.py
Rebecca Cran [Mon, 11 Apr 2022 01:16:57 +0000 (19:16 -0600)]
ArmPlatformPkg: Fix error message in Scripts/Ds5/edk2_debugger.py

An error message in Scripts/Ds5/edk2_debugger.py was missing the word
'not'.

Signed-off-by: Rebecca Cran <rebecca@bsdio.com>
Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
2 years agoOvmfPkg/Bhyve: add support for QemuFwCfg
Corvin Köhne [Wed, 13 Oct 2021 09:19:36 +0000 (11:19 +0200)]
OvmfPkg/Bhyve: add support for QemuFwCfg

QemuFwCfg is much more powerful than BhyveFwCtl. Sadly, BhyveFwCtl
decided to use the same IO ports as QemuFwCfg. It's not possible to use
both interfaces simultaneously. So, prefer QemuFwCfg over BhyveFwCtl.

Signed-off-by: Corvin Köhne <c.koehne@beckhoff.com>
Reviewed-by: Rebecca Cran <rebecca@bsdio.com>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Acked-by: Peter Grehan <grehan@freebsd.org>
Acked-by: Jiewen Yao <jiewen.yao@intel.com>
2 years agoOvmfPkg: restore CompatImageLoaderDxe chunk
Gerd Hoffmann [Fri, 8 Apr 2022 08:22:44 +0000 (10:22 +0200)]
OvmfPkg: restore CompatImageLoaderDxe chunk

Was dropped by accident.

Fixes: b47575801e19 ("OvmfPkg: move tcg configuration to dsc and fdf include files")
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2 years agoBaseTools/Conf: Fix Dynamic-Library-File template
Jake Garver via groups.io [Thu, 7 Apr 2022 17:04:20 +0000 (01:04 +0800)]
BaseTools/Conf: Fix Dynamic-Library-File template

In the Dynamic-Library-File template, add missing output file
declarations.  These files are generated by the template and other rules
explicitly depend on them.

This change resolves missing dependency issues we encountered while
running a recursive make with job control.

Signed-off-by: Jake Garver <jake@nvidia.com>
Reviewed-by: Bob Feng <bob.c.feng@intel.com>
2 years agoOvmfPkg/VirtioGpuDxe: query native display resolution from host
Gerd Hoffmann [Fri, 8 Apr 2022 08:23:33 +0000 (10:23 +0200)]
OvmfPkg/VirtioGpuDxe: query native display resolution from host

Try query native display resolution from the host.  When successful,
setup PcdVideoHorizontalResolution and PcdVideoVerticalResolution
accordingly and add the video mode to the GOP mode list if needed.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
2 years agoOvmfPkg/VirtioGpuDxe: move code to GopInitialize
Gerd Hoffmann [Fri, 8 Apr 2022 08:23:32 +0000 (10:23 +0200)]
OvmfPkg/VirtioGpuDxe: move code to GopInitialize

Add new function to initialize the GOP, move over setup code.  Handle
initialization first, specifically before calling GopQueryMode(), so
GopQueryMode is never called before GopInitialize() did complete.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
2 years agoOvmfPkg/VirtioGpuDxe: use GopQueryMode in GopSetMode
Gerd Hoffmann [Fri, 8 Apr 2022 08:23:31 +0000 (10:23 +0200)]
OvmfPkg/VirtioGpuDxe: use GopQueryMode in GopSetMode

Call GopQueryMode() in GopSetMode(), use the ModeInfo returned when
setting the mode.  This is needed to properly handle modes which are
not on the static mGopResolutions list.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
2 years agoOvmfPkg/VirtioGpuDxe: add VirtioGpuGetDisplayInfo
Gerd Hoffmann [Fri, 8 Apr 2022 08:23:30 +0000 (10:23 +0200)]
OvmfPkg/VirtioGpuDxe: add VirtioGpuGetDisplayInfo

Add support for sending a GetDisplayInfo command.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
2 years agoOvmfPkg/VirtioGpuDxe: add GetDisplayInfo to virtio-gpu spec header.
Gerd Hoffmann [Fri, 8 Apr 2022 08:23:29 +0000 (10:23 +0200)]
OvmfPkg/VirtioGpuDxe: add GetDisplayInfo to virtio-gpu spec header.

Add GetDisplayInfo command, reply and data struct to the
virtio-gpu specification header file.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
2 years agoOvmfPkg/VirtioGpuDxe: add VirtioGpuSendCommandWithReply
Gerd Hoffmann [Fri, 8 Apr 2022 08:23:28 +0000 (10:23 +0200)]
OvmfPkg/VirtioGpuDxe: add VirtioGpuSendCommandWithReply

Extend VirtioGpuSendCommand() to support commands which return data,
rename the function to VirtioGpuSendCommandWithReply() to indicate that.

Add a new VirtioGpuSendCommand() function which is just a thin wrapper
around VirtioGpuSendCommandWithReply() so existing code continues to
work without changes.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
2 years agoShellPkg: Update smbiosview type 0 with SMBIOS 3.5 fields
Bo Chang Ke [Mon, 25 Apr 2022 06:30:08 +0000 (14:30 +0800)]
ShellPkg: Update smbiosview type 0 with SMBIOS 3.5 fields

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

update smbiosview type 0 related fileds.

Signed-off-by: Bo Chang Ke <bo-changx.ke@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 agoArmVirtPkg: clear PcdConOut{Row,Column}
Gerd Hoffmann [Fri, 22 Apr 2022 12:41:20 +0000 (14:41 +0200)]
ArmVirtPkg: clear PcdConOut{Row,Column}

ConSplitterDxe will pick the highest available resolution then,
thereby making better use of the available display space.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
2 years agoOvmfPkg: clear PcdConOut{Row,Column}
Gerd Hoffmann [Fri, 22 Apr 2022 12:41:19 +0000 (14:41 +0200)]
OvmfPkg: clear PcdConOut{Row,Column}

ConSplitterDxe will pick the highest available resolution then,
thereby making better use of the available display space.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
2 years agoMdeModulePkg/GraphicsConsoleDxe: add modes
Gerd Hoffmann [Fri, 22 Apr 2022 12:41:18 +0000 (14:41 +0200)]
MdeModulePkg/GraphicsConsoleDxe: add modes

Add modes for a few common display resolutions higher than 800x600,
specifically 1024x768, 1280x800 and 1920x1080, so ConSplitterDxe has
more options available.

The mode list is not use as-is, InitializeGraphicsConsoleTextMode() will
check the list and filter out any modes which don't fit to the screen,
so this will also work fine for small displays.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
2 years ago.pytool/Plugin/UncrustifyCheck: Add Azure DevOps UI debug instructions
Michael Kubacki [Wed, 20 Apr 2022 01:13:18 +0000 (21:13 -0400)]
.pytool/Plugin/UncrustifyCheck: Add Azure DevOps UI debug instructions

Adds a link to the log output that contains instructions on how find
detailed file formatting errors in the Azure DevOps UI.

Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Sean Brogan <sean.brogan@microsoft.com>
Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
Reviewed-by: Sean Brogan <sean.brogan@microsoft.com>
2 years ago.azurepipelines: Add NOOPT to all package builds
Michael Kubacki [Wed, 20 Apr 2022 00:12:56 +0000 (20:12 -0400)]
.azurepipelines: Add NOOPT to all package builds

The NOOPT build target is used for host-based unit tests. This
change adds the NOOPT target for all packages to ensure that tests
are executed if present.

If the host-based DSC is not specified in the packages CI YAML file,
the host-based compiler plugin will be reported as a skipped test.

Cc: Sean Brogan <sean.brogan@microsoft.com>
Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
Reviewed-by: Sean Brogan <sean.brogan@microsoft.com>
2 years agoBaseTools: Move gPlatformFinalPcd to Datapipe and optimize size
Li, Yi1 [Mon, 18 Apr 2022 08:15:21 +0000 (16:15 +0800)]
BaseTools: Move gPlatformFinalPcd to Datapipe and optimize size

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

This is a bugfix of
bf9230a9f3dde065c3c8b4175ccd32e44e8f0362.

1.In the current code, gPlatformFinalPcd will save all PCDs used at
whole compile process, which wastes runtime memory and is unnecessary.

This patch makes gPlatformFinalPcd save only the PCDes which are
assigned in the DSC file, and the PCD that has not been assigned will
use the default value in DEC.

2.During the compilation process, gPlatformFinalPcd may be lost, and
the current code cannot selectively assign PCD in DSC by specifying ARCH.

This patch moves gPlatformFinalPcd into datapipe and modifies the
assignment logicto fix this.

Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Signed-off-by: yi1 li <yi1.li@intel.com>
Reviewed-by: Bob Feng <bob.c.feng@intel.com>
2 years agoUefiPayloadPkg: Fix IA32 entry build failure
Tan, Dun [Tue, 19 Apr 2022 00:51:10 +0000 (17:51 -0700)]
UefiPayloadPkg: Fix IA32 entry build failure

The ObjCopyFlag and EntryOutputDir need to be modified when
building IA32 UniversalPayload Entry

Signed-off-by: Dun Tan <dun.tan@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Guo Dong <guo.dong@intel.com>
Cc: Benjamin You <benjamin.you@intel.com>
Cc: Zhiguang Liu <zhiguang.liu@intel.com>
Reviewed-by: Guo Dong <guo.dong@intel.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
2 years agoShellPkg: Update smbiosview type 9 with SMBIOS 3.5 fields
Bo Chang Ke [Thu, 21 Apr 2022 10:54:46 +0000 (18:54 +0800)]
ShellPkg: Update smbiosview type 9 with SMBIOS 3.5 fields

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

update smbiosview type 9 related fileds.

Signed-off-by: Bo Chang Ke <bo-changx.ke@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Zhichao Gao <zhichao.gao@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Zhichao Gao <zhichao.gao@intel.com>
2 years agoMdePkg: Update smbiosview type 9 with SMBIOS 3.5 fields
Bo Chang Ke [Thu, 21 Apr 2022 10:54:45 +0000 (18:54 +0800)]
MdePkg: Update smbiosview type 9 with SMBIOS 3.5 fields

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

update smbiosview type 9 related fileds.

Signed-off-by: Bo Chang Ke <bo-changx.ke@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Zhiguang Liu <zhiguang.liu@intel.com>
Cc: Zhichao Gao <zhichao.gao@intel.com>
Cc: Dandan Bi <dandan.bi@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
2 years agoCryptoPkg: Declare PcdEcEnabled in Library consuming OpensslLib
Yi Li [Tue, 19 Apr 2022 14:37:38 +0000 (22:37 +0800)]
CryptoPkg: Declare PcdEcEnabled in Library consuming OpensslLib

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

Tls/Base/Pei/Smm/RuntimeCryptLib.inf will use OpensslLib,
and the opensslconf.h in openssllib will use PcdEcEnabled,
but it is not declared in the inf file now,
it will cause warnings in some compilers.

Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Jian J Wang <jian.j.wang@intel.com>
Signed-off-by: Yi Li <yi1.li@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
2 years agoOvmfPkg/OvmfPkgX64: Adjust load sequence of TdxDxe and AmdSevDxe driver
Min Xu [Thu, 21 Apr 2022 00:45:29 +0000 (08:45 +0800)]
OvmfPkg/OvmfPkgX64: Adjust load sequence of TdxDxe and AmdSevDxe driver

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

TdxDxe driver is introduced for Intel TDX feature. Unfortunately, this
driver also breaks boot process in SEV-ES guest. The root cause is in
the PciLib which is imported by TdxDxe driver.

In a SEV-ES guest the AmdSevDxe driver performs a
MemEncryptSevClearMmioPageEncMask() call against the
PcdPciExpressBaseAddress range to mark it shared/unencrypted. However,
the TdxDxe driver is loaded before the AmdSevDxe driver, and the PciLib
in TdxDxe is DxePciLibI440FxQ35 which will access the
PcdPciExpressBaseAddress range. Since the range has not been marked
shared/unencrypted, the #VC handler terminates the guest for trying to
do MMIO to an encrypted region.

Adjusting the load sequence of TdxDxe and AmdSevDxe can fix the issue.

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>
SEV-Tested-by: Tom Lendacky <thomas.lendacky@amd.com>
TDX-Tested-by: Min Xu <min.m.xu@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
Signed-off-by: Min Xu <min.m.xu@intel.com>
2 years agoPrmPkg/DxePrmContextBufferLib: Fix unit test GCC compilation errors
Michael Kubacki [Tue, 12 Apr 2022 19:05:09 +0000 (15:05 -0400)]
PrmPkg/DxePrmContextBufferLib: Fix unit test GCC compilation errors

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

Fixes GCC compilation errors in DxePrmContextBufferLibUnitTest.c.

Cc: Michael Kubacki <mikuback@linux.microsoft.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Ankit Sinha <ankit.sinha@intel.com>
Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
Reviewed-by: Ankit Sinha <ankit.sinha@intel.com>
2 years agoCryptoPkg/Crt: fix strcpy build on older VS compilers
Gerd Hoffmann [Wed, 20 Apr 2022 06:16:56 +0000 (14:16 +0800)]
CryptoPkg/Crt: fix strcpy build on older VS compilers

Drop 'restrict' keyword which older visual studio compiler
versions complain about.

Fixes: fab6285a73c4 ("CryptoPkg/CrtLibSupport: fix strcpy")
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
2 years agoOvmfPkg: Call CcProbe in SecMain.c instead of TsIsEnabled
Min Xu [Tue, 19 Apr 2022 00:26:28 +0000 (08:26 +0800)]
OvmfPkg: Call CcProbe in SecMain.c instead of TsIsEnabled

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

TdIsEnabled() uses the CPUID instruction. At this point, exception
handling is not established and a CPUID instruction will generate
a #VC and cause the booting guest to crash.

CcProbe() checks Ovmf work area to return the guest type. So call
of CcProbe() instead of TdIsEnabled() to fix the above issue.

Cc: James Bottomley <jejb@linux.ibm.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Brijesh Singh <brijesh.singh@amd.com>
Cc: Erdem Aktas <erdemaktas@google.com>
Cc: Tom Lendacky <thomas.lendacky@amd.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: Tom Lendacky <thomas.lendacky@amd.com>
Signed-off-by: Min Xu <min.m.xu@intel.com>
2 years agoMdePkg: Probe Cc guest in BaseIoLibIntrinsicSev
Min Xu [Tue, 19 Apr 2022 00:26:27 +0000 (08:26 +0800)]
MdePkg: Probe Cc guest in BaseIoLibIntrinsicSev

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

Bad IO performance in SEC phase is observed after TDX features was
introduced. (after commit b6b2de884864 - "MdePkg: Support mmio for
Tdx guest in BaseIoLibIntrinsic").

This is because IsTdxGuest() will be called in each MMIO operation.
It is trying to cache the result of the probe in the efi data segment.
However, that doesn't work in SEC, because the data segment is read only
(so the write seems to succeed but a read will always return the
original value), leading to us calling TdIsEnabled() check for every
mmio we do, which is causing the slowdown because it's very expensive.

This patch is to call CcProbe instead of TdIsEnabled in IsTdxGuest.
Null instance of CcProbe always returns CCGuestTypeNonEncrypted. Its
OvmfPkg version returns the guest type in Ovmf work area.

Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Zhiguang Liu <zhiguang.liu@intel.com>
Cc: James Bottomley <jejb@linux.ibm.com>
Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: Tom Lendacky <thomas.lendacky@amd.com>
Signed-off-by: Min Xu <min.m.xu@intel.com>
2 years agoOvmfPkg: Add CcProbeLib in *.dsc
Min Xu [Tue, 19 Apr 2022 00:26:26 +0000 (08:26 +0800)]
OvmfPkg: Add CcProbeLib in *.dsc

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

CcProbeLib is imported in BaseIoLibIntrinsicSev.
OvmfPkg/Library/CcProbeLib is the OvmfPkg version which checks
OvmfWorkArea to return the Cc guest type. It is included
in OvmfPkgX64.dsc and IntelTdx/IntelTdxX64.dsc.

Other .dsc include the MdePkg/Library/CcProbeLibNull because Cc guest
is not supported in those projects.

Cc: James Bottomley <jejb@linux.ibm.com>
Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Brijesh Singh <brijesh.singh@amd.com>
Cc: Erdem Aktas <erdemaktas@google.com>
Cc: Tom Lendacky <thomas.lendacky@amd.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: Tom Lendacky <thomas.lendacky@amd.com>
Signed-off-by: Min Xu <min.m.xu@intel.com>
2 years agoOvmfPkg: Add CcProbeLib
Min Xu [Tue, 19 Apr 2022 00:26:25 +0000 (08:26 +0800)]
OvmfPkg: Add CcProbeLib

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

This is the OvmfPkg specific CcProbeLib. It checks the Ovmf WorkArea
(PcdOvmfWorkAreaBase) to return the guest type.

Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Zhiguang Liu <zhiguang.liu@intel.com>
Cc: James Bottomley <jejb@linux.ibm.com>
Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Brijesh Singh <brijesh.singh@amd.com>
Cc: Erdem Aktas <erdemaktas@google.com>
Cc: Tom Lendacky <thomas.lendacky@amd.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: Tom Lendacky <thomas.lendacky@amd.com>
Signed-off-by: Min Xu <min.m.xu@intel.com>
2 years agoMdePkg: Add CcProbeLibNull
Min Xu [Tue, 19 Apr 2022 00:26:24 +0000 (08:26 +0800)]
MdePkg: Add CcProbeLibNull

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

CcProbeLib is used to probe the Confidential Computing guest type.
This library is designed to run on SEC / PEI / DXE phases. A null
instance of the library always returns CCGuestTypeNonEncrypted.
A platform specific CcProbeLib will be implemented, for example,
in OvmfPkg.

Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Zhiguang Liu <zhiguang.liu@intel.com>
Cc: James Bottomley <jejb@linux.ibm.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: Tom Lendacky <thomas.lendacky@amd.com>
Signed-off-by: Min Xu <min.m.xu@intel.com>
2 years agoOvmfPkg: Replace GUEST_TYPE with CC_GUEST_TYPE
Min Xu [Tue, 19 Apr 2022 00:26:23 +0000 (08:26 +0800)]
OvmfPkg: Replace GUEST_TYPE with CC_GUEST_TYPE

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

Replace GUEST_TYPE with CC_GUEST_TYPE which is defined in
MdePkg/Include/ConfidentialComputingGuestAttr.h.

Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Zhiguang Liu <zhiguang.liu@intel.com>
Cc: James Bottomley <jejb@linux.ibm.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Brijesh Singh <brijesh.singh@amd.com>
Cc: Erdem Aktas <erdemaktas@google.com>
Cc: Tom Lendacky <thomas.lendacky@amd.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: Tom Lendacky <thomas.lendacky@amd.com>
Signed-off-by: Min Xu <min.m.xu@intel.com>
2 years agoMdePkg: Add CC_GUEST_TYPE in ConfidentialComputingGuestAttr.h
Min Xu [Tue, 19 Apr 2022 00:26:22 +0000 (08:26 +0800)]
MdePkg: Add CC_GUEST_TYPE in ConfidentialComputingGuestAttr.h

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

The confidential computing guest type (GUEST_TYPE) was defined in
OvmfPkg/Include/WorkArea.h. Now it is to be moved to
MdePkg/Include/ConfidentialComputingGuestAttr.h and renamed as
CC_GUEST_TYPE.

There are 2 reasons for this change.
1. CC_GUEST_TYPE is a generic definition and will be used in CcProbeLib
   which is defined in MdePkg.
2. Based on the latest edk2 coding style:
 - First character should be upper case
 - Must contain lower case characters
 - No white space characters
 - Global variable name must start with a 'g'

As the first step CC_GUEST_TYPE is defined in this patch. In the
next patch GUEST_TYPE will be deleted. This is to make sure the
bisect work correctly.

Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Zhiguang Liu <zhiguang.liu@intel.com>
Cc: James Bottomley <jejb@linux.ibm.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Brijesh Singh <brijesh.singh@amd.com>
Cc: Erdem Aktas <erdemaktas@google.com>
Cc: Tom Lendacky <thomas.lendacky@amd.com>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: Tom Lendacky <thomas.lendacky@amd.com>
Signed-off-by: Min Xu <min.m.xu@intel.com>
2 years agoIntelFsp2WrapperPkg: SecFspWrapperPlatformSecLibSample support for X64
Ted Kuo [Fri, 15 Apr 2022 08:37:43 +0000 (01:37 -0700)]
IntelFsp2WrapperPkg: SecFspWrapperPlatformSecLibSample support for X64

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3893
1.Added SecFspWrapperPlatformSecLibSample support for X64.
2.Adopted FSPT_ARCH2_UPD in SecFspWrapperPlatformSecLibSample.
3.Moved Fsp.h up one level to be shared across IA32 and X64.

Cc: Chasel Chiu <chasel.chiu@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Ashraf Ali S <ashraf.ali.s@intel.com>
Signed-off-by: Ted Kuo <ted.kuo@intel.com>
Reviewed-by: Chasel Chiu <chasel.chiu@intel.com>
Reviewed-by: Nate DeSimone <nathaniel.l.desimone@intel.com>
2 years agoIntelFsp2WrapperPkg: BaseFspWrapperApiLib support for X64
Ted Kuo [Fri, 15 Apr 2022 08:37:42 +0000 (01:37 -0700)]
IntelFsp2WrapperPkg: BaseFspWrapperApiLib support for X64

REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3893
Add Execute64BitCode to execute 64bit code from long mode directly
in PEI 64bit.

Cc: Chasel Chiu <chasel.chiu@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Ashraf Ali S <ashraf.ali.s@intel.com>
Signed-off-by: Ted Kuo <ted.kuo@intel.com>
Reviewed-by: Chasel Chiu <chasel.chiu@intel.com>
Reviewed-by: Nate DeSimone <nathaniel.l.desimone@intel.com>
2 years agoIntelFsp2WrapperPkg: Adopt FSPM_UPD_COMMON_FSP24 for X64
Ted Kuo [Fri, 15 Apr 2022 08:37:41 +0000 (01:37 -0700)]
IntelFsp2WrapperPkg: Adopt FSPM_UPD_COMMON_FSP24 for X64

REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3893
Adopt FSPM_UPD_COMMON_FSP24 in FspmWrapperPeim to support X64.

Cc: Chasel Chiu <chasel.chiu@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Ashraf Ali S <ashraf.ali.s@intel.com>
Signed-off-by: Ted Kuo <ted.kuo@intel.com>
Reviewed-by: Chasel Chiu <chasel.chiu@intel.com>
Reviewed-by: Nate DeSimone <nathaniel.l.desimone@intel.com>
2 years agoIntelFsp2Pkg: SecFspSecPlatformLibNull support for X64
Ted Kuo [Fri, 15 Apr 2022 08:37:40 +0000 (01:37 -0700)]
IntelFsp2Pkg: SecFspSecPlatformLibNull support for X64

REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3893
1.Added SecFspSecPlatformLibNull support for X64.
2.Added X64 support to IntelFsp2Pkg.dsc.

Cc: Chasel Chiu <chasel.chiu@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Ashraf Ali S <ashraf.ali.s@intel.com>
Signed-off-by: Ted Kuo <ted.kuo@intel.com>
Reviewed-by: Chasel Chiu <chasel.chiu@intel.com>
Reviewed-by: Nate DeSimone <nathaniel.l.desimone@intel.com>
2 years agoIntelFsp2Pkg: FspSecCore support for X64
Ted Kuo [Fri, 15 Apr 2022 08:37:39 +0000 (01:37 -0700)]
IntelFsp2Pkg: FspSecCore support for X64

REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3893
1.Added FspSecCore support for X64.
2.Bumped FSP header revision to 7 to indicate FSP 64bit is supported.
3.Corrected few typos.

Cc: Chasel Chiu <chasel.chiu@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Ashraf Ali S <ashraf.ali.s@intel.com>
Signed-off-by: Ted Kuo <ted.kuo@intel.com>
Reviewed-by: Chasel Chiu <chasel.chiu@intel.com>
Reviewed-by: Nate DeSimone <nathaniel.l.desimone@intel.com>
2 years agoIntelFsp2Pkg: Update FSP_GLOBAL_DATA and FSP_PLAT_DATA for X64
Ted Kuo [Fri, 15 Apr 2022 08:37:38 +0000 (01:37 -0700)]
IntelFsp2Pkg: Update FSP_GLOBAL_DATA and FSP_PLAT_DATA for X64

REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3893
Updated FSP_GLOBAL_DATA and FSP_PLAT_DATA structures to support
both IA32 and X64.

Cc: Chasel Chiu <chasel.chiu@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Ashraf Ali S <ashraf.ali.s@intel.com>
Signed-off-by: Ted Kuo <ted.kuo@intel.com>
Reviewed-by: Chasel Chiu <chasel.chiu@intel.com>
Reviewed-by: Nate DeSimone <nathaniel.l.desimone@intel.com>
2 years agoIntelFsp2Pkg: Add FSPx_ARCH2_UPD support for X64
Ted Kuo [Fri, 15 Apr 2022 08:37:37 +0000 (01:37 -0700)]
IntelFsp2Pkg: Add FSPx_ARCH2_UPD support for X64

REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3893
1.Added FSPx_ARCH2_UPD structures which support both IA32 and X64.
2.Added FSPx_UPD_COMMON_FSP24 structures.

Cc: Chasel Chiu <chasel.chiu@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Ashraf Ali S <ashraf.ali.s@intel.com>
Signed-off-by: Ted Kuo <ted.kuo@intel.com>
Reviewed-by: Chasel Chiu <chasel.chiu@intel.com>
Reviewed-by: Nate DeSimone <nathaniel.l.desimone@intel.com>
2 years agoIntelFsp2Pkg: X64 compatible changes to support PEI in 64bit
Ted Kuo [Fri, 15 Apr 2022 08:37:36 +0000 (01:37 -0700)]
IntelFsp2Pkg: X64 compatible changes to support PEI in 64bit

REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3893
1.Added EFIAPI to FspNotifyPhasePeimEntryPoint, SwapStack and
  PEI_CORE_ENTRY.
2.Treat both MAX_ADDRESS and MAX_UINT32 as invalid address for
  FSP global data in FspApiCallingCheck().
3.Changed AsmReadEsp to AsmReadStackPointer.
4.Changed the type of the return value of AsmReadStackPointer
  from UINT32 to UINTN.
5.Changed the type of TemporaryMemoryBase, PermenentMemoryBase
  and BootLoaderStack from UINT32 to UINTN.
6.Some type casting to pointers are UINT32. Changed them to
  UINTN to accommodate both IA32 and X64.
7.Corrected some typos.

Cc: Chasel Chiu <chasel.chiu@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Ashraf Ali S <ashraf.ali.s@intel.com>
Signed-off-by: Ted Kuo <ted.kuo@intel.com>
Reviewed-by: Chasel Chiu <chasel.chiu@intel.com>
Reviewed-by: Nate DeSimone <nathaniel.l.desimone@intel.com>
2 years agoShellPkg: Update smbiosview type 41 with SMBIOS 3.5 fields
Ke, Bo-ChangX [Mon, 11 Apr 2022 07:17:50 +0000 (15:17 +0800)]
ShellPkg: Update smbiosview type 41 with SMBIOS 3.5 fields

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

update smbiosview type 41 related fileds.

Signed-off-by: Bo Chang Ke <bo-changx.ke@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Zhichao Gao <zhichao.gao@intel.com>
Reviewed-by: Zhichao Gao <zhichao.gao@intel.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
2 years agoUefiPayloadPkg: Fix the build failure
Guo Dong [Wed, 13 Apr 2022 20:42:09 +0000 (13:42 -0700)]
UefiPayloadPkg: Fix the build failure

When Quite parameter is not provided, its default value would
be "None" instead of "". So update its default value not to
impact the build.

Cc: Ray Ni <ray.ni@intel.com>
Cc: Benjamin You <benjamin.you@intel.com>
Cc: Sean Rhodes <sean@starlabs.systems>
Signed-off-by: Guo Dong <guo.dong@intel.com>
Acked-by: Dun Tan <dun.tan@intel.com>
2 years agoCryptoPkg/TlsLibNull: Remove MU_CHANGE comment markers
Michael Kubacki [Wed, 6 Apr 2022 00:50:00 +0000 (08:50 +0800)]
CryptoPkg/TlsLibNull: Remove MU_CHANGE comment markers

MU_CHANGE tags are used in a different project (Project Mu) to
highlight deviations from Tianocore. Therefore, the comments are
not needed when the changes are present in a Tianocore repository.

Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Xiaoyu Lu <xiaoyu1.lu@intel.com>
Cc: Guomin Jiang <guomin.jiang@intel.com>
Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
2 years agoCryptoPkg: Make EC source file config-able
yi1 li [Wed, 13 Apr 2022 07:02:02 +0000 (15:02 +0800)]
CryptoPkg: Make EC source file config-able

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

Use PCD gEfiCryptoPkgTokenSpaceGuid.PcdEcEnabled to config-able
source files list in OpensslLib.inf and OpensslLibCrypto.inf.
If PcdEcEnabled equals to FALSE, this file will not be compiled.

Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Jian J Wang <jian.j.wang@intel.com>
Signed-off-by: yi1 li <yi1.li@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
2 years agoCryptoPkg: Reconfigure OpensslLib to add EC algorithms
yi1 li [Wed, 13 Apr 2022 07:02:01 +0000 (15:02 +0800)]
CryptoPkg: Reconfigure OpensslLib to add EC algorithms

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

Reconfigure OpensslLib to add elliptic curve cipher algorithms.

Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Jian J Wang <jian.j.wang@intel.com>
Signed-off-by: yi1 li <yi1.li@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
2 years agoCryptoPkg: Add instrinsics to support building ECC on IA32 windows
yi1 li [Wed, 13 Apr 2022 07:02:00 +0000 (15:02 +0800)]
CryptoPkg: Add instrinsics to support building ECC on IA32 windows

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

This dependency is needed to build openssl lib with ECC ciphers
under IA32 Windows and adds implementation for _allmul and _allshr
instrinsics.

It is taken from Project Mu:
microsoft/mu_basecore@b55b341

Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Jian J Wang <jian.j.wang@intel.com>
Signed-off-by: yi1 li <yi1.li@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
2 years agoMaintainers.txt: Add Michael Kubacki as UnitTestFrameworkPkg maintainer
Michael D Kinney [Wed, 13 Apr 2022 15:40:49 +0000 (08:40 -0700)]
Maintainers.txt: Add Michael Kubacki as UnitTestFrameworkPkg maintainer

Cc: Michael Kubacki <mikuback@linux.microsoft.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Michael Kubacki <mikuback@linux.microsoft.com>
2 years agopip-requirements.txt: Update basetools version to 0.1.17
Bob Feng [Tue, 12 Apr 2022 11:49:12 +0000 (19:49 +0800)]
pip-requirements.txt: Update basetools version to 0.1.17

Synced the basetools patch from edk2 repo to
edk2-basetools repo. Update the basetools pip module version
to the latest.

Signed-off-by: Bob Feng <bob.c.feng@intel.com>
Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
2 years agoCryptoPkg/UnitTest: fix DH testcase
Gerd Hoffmann [Mon, 11 Apr 2022 11:24:57 +0000 (19:24 +0800)]
CryptoPkg/UnitTest: fix DH testcase

openssl 3.0 wants at least 512 bytes, otherwise it throws an error:

error:0280007E:Diffie-Hellman routines::modulus too small

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Jiewen Yao <Jiewen.yao@intel.com>
2 years agoCryptoPkg/CrtLibSupport: fix strcpy
Gerd Hoffmann [Mon, 11 Apr 2022 11:24:56 +0000 (19:24 +0800)]
CryptoPkg/CrtLibSupport: fix strcpy

strcpy() returns a pointer to the destination string, AsciiStrCpyS()
does not.  So a simple #define does not work.  Create a function
instead.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Jiewen Yao <Jiewen.yao@intel.com>
2 years agoCryptoPkg/CrtLibSupport: add off_t
Gerd Hoffmann [Mon, 11 Apr 2022 11:24:55 +0000 (19:24 +0800)]
CryptoPkg/CrtLibSupport: add off_t

Add typedef for off_t.
Will be needed by openssl 3.0.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Jiewen Yao <Jiewen.yao@intel.com>
2 years agoCryptoPkg/CrtLibSupport: add MODULESDIR
Gerd Hoffmann [Mon, 11 Apr 2022 11:24:54 +0000 (19:24 +0800)]
CryptoPkg/CrtLibSupport: add MODULESDIR

Add dummy MODULESDIR #define
Will be needed by openssl 3.0.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Jiewen Yao <Jiewen.yao@intel.com>
2 years agoCryptoPkg/CrtLibSupport: add UINT_MAX
Gerd Hoffmann [Mon, 11 Apr 2022 11:24:53 +0000 (19:24 +0800)]
CryptoPkg/CrtLibSupport: add UINT_MAX

Add define for UINT_MAX.
Will be needed by openssl 3.0.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Jiewen Yao <Jiewen.yao@intel.com>
2 years agoCryptoPkg/CrtLibSupport: add INT_MIN
Gerd Hoffmann [Mon, 11 Apr 2022 11:24:52 +0000 (19:24 +0800)]
CryptoPkg/CrtLibSupport: add INT_MIN

Add #define for INT_MIN.
Will be needed by openssl 3.0.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Jiewen Yao <Jiewen.yao@intel.com>
2 years agoCryptoPkg/CrtLibSupport: add strstr()
Gerd Hoffmann [Mon, 11 Apr 2022 11:24:51 +0000 (19:24 +0800)]
CryptoPkg/CrtLibSupport: add strstr()

Add #define for strstr().
Will be needed by openssl 3.0.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Jiewen Yao <Jiewen.yao@intel.com>
2 years agoCryptoPkg/CrtLibSupport: add fcntl.h
Gerd Hoffmann [Mon, 11 Apr 2022 11:24:50 +0000 (19:24 +0800)]
CryptoPkg/CrtLibSupport: add fcntl.h

Add fcntl.h header file.
Will be needed by openssl 3.0.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Jiewen Yao <Jiewen.yao@intel.com>
2 years agoBaseTools: Fix DevicePath tool build failure issue
Feng, Bob C [Mon, 4 Apr 2022 03:46:21 +0000 (11:46 +0800)]
BaseTools: Fix DevicePath tool build failure issue

Fix the DevicePath tool build failure that was introduced by
the fixes: 22130dcd98b4 ("Basetools: turn off gcc12 warning").
Failure cases are:
1. clang 13.1.6 on macOS
2. gcc5.4

Reported-by: Rebecca Cran <rebecca@bsdio.com>
Reported-by: Yuwei Chen <yuwei.chen@intel.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Yuwei Chen <yuwei.chen@intel.com>
Cc: Rebecca Cran <rebecca@bsdio.com>
Reviewed-by: Yuwei Chen <yuwei.chen@intel.com>
2 years agoNetworkPkg/HttpDxe: Detect HTTP/1.0 servers
Oliver Steffen [Tue, 22 Mar 2022 13:30:08 +0000 (14:30 +0100)]
NetworkPkg/HttpDxe: Detect HTTP/1.0 servers

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

Force connection close before the next request if
the server identifies as version 1.0.

Signed-off-by: Oliver Steffen <osteffen@redhat.com>
Reviewed-by: Maciej Rabeda <maciej.rabeda@linux.intel.com>
Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>
2 years agoNetworkPkg/HttpDxe: Detect 'Connection: close' header
Oliver Steffen [Tue, 22 Mar 2022 13:30:07 +0000 (14:30 +0100)]
NetworkPkg/HttpDxe: Detect 'Connection: close' header

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

Force connection close before the next request if
the server sends the 'Connection: close' header.

Signed-off-by: Oliver Steffen <osteffen@redhat.com>
Reviewed-by: Maciej Rabeda <maciej.rabeda@linux.intel.com>
Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>
2 years agoNetworkPkg/HttpDxe: Add ConnectionClose flag fo HTTP_PROTOCOL
Oliver Steffen [Tue, 22 Mar 2022 13:30:06 +0000 (14:30 +0100)]
NetworkPkg/HttpDxe: Add ConnectionClose flag fo HTTP_PROTOCOL

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

Add ConnectionClose flag to HTTP_PROTOCOL.
This boolean is FALSE by default. If set to TRUE, a reconfigure
of the Http instance is forced on the next request. The flag
is then reset.

Signed-off-by: Oliver Steffen <osteffen@redhat.com>
Reviewed-by: Maciej Rabeda <maciej.rabeda@linux.intel.com>
Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>
2 years agoNetworkPkg/HttpDxe: Decofigure Tcp6 before reconfiguring
Oliver Steffen [Tue, 22 Mar 2022 13:30:05 +0000 (14:30 +0100)]
NetworkPkg/HttpDxe: Decofigure Tcp6 before reconfiguring

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

Check if the state of the HTTP instance is HTTP_STATE_TCP_CONNECTED, or
HTTP_STATE_TCP_CLOSED and de-configure the Tcp6 instance before
configuring it again.

Signed-off-by: Oliver Steffen <osteffen@redhat.com>
Reviewed-by: Maciej Rabeda <maciej.rabeda@linux.intel.com>
Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>
2 years agoNetworkPkg/HttpDxe: Decofigure Tcp4 before reconfiguring
Oliver Steffen [Tue, 22 Mar 2022 13:30:04 +0000 (14:30 +0100)]
NetworkPkg/HttpDxe: Decofigure Tcp4 before reconfiguring

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

Check if the state of the HTTP instance is HTTP_STATE_TCP_CONNECTED, or
HTTP_STATE_TCP_CLOSED and de-configure the Tcp4 instance before
configuring it again.

Signed-off-by: Oliver Steffen <osteffen@redhat.com>
Reviewed-by: Maciej Rabeda <maciej.rabeda@linux.intel.com>
Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>
2 years agoNetworkPkg: Add PCDs for HTTP DNS RetryCount and RetryInterval
Heng Luo [Sun, 3 Apr 2022 06:14:10 +0000 (14:14 +0800)]
NetworkPkg: Add PCDs for HTTP DNS RetryCount and RetryInterval

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

Currently the HTTP DNS Retry Interval is 2 second and no retry attempt.
If DNS response can't arrive in 2 second, the DNS request is failed,
and then HTTP boot is failed.
In order to resolve this issue, Add PCDs to support RetryCount
and RetryInterval configured in Platform.

Cc: Maciej Rabeda <maciej.rabeda@linux.intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Cc: Wu Jiaxin <jiaxin.wu@intel.com>
Signed-off-by: Heng Luo <heng.luo@intel.com>
Reviewed-by: Maciej Rabeda <maciej.rabeda@linux.intel.com>
2 years agoUefiPayloadPkg: Add --quiet argument to Universal Payload build script
Guo Dong [Sun, 10 Apr 2022 20:45:58 +0000 (13:45 -0700)]
UefiPayloadPkg: Add --quiet argument to Universal Payload build script

Signed-off-by: Sean Rhodes <sean@starlabs.systems>
Reviewed-by: Guo Dong <guo.dong@intel.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
2 years agoUefiPayloadPkg: Add dependency of VariableSmm driver.
Li, Zhihao [Tue, 29 Mar 2022 07:12:01 +0000 (00:12 -0700)]
UefiPayloadPkg: Add dependency of VariableSmm driver.

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

UefiCpuPkg define a new Protocol with the new services
SmmWaitForAllProcessor(), which can be used by SMI handler
to optionally wait for other APs to complete SMM rendezvous in
relaxed AP mode.

VariableSmm driver need use SmmCpuRendezvousLib, So add
SmmCpuRendezvousLib dependency in UefiPayloadPkg which use
VariableSmm driver.

Cc: Guo Dong <guo.dong@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Benjamin You <benjamin.you@intel.com>
Cc: Sean Rhodes <sean@starlabs.systems>
Cc: Siyuan Fu <siyuan.fu@intel.com>
Signed-off-by: Zhihao Li <zhihao.li@intel.com>
Reviewed-by: Guo Dong <guo.dong@intel.com>
2 years agoUefiPayloadPkg: Support IA32 Build
Guo Dong [Tue, 29 Mar 2022 17:35:36 +0000 (10:35 -0700)]
UefiPayloadPkg: Support IA32 Build

The payload entry module should support to build as IA32 image
beside X64 image so that it could work with 32bit bootloaders.

This patch adds a option build parameter for arch selection.

Cc: Ray Ni <ray.ni@intel.com>
Cc: Benjamin You <benjamin.you@intel.com>
Cc: Sean Rhodes <sean@starlabs.systems>
Signed-off-by: Guo Dong <guo.dong@intel.com>
Reviewed-by: Sean Rhodes <sean@starlabs.systems>
2 years agoUefiPayloadPkg: Fix PciHostBridgeLib
Lean Sheng Tan [Wed, 30 Mar 2022 18:29:02 +0000 (11:29 -0700)]
UefiPayloadPkg: Fix PciHostBridgeLib

Don't assume a 64bit register always holds an address greater than 4GB.
Check the value in the register and decide which Aperature it should be
assigned to.

Fixes assertion
"ASSERT [PciHostBridgeDxe] Bridge->MemAbove4G.Base >= 0x0000000100000000ULL".

Tested with coreboot as bootloader on platforms that have PCI resource
above 4GiB and on platforms that don't have resource above 4GiB.

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 Rhodes <sean@starlabs.systems>
Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com>
Reviewed-by Sean Rhodes <sean@starlabs.systems>
Reviewed-by: Guo Dong <guo.dong@intel.com>
2 years agoBaseTools: Scripts/efi_lldb.py: Add lldb EFI commands and pretty Print
Rebecca Cran [Mon, 21 Mar 2022 20:20:48 +0000 (04:20 +0800)]
BaseTools: Scripts/efi_lldb.py: Add lldb EFI commands and pretty Print

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

Use efi_debugging.py Python Classes to implement EFI gdb commands:
efi_symbols, guid, table, hob, and devicepath

You can attach to any standard gdb or kdp remote server and get EFI
symbols. No modifications of EFI are required.

Example usage:
OvmfPkg/build.sh qemu -gdb tcp::9000
lldb -o "gdb-remote localhost:9000" -o "command script import efi_lldb.py"
Note you may also have to teach lldb about QEMU:
-o "settings set plugin.process.gdb-remote.target-definition-file
 x86_64_target_definition.py"

Cc: Leif Lindholm <quic_llindhol@quicinc.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Hao A Wu <hao.a.wu@intel.com>
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: Rebecca Cran <quic_rcran@quicinc.com>
Reviewed-by: Bob Feng <bob.c.feng@intel.com>
Acked-by: Liming Gao <gaoliming@byosoft.com.cn>
2 years agoBaseTools: Scripts/efi_gdb.py: Add gdb EFI commands and pretty Print
Rebecca Cran [Mon, 21 Mar 2022 20:20:47 +0000 (04:20 +0800)]
BaseTools: Scripts/efi_gdb.py: Add gdb EFI commands and pretty Print

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

Use efi_debugging.py Python Classes to implement EFI gdb commands:
(gdb) help efi
Commands for debugging EFI. efi <cmd>

List of efi subcommands:

efi devicepath -- Display an EFI device path.
efi guid -- Display info about EFI GUID's.
efi hob -- Dump EFI HOBs. Type 'hob -h' for more info.
efi symbols -- Load Symbols for EFI. Type 'efi_symbols -h' for more info.
efi table -- Dump EFI System Tables. Type 'table -h' for more info.

This module is coded against a generic gdb remote serial stub. It should
work with QEMU, JTAG debugger, or a generic EFI gdb remote serial stub.
No modifications of EFI is required to load symbols.

Example usage:
OvmfPkg/build.sh qemu -gdb tcp::9000
gdb -ex "target remote localhost:9000" -ex "source efi_gdb.py"

Cc: Leif Lindholm <quic_llindhol@quicinc.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Hao A Wu <hao.a.wu@intel.com>
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: Rebecca Cran <quic_rcran@quicinc.com>
Reviewed-by: Bob Feng <bob.c.feng@intel.com>
Acked-by: Liming Gao <gaoliming@byosoft.com.cn>
2 years agoBaseTools: efi_debugging.py: Add debugger agnostic dbg Python Classes
Rebecca Cran [Mon, 21 Mar 2022 20:20:46 +0000 (04:20 +0800)]
BaseTools: efi_debugging.py: Add debugger agnostic dbg Python Classes

Add Scripts/efi_debugging.py to provide debugger agnostic debugging
utility Python classes.

Cc: Leif Lindholm <quic_llindhol@quicinc.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Hao A Wu <hao.a.wu@intel.com>
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: Rebecca Cran <quic_rcran@quicinc.com>
Reviewed-by: Bob Feng <bob.c.feng@intel.com>
Acked-by: Liming Gao <gaoliming@byosoft.com.cn>
2 years agoMdeModulePkg/HiiDatabase: Fix Setup numeric default value incorrect issue
Chen, Lin Z [Fri, 1 Apr 2022 06:09:05 +0000 (14:09 +0800)]
MdeModulePkg/HiiDatabase: Fix Setup numeric default value incorrect issue

When default/manufacturing flag get removed from numeric varid, it can't
get default value from StructurePcd in 'UpdateDefaultSettingInFormPackage'
function since there is no EFI_IFR_DEFAULT_OP opcode in IFR file. Add a
chance to get numeric default value from StructurePcd in the case that
numeric minimum value will be used as default value.

Signed-off-by: Chen Lin Z <lin.z.chen@intel.com>
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
2 years agoPrmPkg: Apply uncrustify changes
Michael Kubacki [Tue, 15 Mar 2022 18:46:34 +0000 (14:46 -0400)]
PrmPkg: Apply uncrustify changes

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

Apply uncrustify changes to .c/.h files in PrmPkg.

Cc: Andrew Fish <afish@apple.com>
Cc: Kang Gao <kang.gao@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Michael Kubacki <michael.kubacki@microsoft.com>
Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Benjamin You <benjamin.you@intel.com>
Cc: Liu Yun <yun.y.liu@intel.com>
Cc: Ankit Sinha <ankit.sinha@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
Acked-by: Michael D Kinney <michael.d.kinney@intel.com>
Acked-by: Liming Gao <gaoliming@byosoft.com.cn>
Acked-by: Leif Lindholm <quic_llindhol@quicinc.com>
Reviewed-by: Ankit Sinha <ankit.sinha@intel.com>
2 years agoPrmPkg: Changes for edk2 repo transition
Michael Kubacki [Tue, 18 Jan 2022 21:54:51 +0000 (16:54 -0500)]
PrmPkg: Changes for edk2 repo transition

Updates the Readme.md files to remove information that was specific
to the package in edk2-staging and adds key definitions being added
for PRM support in the ACPI Specification.

Adds PrmPkg/PrmPkg.ci.yaml to support CI.

Adds PrmPkg to .pytool/CISettings.py.

Adds PrmPkg maintainers to Maintainers.txt.

Cc: Andrew Fish <afish@apple.com>
Cc: Kang Gao <kang.gao@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Michael Kubacki <michael.kubacki@microsoft.com>
Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Benjamin You <benjamin.you@intel.com>
Cc: Liu Yun <yun.y.liu@intel.com>
Cc: Ankit Sinha <ankit.sinha@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
Acked-by: Michael D Kinney <michael.d.kinney@intel.com>
Acked-by: Liming Gao <gaoliming@byosoft.com.cn>
Acked-by: Leif Lindholm <quic_llindhol@quicinc.com>
Reviewed-by: Ankit Sinha <ankit.sinha@intel.com>
2 years agoReadme.md: Add a link to PRM Specification
Michael Kubacki [Tue, 13 Apr 2021 22:21:22 +0000 (15:21 -0700)]
Readme.md: Add a link to PRM Specification

Adds a link to the PRM Specification now that it is available on uefi.org.

Cc: Andrew Fish <afish@apple.com>
Cc: Kang Gao <kang.gao@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Michael Kubacki <michael.kubacki@microsoft.com>
Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Benjamin You <benjamin.you@intel.com>
Cc: Liu Yun <yun.y.liu@intel.com>
Cc: Ankit Sinha <ankit.sinha@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
Acked-by: Michael D Kinney <michael.d.kinney@intel.com>
Acked-by: Liming Gao <gaoliming@byosoft.com.cn>
Acked-by: Leif Lindholm <quic_llindhol@quicinc.com>
Reviewed-by: Ankit Sinha <ankit.sinha@intel.com>
2 years agoPrmPkg: Remove the concept of OS services
Michael Kubacki [Tue, 17 Nov 2020 17:37:25 +0000 (09:37 -0800)]
PrmPkg: Remove the concept of OS services

OS services are no longer supported as of the current PRM design.

1. Removes OS services from PrmSampleHardwareAccessModule
2. Removes the PrmOsServices.h file

Cc: Andrew Fish <afish@apple.com>
Cc: Kang Gao <kang.gao@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Michael Kubacki <michael.kubacki@microsoft.com>
Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Benjamin You <benjamin.you@intel.com>
Cc: Liu Yun <yun.y.liu@intel.com>
Cc: Ankit Sinha <ankit.sinha@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
Acked-by: Michael D Kinney <michael.d.kinney@intel.com>
Acked-by: Liming Gao <gaoliming@byosoft.com.cn>
Acked-by: Leif Lindholm <quic_llindhol@quicinc.com>
Reviewed-by: Ankit Sinha <ankit.sinha@intel.com>
2 years agoPrmPkg/Samples: Remove PrmSamplePrintModule
Michael Kubacki [Tue, 17 Nov 2020 18:45:32 +0000 (10:45 -0800)]
PrmPkg/Samples: Remove PrmSamplePrintModule

This sample module is removed since it directly depends on OS
services which are no longer supported as of the current PRM
design.

Cc: Andrew Fish <afish@apple.com>
Cc: Kang Gao <kang.gao@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Michael Kubacki <michael.kubacki@microsoft.com>
Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Benjamin You <benjamin.you@intel.com>
Cc: Liu Yun <yun.y.liu@intel.com>
Cc: Ankit Sinha <ankit.sinha@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
Acked-by: Michael D Kinney <michael.d.kinney@intel.com>
Acked-by: Liming Gao <gaoliming@byosoft.com.cn>
Acked-by: Leif Lindholm <quic_llindhol@quicinc.com>
Reviewed-by: Ankit Sinha <ankit.sinha@intel.com>
2 years agoPrmPkg/Samples: Remove PrmSampleMemoryAllocationModule
Michael Kubacki [Tue, 17 Nov 2020 18:36:10 +0000 (10:36 -0800)]
PrmPkg/Samples: Remove PrmSampleMemoryAllocationModule

Removes PrmSampleMemoryAllocationModule since the module depends
upon the deprecated concept of OS services.

Cc: Andrew Fish <afish@apple.com>
Cc: Kang Gao <kang.gao@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Michael Kubacki <michael.kubacki@microsoft.com>
Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Benjamin You <benjamin.you@intel.com>
Cc: Liu Yun <yun.y.liu@intel.com>
Cc: Ankit Sinha <ankit.sinha@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
Acked-by: Michael D Kinney <michael.d.kinney@intel.com>
Acked-by: Liming Gao <gaoliming@byosoft.com.cn>
Acked-by: Leif Lindholm <quic_llindhol@quicinc.com>
Reviewed-by: Ankit Sinha <ankit.sinha@intel.com>
2 years agoPrmPkg: Replace PcdPrmPlatformGuid with EDKII_DSC_PLATFORM_GUID
Michael Kubacki [Mon, 12 Oct 2020 15:23:44 +0000 (08:23 -0700)]
PrmPkg: Replace PcdPrmPlatformGuid with EDKII_DSC_PLATFORM_GUID

Bugzilla request https://bugzilla.tianocore.org/show_bug.cgi?id=2969
was recently completed which causes the PLATFORM_GUID value from the
DSC file to be placed into Autogen file .c & .h files. With this
change, the PRM Platform GUID can be directly matched to the DSC
PLATFORM_GUID value.

Cc: Andrew Fish <afish@apple.com>
Cc: Kang Gao <kang.gao@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Michael Kubacki <michael.kubacki@microsoft.com>
Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Benjamin You <benjamin.you@intel.com>
Cc: Liu Yun <yun.y.liu@intel.com>
Cc: Ankit Sinha <ankit.sinha@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
Acked-by: Michael D Kinney <michael.d.kinney@intel.com>
Acked-by: Liming Gao <gaoliming@byosoft.com.cn>
Acked-by: Leif Lindholm <quic_llindhol@quicinc.com>
Reviewed-by: Ankit Sinha <ankit.sinha@intel.com>
2 years agoReadme.md: Add iASL note and QEMU sample link
Michael Kubacki [Wed, 9 Sep 2020 23:47:09 +0000 (16:47 -0700)]
Readme.md: Add iASL note and QEMU sample link

Adds a note that the build now depends on an ASL compiler supporting
PlatformRtMechanism by default. The minimum iASL version supported
is noted in addition to an alternative to remove the code that
requires the new OperationRegion.

Also, a link is provided to an example of how to integrate the
package into a platform using QEMU/OvmfPkg as the sample platform
and firmware.

Cc: Andrew Fish <afish@apple.com>
Cc: Kang Gao <kang.gao@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Michael Kubacki <michael.kubacki@microsoft.com>
Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Benjamin You <benjamin.you@intel.com>
Cc: Liu Yun <yun.y.liu@intel.com>
Cc: Ankit Sinha <ankit.sinha@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
Acked-by: Michael D Kinney <michael.d.kinney@intel.com>
Acked-by: Liming Gao <gaoliming@byosoft.com.cn>
Acked-by: Leif Lindholm <quic_llindhol@quicinc.com>
Reviewed-by: Ankit Sinha <ankit.sinha@intel.com>
2 years agoPrmPkg: Update PRM OpRegion
Liu Yun Y [Tue, 8 Sep 2020 06:57:18 +0000 (14:57 +0800)]
PrmPkg: Update PRM OpRegion

1. Enable new PRM OpRegion structure
2. Add PRM Handler Update Lock/Unlock support

Cc: Andrew Fish <afish@apple.com>
Cc: Kang Gao <kang.gao@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Michael Kubacki <michael.kubacki@microsoft.com>
Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Benjamin You <benjamin.you@intel.com>
Cc: Liu Yun <yun.y.liu@intel.com>
Cc: Ankit Sinha <ankit.sinha@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Signed-off-by: Liu Yun <yun.y.liu@intel.com>
Acked-by: Michael D Kinney <michael.d.kinney@intel.com>
Acked-by: Liming Gao <gaoliming@byosoft.com.cn>
Acked-by: Leif Lindholm <quic_llindhol@quicinc.com>
Reviewed-by: Ankit Sinha <ankit.sinha@intel.com>
2 years agoPrmPkg: Add PlatformGuid
Michael Kubacki [Mon, 29 Jun 2020 22:54:01 +0000 (15:54 -0700)]
PrmPkg: Add PlatformGuid

Adds a "platform GUID" field to the PRM ACPI table. This field
is used by a platform to uniquely identify itself such that it
can be targeted by runtime PRM module updates for that platform.

Platforms using PRM are currently required to set a unique value
for gPrmPkgTokenSpaceGuid.PcdPrmPlatformGuid in their platform
DSC.

Cc: Andrew Fish <afish@apple.com>
Cc: Kang Gao <kang.gao@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Michael Kubacki <michael.kubacki@microsoft.com>
Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Benjamin You <benjamin.you@intel.com>
Cc: Liu Yun <yun.y.liu@intel.com>
Cc: Ankit Sinha <ankit.sinha@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
Acked-by: Michael D Kinney <michael.d.kinney@intel.com>
Acked-by: Liming Gao <gaoliming@byosoft.com.cn>
Acked-by: Leif Lindholm <quic_llindhol@quicinc.com>
Reviewed-by: Ankit Sinha <ankit.sinha@intel.com>
2 years agoPrmPkg/DxePrmModuleDiscoveryLib: Add initial host-based unit tests
Michael Kubacki [Wed, 17 Jun 2020 19:09:54 +0000 (12:09 -0700)]
PrmPkg/DxePrmModuleDiscoveryLib: Add initial host-based unit tests

Adds host-based unit tests for DxePrmModuleDiscoveryLib. This is
an initial set of support, more tests should be added in the
future.

Cc: Andrew Fish <afish@apple.com>
Cc: Kang Gao <kang.gao@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Michael Kubacki <michael.kubacki@microsoft.com>
Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Benjamin You <benjamin.you@intel.com>
Cc: Liu Yun <yun.y.liu@intel.com>
Cc: Ankit Sinha <ankit.sinha@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
Acked-by: Michael D Kinney <michael.d.kinney@intel.com>
Acked-by: Liming Gao <gaoliming@byosoft.com.cn>
Acked-by: Leif Lindholm <quic_llindhol@quicinc.com>
Reviewed-by: Ankit Sinha <ankit.sinha@intel.com>