Commit Graph

33443 Commits

Author SHA1 Message Date
Revathy V 9dc7fb819c MdePkg: Updated Type 4 Info as per Smbios 3.8.0
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4861

Added PROCESSOR_FAMILY_NAME support in MdePkg.

Signed-off-by: Revathy <revathyv@ami.com>
2024-10-22 18:25:54 +00:00
Abdul Lateef Attar ad522d9609 DynamicTablesPkg: Update X64 FADT XPm1aEvtBlk
Copy the provided configuration data for
PM1 event block.

Cc: Sami Mujawar <Sami.Mujawar@arm.com>
Cc: Pierre Gondois <pierre.gondois@arm.com>
Signed-off-by: Abdul Lateef Attar <AbdulLateef.Attar@amd.com>
2024-10-22 13:25:31 +00:00
Rebecca Cran 11bd2fa072 Update CI config following CompilerIntrinsicsLib move from ArmPkg
Library/CompilerIntrinsicsLib was moved from ArmPkg to MdePkg.
Since MdePkg is passing EccCheck without needing to ignore
CompilerIntrinsicsLib, just remove it from ArmPkg.ci.yaml.

This fixes the error during "stuart_ci_build":

ERROR - EccCheck.IgnoreInf ->
Build/.pytool/Plugin/EccCheck/ArmPkg/Library/CompilerIntrinsicsLib
not found in filesystem.  Invalid ignore files

Signed-off-by: Rebecca Cran <rebecca@bsdio.com>
2024-10-22 12:05:12 +00:00
Abdul Lateef Attar cb1db8b9b9 DynamicTablesPkg: Update creator id for WSMT table
Update WSMT table with generic creator id.

Cc: Sami Mujawar <Sami.Mujawar@arm.com>
Cc: Pierre Gondois <pierre.gondois@arm.com>
Signed-off-by: Abdul Lateef Attar <AbdulLateef.Attar@amd.com>
2024-10-22 08:14:47 +00:00
Oleg Ilyasov 7b3969c951 MdeModulePkg UsbNetwork: Use USB class definition from MdePkg
- Class specific types for interface and endpoint are generic
- Definitions are in IndustryStandard/Usb.h
- Remove type redefinitions
- Update references to the descriptor types

Signed-off-by: Oleg Ilyasov <olegi@ami.com>
2024-10-22 05:40:04 +00:00
Jason Zhao e2ab098e65 ShellPkg/SmbiosView: Correct wrong length offset usage in SMBIOS Type4
The patch will correct wrong length offset usage in SMBIOS Type4.
For SMBIOS Ver3.6, length should be larger than 0x30.
For SMBIOS Ver3.8, length should be larger than 0x32.

Signed-off-by: Jason Zhao <jason.zhao@intel.com>
2024-10-22 03:57:20 +00:00
Sienski Piotr a19f50bb95 MdePkg/Include/Guid: Rename CXL definitions in Cper.h
[Issue Description]
In MdePkg/Include/Guid/Cper.h there are multiple definitions
regarding CXL that can do use EFI_ prefix in their names

[Resolution]
Rename these definitions in MdePkg/Include/Guid/Cper.h

Signed-off-by: Sienski Piotr <piotr.sienski@intel.com>
2024-10-21 15:59:39 +00:00
Mike Beaton 8f84eb0e76 BaseTools: Remove -Wno-unneeded-internal-declaration from CLANGDWARF
Subsequent to updating the 'null' DEBUG macro to explicitly
discard its expression, it is possible to remove this warning
suppression from CLANGDWARF and still successfully compile
its RELEASE build.

Note that CLANGPDB did and does not have this warning suppressed,
and so before updating the 'null' DEBUG macro, CLANGPDB RELEASE
was not building successfully in recent versions of clang,
but was stopping with the error:

.../edk2/OvmfPkg/VirtioSerialDxe/VirtioSerial.c:28:22: error:
variable &apos;EventNames&apos; is not needed and will not be
emitted [-Werror,-Wunneeded-internal-declaration]
STATIC CONST CHAR8  *EventNames[] = {
                     ^

This change makes the two CLANG variants match with respect
to this warning, and leaves the warning enabled which is
considered a benefit as it has the potential to catch real
coding errors

Signed-off-by: Mike Beaton <mjsbeaton@gmail.com>
2024-10-18 16:22:07 +00:00
Mike Beaton ae83c6b7fd MdePkg: Fix null macros for XCODE5 and CLANG
When building OvmfPkg in RELEASE mode in the XCODE5 toolchain, the
ASSERT_EFI_ERROR change prevents this error:

.../MdePkg/Library/UefiMemoryAllocationLib/MemoryAllocationLib.c:141:15:
error: variable 'Status' set but not used [-Werror,-Wunused-but-set-variable]
  EFI_STATUS  Status;
              ^

which is currently stopping the build.

When building in RELEASE mode in the CLANGPDB toolchain,the DEBUG macro
change prevents this error:

.../edk2/OvmfPkg/VirtioSerialDxe/VirtioSerial.c:28:22: error:
variable &apos;EventNames&apos; is not needed and will not be
emitted [-Werror,-Wunneeded-internal-declaration]
STATIC CONST CHAR8  *EventNames[] = {
                     ^

which is currently stopping the build.

CLANGDWARF produces the same error as CLANGPDB above, if
-Wno-unneeded-internal-declaration is removed from its build flags.
With the null DEBUG macro change, this warning suppression
can be removed from CLANGDWARF, which is considered a benefit
as it has the potential to catch real coding errors. This is
done in a subsequent commit.

This commit has the desirable side effect that we no longer require
(and cannot use) explicit `#ifndef MDEPKG_NDEBUG` around items only
used in DEBUG macros. This requires the ArmPkg change made here to
be in the same commit as the MdePkg changes.

Note: In common with existing macros in EDK II, including the pre-existing
and unchanged DEBUG/NOOPT versions of the macros which are modified here,
we use the standard approach of adding `do { ... } while (FALSE)` wrapping
to ensure that the macros behave correctly with surrounding code
(e.g. require a following ';' and do not combine in unexpected ways with
nearby conditionals).

Continuous-integration-options: PatchCheck.ignore-multi-package
Co-authored-by: Mikhail Krichanov <krichanov@ispras.ru>
Signed-off-by: Mike Beaton <mjsbeaton@gmail.com>
2024-10-18 16:22:07 +00:00
v-chhsieh 6e197a8ba5 MdePkg: Add Google Test Library and Protocol
Mock Libraries:
 MdePkg\Test\Mock\Library\GoogleTest\MockCpuLib
 MdePkg\Test\Mock\Library\GoogleTest\MockPciSegmentLib
 MdePkg\Test\Mock\Library\GoogleTest\MockReportStatusCodeLib
 MdePkg\Test\Mock\Library\GoogleTest\MockSmmServicesTableLib

Mock Protocol:
 MdePkg\Test\Mock\Include\GoogleTest\Protocol\MockMpService.h

Signed-off-by: jack Hsieh <v-chhsieh@microsoft.com>
Cc: Maintainer Shruti Gupta <shrugupt@microsoft.com>
Cc: Reviewer   Shruti Gupta <shrugupt@microsoft.com>
2024-10-17 17:03:15 +00:00
Jeremy Compostella 866abb2338 MdeModulePkg: Replace right bit shift operator with RShiftU64
Instead of using bit shift operations, it is preferable to use BaseLib
bit shift functions to prevent compilers from inserting intrinsics.

Signed-off-by: Jeremy Compostella <jeremy.compostella@intel.com>
2024-10-17 13:32:42 +00:00
Jeremy Compostella 996e740cc8 MdeModulePkg: Fix PeiAllocatePages() corner case
I recently ran into an AllocatePages() hang. It turns out that
AllocatePages() does not account for the Memory Allocation HOB when it
makes the decision of allocating out of free memory.

Here is the scenario:

  FreeMemoryTop    - 0x71C03000
  FreeMemoryBottom - 0x71BDBFD8
  => We have 159,784 bytes left => ~39.0098 pages left.

We attempt to allocate 39 pages. There are enough pages left but
allocating those pages requires to allocate a Memory Allocation HOB
which needs an extra 48 bytes. But once the pages are allocated,
there are only 40 bytes left.

In addition to taking into account the Memory Allocation HOB size,
this commit reverses the condition to keep it simple.

Signed-off-by: Jeremy Compostella <jeremy.compostella@intel.com>
2024-10-17 13:32:42 +00:00
Sienski Piotr 1b70dcd375 MdePkg/Include/Guid: Add missing CXL definitions to Cper.h
[Issue Description]
In MdePkg/Include/Guid/Cper.h there are missing multiple definitions
regarding CXL that can be found in UEFI 2.10 spec
chapters N.2.13 and N.2.14

[Resolution]
Add these definitions to MdePkg/Include/Guid/Cper.h

Signed-off-by: Sienski Piotr <piotr.sienski@intel.com>
2024-10-17 11:24:28 +00:00
Kun Qin 79598f34fa MdeModulePkg: PeiMain: Updated dispatcher for delayed dispatch
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4496

This change adds a check for PEI dispatcher to continue dispatching when
there are still pending delayed dispatch requests, to be compatible with
newly integrated Delayed Dispatcher PPI interface.

Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Dandan Bi <dandan.bi@intel.com>
Cc: Debkumar De <debkumar.de@intel.com>
Cc: Catharine West <catharine.west@intel.com>

Co-authored-by: John Schock <joschock@microsoft.com>
Signed-off-by: Kun Qin <kuqin12@gmail.com>
2024-10-17 08:51:15 +00:00
Kun Qin d64d1e195c MdeModulePkg: PeiMain: Introduce implementation of delayed dispatch
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4496

This change adds the implementation that fits the needs and description
of PI spec defined Delayed Dispatch PPI in Pei Core.

The PPI would allow minimal delay for registered callbacks. As well as
allowing other functions to wait for GUIDed delayed dispatch callbacks.

Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Dandan Bi <dandan.bi@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Debkumar De <debkumar.de@intel.com>
Cc: Catharine West <catharine.west@intel.com>

Co-authored-by: Mike Turner <mikeyt@pobox.com>
Co-authored-by: Sachin Ganesh <sachinganesh@ami.com>
Signed-off-by: Kun Qin <kuqin12@gmail.com>
2024-10-17 08:51:15 +00:00
Kun Qin b3f36e151d MdePkg: Update Delayed Dispatch PPI as per PI 1.8 A Spec
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4496

PI spec defined the `Register` function input argument `Delay` as output.
However, this parameter should be used to define the minmal time delay
the callback should fire. Thus it should be an input parameter.

This change fixed the argument type.

Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Zhiguang Liu <zhiguang.liu@intel.com>

Co-authored-by: Mike Turner <mikeyt@pobox.com>
Co-authored-by: Sachin Ganesh <sachinganesh@ami.com>
Signed-off-by: Kun Qin <kuqin12@gmail.com>
2024-10-17 08:51:15 +00:00
Jason1 Lin e19cc32bce edksetup.sh: Fix the Issue of PYTHON_COMMAND Un-Configurable
- With the commit e6447d2a08 introduced,
  there do not have chance for caller to configure the PYTHON_COMMAND
  environment variable outside of this script.

- All the configured value would be assigned into "python3" forcedly,
  without checking the environment variable is set or not.

- This patch included the below changes,
  - Check the "PYTHON_COMMAND" is set or not before assigning
    the default value "python3" on it.
  - Rename the function naming into "SetupPythonCommand" to align
    its functionality.

Signed-off-by: Jason1 Lin <jason1.lin@intel.com>
2024-10-17 06:53:34 +00:00
Ashraf Ali S b7342074a6 UnitTestFrameworkPkg: VS2022 Support on UnitTest.
Currently EDK2 is supporting VS2022, with VS2022 UnitTestFrameworkPkg
build is failing, this patch is to add the VS2022 support for UnitTest

Signed-off-by: Ashraf Ali S <ashraf.ali.s@intel.com>
2024-10-16 19:03:09 +00:00
Oleg Ilyasov 1b19ccfdfa Add USB Association Descriptor definitions
- USB 3.0 spec, Section 9.6.4
- Add class specific descriptor types

Signed-off-by: Oleg Ilyasov <olegi@ami.com>
2024-10-16 17:42:26 +00:00
kuqin12 d44b82270b ArmPkg: CodeQL Fixes.
Makes changes to comply with alerts raised by CodeQL.

The issues here fall into the following category:

1. unsigned-comparison-zero

Signed-off-by: Raymond Diaz <raymonddiaz@microsoft.com>
2024-10-16 08:18:16 +00:00
Jiaxin Wu a232e0cd2f UefiCpuPkg/PiSmmCpuDxeSmm: Save and restore CR2 only if SmiProfile enable
A page fault (#PF) that triggers an update to the page table only occurs
if SmiProfile is enabled. Therefore, it is necessary to save and restore
the CR2 register if SmiProfile is configured to be enabled.

Signed-off-by: Jiaxin Wu <jiaxin.wu@intel.com>
2024-10-16 04:06:42 +00:00
INDIA\sachinganesh 92c1274467 MdePkg: Describe storage location of config tables as per PI 1.7 A spec
Added comments to describe the storage location of DXE Services Table,
HOB List Table and PEI Vector Handoff Table.

As defined in PI 1.7 A Errata specification.

Cc: Felix Polyudov <felixp@ami.com>
Cc: Dhanaraj V <vdhanaraj@ami.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Signed-off-by: Sachin Ganesh <sachinganesh@ami.com>
2024-10-16 00:27:51 +00:00
INDIA\sachinganesh caec6089cf MdePkg: Clarify EFI_MM_SX_DISPATCH_PROTOCOL.Register() as per PI 1.7 A spec
Clarified comments regarding the usage of RegisterContext parameter of
Register() API in EFI_MM_SX_DISPATCH_PROTOCOL.

As defined in the PI 1.7 A Errata specification.

Cc: Felix Polyudov <felixp@ami.com>
Cc: Dhanaraj V <vdhanaraj@ami.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Signed-off-by: Sachin Ganesh <sachinganesh@ami.com>
2024-10-16 00:27:51 +00:00
INDIA\sachinganesh c80f456ef4 MdePkg: Define PI Specification Version Macro
Defined PI specification version.
Used them to define revisions of PEI/DXE/MM system tables.

Cc: Felix Polyudov <felixp@ami.com>
Cc: Dhanaraj V <vdhanaraj@ami.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Signed-off-by: Sachin Ganesh <sachinganesh@ami.com>
2024-10-16 00:27:51 +00:00
Leandro Becker b3efbda166 NetworkPkg/HttpBootDxe: Report download error when resume attempts fail
When all resume attempts to continue an interrupted NBP file
download have failed, report the failure status to the caller.

Original implementation was returning success when number of
retries reaches the limit defined by PcdMaxHttpResumeRetries.

Signed-off-by: Leandro Gustavo Biss Becker <lbecker@positivo.com.br>
2024-10-15 22:26:37 +00:00
Abdul Lateef Attar 081cf576a2 DynamicTablesPkg: Update FADT fixed feature flags validation
Validate the FADT fixed feature flags for
non-hardware reduced model.

Cc: Sami Mujawar <Sami.Mujawar@arm.com>
Cc: Pierre Gondois <pierre.gondois@arm.com>
Signed-off-by: Abdul Lateef Attar <AbdulLateef.Attar@amd.com>
2024-10-15 07:34:44 +00:00
Nhi Pham 21767dcf4e RedfishPkg/RedfishCredentialDxe: Fix 'too many arguments' error
This fixes the error 'too many arguments to ClearRedfishServiceList'
when building with clang compiler.

Signed-off-by: Nhi Pham <nhi@os.amperecomputing.com>
2024-10-14 10:09:54 -05:00
Jiaxin Wu fcd9570c8d UefiCpuPkg/PiSmmCpuDxeSmm: Consume SmmCpuPlatformHookBeforeMmiHandler func
This patch is for PiSmmCpuDxeSmm driver to add one round wait/release sync
for BSP and AP to perform the SMM CPU Platform Hook before executing MMI
Handler: SmmCpuPlatformHookBeforeMmiHandler (). With the function, SMM CPU
driver can perform the platform specific items after one round BSP and AP
sync (to make sure all APs in SMI) and before the MMI handlers.

After the change, steps #1 and #2 are additional requirements if the
MmCpuSyncModeTradition mode is selected.

Signed-off-by: Jiaxin Wu <jiaxin.wu@intel.com>
2024-10-12 08:56:05 +00:00
Jiaxin Wu e34460c8b2 OvmfPkg/Library: Impl SmmCpuPlatformHookBeforeMmiHandler func
This patch is to add SmmCpuPlatformHookBeforeMmiHandler func
for OVMF.

Signed-off-by: Jiaxin Wu <jiaxin.wu@intel.com>
2024-10-12 08:56:05 +00:00
Jiaxin Wu 7d4da670ea UefiCpuPkg: Add SmmCpuPlatformHookBeforeMmiHandler
This patch is to add SmmCpuPlatformHookBeforeMmiHandler interface
in SmmCpuPlatformHookLib.

The new API can be used to perform the platform specific items
before executing MMI Handler. For example, Intel can leverage
this API to clear the pending SMI bit after all CPUs finish the
sync and before the MMI handlers. If so, the the redundant
SMI can be avoided after CPU exit from current SMI.

Signed-off-by: Jiaxin Wu <jiaxin.wu@intel.com>
2024-10-12 08:56:05 +00:00
Jiaxin Wu 2351165f1b UefiCpuPkg/PiSmmCpuDxeSmm: Clarification for BSP & APs Sync Flow
This patch does not impact functionality. It aims to clarify the
synchronization flow between the BSP and APs to enhance code
readability and understanding:

Steps #6 and #11 are the basic synchronization requirements for all
cases.

Steps #1 is additional requirements if the MmCpuSyncModeTradition
mode is selected.

Steps #1, #2, #3, #4, #5, #7, #8, #9, and #10 are additional
requirements if the system needs to configure the MTRR.

Steps #9 and #10 are additional requirements if the system needs to
support the mSmmDebugAgentSupport.

Signed-off-by: Jiaxin Wu <jiaxin.wu@intel.com>
2024-10-12 08:56:05 +00:00
Rebecca Cran d2a41d1a7a Maintainers.txt: Update GitHub username for myself
Signed-off-by: Rebecca Cran <rebecca@bsdio.com>
2024-10-11 09:17:01 +08:00
Zhiguang Liu 0bae161fed UefiCpuPkg/MpLib: Remove NotifyOnS3SmmInitDonePpi
Previously, the SMM S3 resume code required taking control of APs to
perform SMM rebase, which would overwrite the context set by MpLib.
As a result, MpLib needed to wake up APs using InitSipiSipi to restore
the context after SMM S3 resume.

With the recent change where SMM rebase occurs in the early PEI phase,
the SMM S3 resume code no longer modifies AP context. Therefore, the
forced use of InitSipiSipi after SMM S3 resume is no longer necessary.

Signed-off-by: Zhiguang Liu <zhiguang.liu@intel.com>
2024-10-10 06:00:56 +00:00
Zhiguang Liu 6f17bd5eaf UefiCpuPkg/S3: Skip CR3 modification in S3Resume for 64-bit PEI
Previously, when PEI was 32-bit and DXE was 64-bit, S3 resume code had
to set or change the CR3 register before executing 64-bit code.
However, with both PEI and DXE now may being 64-bit, this modification
is unnecessary as PEI already utilizes sufficiently large page tables.

Additionally, there is a bug in the current implementation where
the changed CR3 during S3 resume could map only below 4G MMIO, which
could lead to issues if end of PEI notify attempts to access above 4G.

Overall, skipping the CR3 modification in S3Resume when PEI is 64-bit
can fix the bug and also avoid unnecessary logic.

Signed-off-by: Zhiguang Liu <zhiguang.liu@intel.com>
2024-10-10 06:00:56 +00:00
Sean Rhodes da1c6dd62a UefiPayloadPkg: Add Secure Boot support
Introduce Secure Boot functionality within UefiPayloadPkg by adding
necessary modules and configurations. A new build flag,
`SECURE_BOOT_ENABLE`, is introduced to control the activation of
Secure Boot.

This patch also overrides values in SecurityPkg to enforce image
verification from all sources.

A new FV (`SECURITY_FV`) for security modules is added for components
and the firmware volume sizes to accommodate additional Secure Boot
components.

Cc: Guo Dong <guo.dong@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: James Lu <james.lu@intel.com>
Cc: Gua Guo <gua.guo@intel.com>
Signed-off-by: Sean Rhodes <sean@starlabs.systems>
2024-10-09 19:14:11 +00:00
Nhi Pham 7bac0a940e BaseTools/SetupGit.py: Fix invalid choice 'edk2-test'
This fixes missing 'edk2-test' in the choices of the repo name option.

Signed-off-by: Nhi Pham <nhi@os.amperecomputing.com>
2024-10-09 10:53:19 +00:00
Abdul Lateef Attar fd619ec460 BaseTools/CodeQl: Give preference to Plugin settings
For the CodeQl `AuditOnly` flag,
prioritize Plugin settings over global settings.

This patch adjusts the logic for the global `AuditOnly` setting,
placing it before the Plugin setting code.
This ensures that Plugin settings take precedence over global settings.

Cc: Sean Brogan <sean.brogan@microsoft.com>
Cc: Joey Vagedes <joey.vagedes@gmail.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Signed-off-by: Abdul Lateef Attar <AbdulLateef.Attar@amd.com>
2024-10-09 06:02:34 +00:00
Michael Kubacki 06da7daab1 FmpDevicePkg/FmpDependencyLib: Fix potential overflow in loop
FmpVersionsCount is a UINTN while the loop index variable compared
against it is a UINT8. This can lead to an overflow of the loop
index for FmpVersionsCount values larger than UINT8_MAX. This change
makes Index a UINTN to match in width.

Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
2024-10-09 02:13:56 +00:00
Linus Liu 550c38a299 UefiPayloadPkg : Roll back the sequence of gEfiEndOfPeiSignalPpiGuid.
Adjust the sequence of gEfiEndOfPeiSignalPpiGuid notify function
when FDT is disabled , or some of notify functions won't work
cause the debug message print twice.

Signed-off-by: Linus Liu <linus.liu@intel.com>
2024-10-08 02:30:21 +00:00
Oliver Smith-Denny 2ee050d1d5 UnitTestFrameworkPkg: UnitTestLib: Support Failure Strings of 512 Chars
Currently, there is a mismatch of allowed string sizes in UnitTestLib.
The UT_LOG_* macros allow a string size of 512, but failure messages
are constrained to 120 characters and some other string lengths are
similarly constrained. 120 characters is too few for some longer
error messages, particularly the ones that print out the path to
the failing line. This can result in the actual error not getting
printed in the log.

This patch updates all UnitTestLib allowed string lengths to be 512
characters.

Signed-off-by: Oliver Smith-Denny <osde@linux.microsoft.com>
2024-10-08 01:26:36 +00:00
Oliver Smith-Denny d99045f392 MdePkg: DebugLib: Check Signature in CR in Release Builds
The CR macro is used to access an enclosing structure from a
pointer within the structure. In DEBUG builds (i.e. when
MDEPKG_NDEBUG is not set and debug asserts are enabled), this
macro does signature validation checking to ensure that the
structure that has been found is the correct structure, based
on a signature passed in by the caller.

However, if MDEPKG_NDEBUG is set or debug asserts are disabled,
no signature validation is performed, meaning that CR may return
an invalid structure that the caller believes is valid and has had
signature validation on, causing undefined behavior (memory
corruption). We should where at all possible have defined behavior,
particularly in RELEASE builds, which are what typical platforms
will ship to consumers.

This patch updates CR to do the signature validation in all scenarios
to provide defined behavior from the macro. In the event of a
signature failure, CR will either 1) assert if !MDEPKG_NDEBUG and
debug asserts are enabled (existing behavior) or 2) return NULL to
indicate to the caller that signature validation failed.

There exist consumers today who already, erroneously, rely on this
behavior.

Another macro, BASE_CR, exists for callers who do not wish to perform
signature validation. Any code that wishes to avoid the signature
validation should move to this macro.

Signed-off-by: Oliver Smith-Denny <osde@linux.microsoft.com>
2024-10-08 00:31:58 +00:00
Oliver Smith-Denny 77c070b1a7 EmulatorPkg: Add Signature to Graphics Structure
When updating MdePkg's CR macro to enforce signature checking in
all usages, it was discovered that EmulatorPkg was initializing
a structure without setting the signature for it, causing an error
to be returned when CR now checked the signature.

This commit updates the graphics stack in EmulatorPkg to set the
signature of the data structure and check the return value of
the wrapper for the CR macro.

Signed-off-by: Oliver Smith-Denny <osde@linux.microsoft.com>
2024-10-08 00:31:58 +00:00
Oliver Smith-Denny 596773f5e3 DynamicTablesPkg: AmlLib: Fix CodeQL Issue
Without the addition of this cast, the compiler promotes 1 to
a UINT32, which leads CodeQL to complain that different
size types are being compared.

Signed-off-by: Oliver Smith-Denny <osde@linux.microsoft.com>
2024-10-07 07:33:52 +00:00
Benjamin Doron 80d9b44491 Maintainers.txt: Add myself as UefiPayloadPkg maintainer
Per discussion in an email thread, I'm adding myself as a maintainer
of the UefiPayloadPkg.

Signed-off-by: Benjamin Doron <benjamin.doron@9elements.com>
2024-10-04 23:34:02 +00:00
Jeff Brasen 8cce048d48 DynamicTablesPkg: Correct _PSD package format
The _PSD structure should have nested packages.

The current implementation generates

Name (_PSD, Package()
   {
   NumEntries             // Integer
   Revision               // Integer (BYTE)
   Domain                 // Integer (DWORD)
   CoordType              // Integer (DWORD)
   NumProcessors          // Integer (DWORD)
})

when this should be

Name (_PSD, Package()
   {
    Package()
    {
    NumEntries             // Integer
    Revision               // Integer (BYTE)
    Domain                 // Integer (DWORD)
    CoordType              // Integer (DWORD)
    NumProcessors          // Integer (DWORD)
    }
})

REF: https://uefi.org/specs/ACPI/6.5/08_Processor_Configuration_and_Control.html#psd-p-state-dependency
Signed-off-by: Jeff Brasen <jbrasen@nvidia.com>
2024-10-04 22:08:35 +00:00
Tormod Volden 54469a6918 ShellPkg: Fix Optional Data rewriting with bcfg
When modifying the Optional Data of a boot option with bcfg boot -opt
the result was corrupted data, for instance a concatenation of old data,
heap contents, and new data. This was due to a erronous calculation of
the original optional data length.

In addition to fixing the calculation, add explaining comments and
introduce a helper variable, to not abuse other variables and confuse
readers (including the author).

Signed-off-by: Tormod Volden <debian.tormod@gmail.com>
2024-10-04 21:11:41 +00:00
Tormod Volden b21cf3bd5b ShellPkg: ShellLevel2StripQuotes: Strip consecutive quotes
When a quotation mark was found, the remaining line would be shifted
in-place to get rid of it. However, the "walker" index would still be
increased and therefore the first character of the shifted part would be
skipped. This means a second quotation mark would not be deleted.

Signed-off-by: Tormod Volden <debian.tormod@gmail.com>
2024-10-04 19:34:05 +00:00
Carsten Haitzler df884297fd ShellPkg/AcpiView: RASF Parser
Add a new parser for the RASF Table as specified in ACPI6.5

Signed-off-by: Carsten Haitzler <carsten.haitzler@foss.arm.com>
2024-10-04 17:48:11 +00:00
Carsten Haitzler c82bf392c5 ShellPkg/AcpiView: RAS2 Parser - Remove unused define
Remove unused define from RAS2 parser

Signed-off-by: Carsten Haitzler <carsten.haitzler@foss.arm.com>
2024-10-04 16:23:55 +00:00
Heinrich Schuchardt 91d806917f OvmfPkg: RiscV64: build BaseRiscVFpuLib
Enable building the BaseRiscVFpuLib library for OvmfPkg to

* Enable the FPU and set it to state 'dirty'.
* Clear the fcsr CSR.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2024-10-04 04:53:21 +00:00