124 Commits

Author SHA1 Message Date
Benjamin Doron
07d0c98908 S3FeaturePkg: Implement working S3 resume
Follow-up commits to MinPlatform (PeiFspWrapperHobProcessLib for
memory) and FSP-related board libraries (policy overrides)
required for successful S3 resume.

Factored allocation logic into new module to avoid MinPlatform
dependency on S3Feature package.

TODO: Can optimise required size.

Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Ankit Sinha <ankit.sinha@intel.com>
Cc: Sai Chaganty <rangasai.v.chaganty@intel.com>
Cc: Isaac Oram <isaac.w.oram@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Signed-off-by: Benjamin Doron <benjamin.doron00@gmail.com>
Reviewed-by: Isaac Oram <isaac.w.oram@intel.com>

S3FeaturePkg/Build: Add libraries needed by S3FeaturePkg

This change is needed for proposed S3FeaturePkg additions.
Changes ensure standalone build for S3FeaturePkg and AdvancedFeaturePkg

Cc: Sai Chaganty <rangasai.v.chaganty@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Benjamin Doron <benjamin.doron00@gmail.com>
Signed-off-by: Isaac Oram <isaac.w.oram@intel.com>
Reviewed-by: Nate DeSimone <nathaniel.l.desimone@intel.com>

MinPlatformPkg/S3: Use EFI_PHYSICAL_ADDRESS for address

This change fixes build warnings with type casts from some compilers.
Also changes type for ACPI_S3_MEMORY S3PeiMemBase to EFI_PHYSICAL_ADDRESS.
This generally makes code eaiser to understand as opposed to UINT64.

Cc: Sai Chaganty <rangasai.v.chaganty@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Chasel Chiu <chasel.chiu@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Cc: Benjamin Doron <benjamin.doron00@gmail.com>
Signed-off-by: Isaac Oram <isaac.w.oram@intel.com>
Reviewed-by: Nate DeSimone <nathaniel.l.desimone@intel.com>
2022-10-11 17:52:24 -07:00
Pedro Falcato
e55f0527dd Ext4Pkg: Fix broken stack protector-enabled builds
As reported by Rebecca Cran, there was some build breakage when
compiling with stack-protector-on-by-default toolchains. Adding the
proper library to the DSC should fix it.

Cc: Rebecca Cran <rebecca@quicinc.com>
Cc: Marvin Häuser <mhaeuser@posteo.de>
Signed-off-by: Pedro Falcato <pedro.falcato@gmail.com>
Reviewed-by: Rebecca Cran <rebecca@quicinc.com>
Reviewed-by: Marvin Häuser <mhaeuser@posteo.de>
2022-09-16 10:59:38 +01:00
Savva Mitrofanov
76fc44fecb Ext4Pkg: Add base containing record macro for EXT4_FILE
We shouldn't use direct casts, because in the future it could break
the code, so using BASE_CR would be safe against possible structure
changes and rearrangements

Cc: Marvin Häuser <mhaeuser@posteo.de>
Cc: Pedro Falcato <pedro.falcato@gmail.com>
Cc: Vitaly Cheptsov <vit9696@protonmail.com>
Signed-off-by: Savva Mitrofanov <savvamtr@gmail.com>
Reviewed-by: Marvin Häuser <mhaeuser@posteo.de>
Reviewed-by: Pedro Falcato <pedro.falcato@gmail.com>
2022-09-15 21:58:56 +01:00
Savva Mitrofanov
e81432fbac Ext4Pkg: Add symbolic links support
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3677

Provided support for symlink file type. Added routine which allows
reading and following them through recursive open() call. As a security
meausure implemented simple symlink loop check with nest level limit
equal 8. Also this patch moves Ext4Open functionality to internal
routine.

Cc: Marvin Häuser <mhaeuser@posteo.de>
Cc: Pedro Falcato <pedro.falcato@gmail.com>
Cc: Vitaly Cheptsov <vit9696@protonmail.com>
Signed-off-by: Savva Mitrofanov <savvamtr@gmail.com>
Reviewed-by: Pedro Falcato <pedro.falcato@gmail.com>
2022-09-15 21:58:30 +01:00
Isaac Oram
83ea6b2de1 PlatformPayloadFeaturePkg/Build: Use MinPlatform PCD include
Fix build issue from removed PCD and use MinPlatformFeaturesPcd.dsc.inc.

Cc: Sai Chaganty <rangasai.v.chaganty@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Signed-off-by: Isaac Oram <isaac.w.oram@intel.com>
Reviewed-by: Sai Chaganty <rangasai.v.chaganty@intel.com>
2022-09-12 18:13:51 -07:00
CrystalLee
341d41ac40 Features/Intel/OutOfBandManagement/AsfFeaturePkg: Add initial package
Add a new feature package for Alert standard format support.

Alert Standard format specification(DSP0136)
REF:https://www.dmtf.org/sites/default/files/standards/documents/DSP0136.pdf

Cc: Sai Chaganty <rangasai.v.chaganty@intel.com>
Cc: Isaac Oram <isaac.w.oram@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Signed-off-by: CrystalLee <CrystalLee@ami.com>
Reviewed-by: Isaac Oram <isaac.w.oram@intel.com>
2022-09-07 15:37:34 -07:00
Pedro Falcato
bcad50b813 Ext4Pkg: Fix bug in EXT4_HAS_GDT_CSUM
Caught when running clang-tidy on this code. Also tidies up some logic
in BlockGroup.c

Cc: Marvin Häuser <mhaeuser@posteo.de>
Signed-off-by: Pedro Falcato <pedro.falcato@gmail.com>
Reviewed-by: Marvin Häuser <mhaeuser@posteo.de>
2022-09-05 23:36:08 +01:00
Isaac Oram
63f9e0d918 Features/Intel: Reduce duplicate code
Enable simpler initialation of the MinPlatformPkg feature
selection PCD.  Most features and boards don't benefit from
initializing these.

Cc: Sai Chaganty <rangasai.v.chaganty@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Signed-off-by: Isaac Oram <isaac.w.oram@intel.com>
Reviewed-by: Nate DeSimone <nathaniel.l.desimone@intel.com>
2022-08-31 18:42:40 -07:00
Isaac Oram
1096b98314 PlatformPayloadFeaturePkg: Update contents to match feature conventions
Rename gPlatformPayloadPkgTokenSpaceGuid to
gPlatformPayloadFeaturePkgTokenSpaceGuid

Rename PcdPayloadPackageFeatureEnable to PcdPlatformPayloadFeatureEnable

Update Readme including format improvements

Cc: Sai Chaganty <rangasai.v.chaganty@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Guo Dong <guo.dong@intel.com>
Signed-off-by: Isaac Oram <isaac.w.oram@intel.com>
Reviewed-by: Guo Dong <guo.dong@intel.com>
Reviewed-by: Sai Chaganty <rangasai.v.chaganty@intel.com>
2022-08-16 14:53:25 -07:00
Isaac Oram
2430726366 PlatformPayloadPkg: Rename to match other feature conventions
Rename PlatformPayloadPkg to PlatformPayloadFeaturePkg.
Rename Package DEC, DSC, FDF and py scripts to match.
Search and replace PlatformPayloadPkg with PlatformPayloadFeaturePkg.

Cc: Sai Chaganty <rangasai.v.chaganty@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Guo Dong <guo.dong@intel.com>
Signed-off-by: Isaac Oram <isaac.w.oram@intel.com>
Reviewed-by: Sai Chaganty <rangasai.v.chaganty@intel.com>
Reviewed-by: Guo Dong <guo.dong@intel.com>
2022-08-16 14:52:54 -07:00
Isaac Oram
b97a3f70e0 PlatformPayloadPkg: Fix AdvancedFeaturePkg build issue
Feature packages should build with -a IA32 -a X64.
The commonly board selected libraries were moved to the
PlatformPayloadPkg build so as not to conflict with other
advanced features.

Cc: Sai Chaganty <rangasai.v.chaganty@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Guo Dong <guo.dong@intel.com>
Signed-off-by: Isaac Oram <isaac.w.oram@intel.com>
Reviewed-by: Sai Chaganty <rangasai.v.chaganty@intel.com>
Reviewed-by: Guo Dong <guo.dong@intel.com>
2022-08-16 14:52:53 -07:00
Benjamin Doron
d85e4251ce AcpiDebugFeaturePkg: Included modules are mutually exclusive
The DXE and SMM versions of AcpiDebug perform the same task and
are therefore mutually exclusive. Including both modules results in a
duplicate ACPI table, resulting in the feature not working at all.

Therefore, add a new PCD to determine which module will be included.
Now, either version successfully write to the debug buffer.

Cc: Sai Chaganty <rangasai.v.chaganty@intel.com>
Cc: Isaac Oram <isaac.w.oram@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Ankit Sinha <ankit.sinha@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Eric Dong <eric.dong@intel.com>
Signed-off-by: Benjamin Doron <benjamin.doron00@gmail.com>
Reviewed-by: Isaac Oram <isaac.w.oram@intel.com>
2022-08-08 12:25:11 -07:00
Guo Dong
edc718521e Features/Intel/PlatformPayloadPkg: add platform payload FV
UefiPayloadPkg in EDK2 repo was added SMM variable support for Intel
platform with SPI flash. But some of the modules for SMM variable are
Intel PCH specific (e.g. SPI library, SMM PCH module), so move these
modules into edk2-platforms repo.

A platform payload FV could be built from PlatformPayloadPkg which works
on Intel platforms (e.g.. ICX, APL, CML, CFL, KBL, TGL, ADL, etc.) with
SMM variable. This platform payload FV could be added into universal UEFI
payload built from EDK2 UefiPayloadPkg.

The steps to build a complete payload (use windows host as example):

set WORKSPACE=c:\payload
set PACKAGES_PATH=C:\payload\edk2;C:\payload\edk2-platforms\Platform\Intel;
C:\payload\edk2-platforms\Features\Intel;
edk2\edksetup.bat

python edk2\UefiPayloadPkg\UniversalPayloadBuild.py -t VS2019
 -D SMM_SUPPORT=TRUE -DVARIABLE_SUPPORT=NONE

python edk2-platforms\Features\Intel\PlatformPayloadPkg\PlatformPayloadPkg.py
 -t VS2019 -D SMM_VARIABLE=TRUE -s

The final UEFI payload generated at Build\UefiPayloadPkgX64\UniversalPayload.elf
if build success.

Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Sean Rhodes <sean@starlabs.systems>
Signed-off-by: Guo Dong <guo.dong@intel.com>
Signed-off-by: Isaac Oram <isaac.w.oram@intel.com>
Reviewed-by: Sai Chaganty <rangasai.v.chaganty@intel.com>
2022-08-08 12:16:22 -07:00
Pedro Falcato
436a8612ae Ext4Pkg: Sanity check the inode size
Check its alignment and value for possible bad values.

Cc: Marvin Häuser <mhaeuser@posteo.de>
Signed-off-by: Pedro Falcato <pedro.falcato@gmail.com>
Reviewed-by: Marvin Häuser <mhaeuser@posteo.de>
2022-08-07 15:28:43 +01:00
Savva Mitrofanov
c367ec54f7 Ext4Pkg: Code correctness and security improvements
This changes tends to improve security of code sections by fixing
integer overflows, missing alignment checks, unsafe casts, also
simplified some routines, fixed compiler warnings and corrected some
code mistakes.

- Set HoleLen to UINT64 to prevent truncation in Ext4Read function
- Replace EXT4_BLOCK_NR with 32-bit EXT2_BLOCK_NR in BlockMap, because
by specification files using block maps must be placed within the first
2^32 blocks of a filesystem
- Replace UNREACHABLE with ASSERT (FALSE) in case of new checksum
algorithms, due to it is an invariant violation rather than unreachable
path
- Solve compiler warnings. Initialize all fields in gExt4BindingProtocol
Fix comparison of integer expressions of different signedness
- Field name_len has type CHAR8, while filename limit is 255
(EXT4_NAME_MAX), so because structure EXT4_DIR_ENTRY would be
unchangeable in future, we could drop this check without any
assertions
- Simplify Ext4RemoveDentry logic by using IsNodeInList
- Fix possible int overflow in Ext4ExtentsMapKeyCompare
- Return bad block type in Ext4GetBlockpath
- Adds 4-byte aligned check for superblock group descriptor size field

Cc: Marvin Häuser <mhaeuser@posteo.de>
Cc: Pedro Falcato <pedro.falcato@gmail.com>
Cc: Vitaly Cheptsov <vit9696@protonmail.com>
Signed-off-by: Savva Mitrofanov <savvamtr@gmail.com>
Reviewed-by: Marvin Häuser <mhaeuser@posteo.de>
Reviewed-by: Pedro Falcato <pedro.falcato@gmail.com>
2022-08-07 00:24:07 +01:00
KalaiyarasanX Thangaraj
d09dafd0b9 VirtualKeyboardFeaturePkg: Pre OS virtual keyboard touch response are very slow with I2C touch panel
On one Touch, multiple Reads happend and  this reads varying based on Key Press time.
Resulting in Multiple key press update on screen. This condition avoids KeyPressed skips
resulting due to faster key press and update only on valid key press.

Cc: Dandan Bi <dandan.bi@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Madhan Pethaiyan <madhan.pethaiyan@intel.com>
Cc: Kathappan Esakkithevar <kathappan.esakkithevar@intel.com>
Cc: Madhusudhan Balaji <madhusudhan.balaji@intel.com>
Signed-off-by: KalaiyarasanX Thangaraj <kalaiyarasanx.thangaraj@intel.com>
Reviewed-by:Balaji, Madhusudhan madhusudhan.balaji@intel.com
Reviewed-by: Dandan Bi <dandan.bi@intel.com>
2022-08-03 09:55:49 +08:00
Thangaraj, KalaiyarasanX
57729d3c34 VirtualKeyboardFeaturePkg: Pre OS virtual keyboard touch are not working with I2C touch panel
Vktimer event Task Priority Level changed to TPL_CALLBACK from TPL_NOTIFY
to fix Virtual Keyboard touch slowness issues and touch not working issues

Cc: Dandan Bi <dandan.bi@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Madhan Pethaiyan <madhan.pethaiyan@intel.com>
Cc: Kathappan Esakkithevar <kathappan.esakkithevar@intel.com>
Cc: Madhusudhan Balaji <madhusudhan.balaji@intel.com>
Signed-off-by: KalaiyarasanX Thangaraj <kalaiyarasanx.thangaraj@intel.com>
Reviewed-by: Dandan Bi <dandan.bi@intel.com>
2022-07-21 09:05:52 +08:00
Isaac Oram
24316d1e48 IpmiFeaturePkg/GenericIpmi: Fix GCC compilation warnings
Fix compiler warnings for unused variables.
Fix PeimIpmiInterfaceInit to return initialization status instead of
EFI_SUCCESS.

Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Signed-off-by: Isaac Oram <isaac.w.oram@intel.com>
Reviewed-by: Nate DeSimone <nathaniel.l.desimone@intel.com>
2022-07-20 15:22:53 -07:00
Pedro Falcato
7c46116b0e Ext4Pkg: Add ext2/3 support
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3745

Adds ext2/3 support by supporting (legacy) block maps.
Also fixes a bug regarding uninitialised extents.

Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Signed-off-by: Pedro Falcato <pedro.falcato@gmail.com>
Acked-by: Liming Gao <gaoliming@byosoft.com.cn>
2022-06-14 16:56:00 +01:00
Pedro Falcato
f47290b730 Ext4Pkg: Format using uncrustify
Previously, Ext4Pkg was formatted using uncrustify with an older config file.
Re-format it using the upstream edk2 uncrustify config file.

Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Signed-off-by: Pedro Falcato <pedro.falcato@gmail.com>
Acked-by: Liming Gao <gaoliming@byosoft.com.cn>
2022-06-14 16:56:00 +01:00
Pedro Falcato
a7e81ad030 Ext4Pkg: Replace the CRC implementations with BaseLib
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3871

Since the existing CRC16/CRC32c implementations have been/will be
a part of BaseLib, use BaseLib and remove the Crc16.c/Crc32c.c.

Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>

Signed-off-by: Pedro Falcato <pedro.falcato@gmail.com>
Acked-by: Liming Gao <gaoliming@byosoft.com.cn>
2022-06-14 16:56:00 +01:00
Isaac Oram
5757dceecb BeepDebugFeaturePkg: Enable FixedAtBuild PCD type
Enable PcdStatusCodeUseBeep to allow FixedAtBuild type for backwards
compatibility.

Cc: Sai Chaganty <rangasai.v.chaganty@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Signed-off-by: Isaac Oram <isaac.w.oram@intel.com>
Reviewed-by: Sai Chaganty <rangasai.v.chaganty@intel.com>
2022-02-15 14:12:25 -08:00
Isaac Oram
c344b0dd87 AdvancedFeaturePkg/Build: Add FDF to create FV for all features
This produces three FV and no FD.
FvAdvancedPreMemory.fv contains PEIM for pre-memory use.
FvAdvancedUncompressed.fv contains post memory PEIM and drivers for DXE
and SMM.
FvAdvanced.fv contains the compressed FvAdvancedUncompressed.fv in an
FV file format as is common practice.

These FV are not expected to be used as is, but are needed to test the
individual features for things like filename collisions.  Some features
require build customization so binary reuse is not feasible at this time.

Cc: Sai Chaganty <rangasai.v.chaganty@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>

Signed-off-by: Isaac Oram <isaac.w.oram@intel.com>
Reviewed-by: Nate DeSimone <nathaniel.l.desimone@intel.com>
2022-02-02 15:26:21 -08:00
Isaac Oram
388975530e AdvancedFeaturePkg: Add missing features
The AdvancedFeaturePkg is supposed to include all features.
Add Beep Debug feature to include DSC and FDF.

Order features based on their domains.

Cc: Sai Chaganty <rangasai.v.chaganty@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>

Signed-off-by: Isaac Oram <isaac.w.oram@intel.com>
Reviewed-by: Nate DeSimone <nathaniel.l.desimone@intel.com>
2022-02-02 15:26:21 -08:00
Isaac Oram
280304c436 Usb3DebugFeaturePkg: Align with feature design guidelines
Remove build of common libraries.  Boards will already have those.

Modified Usb3DebugFeature.dsc to treat libraries like libraries.
Usb3DebugFeaturePkg.dsc uses the component trick for standalone build
testing of the libraries.

Added a PCD to allow board to select between NULL, regular, and IO MMU
library instances.  Prior implementation of Usb3DebugFeature.dsc was not
useful as an includable file because it didn't specify LibaryClass
instance to use.

Removed unused CMOS PCD.

Updated some of the readme sections.

Cc: Eric Dong <eric.dong@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>

Signed-off-by: Isaac Oram <isaac.w.oram@intel.com>
Reviewed-by: Nate DeSimone <nathaniel.l.desimone@intel.com>
2022-02-02 15:26:21 -08:00