Commit Graph

33851 Commits

Author SHA1 Message Date
Gerd Hoffmann 73570d8ab6 openssl: disable visual studio warning #4189
4189 is "local variable is initialized but not referenced"

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2024-12-06 08:01:25 +00:00
Gerd Hoffmann 99e18f2327 CryptoPkg: CI: update OpensslGen file list
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2024-12-06 08:01:25 +00:00
Gerd Hoffmann 8c5dcecd24 CryptoPkg: gcc needs 4k section alignment too
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2024-12-06 08:01:25 +00:00
Gerd Hoffmann 9895fe25ac CryptoPkg/BaseCryptLib: add next parameter to SHA3_squeeze
Needed for openssl 3.3.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2024-12-06 08:01:25 +00:00
Gerd Hoffmann a801363249 CryptoPkg: add openssl/providers/fips/include to includes
Needed for openssl 3.4.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2024-12-06 08:01:25 +00:00
Gerd Hoffmann 005f4c6b5e openssl: add more stubs for openssl 3.2.x
openssl-3.2.2 got a few more tls config hooks, add stubs for them.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2024-12-06 08:01:25 +00:00
Gerd Hoffmann 53cea8efd1 openssl: adapt stubs to openssl 3.2.x
Function declarations have changed in openssl-3.2.x, adapt the stubs.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2024-12-06 08:01:25 +00:00
Gerd Hoffmann 8f6c2ccc45 openssl: update generated files
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2024-12-06 08:01:25 +00:00
Gerd Hoffmann e584e865f8 openssl: update submodule to 3.4.0
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2024-12-06 08:01:25 +00:00
Aniket_Surekar 333e9638ad MdeModulePkg/Bus/Pci: Fix Descriptor Misalignment in USB Config Handling
The issue with locating the expected interface and endpoint descriptors
arises because `configDesc` (USB_CONFIG_DESCRIPTOR) and `IfDesc`
(USB_INTERFACE_DESCRIPTOR) are incremented by structure size rather than
by actual descriptor length.

Specifically:
  - `configDesc` should be incremented by its actual length.
  - `IfDesc` should be incremented by its actual length.

This incorrect increment causes misalignment, preventing access to the
subsequent interface and endpoint descriptors.

[Suggested Solution]
Update the code to increment the pointers by the actual descriptor lengths,
ensuring proper access to all descriptors in the USB configuration.

Signed-off-by: Aniket Surekar <Aniket.Surekar@Dell.com>
2024-12-06 01:45:22 +00:00
Ard Biesheuvel e8668d2dee MdeModulePkg/DxeCore: Call BeforeExitBootServices event group only once
According to UEFI spec 2.10 errata A section 7.4.6

  "All events from the EFI_EVENT_GROUP_BEFORE_EXIT_BOOT_SERVICES and
  EFI_EVENT_GROUP_EXIT_BOOT_SERVICES event notification groups as well
  as events of type EVT_SIGNAL_EXIT_BOOT_SERVICES must be signaled
  before ExitBootServices() returns EFI_SUCCESS. The events are only
  signaled once even if ExitBootServices() is called multiple times."

So keep track of whether ExitBootServices() has been called, and signal
the event group EFI_EVENT_GROUP_BEFORE_EXIT_BOOT_SERVICES only the first
time around.

EFI_EVENT_GROUP_EXIT_BOOT_SERVICES will only be signalled if
ExitBootServices() is going to run to [successful] completion, after
which calling it a second time is not possible anyway. So for this case,
no special handling is needed.

Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
2024-12-06 08:33:53 +08:00
Ard Biesheuvel 47e28a6d44 ArmVirtPkg/ArmPlatformLibQemu: Enable early ID map on EL2+VHE
When booting at EL2, enable VHE if available so that the early ID map
can be enabled as well. This gets rid of any memory accesses (reads or
writes) before the MMU and caches are enabled.

Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
2024-12-05 10:50:48 +00:00
Chao Li 793f4d2662 Maintainers.txt: Add a new R for LoongArch64
Added Xiangdong Meng as a new reviewer for LoongArch64 ARCH.

Signed-off-by: Chao Li <lichao@loongson.cn>
2024-12-05 03:10:43 +00:00
Oliver Steffen 47ef197873 BaseTools: Coverage: Detect lcov version
Detect the version of lcov and only apply
version 2 workaround when needed.

Fixes 61c714285f

Signed-off-by: Oliver Steffen <osteffen@redhat.com>
2024-12-05 00:05:47 +00:00
Gerd Hoffmann 2940708eb2 NetworkPkg/DxeNetLib: drop GLOBAL_REMOVE_IF_UNREFERENCED
With mSecureHashAlgorithms being static this should not be
needed any more.

Suggested-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2024-12-04 22:25:37 +00:00
Gerd Hoffmann d31fd8bcb7 MdePkg/DxeRngLib: drop GLOBAL_REMOVE_IF_UNREFERENCED
With mSecureHashAlgorithms being static this should not be
needed any more.

Suggested-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2024-12-04 22:25:37 +00:00
Rebecca Cran 061bccff3a DynamicTablesPkg: Update link to iASL in Readme.md
Links from acpica.org are now redirected to the ACPICA overview page
on intel.com. Update the link so it goes to the 20200717 download page.

Signed-off-by: Rebecca Cran <rebecca@bsdio.com>
2024-12-04 20:37:33 +00:00
Ray Ni 210a76e917 Remove Ray from maintainer list of FatPkg
Signed-off-by: Ray Ni <ray.ni@intel.com>
2024-12-04 17:22:22 +00:00
Gerd Hoffmann 775d6cd7ed OvmfPkg/QemuFwCfgDxeLib: use PcdConfidentialComputingGuestAttr
Check PcdConfidentialComputingGuestAttr instead of calling
MemEncryptSevIsEnabled() and MemEncryptTdxIsEnabled() to figure
whenever SEV or TDX is enabled.

This allows to remove the MemEncryptSevLib + MemEncryptTdxLib
dependencies.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2024-12-04 12:40:35 +00:00
Rebecca Cran 194cdc1700 SecurityPkg: remove unused `EfiSig` variable in SecureBootFetchData
The `EfiSig` variable in SecureBootFetchData is unused, so remove it.

Signed-off-by: Rebecca Cran <rebecca@bsdio.com>
2024-12-04 11:05:10 +00:00
Rebecca Cran dfab971e91 SecurityPkg: Improve formatting of msg when GetVariable fails
Improve the formatting of the error message when GetVariable
fails: start the message with an upper-case character, and close the
quotes around the variable name.

Signed-off-by: Rebecca Cran <rebecca@bsdio.com>
2024-12-04 09:30:53 +00:00
Oliver Steffen 61c714285f BaseTools: Coverage: make lcov v2.0 work
lcov 2.0 and newer does additional error and consistency checking
compared to previous versions. This can lead to CI jobs failing due to
new/unexpected errors showing up.

See:
- https://edk2.groups.io/g/devel/message/116138
- https://github.com/linux-test-project/lcov/issues/209
- https://github.com/linux-test-project/lcov/issues/238

Signed-off-by: Oliver Steffen <osteffen@redhat.com>
2024-12-04 06:08:05 +00:00
Oliver Steffen 29859cbc28 CI: Use latest Fedora 40 image for Linux jobs
The Fedora 40 images uses gcc 14, includes libasan and
libubsan, clang, and some fixes and improvements.

See c98ff99762

Signed-off-by: Oliver Steffen <osteffen@redhat.com>
2024-12-04 06:08:05 +00:00
Oliver Smith-Denny 0f9dbb4abf Maintainers.txt: Add myself as FatPkg Maintainer
Per request from current FatPkg maintainer Ray Ni, I am
signing up to maintain FatPkg.

Signed-off-by: Oliver Smith-Denny <osde@microsoft.com>
2024-12-04 02:58:55 +00:00
Jeff Brasen 745cab5aad DynamicTablesPkg: Fix BDF format for PCI initiators
The BDF format for PCI initiators in the SRAT table is incorrect.
The format is not a UINT16 but specific bytes.

PCI Bus Number (Bits 7:0 of Byte 2)
PCI Device Number (Bits 7:3 of Byte 3)
PCI Function Number (Bits 2:0 of Byte 3)

REF: https://uefi.org/specs/ACPI/6.5/05_ACPI_Software_Programming_Model.html#device-handle-pci
Signed-off-by: Jeff Brasen <jbrasen@nvidia.com>
2024-12-03 22:13:29 +00:00
Rebecca Cran bff50932c1 OvmfPkg: Update links to Intel & MS ACPI compilers in README
Intel's ACPICA download is no longer on acpica.org, but that site
redirects to pages on intel.com. Update the link to acpica.org to
the new ACPICA download page.

Microsoft's acpi.info no longer exists, so update the link to point to
Microsoft's ACPI compiler information page.

While here, update the nasm link from http to https.

Signed-off-by: Rebecca Cran <rebecca@bsdio.com>
2024-12-03 08:21:51 +00:00
Michael D Kinney da1084ccf4 MdePkg/Include/IndustryStandard: Address C++ keyword collisions
Update Tpm12.h and Tpm20.h and not use c++ reserved keywords
operator and xor in C structures to support use of these
include files when building with a C++ compiler.

This patch removes the temporary use of anonymous unions and
warning 4201 disable for VS20xx tool chains to complete the
following field name changes:

* operator -> operator_
* xor -> xor_

NOTE: This is a non-backwards compatible change to Tpm12.h
and Tmp20.h. And consumers of these include files that access
the "operator" or "xor" fields must be updated.

Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
2024-12-03 06:25:32 +00:00
Michael D Kinney e6a886fdfc SecurityPkg/Library/TpmCommandLib: Change xor to xor_
Change xor to xor_ to avoid C++ reserved work name collisions
when building with C++ compilers.

Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
2024-12-03 06:25:32 +00:00
Michael D Kinney 05ac9a58f5 MdePkg/Include/IndustryStandard: Add operator_ and xor_ field names
Update Tpm12.h and Tpm20.h and not use c++ reserved keywords
operator and xor in C structures to support use of these
include files when building with a C++ compiler.

This patch temporarily introduces an anonymous union to add
operator_ and xor_ fields to support migration from the current
field names to the new field names.

Warning 4201 is disabled for VS20xx tool chains is a temporary
change to allow the use of anonymous unions.

Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
2024-12-03 06:25:32 +00:00
Rebecca Cran 1e079360cd PrmPkg: Update link to ACPICA in Readme.md
Links from acpica.org are now redirected to the ACPICA overview page
on intel.com. Update the link so it goes to the 20200517 download page.

Signed-off-by: Rebecca Cran <rebecca@bsdio.com>
2024-12-03 02:50:57 +00:00
Dandan Bi 9112fb0ecc MdeModulePkg/HiiDatabase: Return default value for BIT VarStore as UNIT32
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4874

Question CheckBox, OneOf and Numeric can refer to Bit EFI VarStore.
CheckBox: data type is Boolean (1 byte),
Numeric/Oneof: data type is always UNIT32 for BIT VarStore,
When get default value for BIT VarStore, should return default value
with sizeof (UINT32) rather than the byte the bit width occupied.
Or incorrect default value will be used due to the size mismatch.

Signed-off-by: Dandan Bi <dandan.bi@intel.com>
2024-12-02 13:38:48 +00:00
Chao Li 9a9bcacbe0 UefiCpuPkg/CpuMmuLib: Adjust default memory attributes on LoongArch
When updating memory attributes, if only access attributes are changed,
the default memory cache attribute is NULL and a CACHE_CC is added by
default.

Signed-off-by: Chao Li <lichao@loongson.cn>
2024-12-02 06:57:09 +00:00
Doug Cook (WINDOWS) 9098efdf0d EmulatorPkg: BlockIo2 APIs do not signal event
BlockIo2 Read/Write/Flush APIs should signal the token's event when the
I/O operation completes, but the Emulator APIs do not. As a result, any
code that tries to implement async I/O will hang on emulator.

Both Windows and Unix emulator hosts work the same way:

- All I/O is completed synchronously.
- All I/O implementations contain the comment:
  `// Caller is responsible for signaling EFI Event`

However, the protocol implementations do not signal the event, so the
event is never signalled.

Fix is to signal the event in the appropriate protocol implementations.

- If the host API returns success then the I/O is complete since it's
  always synchronous.
- If there is a Token and Token->Event is not null and the I/O is
  successful then the event should be signalled.

Signed-off-by: Doug Cook <idigdoug@gmail.com>
2024-12-02 02:23:31 +00:00
Abdul Lateef Attar 5158b598f7 DynamicTablesPkg: Adds X64 support for CPU SSDT generator
Introduce support for generating ACPI CPU SSDT table
for the X64 architecture.

Creates processor objects based on configuration data.

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-11-28 16:46:34 +01:00
Abdul Lateef Attar e89ff68110 DynamicTablesPkg: Add X64 MADT table generator
Updates X64 namespace object.
Updates the object parser.
Updates the Readme.

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-11-28 16:46:34 +01:00
Alexander Gryanko 24d835a131 OvmfPkg/Library/HardwareInfoLib: Fix memory allocation for a root bridge
Currently, PciHostBridgeUtilityGetRootBridgesHostProvided allocates memory
for aperture structures without clearing memory. This causes garbage in
the Translation field, but the Base and Limit fields have the correct
values because they are copied from the HOST_BRIDGE_INFO fields in the
HardwareInfoPciHostBridgeHostBridgeHostBridgeGetApertures function.

RootBridge: PciRoot(0x0)
  Support/Attr: 70069 / 70069
    DmaAbove4G: No
NoExtConfSpace: No
     AllocAttr: 3 (CombineMemPMem Mem64Decode)
           Bus: 0 - 80 Translation=0
            Io: 6000 - FFFF Translation=5E9EB018
           Mem: 80000000 - DFFFFFFF Translation=0
    MemAbove4G: 600000000000 - 7FFFFFFFFFFF Translation=0
          PMem: FFFFFFFFFFFFFFFF - 0 Translation=0
   PMemAbove4G: FFFFFFFFFFFFFFFF - 0 Translation=0

Signed-off-by: Alexander Gryanko <xpahos@gmail.com>
2024-11-27 22:06:12 +00:00
Yang Gang 4928851899 ArmVirtPkg: Report an error if NETWORK_TLS_ENABLE is TRUE on ARM
Signed-off-by: Yang Gang <yanggang@byosoft.com.cn>
2024-11-27 20:57:03 +00:00
Marc Chen 3781ad107d OvmfPkg/QemuVideoDxe: Clean up Non-Used PCDs
Clean up PcdOvmfHostBridgePciDevId and PcdNullPointerDetectionPropertyMask
from QemuVideoDxe.inf

Signed-off-by: Marc Chen <marc.chen@microsoft.com>
2024-11-27 19:43:58 +00:00
Oliver Steffen 9c4542a064 OvmfPkg: Rerun dispatcher after initializing virtio-rng
Since the pixiefail CVE fix the network stack requires a hardware
random number generator. This can currently be a modern CPU supporting
the RDRAND instruction or a virtio-rng device.
The latter is initialized during the BDS phase.
To ensure all depending (network) modules are also started, we need to
run the dispatcher once more after the device was initialized.
Without this, network boot is not available under certain hardware
configurations.

Fixes: 4c4ceb2ceb ("NetworkPkg: SECURITY PATCH CVE-2023-45237")

Analysed-by: Stefano Garzarella <sgarzare@redhat.com>
Suggested-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Oliver Steffen <osteffen@redhat.com>
2024-11-27 18:07:10 +00:00
Pierre Gondois 3ee2ceb6fa FatPkg/EnhancedFatDxe: Add comments around StrSize() checks
StrSize() cannot return 0. As done in other packages, StrSize()
checks the length of the string doesn't exceed
PcdMaximumUnicodeStringLength. Add comments to make it more obvious.

BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=4859
Reported-by: Tormod Volden <debian.tormod@gmail.com>
Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
2024-11-27 15:57:08 +00:00
Pierre Gondois bf32c2d61f ArmPkg/SemihostFs: StrSize() cannot return 0
StrSize() account the terminating NULL character and cannot return 0.
Replace StrSize() StrLen().

BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=4859
Reported-by: Tormod Volden <debian.tormod@gmail.com>
Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
2024-11-27 15:57:08 +00:00
Rebecca Cran d90bf1f973 EmbeddedPkg: reduce "Found ACPI table" messages from ERROR to INFO
The "Found ACPI table" messages are informative and don't indicate an
error, so reduce the debug level from DEBUG_ERROR to DEBUG_INFO.

Signed-off-by: Rebecca Cran <rebecca@bsdio.com>
2024-11-27 15:11:26 +01:00
Rebecca Cran b78b4da1fb ArmPlatformPkg: Allow up to 5 Secure Boot DB certs
Update SecureBootDefaultKeys.fdf.inc to add support for 2 more DB
certificates, for a total of 5. This allows all the files from
https://github.com/microsoft/secureboot_objects/tree/main/PreSignedObjects/DB/Certificates
to be supported.

Signed-off-by: Rebecca Cran <rebecca@bsdio.com>
2024-11-27 08:28:36 +00:00
Ard Biesheuvel ae8ab7190c ArmVirtPkg/ArmVirtKvmTool: Use PSCI/SMCCC conduit from FDT
ArmVirtKvmTool might execute at EL2 when running under nested
virtualization, and in this case, it should not use HVC but SMC to
invoke PSCI and SMCCC services.

Like QEMU, kvmtool provides the PSCI conduit via a node in the FDT, and
as per the SMCCC, the PSCI conduit and the SMCCC conduit are guaranteed
to be the same. So switch to the ArmMonitorLib implementation that
selects the conduit based on this FDT node.

Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
2024-11-26 23:53:16 +00:00
Ard Biesheuvel f9f4164af9 ArmVirtPkg: Rename ArmVirtQemuMonitorLib to ArmVirtMonitorLib
The implementation of ArmMonitorLib that selects the conduit (SMC or
HVC) based on the PSCI FDT node is suitable for other VMMs as well, so
rename it more appropriately.

Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
2024-11-26 23:53:16 +00:00
Ard Biesheuvel 91171b6b94 ArmVirtPkg/PrePi: Don't clear HCR_EL2 fields when setting TGE
HCR_EL2 may contain fields that should be preserved (such as E2H, which
may be RES1 for all intents and purposes other than reading back the
register). So preserve the existing value when setting the TGE bit.

Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
2024-11-26 23:53:16 +00:00
Ard Biesheuvel f60a839480 ArmPkg/ArmMmuLib: Add support for EL2&0 translation regime
With VHE enabled, EL2 uses the EL2&0 translation regime, which is
compatible with the EL1&0 translation regime when it comes to the TCR
configuration register and the page table descriptor.

Given that some CPUs may have VHE force enabled when executing at EL2,
the MMU code needs to be able to deal with this even if it doesn't
enable VHE itself.

Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
2024-11-26 23:53:16 +00:00
Ard Biesheuvel e80b17d21a ArmPkg/ArmMmuLib: Ignore EL3 in RELEASE code
Remove the code path for execution at EL3, which just dumps an error.
None of the other code is remotely suitable for execution at EL3, and so
just ASSERT()'ing here is sufficient, and simplifies future changes
related to VHE.

Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
2024-11-26 23:53:16 +00:00
Ard Biesheuvel 31ff325228 ArmPkg/ArmLib: Use VHE alternatives for timer system registers
When VHE is enabled, some pre-existing timer system register specifiers
are redirected to the HYP timer. To access the conventional timer,
special aliases have to be used that end in _EL02.

These aliases are not understood by Clang's internal assembler, so use
the generic mnemonics instead.

Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
2024-11-26 23:53:16 +00:00
Ard Biesheuvel c2827283a8 MdePkg/AArch64: Add some missing MMU related constants
Add definitions for the non-global page tables descriptor attribute, as
well as the E2H TCR bit, so that we can use them in the MMU code.

Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
2024-11-26 23:53:16 +00:00