summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2025-05-05MdeModulePkg/Spi: Solving potential null ptr deref. in SpiNorFlashJedecSfdpPaddyDeng1-1/+11
The pointer `Instance->SfdpBasicFlash` can be used before initializing. Example code flow: - CreateSpiNorFlashSfdpInstance: Allocate pool for `Instance` - InitialSpiNorFlashSfdpInstance - ReadSfdp - ReadSfdpHeader - FillWriteBuffer: Dereferencing `Instance->SfdpBasicFlash` - ReadSfdpBasicParameterTable: Allocate pool for `Instance->SfdpBasicFlash` Check both `Instance` and `Instance->SfdpBasicFlash` should have a non null value before dereferencing it. Otherwise use the defaut value 0. Also terminate the function if `Instance` or `WriteBuffer` is NULL. Signed-off-by: Paddy Deng <v-paddydeng@microsoft.com>
2025-05-03BaseTools: Change arm align value from 32 to 64Vivian Nowka-Keane1-2/+2
Alignment needed to be updated to 64 because of a linker warning when building with MSVC. /ALIGN:64 is the minimum alignment for MSVC ARM64, which differs from MSVC x64. This was missed when checking into edk2 because CI isn't run for MSVC ARM64. Signed-off-by: Vivian Nowka-Keane <vnowkakeane@linux.microsoft.com>
2025-05-03BaseTools: Update tools_def for aarch64Vivian Nowka-Keane1-3/+3
/WX was added as a build flag in VS2022 and now aarch64 builds fail because of an undocumented linker warning: 4226 Alignment specified exceeds target machine page size. This linker warning has always occured and can be ignored. Signed-off-by: Vivian Nowka-Keane <vnowkakeane@linux.microsoft.com>
2025-05-02UefiCpuPkg/MpInitLib: Fix SNP AP creation when using known APIC IDsTom Lendacky6-8/+98
A typical initial AP boot up will choose a CpuNumber based on the ApIndex value that it gets back after a locked increment of the ApIndex value. The ApIndex to APIC ID relationship is random, which is not an issue when a broadcast INIT-SIPI is performed. With SNP and a hypervisor that supports retrieval of the known APIC IDs, the broadcast INIT-SIPI method is replaced by waking each individual vCPU. In this situation, a specific VMSA is associated with a specific APIC ID. However, random assignment of an ApIndex can break this association. This isn't typically an issue, because the AP bring-up finishes with the AP issuing a HLT instruction, which is intercepted by the hypervisor and the AP won't run again until the next INIT-SIPI. However, when HLT isn't intercepted by the hypervisor (Qemu '-overcommit cpu-pm=on' parameter), then the HLT does not exit to the hypervisor. On the next INIT-SIPI, it can happen that a VMRUN is executed with a different VMSA address than was originally used, and if that VMSA is still in a VMRUN on another AP, then the executing VMRUN will fail, crashing the guest. To fix this issue, add a CPU exchange info field, SevSnpKnownInitApicId, that indicates the APs are starting with an already known initial APIC ID and set the initial APIC ID and APIC ID in the CPU_INFO_IN_HOB HOB. During AP boot, the SevSnpKnownInitApicId field will result in the CpuNumber being set to the index with a matching APIC ID (similar to AP booting when the InitFlag != ApInitConfig). Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com>
2025-05-02MdeModulePkg/AcpiTableDxe: Add function for extract ACPI table from HOB.George Liao1-45/+165
1. Got RSDP table which installed during the FSP phase from Hob, then pass it to the DXE AcpiTableInstance. 2. Got XSDT from RSDP and extract necessary data from XSDT, according to the old XSDT to Initialize a new XSDT. 3. Re-install ACPI table from old XSDT to the new XSDT. a. If Hob has DSDT table then re-install DSDT table in the new XSDT. If not, then skip it. b. If Hob has FACS table then re-install FACS table in the new XSDT. If not, then skip it. Signed-off-by: George Liao <george.liao@intel.com>
2025-05-01RedfishPkg/RedfishExDxe: call platform device wanted libNickle Wang3-10/+18
In supported() function, add the call to platform device wanted lib to see if platform wants to support this device or not. If platform does not support this device, Redfish Ex protocol won't be available on this controller handle and the reset of Redfish service is not available either. Signed-off-by: Nickle Wang <nicklew@nvidia.com>
2025-05-01RedfishPkg: introduce platform wanted device libNickle Wang5-2/+115
Introduce platform wanted device lib to RedfishPkg. This library provide the flexibility for platform owner to device which device we like to support Redfish service. This helps to reduce boot time and resource on devices that is not host interface. A null library is implemented and it accepts all devices as default behavior. Signed-off-by: Nickle Wang <nicklew@nvidia.com>
2025-05-01ArmFfaLib: Replace SMCCC_VERSION check with FF-A version checkMohamed Gamal Morsy1-22/+19
Patch 8d03c42d38d1 ("ArmPkg: ArmFfaLib: Update FF-A direct message to support 18 registers") calls SMCCC_VERSION by default during FF-A initialization even if the SMC conduit is not enabled. This leads to sending malformed FF-A versions if the SVC conduit is used instead. This is observed for example when using an SPMC@EL-1 (e.g. rust-spmc) which receives the FF-A message via an SVC call and interprets SMCCC_VERSION as an FF-A Function ID and subsequently fails to handle it. Since 18-register support is only support with FF-A >= 1.2, replace SMCCC_VERSION check with FF-A version check Signed-off-by: Mohamed Gamal Morsy <mohamed.morsy@arm.com>
2025-04-30MdePkg/IndustryStandard: fix PASID supported bitAbhishek Mainkar1-2/+8
Fix #define EFI_ACPI_IORT_ROOT_COMPLEX_PASID_SUPPORTED from BIT1 to BIT0 based on IO Remapping Table Platform Design Document Issue E.f Add macros for minimum and maximum PASID capabilites for PCI root complex node. Signed-off-by: Abhishek Mainkar <abmainkar@nvidia.com>
2025-04-30ArmVirtPkg,DynamicTablesPkg,EmbeddedPkg,OvmfPkg: use MdePkg BaseFdtLibLeif Lindholm37-237/+252
Migrate these packages to use the up-to-date BaseFdtLib instead of the EmbeddedPkg relic that is going away. Continuous-integration-options: PatchCheck.ignore-multi-package Signed-off-by: Leif Lindholm <leif.lindholm@oss.qualcomm.com>
2025-04-30ArmVirtPkg/ArmVirtCloudHv: add missing PrePiLib dependency/resolutionLeif Lindholm2-0/+2
Add an explicit dependency on a previously accidentally resolved one, tripped over while excising the EmbeddedPkg libfdt. Signed-off-by: Leif Lindholm <leif.lindholm@oss.qualcomm.com>
2025-04-30MdePkg/BaseFdtLib: add FdtGetPropertyW wrapperLeif Lindholm2-0/+45
Add wrapper for fdt_get_property_w. Signed-off-by: Leif Lindholm <leif.lindholm@oss.qualcomm.com>
2025-04-30MdePkg/BaseFdtLib: add FdtSubnodeOffset prototypeLeif Lindholm1-0/+18
FdtSubnodeOffset was added to FdtLib.c, but missed out of the header. Add the prototype to the header. Signed-off-by: Leif Lindholm <leif.lindholm@oss.qualcomm.com>
2025-04-30MdePkg,UefiPayloadPkg: clean up BaseFdtLib API confusionLeif Lindholm4-63/+110
Commit 8040fdbb8b8b (MdePkg: consistently use "Property" in BaseFdtLib) got a bit carried away and confused around how libfdt contains both getprop and get_property functions, which operate quite differently; the getprop variant returns a pointer to the value of the property, whereas the get_property returns a pointer to the fdt_property structure. Untangle this, including fixing up affected existing in-tree users, and adding the previously not exported FdtGetProp wrapper on fdt_getprop. Continuous-integration-options: PatchCheck.ignore-multi-package Signed-off-by: Leif Lindholm <leif.lindholm@oss.qualcomm.com>
2025-04-30MdeModulePkg SpiBus: Use correct GUIDJack Hsieh2-3/+12
Fix incorrect guid in SpiBusDxe and add null checking for AllocateZeroPool in the SpiBus driver. Signed-off-by: Jack Hsieh <v-chhsieh@microsoft.com>
2025-04-30ShellPkg: Add PCIe extended capabilityCian Costello2-0/+1157
Updates PCIe shell command to display previously undefined PCIe extended capabilities. Signed-off-by: Cian Costello <ccostello@nvidia.com>
2025-04-30MdePkg: Add additional PCIe extended capabilitiesCian Costello6-1/+314
Changes applied to appropriate PCIExpress header files based on the specification. Signed-off-by: Cian Costello <ccostello@nvidia.com>
2025-04-29NetworkPkg: Add PCD for HTTP transfer buffer sizeBaraneedharan Anbazhagan6-5/+26
Current HTTP transfer size have a default value of 2M. This PCD change allows the platform code to change the transfer buffer size. Based on the network bandwidth, the buffer size can be adjusted to improve performance. Large buffer size provides better performance in high-bandwidth connections. However, small buffer size helps to reduce packet loss in low-bandwidth scenarios. Signed-off-by: Anbazhagan Baraneedharan <anbazhagan@hp.com>
2025-04-29BaseTools: Scripts: efi_debugging.py: search for EFI_SYSTEM_TABLE_POINTERYing-Chun Liu (PaulLiu)1-2/+34
Add code to search for gST via EFI_SYSTEM_TABLE_POINTER. Signed-off-by: Ying-Chun Liu (PaulLiu) <paulliu@debian.org>
2025-04-28BaseTools/Conf: Enable GCC preprocessor line-markers for VFRNate DeSimone1-2/+2
This change enables the emission of C preprocessor line-markers for VFR intermediate files on the GCC and Clang compilers. Since the VfrCompiler now supports GCC-style preprocessor line markers, they can be enabled by default. Signed-off-by: Nate DeSimone <nathaniel.l.desimone@intel.com>
2025-04-28BaseTools: Add support for GCC preprocessor line directivesNate DeSimone1-1/+2
This change adds support for GCC-style preprocessor line directives as documented in: https://gcc.gnu.org/onlinedocs/cpp/Preprocessor-Output.html On Windows systems, one can use line-markers to see which .vfr file was used to generate a *.i file in the Build directory. This is useful for debugging VFR compilation failures. With this change, the VfrCompiler will not generate compilation errors if the *.i file contains GCC-style line-markers. Without this change, one must disable the pre-processor's emission of line-markers, removing the debug aid they provide. Signed-off-by: Nate DeSimone <nathaniel.l.desimone@intel.com>
2025-04-28ReadMe.rst: Update pipeline badges for new pipelinesMichael Kubacki1-86/+79
Update badges for the equivalent pipelines that are now being used. EmulatorPkg dropped some IA32 builds that are removed from the table. Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
2025-04-28DynamicTablesPkg: Fix incorrect WSMT table sizeAbdul Lateef Attar1-2/+2
Adjust the WSMT table size to ensure the ACPI table header is generated correctly. Cc: Sami Mujawar <Sami.Mujawar@arm.com> Cc: Pierre Gondois <pierre.gondois@arm.com> Signed-off-by: Abdul Lateef Attar <AbdulLateef.Attar@amd.com>
2025-04-27MdeModulePkg: DxeCore: Set Image Protections Through GCDOliver Smith-Denny2-7/+112
Today, SetUefiImageMemoryAttributes calls directly to the CPU Arch protocol to set EFI_MEMORY_XP or EFI_MEMORY_RO on image memory. However, this bypasses the GCD and so the GCD is out of sync with the actual state of memory. This can cause an issue in the scenario where a new attribute is being set (whether a virtual attribute or a real HW attribute), if the GCD attributes are queried for a region and the new attribute is appended to the existing GCD attributes (which are incorrect), then the incorrect attributes can get applied. This can result in setting EFI_MEMORY_XP on code sections of images and causing an execution fault. This patch updates SetUefiImageMemoryAttributes to call into the GCD to update the attributes there and let the GCD code call into the CPU Arch protocol to update the page table. Signed-off-by: Oliver Smith-Denny <osde@microsoft.com>
2025-04-27MdeModulePkg: DxeCore: Lower Image Protection Print to Verbose Log LevelOliver Smith-Denny1-1/+1
The print that describes memory attributes being applied to image memory sections is currently at info level and very noisy, being printed multiple times per image. Reduce this to the verbose logging level. Signed-off-by: Oliver Smith-Denny <osde@microsoft.com>
2025-04-26OvmfPkg/CcExitLib: Use the proper register when filtering MSRsTom Lendacky1-1/+3
The MsrExit() routine uses an incorrect register to check for the CAA MSR. Instead of checking RCX, the input register for RDMSR/WRMSR that holds the MSR value, it is checking RAX, which results in failure to detect the CAA MSR request. The check should only be checking the lower 32-bits of the register (ECX), too. Change the check in MsrExit() to check the MSR value contained in ECX. Fixes: 47001ab98914 ("Ovmfpkg/CcExitLib: Provide SVSM discovery support") Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com>
2025-04-25ArmPkg/ArmScmiDxe: Use array indexing to access adjacent buffersArd Biesheuvel1-7/+4
MessageParams1 and MessageParams2 always point to adjacent slots in the payload buffer, so no need to keep two separate pointers. Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
2025-04-25MdeModulePkg BmDriverHealth.c: Support dump the driver nameYang Gang1-15/+145
Sometimes the controller name is not present, add BmGetDriverName to retrieve the driver name.(Like DriverHealthManagerDxe) Signed-off-by: Yang Gang <yanggang@byosoft.com.cn>
2025-04-25DeviceManagerUiLib:Update DeviceManager form data when the form opens.Gao Qihang2-6/+22
Issue link:https://github.com/tianocore/edk2/issues/10925 If new HII resource is installed, show it in DeviceManager form. If HII resource is uninstalled, remove it from DeviceManager form. So once we enter DeviceManager form, form data should be refreshed to display dynamically. Cc: Li Chao <lichao@loongson.cn> Cc: Qian Dongyan <qiandongyan@loongson.cn> Signed-off-by: Gao Qihang <gaoqihang@loongson.cn>
2025-04-25DisplayEngineDxe: Fix length when displaying menu stringGao Qihang1-1/+2
Function `PrintStringAt` returns the count of Unicode character, which is not correct for computing column offset when display empty string if wide character is introduced. `GetStringWidth (String) / 2 - 1` is suitable option which is compatible with wide and narrow characters. Cc: Lichao <lichao@loongson.cn> Cc: Qian Dongyan <qiandongyan@loongson.cn> Signed-off-by: Gao Qihang <gaoqihang@loongson.cn>
2025-04-24DynamicTablesPkg: Add Dbg2Generator Hostbased testJeff Brasen7-1/+1584
This commit adds a hostbased test for the Dbg2Generator library. The test is designed to be run on a host machine against a UEFI image that has been built with the DynamicTablesPkg. The test exercises the Dbg2Generator library by building an ACPI DBG2 from a list of devices. Signed-off-by: Jeff Brasen <jbrasen@nvidia.com>
2025-04-24DynamicTablesPkg: Add support for non-serial DBG2 devicesJeff Brasen4-261/+563
This commit adds support for building non-serial DBG2 devices 1. Add new common namespace objects: - EArchCommonObjMemoryRangeDescriptor - EArchCommonObjDbg2DeviceInfo 2. Enhance DBG2 table generator: - Add support for non-serial DBG2 devices - Support multiple debug devices - Improve memory handling with proper allocation checks - Add better cleanup in error paths 3. Update configuration manager: - Add parsers for new common namespace objects Signed-off-by: Jeff Brasen <jbrasen@nvidia.com>
2025-04-24DynamicTablesPkg/AcpiDbg2Lib.inf: Add support for X64 BuildJeff Brasen1-1/+1
Add support for X64 Build needed for HostBasedTests Signed-off-by: Jeff Brasen <jbrasen@nvidia.com>
2025-04-23OvmfPkg/VirtMmCommunicationDxe: stop on init failureGerd Hoffmann2-0/+11
Print an error and stop in case VirtMmCommunicationDxe initialization fails. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2025-04-23ArmVirtPkg: set PcdQemuVarsRequireGerd Hoffmann2-0/+2
Set PcdQemuVarsRequire to TRUE for builds with QEMU_PV_VARS enabled. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2025-04-23OvmfPkg: add PcdQemuVarsRequireGerd Hoffmann4-0/+9
Add PcdQemuVarsRequire FeaturePcd, so firmware code can figure whenever the given build is supposed to use the qemu uefi variable service. Skip the emulated variable store setup in case PcdQemuVarsRequire is true. This is needed to make secure boot work. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2025-04-23ArmVirtPkg/ArmVirtQemu: add QEMU_PV_VARS optionGerd Hoffmann4-0/+28
Add config option to use qemu variable service, via VirtMmCommunicationDxe. Default is FALSE, build using '-D QEMU_PV_VARS=TRUE' to enable. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2025-04-23OvmfPkg/OvmfPkgX64: add QEMU_PV_VARS optionGerd Hoffmann3-2/+27
Add config option to use qemu variable service, via VirtMmCommunicationDxe. Default is FALSE, build using '-D QEMU_PV_VARS=TRUE' to enable. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2025-04-23OvmfPkg: add new VirtMmCommunicationDxe driverGerd Hoffmann7-0/+1145
EFI driver implementing the MmCommunication2Protocol, but instead of trapping to MM mode (SMM on x86, el3 on arm) trap to the host, using a virtual device. Moving the efi variable management to the host allows to have persistent efi variables without flash storage, and it also allows to have secure boot support without requiring MM mode to protect variable storage in flash. On x86 etc/hardware-info is used for device discovery, on arm the FDT will be consulted. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2025-04-23OvmfPkg: add IndustryStandard/QemuUefiVars.hGerd Hoffmann1-0/+50
Add header file for the qemu uefi variable service device. This defines the registers of the device and the device tree name. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2025-04-23OvmfPkg/HardwareInfoLib: add support for qemu vars deviceGerd Hoffmann1-2/+12
Add SIMPLE_INFO for devices which only have an mmio address. Add HardwareInfoTypeQemuUefiVars type. While being at it remove HardwareInfoTypeMax. Looks pointless to have it, we never loop over the available types. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2025-04-23MdeModulePkg/ArmFfaLib: Add depex on gEfiPeiMemoryDiscoveredPpiGuidAnubhav Raina1-1/+4
If ArmFfaLibRxTxMap is called before permanent memory is installed the memory allocated for the FF-A buffers will be migrated to the permanent memory after it is installed without updating gArmFfaRxTxBufferInfoGuid or unmapping the old buffers and mapping the updated buffers. An ASSERT in MemoryServices at ExitBootServices is triggered when ArmFfaDxeLib tries to call FreeAlignedPages on the original buffer reference. Add depex on gEfiPeiMemoryDiscoveredPpiGuid for ArmFfaPeiLib so any Peims that use FF-A are only dispatched after permanent memory is available. Signed-off-by: Anubhav Raina <anubhav.raina@arm.com>
2025-04-22OvmfPkg: Update ubuntu VM image to 24.04Michael Kubacki1-1/+1
Update to the latest 24.04 image from 22.04. Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
2025-04-22EmulatorPkg: Update ubuntu VM image to 24.04Michael Kubacki1-1/+1
Update to the latest 24.04 image from 22.04. Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
2025-04-22ArmVirtPkg: Update ubuntu VM image to 24.04Michael Kubacki1-1/+1
Update to the latest 24.04 image from 22.04. Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
2025-04-22.azurepipelines: Update ubuntu VM image to 24.04Michael Kubacki1-1/+1
Update to the latest 24.04 image from 22.04. Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
2025-04-22.pytool: Update pipeline filename instructionsMichael Kubacki1-1/+1
Updates the readme file for the current naming convention used for pipeline files. Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
2025-04-22OvmfPkg: Update pipeline filenamesMichael Kubacki2-2/+2
Details about a particular pipeline change over time - such as the specific Linux distro or toolchain version. At the same time, the pipeline files are directly referenced in Azure Pipelines to run the pipeline and few users have access to change those details. To make the files less likely to refer to outdated information over time and reduce the need for an Azure Pipeline administrator to get involved, the files are updated to drop specific details apart from the host OS environment used in the pipeline. Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
2025-04-22EmulatorPkg: Update pipeline filenamesMichael Kubacki2-2/+2
Details about a particular pipeline change over time - such as the specific Linux distro or toolchain version. At the same time, the pipeline files are directly referenced in Azure Pipelines to run the pipeline and few users have access to change those details. To make the files less likely to refer to outdated information over time and reduce the need for an Azure Pipeline administrator to get involved, the files are updated to drop specific details apart from the host OS environment used in the pipeline. Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
2025-04-22ArmVirtPkg: Rename Linux pipeline fileMichael Kubacki1-1/+1
Details about a particular pipeline change over time - such as the specific Linux distro or toolchain version. At the same time, the pipeline files are directly referenced in Azure Pipelines to run the pipeline and few users have access to change those details. To make the files less likely to refer to outdated information over time and reduce the need for an Azure Pipeline administrator to get involved, the files are updated to drop specific details apart from the host OS environment used in the pipeline. Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>