Commit Graph

209 Commits

Author SHA1 Message Date
Laszlo Ersek 1c0db23151 UefiPayloadPkg: auto-generate SEC ProcessLibraryConstructorList() decl
Rely on AutoGen for declaring ProcessLibraryConstructorList().

Build-tested with:

  python UefiPayloadPkg/UniversalPayloadBuild.py -a X64 -b DEBUG -t GCC5

  python UefiPayloadPkg/UniversalPayloadBuild.py -a X64 -b DEBUG -f \
    -t GCC5

  build -a X64 -b DEBUG -p UefiPayloadPkg/UefiPayloadPkg.dsc -t GCC5 \
    -D BUILD_ARCH=X64

Cc: Gua Guo <gua.guo@intel.com>
Cc: Guo Dong <guo.dong@intel.com>
Cc: James Lu <james.lu@intel.com>
Cc: Sean Rhodes <sean@starlabs.systems>
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=990
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Message-Id: <20240305113843.68812-11-lersek@redhat.com>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
2024-03-08 09:09:22 +00:00
Dhaval e60529df58 UefiPayloadPkg: Make Dsc accomodative of other archs
Current DSC files contains a lot of files which are
specific to X86 arch. Need to move around files under
arch specific sections.

Cc: Guo Dong <guo.dong@intel.com>
Cc: Sean Rhodes <sean@starlabs.systems>
Cc: James Lu <james.lu@intel.com>
Cc: Gua Guo <gua.guo@intel.com>
Signed-off-by: Dhaval Sharma <dhaval@rivosinc.com>
Reviewed-by: Gua Guo <gua.guo@intel.com>
2024-03-06 03:15:21 +00:00
Gua Guo 970aacd191 UefiPayloadPkg: UPL arch backward support ELF
After 11ad164bce merge,
ELF format API won't meet backward requirement.

Cc: Guo Dong <guo.dong@intel.com>
Cc: Sean Rhodes <sean@starlabs.systems>
Reviewed-by: James Lu <james.lu@intel.com>
Cc: Gua Guo <gua.guo@intel.com>
Signed-off-by: Gua Guo <gua.guo@intel.com>
2024-03-04 08:57:18 +00:00
Gua Guo 7fa4a984c4 UefiPayloadPkg/Gop: Clean up unused protocol and Guid
Below Guid is redundant code on UefiPayloadPkg.dec
1. gBmpImageGuid
2. gPlatformGOPPolicyGuid

Reviewed-by: Chasel Chiu <chasel.chiu@intel.com>
Cc: Guo Dong <guo.dong@intel.com>
Cc: Sean Rhodes <sean@starlabs.systems>
Cc: James Lu <james.lu@intel.com>
Reviewed-by: Gua Guo <gua.guo@intel.com>
Signed-off-by: Gua Guo <gua.guo@intel.com>
2024-02-24 13:13:40 +00:00
Dhaval 11ad164bce UefiPayloadPkg: Make UPL build script arch agnostic
Current implementation makes assumptions about arch it will be built
for. Need to make it more generic to add follow up support for RISCV.
Right now it does not build for RV until relevant dsc file is available.

Cc: Guo Dong <guo.dong@intel.com>
Cc: Sean Rhodes <sean@starlabs.systems>
Cc: James Lu <james.lu@intel.com>
Reviewed-by: Gua Guo <gua.guo@intel.com>
Signed-off-by: Dhaval Sharma <dhaval@rivosinc.com>
2024-02-23 12:44:58 +00:00
MarsX Lin 3656352675 UefiPayloadPkg/Crypto: Support external Crypto drivers.
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4661

There is potential build problem when CRYPTO_PROTOCOL_SUPPORT
is set to TRUE and CRYPTO_DRIVER_EXTERNAL_SUPPORT is set to TRUE

Cc: Chasel Chiu <chasel.chiu@intel.com>
Cc: Guo Dong <guo.dong@intel.com>
Cc: Sean Rhodes <sean@starlabs.systems>
Reviewed-by: James Lu <james.lu@intel.com>
Reviewed-by: Gua Guo <gua.guo@intel.com>

Signed-off-by: MarsX Lin <marsx.lin@intel.com>
2024-02-01 22:23:54 +00:00
Gua Guo 7d7decfa3d UefiPayloadPkg/Crypto: Support external Crypto drivers.
Crypto in serveral case will use old version or latest version,
Platform may choose to only update Crypto drivers without updating
whole UPL, in this case the Crypto driver will provide by platform
payload outside the common UPL binary.

Reviewed-by: Chasel Chiu <chasel.chiu@intel.com>
Cc: Guo Dong <guo.dong@intel.com>
Cc: Sean Rhodes <sean@starlabs.systems>
Reviewed-by: James Lu <james.lu@intel.com>
Cc: Gua Guo <gua.guo@intel.com>
Signed-off-by: Gua Guo <gua.guo@intel.com>
2024-01-26 04:59:33 +00:00
Patrick Rudolph 0b09397dfa UefiPayloadPkg: CbParseLib: Fix integer overflow
The IMD entry uses the 32bit start field as relative offset
to root. On Ia32X64 this works fine as UINTN is also 32 bit and
negative relative offsets are properly calculated due to an
integer overflow.

On X64 this doesn't work as UINTN is 64 bit and the offset
is no longer subtracted, but it's added to the root. Fix that
by sign extending the start field to 64 bit.

Test: Booting UefiPayloadPkg still works on Ia32X64 and now also
      works on X64.

Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com>
Reviewed-by: Gua Guo <gua.guo@intel.com>
Reviewed-by: Sean Rhodes <sean@starlabs.systems>
2024-01-22 11:04:21 +00:00
Gua Guo 59f024c76e UefiPayloadPkg/Hob: Integer Overflow in CreateHob()
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4166

Fix integer overflow in various CreateHob instances.
Fixes: CVE-2022-36765

The CreateHob() function aligns the requested size to 8
performing the following operation:
```
HobLength = (UINT16)((HobLength + 0x7) & (~0x7));
```

No checks are performed to ensure this value doesn't
overflow, and could lead to CreateHob() returning a smaller
HOB than requested, which could lead to OOB HOB accesses.

Reported-by: Marc Beatove <mbeatove@google.com>
Cc: Guo Dong <guo.dong@intel.com>
Cc: Sean Rhodes <sean@starlabs.systems>
Cc: James Lu <james.lu@intel.com>
Reviewed-by: Gua Guo <gua.guo@intel.com>
Cc: John Mathew <john.mathews@intel.com>
Authored-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Gua Guo <gua.guo@intel.com>
2024-01-16 23:36:08 +00:00
Gang Chen edba0779ba UefiPayloadPkg/UefiPayloadEntry: Remove SCI enabling check
It's too early to check the SCI enable status, which is set in the BDS
phase ususally. Remove the check from UPL.

Reviewed-by: James Lu <james.lu@intel.com>
Reviewed-by: Gua Guo <gua.guo@intel.com>
Cc: Guo Dong <guo.dong@intel.com>
Cc: Sean Rhodes <sean@starlabs.systems>
Signed-off-by: Gang Chen <gang.c.chen@intel.com>
2024-01-10 01:43:54 +00:00
Hua Ma c3d865a4c2 UefiPayloadPkg: Add macro to enable selection of timer
Add macro to enable selection of timer

- HPET:  UEFI Payload will use HPET timer
- LAPIC: UEFI Payload will use local APIC timer

Cc: Guo Dong <guo.dong@intel.com>
Cc: Sean Rhodes <sean@starlabs.systems>
Cc: James Lu <james.lu@intel.com>
Cc: Gua Guo <gua.guo@intel.com>
Signed-off-by: Hua Ma <hua.ma@intel.com>
Reviewed-by: Gua Guo <gua.guo@intel.com>
2024-01-08 07:48:46 +00:00
Jiaxin Wu 0a248f169d UefiPayloadPkg: Specifies SmmCpuSyncLib instance
This patch is to specify SmmCpuSyncLib instance for UefiPayloadPkg.

Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Guo Dong <guo.dong@intel.com>
Cc: Sean Rhodes <sean@starlabs.systems>
Cc: James Lu <james.lu@intel.com>
Cc: Gua Guo <gua.guo@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Zeng Star <star.zeng@intel.com>
Signed-off-by: Jiaxin Wu <jiaxin.wu@intel.com>
Reviewed-by: Gua Guo <gua.guo@intel.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
2023-12-20 02:30:56 +00:00
Taylor Beebe 26460342d0 UefiPayloadPkg: Add ImagePropertiesRecordLib Instance
Add an instance of ImagePropertiesRecordLib which will be used by the
DXE Core.

Cc: Guo Dong <guo.dong@intel.com>
Cc: Sean Rhodes <sean@starlabs.systems>
Cc: James Lu <james.lu@intel.com>
Cc: Gua Guo <gua.guo@intel.com>
Signed-off-by: Taylor Beebe <taylor.d.beebe@gmail.com>
Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Gua Guo <gua.guo@intel.com>
2023-11-27 18:55:18 +00:00
BruceX Wang 7ff6ab2b3e UefiPayloadPkg: Fix incorrect code on Fit function.
1. Add firmware volume need to check firmware volume exist or not.
2. Remove clang version check dependency.

Cc: Guo Dong <guo.dong@intel.com>
Cc: Sean Rhodes <sean@starlabs.systems>
Cc: James Lu <james.lu@intel.com>
Cc: Gua Guo <gua.guo@intel.com>

Signed-off-by: BruceX Wang <brucex.wang@intel.com>
Reviewed-by: Gua Guo <gua.guo@intel.com>
2023-10-27 23:36:15 +00:00
Brucex.Wang 39f3c26e8c UefiPayloadPkg: Add FIT support
Provide Fit format for UniversalPayload, developer can use argument
"--Fit" to build UniversalPayload.fit

Cc: Guo Dong <guo.dong@intel.com>
Cc: Sean Rhodes <sean@starlabs.systems>
Cc: James Lu <james.lu@intel.com>
Cc: Gua Guo <gua.guo@intel.com>

Reviewed-by: Gua Guo <gua.guo@intel.com>

Signed-off-by: BruceX Wang <brucex.wang@intel.com>
2023-09-26 07:26:21 +00:00
KasimX Liu 92006e5804 UefiPayloadPkg:Enhance the build processing for Universalpayload
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4532

To Copy the PrebuildUplBinary to Build folder then add/replace Fvs.

Cc: Guo Dong <guo.dong@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Reviewed-by: James Lu <james.lu@intel.com>
Reviewed-by: Gua Guo <gua.guo@intel.com>
Signed-off-by: KasimX Liu <kasimx.liu@intel.com>
2023-08-28 06:22:17 +00:00
MarsX Lin 8dab4eebe4 UefiPayloadPkg: Integrate UiApp and BootManagerMenuApp into MultiFv
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4347

To put UiApp.inf and BootManagerMenuApp.inf to proper FV(BDSFV)

Cc: Guo Dong <guo.dong@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Sean Rhodes <sean@starlabs.systems>
Reviewed-by: James Lu <james.lu@intel.com>
Reviewed-by: Gua Guo <gua.guo@intel.com>

Signed-off-by: MarsX Lin <marsx.lin@intel.com>
2023-07-11 06:36:11 +00:00
BruceX Wang aad98d915a UefiPayloadPkg: Fix incorrect code on AddSectionHeader
Fix incorrect code on AddSectionHeader32() and AddSectionHeader64()

Cc: Guo Dong <guo.dong@intel.com>
Cc: Sean Rhodes <sean@starlabs.systems>
Cc: James Lu <james.lu@intel.com>
Cc: Gua Guo <gua.guo@intel.com>
Signed-off-by: BruceX Wang <brucex.wang@intel.com>
Reviewed-by: Gua Guo <gua.guo@intel.com>
2023-06-14 14:49:52 +00:00
MarsX Lin 51bb8eb76c UefiPayloadPkg: Add CAPSULE_SUPPORT in UPL and set it as FALSE in default
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4479

Add CAPSULE_SUPPORT to optionally select CapsuleLib instance,
default value is FALSE.

Cc: Ray Ni <ray.ni@intel.com>
Cc: Sean Rhodes <sean@starlabs.systems>
Reviewed-by: Gua Guo <gua.guo@intel.com>
Reviewed-by: James Lu <james.lu@intel.com>
Cc: Guo Dong <guo.dong@intel.com>

Signed-off-by: MarsX Lin <marsx.lin@intel.com>
2023-06-13 06:36:16 +00:00
Gua Guo 69abcf1e78 UefiPayloadPkg: Enhance build script for BuildEntryOnly
Currently, have two command for pre-build binary support
1. --BuildEntryOnly: build UPL Entry file
2. --PreBuildUplBinary: build UPL binary based on UPL

And these two commands should be exclusived, shouldn't
have chance run it in the meantime.

Case1: Build UPL entry with CLANGDWARF
  python UefiPayloadPkg/UniversalPayloadBuild.py --BuildEntryOnly

Case2: Use pre-built UPL entry and build other fv by VS2019
  python UefiPayloadPkg/UniversalPayloadBuild.py -t VS2019 \
    --PreBuildUplBinary UniversalPayload.elf

Case3: Build UPL Entry with CLANGDWARF and build other fv by VS2019
  python UefiPayloadPkg/UniversalPayloadBuild.py -t VS2019

Cc: Guo Dong <guo.dong@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Sean Rhodes <sean@starlabs.systems>
Cc: James Lu <james.lu@intel.com>
Cc: Gua Guo <gua.guo@intel.com>
Signed-off-by: Gua Guo <gua.guo@intel.com>
Reviewed-by: James Lu <james.lu@intel.com>
2023-06-07 18:22:28 +00:00
Jiaxin Wu d8e5d35ede UefiPayloadPkg: Add CpuPageTableLib required by SecCore & CpuMpPei
Add CpuPageTableLib required by SecCore & CpuMpPei in UefiPayloadPkg.

Cc: Guo Dong <guo.dong@intel.com>
Cc: Sean Rhodes <sean@starlabs.systems>
Cc: James Lu <james.lu@intel.com>
Cc: Gua Guo <gua.guo@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Zeng Star <star.zeng@intel.com>
Signed-off-by: Jiaxin Wu <jiaxin.wu@intel.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
Reviewed-by: Gua Guo <gua.guo@intel.com>
2023-05-31 04:48:36 +00:00
Guo Dong cafb4f3f36 UefiPayloadPkg: Fix boot shell issue for universal UEFI payload
After moving BDS driver to a new FV for universal UEFI payload,
the shell boot option path is not correct since it used the BDS
FV instead of DXE FV in its device path.
This patch would find the correct FV by reading shell file.
It also removed PcdShellFile by using gUefiShellFileGuid.

Signed-off-by: Guo Dong <guo.dong@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Sean Rhodes <sean@starlabs.systems>
Cc: James Lu <james.lu@intel.com>
Cc: Gua Guo <gua.guo@intel.com>
Reviewed-by: James Lu <james.lu@intel.com>
Reviewed-by: Gua Guo <gua.guo@intel.com>
Reviewed-by: Mike Maslenkin <mike.maslenkin@gmail.com>
2023-05-15 21:26:04 +00:00
PaytonX Hsieh 23c71536ef UefiPayloadPkg: Fix issues when MULTIPLE_DEBUG_PORT_SUPPORT is true
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4427

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

Cc: Guo Dong <guo.dong@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Sean Rhodes <sean@starlabs.systems>
Cc: James Lu <james.lu@intel.com>
Reviewed-by: Gua Guo <gua.guo@intel.com>
Signed-off-by: PaytonX Hsieh <paytonx.hsieh@intel.com>
2023-05-02 07:11:21 +00:00
BruceX Wang 95ef765839 UefiPayloadPkg: Clang dependency removal
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4426

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

Cc: Guo Dong <guo.dong@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Sean Rhodes <sean@starlabs.systems>
Cc: James Lu <james.lu@intel.com>
Signed-off-by: BruceX Wang <brucex.wang@intel.com>
Reviewed-by: Gua Guo <gua.guo@intel.com>
2023-04-28 05:54:26 +00:00
Linus Wu 67b5dba791 UefiPayloadPkg: Move Network modules from Dxe FV to Network FV in elf
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4417

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

Cc: Guo Dong <guo.dong@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Sean Rhodes <sean@starlabs.systems>
Cc: James Lu <james.lu@intel.com>
Signed-off-by: Linus Wu <linusx.wu@intel.com>
Reviewed-by: Gua Guo <gua.guo@intel.com>
2023-04-20 18:47:10 +00:00
Sean Rhodes 89520115b8 UefiPayloadPkg: Update default memory type information for S4
Copied values from OVMF, these are sufficient for a debug build.

Cc: Guo Dong <guo.dong@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Sean Rhodes <sean@starlabs.systems>
Cc: James Lu <james.lu@intel.com>
Cc: Gua Guo <gua.guo@intel.com>
Reviewed-by: Sean Rhodes <sean@starlabs.systems>
Signed-off-by: Benjamin Doron <benjamin.doron00@gmail.com>
Signed-off-by: Sean Rhodes <sean@starlabs.systems>
2023-04-12 11:50:30 +00:00
Benjamin Doron dc5f2905eb UefiPayloadPkg: Always build MemoryTypeInformation HOB for DXE GCD
MemoryType information assists GCD with defragmenting the memory map.
When the DXE core starts, GCD adds memory descriptors for the resource
descriptors HOBs. This allocates heap space which can be reused later
as the bins by memory type. It seems memory allocation prefers low
ranges.

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

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

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

Cc: Guo Dong <guo.dong@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Sean Rhodes <sean@starlabs.systems>
Cc: James Lu <james.lu@intel.com>
Cc: Gua Guo <gua.guo@intel.com>
Reviewed-by: Sean Rhodes <sean@starlabs.systems>
Signed-off-by: Benjamin Doron <benjamin.doron00@gmail.com>
2023-04-12 11:50:30 +00:00
Rebecca Cran 33f30cfec2 UefiPayloadPkg: Update code to be more C11 compliant by using __func__
__FUNCTION__ is a pre-standard extension that gcc and Visual C++ among
others support, while __func__ was standardized in C99.

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

Signed-off-by: Rebecca Cran <rebecca@bsdio.com>
Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
Reviewed-by: Gua Guo <gua.guo@intel.com>
Reviewed-by: James Lu <james.lu@intel.com>
2023-04-10 14:19:57 +00:00
KasimX Liu cdf6ff1719 UefiPayloadPkg:Add new build commands for UniversalPayload
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4375

add '-pb' command of build bios with exist PreUniversalPayload file.
    '-e'  command of olny build the UniversalPayloadentry file.

Cc: Guo Dong <guo.dong@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Reviewed-by: James Lu <james.lu@intel.com>
Reviewed-by: Gua Guo <gua.guo@intel.com>
Signed-off-by: KasimX Liu <kasimx.liu@intel.com>
2023-04-07 03:47:30 +00:00
Linus Wu e3e88d90e8 UefiPayloadPkg: Support more input parameter
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4386

Add additional input parameter support
--SpecRevision: user input spec version
--Revision: user input revision
--ProducerId: producer company name
1. UniversalPayloadBuild.py
2. Downgrade spec revision from 0.9 to 0.7

Cc: Guo Dong <guo.dong@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Sean Rhodes <sean@starlabs.systems>
Cc: James Lu <james.lu@intel.com>
Reviewed-by: Gua Guo <gua.guo@intel.com>

Signed-off-by: Linus Wu <linusx.wu@intel.com>
2023-03-30 02:25:13 +00:00
Gua Guo 1bfc89414d UefiPayloadPkg: Add gUefiAcpiBoardInfoGuid support
if system both exist gUefiAcpiBoardInfoGuid and rsdp,
we may need to use gUefiAcpiBoardInfoGuid as final
config to have backward support.

Cc: Guo Dong <guo.dong@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Sean Rhodes <sean@starlabs.systems>
Reviewed-by: James Lu <james.lu@intel.com>

Signed-off-by: Gua Guo <gua.guo@intel.com>
2023-03-27 04:21:28 +00:00
MarsX Lin 961792c9d6 UefiPayloadPkg: Correct MAX_LOGICAL_PROCESSORS value
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4372

Correct MAX_LOGICAL_PROCESSORS value to 1024

Cc: Guo Dong <guo.dong@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Sean Rhodes <sean@starlabs.systems>
Reviewed-by: James Lu <james.lu@intel.com>
Reviewed-by: Gua Guo <gua.guo@intel.com>

Signed-off-by: MarsX Lin <marsx.lin@intel.com>
2023-03-14 09:51:58 +00:00
Yu Pu a4c9c2b0f0 UefiPayloadPkg: Remove UefiCpuLib from module INFs.
Because UefiCpuPkg/UefiCpuLib is merged to MdePkg/CpuLib, remove the
dependency of UefiCpuLib.

Reviewed-by: Guo Dong <guo.dong@intel.com>
Reviewed-by: James Lu <james.lu@intel.com>
Reviewed-by: Gua Guo <gua.guo@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>
2023-03-10 08:23:56 +00:00
Xie, Yuanhao 6bc74286e7 UefiPayloadPkg: Add CpuPageTableLib required by MpInitLib.
Add CpuPageTableLib required by MpInitLib in UefiPayloadPkg.

Cc: Guo Dong <guo.dong@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Sean Rhodes <sean@starlabs.systems>
Cc: James Lu <james.lu@intel.com>
Cc: Gua Guo <gua.guo@intel.com>
Signed-off-by: Yuanhao Xie <yuanhao.xie@intel.com>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Tested-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
2023-03-07 08:14:59 +00:00
MarsX Lin 1eeca0750a UefiPayloadPkg: remove the change that get platform specific logic
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4241

Since UefiPayloadPkg had supported multiple firmware volume,
remove the platform specific logic via protocol

Cc: Ray Ni <ray.ni@intel.com>
Cc: Sean Rhodes <sean@starlabs.systems>
Cc: Gua Guo <gua.guo@intel.com>
Reviewed-by: James Lu <james.lu@intel.com>
Reviewed-by: Guo Dong <guo.dong@intel.com>

Signed-off-by: MarsX Lin <marsx.lin@intel.com>
2023-02-23 07:47:12 +00:00
KasimX Liu 2f2fd79fc4 UefiPayloadPkg: Set RTC dynamic PCD to PeiPCDdatabase
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4193

In order to remove RTC_INDEX/RTC_TARGET from
the UplBuild macro list,change the RTC_INDEX
/RTC_TARGET type from PcdsFixedAtBuild to PcdsDynamicEx

Reviewed-by: Guo Dong <guo.dong@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: James Lu <james.lu@intel.com>
Reviewed-by: Gua Guo <gua.guo@intel.com>
Signed-off-by: KasimX Liu <kasimx.liu@intel.com>
2023-01-31 15:04:26 +00:00
Ning Feng 2cc6d4c8ed UefiPayloadPkg: Fix debug print error level hob not save correct
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4264
Fix debug print error level hob not save correct DebugPrintErrorlevel
Should cover the case:
Header.Length == UNIVERSAL_PAYLOAD_SIZEOF_THROUGH_FIELD ()
Cc: Ray Ni <ray.ni@intel.com>
Cc: Sean Rhodes <sean@starlabs.systems>
Cc: James Lu <james.lu@intel.com>
Cc: Gua Guo <gua.guo@intel.com>
Signed-off-by: Ning Feng <ning.feng@intel.com>
Reviewed-by: Gua Guo <gua.guo@intel.com>
2023-01-10 03:44:38 +00:00
Yuanhao Xie 5ef3990735 Revert "UefiPayloadPkg: Add CpuPageTableLib required by MpInitLib."
This reverts commit 3f378450df, since the
commit 73ccde8 introduced CpuPageTableLib dependency which resolved
for UefiPayloadPkg need to be reverted.

Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=4234
Cc: Guo Dong <guo.dong@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Sean Rhodes <sean@starlabs.systems>
Cc: James Lu <james.lu@intel.com>
Cc: Gua Guo <gua.guo@intel.com>
Reviewed-by: Gua Guo <gua.guo@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Signed-off-by: Yuanhao Xie <yuanhao.xie@intel.com>
2023-01-09 17:53:41 +00:00
KasimX Liu d8d829b89d UefiPayloadPkg: Move RTC PCD to dynamic PCD
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4193

In order to remove RTC_INDEX/RTC_TARGET from
the UplBuild macro list,change the RTC_INDEX
/RTC_TARGET type from PcdsFixedAtBuild to PcdsDynamicEx

Reviewed-by: Guo Dong <guo.dong@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: James Lu <james.lu@intel.com>
Reviewed-by: Gua Guo <gua.guo@intel.com>
Signed-off-by: KasimX Liu <kasimx.liu@intel.com>
2023-01-06 16:10:13 +00:00
Guo Dong d8d4abdff9 UefiPayloadPkg: Fix boot issue for non-universal payload
BDS module was moved from DXEFV to newly created BDSFV recently.
Non-universal UEFI payload doesn't support multiple FV, so it failed
to boot since BDS module could not be found.
This patch add BDS back to DXEFV when UNIVERSAL_PAYLOAD is not set.

Cc: Ray Ni <ray.ni@intel.com>
Cc: Sean Rhodes <sean@starlabs.systems>
Cc: James Lu <james.lu@intel.com>
Cc: Gua Guo <gua.guo@intel.com>
Signed-off-by: Guo Dong <guo.dong@intel.com>
Reviewed-by: James Lu <james.lu@intel.com>
Reviewed-by: Gua Guo <gua.guo@intel.com>
2022-12-22 17:16:54 +00:00
MarsX Lin 3c16e6fb97 UefiPayloadPkg: Fixed that The UPL info section is not aligned at 4-byte
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4196

Align .upld_info with 4-byte boundary by spec

Cc: Guo Dong <guo.dong@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Sean Rhodes <sean@starlabs.systems>
Reviewed-by: James Lu <james.lu@intel.com>
Reviewed-by: Gua Guo <gua.guo@intel.com>
Signed-off-by: MarsX Lin <marsx.lin@intel.com>
2022-12-21 04:44:29 +00:00
Yuanhao Xie 3f378450df UefiPayloadPkg: Add CpuPageTableLib required by MpInitLib.
Add CpuPageTableLib required by MpInitLib in UefiPayloadPkg.

Signed-off-by: Yuanhao Xie <yuanhao.xie@intel.com>
Reviewed-by: Gua Guo <gua.guo@intel.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
2022-12-20 08:38:28 +00:00
Kavya 6937fc8338 UefiPayloadPkg/SerialPortLib: Enhance multi port behaviour
Add condition to return success if mUartCount is greater
than zero in SerialPortInitialize() to avoid filling mUartInfo
with the same hob data when SerialPortInitialize() is called
multiple times. Also add proper conditions in SerialPortRead
function to read the data properly from multiple UART's.

Cc: Guo Dong <guo.dong@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: James Lu <james.lu@intel.com>
Reviewed-by: Gua Guo <gua.guo@intel.com>
Signed-off-by: Kavya <k.kavyax.sravanthi@intel.com>
2022-12-20 07:53:41 +00:00
jdzhang 560f9bb063 UefiPayloadPkg: Define default values for the DynamicEX PCDs
The following PCDs have no value in UefiPayloadPkg.dsc
and they can not pass the Ecc tool check, so assign
the default values the same as they are in *.dec file.
1. gEfiMdeModulePkgTokenSpaceGuid.PcdAriSupport
2. gEfiMdeModulePkgTokenSpaceGuid.PcdMrIovSupport
3. gEfiMdeModulePkgTokenSpaceGuid.PcdSrIovSuppor
4. gEfiMdeModulePkgTokenSpaceGuid.PcdSrIovSystemPageSize
5. gUefiCpuPkgTokenSpaceGuid.PcdCpuApInitTimeOutInMicroSeconds
6. gUefiCpuPkgTokenSpaceGuid.PcdCpuApLoopMode
7. gUefiCpuPkgTokenSpaceGuid.PcdCpuMicrocodePatchAddress
8. gUefiCpuPkgTokenSpaceGuid.PcdCpuMicrocodePatchRegionSize

Reviewed-by: Gua Guo <gua.guo@intel.com>
Signed-off-by: jdzhang <jdzhang@kunluntech.com.cn>
2022-12-20 03:53:47 +00:00
MarsX Lin 05da2d24b0 UefiPayloadPkg: Move bdsdxe.inf from DXEFV to BDSFV
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4196

Since UefiPayload had supported multiple fv,
move bdsdxe.inf to new firmware volume and
modify the script of UniversalPayloadPkgBuild.py to
support bdsdxe fv in elf file

Cc: Guo Dong <guo.dong@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Sean Rhodes <sean@starlabs.systems>
Reviewed-by: James Lu <james.lu@intel.com>
Reviewed-by: Gua Guo <gua.guo@intel.com>

Signed-off-by: MarsX Lin <marsx.lin@intel.com>
2022-12-19 07:28:55 +00:00
MarsX Lin a639248bd0 UefiPayloadPkg: Support multiple firmware volume
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4164

To support multiple FVs provided by UPL

Cc: Guo Dong <guo.dong@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Sean Rhodes <sean@starlabs.systems>
Reviewed-by: James Lu <james.lu@intel.com>
Reviewed-by: Gua Guo <gua.guo@intel.com>

Signed-off-by: MarsX Lin <marsx.lin@intel.com>
2022-12-06 10:13:54 +00:00
VictorX Hsu 85d805ed32 UefiPayloadPkg: The UPL info section is not aligned at 4-byte boundary
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4153

1.Upgrade spec revision to 0.9
2.Align .upld_info with 4-byte boundary by spec

Reviewed-by: Guo Dong <guo.dong@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Reviewed-by: James Lu <james.lu@intel.com>
Cc: Gua Guo <gua.guo@intel.com>
Signed-off-by: VictorX Hsu <victorx.hsu@intel.com>
2022-11-28 06:59:08 +00:00
Min M Xu a89f558d3c OvmfPkg/UefiCpuPkg/UefiPayloadPkg: Rename VmgExitLib to CcExitLib
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=4123

VmgExitLib once was designed to provide interfaces to support #VC handler
and issue VMGEXIT instruction. After TDVF (enable TDX feature in OVMF) is
introduced, this library is updated to support #VE as well. Now the name
of VmgExitLib cannot reflect what the lib does.

This patch renames VmgExitLib to CcExitLib (Cc means Confidential
Computing). This is a simple renaming and there is no logic changes.
After renaming all the VmgExitLib related codes are updated with
CcExitLib. These changes are in OvmfPkg/UefiCpuPkg/UefiPayloadPkg.

Cc: Guo Dong <guo.dong@intel.com>
Cc: Sean Rhodes <sean@starlabs.systems>
Cc: James Lu <james.lu@intel.com>
Cc: Gua Guo <gua.guo@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
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>
Reviewed-by: James Lu <james.lu@intel.com>
Reviewed-by: Gua Guo <gua.guo@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
Signed-off-by: Min Xu <min.m.xu@intel.com>
2022-11-14 04:55:34 +00:00
VictorX Hsu 2695e49219 UefiPayloadPkg: Boot mode in PHIT HOB will not be updated
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4136

System will depend on Boot Mode value to do different behavior
Update during Capsule Update process. So UPL need to support
update boot mode.

Cc: Guo Dong <guo.dong@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Reviewed-by: James Lu <james.lu@intel.com>
Reviewed-by: Gua Guo <gua.guo@intel.com>
Signed-off-by: VictorX Hsu <victorx.hsu@intel.com>
2022-11-04 12:38:29 +08:00
Gua Guo 5bd2dbc698 UefiPayloadPkg: Remove deprecate Crypto Service
REF : https://bugzilla.tianocore.org/show_bug.cgi?id=4096

TDES and ARC4 services are deprecated so set it as disable.

Cc: Guo Dong <guo.dong@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Reviewed-by: James Lu <james.lu@intel.com>
Signed-off-by: Gua Guo <gua.guo@intel.com>
2022-10-13 10:43:52 +08:00