summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* pip: update edk2-pytool-extensions requirement from ~=0.20.0 to ~=0.21.1dependabot/pip/edk2-pytool-extensions-approx-eq-0.21.1dependabot[bot]2023-01-251-1/+1
| | | | | | | | | | | | | Updates the requirements on [edk2-pytool-extensions](https://github.com/tianocore/edk2-pytool-extensions) to permit the latest version. - [Release notes](https://github.com/tianocore/edk2-pytool-extensions/releases) - [Commits](https://github.com/tianocore/edk2-pytool-extensions/compare/v0.20.0...v0.21.1) --- updated-dependencies: - dependency-name: edk2-pytool-extensions dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com>
* SecurityPkg/AuthVariableLib: Check SHA-256 OID with ContentInfo presentJan Bobek2023-01-231-8/+42
| | | | | | | | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4305 Based on whether the DER-encoded ContentInfo structure is present in authenticated SetVariable payload or not, the SHA-256 OID can be located at different places. UEFI specification explicitly states the driver shall support both cases, but the old code assumed ContentInfo was not present and incorrectly rejected authenticated variable updates when it were present. Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Jian J Wang <jian.j.wang@intel.com> Cc: Min Xu <min.m.xu@intel.com> Signed-off-by: Jan Bobek <jbobek@nvidia.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
* MdeModulePkg: remove garbage pixels in LaffStd glyphsdevel@edk2.groups.io2023-01-201-5/+5
| | | | | Signed-off-by: Jan Engelhardt <jengelh@inai.de> Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
* ShellPkg: Export default shell delay as PCDTomas Pilar2023-01-203-1/+6
| | | | | | | | | | | | | | | | | | | | | Create PcdShellDefaultDelay to configure the default delay the shell provides for the user at the start time if the user wishes to cancel the execution of a potential startup script. The shell application already allows the user to override the delay default value by specifying the -delay cmdline argument. This however cannot be used when loading the shell application using direct boot or when integrating the shell into the platform firmware build. Thus, a PCD can be easily configured by the developer either at build time, or even at runtime. Cc: Ray Ni <ray.ni@intel.com> Cc: Zhichao Gao <zhichao.gao@intel.com> Signed-off-by: Tomas Pilar <tomas@quicinc.com> Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
* OvmfPkg/PlatformInitLib: catch QEMU's CPU hotplug reg block regressionLaszlo Ersek2023-01-201-0/+87
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In QEMU v5.1.0, the CPU hotplug register block misbehaves: the negotiation protocol is (effectively) broken such that it suggests that switching from the legacy interface to the modern interface works, but in reality the switch never happens. The symptom has been witnessed when using TCG acceleration; KVM seems to mask the issue. The issue persists with the following (latest) stable QEMU releases: v5.2.0, v6.2.0, v7.2.0. Currently there is no stable release that addresses the problem. The QEMU bug confuses the Present and Possible counting in function PlatformMaxCpuCountInitialization(), in "OvmfPkg/Library/PlatformInitLib/Platform.c". OVMF ends up with Present=0 Possible=1. This in turn further confuses MpInitLib in UefiCpuPkg (hence firmware-time multiprocessing will be broken). Worse, CPU hot(un)plug with SMI will be summarily broken in OvmfPkg/CpuHotplugSmm, which (considering the privilege level of SMM) is not that great. Detect the issue in PlatformCpuCountBugCheck(), and print an error message and *hang* if the issue is present. Users willing to take risks can override the hang with the experimental QEMU command line option -fw_cfg name=opt/org.tianocore/X-Cpuhp-Bugcheck-Override,string=yes (The "-fw_cfg" QEMU option itself is not experimental; its above argument, as far it concerns the firmware, is experimental.) The problem was originally reported by Ard [0]. We analyzed it at [1] and [2]. A QEMU patch was sent at [3]; now merged as commit dab30fbef389 ("acpi: cpuhp: fix guest-visible maximum access size to the legacy reg block", 2023-01-08), to be included in QEMU v8.0.0. [0] https://bugzilla.tianocore.org/show_bug.cgi?id=4234#c2 [1] https://bugzilla.tianocore.org/show_bug.cgi?id=4234#c3 [2] IO port write width clamping differs between TCG and KVM http://mid.mail-archive.com/aaedee84-d3ed-a4f9-21e7-d221a28d1683@redhat.com https://lists.gnu.org/archive/html/qemu-devel/2023-01/msg00199.html [3] acpi: cpuhp: fix guest-visible maximum access size to the legacy reg block http://mid.mail-archive.com/20230104090138.214862-1-lersek@redhat.com https://lists.gnu.org/archive/html/qemu-devel/2023-01/msg00278.html NOTE: PlatformInitLib is used in the following platform DSCs: OvmfPkg/AmdSev/AmdSevX64.dsc OvmfPkg/CloudHv/CloudHvX64.dsc OvmfPkg/IntelTdx/IntelTdxX64.dsc OvmfPkg/Microvm/MicrovmX64.dsc OvmfPkg/OvmfPkgIa32.dsc OvmfPkg/OvmfPkgIa32X64.dsc OvmfPkg/OvmfPkgX64.dsc but I can only test this change with the last three platforms, running on QEMU. Test results: TCG QEMU OVMF override result patched patched --- ------- ------- -------- -------------------------------------- 0 0 0 0 CPU counts OK (KVM masks the QEMU bug) 0 0 1 0 CPU counts OK (KVM masks the QEMU bug) 0 1 0 0 CPU counts OK (QEMU fix, but KVM masks the QEMU bug anyway) 0 1 1 0 CPU counts OK (QEMU fix, but KVM masks the QEMU bug anyway) 1 0 0 0 boot with broken CPU counts (original QEMU bug) 1 0 1 0 broken CPU count caught (boot hangs) 1 0 1 1 broken CPU count caught, bug check overridden, boot continues 1 1 0 0 CPU counts OK (QEMU fix) 1 1 1 0 CPU counts OK (QEMU fix) Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> 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: Jordan Justen <jordan.l.justen@intel.com> Cc: Michael Brown <mcb30@ipxe.org> Cc: Min Xu <min.m.xu@intel.com> Cc: Oliver Steffen <osteffen@redhat.com> Cc: Sebastien Boeuf <sebastien.boeuf@intel.com> Cc: Tom Lendacky <thomas.lendacky@amd.com> Bugzilla: https://bugzilla.tianocore.org/show_bug.cgi?id=4250 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Message-Id: <20230119110131.91923-3-lersek@redhat.com> Reviewed-by: Ard Biesheuvel <ardb@kernel.org> Hugely-appreciated-by: Michael Brown <mcb30@ipxe.org> Acked-by: Gerd Hoffmann <kraxel@redhat.com>
* OvmfPkg/PlatformInitLib: factor out PlatformCpuCountBugCheck()Laszlo Ersek2023-01-201-23/+58
| | | | | | | | | | | | | | | | | | | | | | | | Move the QEMU v2.7 reset bug check/workaround to a separate function, as we'll need to detect further issues. Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> 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: Jordan Justen <jordan.l.justen@intel.com> Cc: Michael Brown <mcb30@ipxe.org> Cc: Min Xu <min.m.xu@intel.com> Cc: Oliver Steffen <osteffen@redhat.com> Cc: Sebastien Boeuf <sebastien.boeuf@intel.com> Cc: Tom Lendacky <thomas.lendacky@amd.com> Bugzilla: https://bugzilla.tianocore.org/show_bug.cgi?id=4250 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Message-Id: <20230119110131.91923-2-lersek@redhat.com> Reviewed-by: Ard Biesheuvel <ardb@kernel.org> Hugely-appreciated-by: Michael Brown <mcb30@ipxe.org> Acked-by: Gerd Hoffmann <kraxel@redhat.com>
* OvmfPkg/PlatformCI VS2019: Enable temporary workaround for cpuhp bugfixArd Biesheuvel2023-01-202-1/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QEMU for x86 has a nasty CPU hotplug bug of which the ramifications are difficult to oversee, even though KVM acceleration seems to be unaffected. This has been addressed in QEMU mainline, and will percolate through the ecosystem at its usual pace. In the mean time, due to the potential impact on production workloads, we will be updating OVMF to abort the boot when it detects a QEMU build that is affected. Tiancore's platform CI uses QEMU in TCG mode, and is therefore impacted by this mitigation, unless its QEMU builds are updated. This has been done for Ubuntu-GCC5, but Windows-VS2019 still uses a QEMU build that is affected. Aborting the boot upon detecting the QEMU issue will render all boot tests carried out on Windows-VS2019 broken unless we implement the 'escape hatch' that enables proceed-at-your-own-risk mode, and permits the boot to proceed even if the QEMU issue is detected. So let's enable this for Windows-VS2019, and remove it again once it is no longer needed. Cc: Laszlo Ersek <lersek@redhat.com> Cc: Gerd Hoffmann <kraxel@redhat.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Michael Brown <mcb30@ipxe.org> Cc: Oliver Steffen <osteffen@redhat.com> Cc: Michael Kubacki <michael.kubacki@microsoft.com> Bugzilla: https://bugzilla.tianocore.org/show_bug.cgi?id=4250 Signed-off-by: Ard Biesheuvel <ardb@kernel.org> Message-Id: <20230119134302.1524569-1-ardb@kernel.org> Acked-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Michael Kubacki <michael.kubacki@microsoft.com> Acked-by: Jiewen Yao <Jiewen.yao@Intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
* EmbeddedPkg: Add back FfsFindSectionDataMin M Xu2023-01-192-0/+43
| | | | | | | | | | | In commit c673216f53 a new input parameter is added in FfsFindSectionData. That change breaks the build of ArmVirtPkg. In this patch FfsFindSectionData is added back. It calls FfsFindSectionDataWithHook with a NULL hook. Signed-off-by: Min Xu <min.m.xu@intel.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com> Acked-by: Gerd Hoffmann <kraxel@redhat.com>
* EmbeddedPkg: Rename FfsFindSectionData as FfsFindSectionDataWithHookMin M Xu2023-01-194-8/+10
| | | | | | | | | | | | | | | | Commit c673216f53 introduces FFS_CHECK_SECTION_HOOK and add it as the second input parameter in FfsFindSectionData. This change breaks the build of ArmVirtPkg. To fix this issue, the new version of FfsFindSectionData is renamed as FfsFindSectionDataWithHook in this patch. In the following patch the original FfsFindSectionData will be added back. FfsFindSectionData is renamed as FfsFindSectionDataWithHook. Accordingly PeilessStartupLib in OvmfPkg should be updated as well. To prevent the build from being broken, the changes in OvmfPkg are in this patch. Signed-off-by: Min Xu <min.m.xu@intel.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com> Acked-by: Gerd Hoffmann <kraxel@redhat.com>
* MdeModulePkg: Add IpmiCommandLibAbner Chang2023-01-192-0/+8
| | | | | | | | | | | | | | | | Add IpmiCommandLib to MdeModulePkg DEC/DSC files. Signed-off-by: Abner Chang <abner.chang@amd.com> Cc: Jian J Wang <jian.j.wang@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Nickle Wang <nicklew@nvidia.com> Cc: Igor Kulchytskyy <igork@ami.com> Cc: Isaac Oram <isaac.w.oram@intel.com> Cc: Nate DeSimone <nathaniel.l.desimone@intel.com> Reviewed-by: Isaac Oram <isaac.w.oram@intel.com> Reviewed-by: Igor Kulchytskyy <igork@ami.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
* MdeModulePkg/IpmiCommandLib: Add NULL instance libraryAbner Chang2023-01-195-0/+757
| | | | | | | | | | | | | | | | | The NULL instance of IpmiCommandLib library under MdeModulePkg as the default IpmiCommandLib instance used by the modules under edk2. Signed-off-by: Abner Chang <abner.chang@amd.com> Cc: Jian J Wang <jian.j.wang@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Nickle Wang <nicklew@nvidia.com> Cc: Igor Kulchytskyy <igork@ami.com> Cc: Isaac Oram <isaac.w.oram@intel.com> Cc: Nate DeSimone <nathaniel.l.desimone@intel.com> Reviewed-by: Isaac Oram <isaac.w.oram@intel.com> Reviewed-by: Igor Kulchytskyy <igork@ami.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
* MdeModulePkg/Include: Add IpmiCommandLib header fileAbner Chang2023-01-191-0/+683
| | | | | | | | | | | | | | | | | | | | | | | | Add IpmiCommandLib to MdeModulePkg. This header file is copied from edk2-platforms/Features/Intel/OutOfBandManagement/ IpmiFeaturePkg\Include\Library. Having this header file in edk2 to avoid the dependence of edk2 module with edk2-platfrom. The NULL instance of IpmiCommandLib under MdeModulePkg has to be implemented for the same reason. IpmiCommandLib.h in edk2-platforms should be removed once this patch set is merged. Expect no impacts on edk2-platforms because MdeModulePkg is referred in INF file by all edk2 modules under edk2-platforms that use IpmiCommandLib. Signed-off-by: Abner Chang <abner.chang@amd.com> Cc: Jian J Wang <jian.j.wang@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Nickle Wang <nicklew@nvidia.com> Cc: Igor Kulchytskyy <igork@ami.com> Cc: Isaac Oram <isaac.w.oram@intel.com> Cc: Nate DeSimone <nathaniel.l.desimone@intel.com> Reviewed-by: Isaac Oram <isaac.w.oram@intel.com> Reviewed-by: Igor Kulchytskyy <igork@ami.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
* RedfishPkg/Include: Redfish USB Interface V2 updateAbner Chang2023-01-191-1/+24
| | | | | | | | | | | Support USB_INTERFACE_DEVICE_DESCRIPTOR_V2 which is updated in Redfish Host Interface spec v1.3. Signed-off-by: Abner Chang <abner.chang@amd.com> Cc: Nickle Wang <nicklew@nvidia.com> Cc: Igor Kulchytskyy <igork@ami.com> Reviewed-by: Igor Kulchytskyy <igork@ami.com> Reviewed-by: Nickle Wang <nicklew@nvidia.com>
* RedfishPkg/Include: Add Redfish IPMI definitionsAbner Chang2023-01-191-0/+51
| | | | | | | | | | | Add the definitions of Redfish Host Interface credential bootstrapping IPMI commands. Signed-off-by: Nickle Wang <nicklew@nvidia.com> Cc: Abner Chang <abner.chang@amd.com> Cc: Igor Kulchytskyy <igork@ami.com> Reviewed-by: Igor Kulchytskyy<igork@ami.com> Reviewed-by: Isaac Oram <isaac.w.oram@intel.com>
* MdePkg/IndustryStandard: Update IPMI definitionsAbner Chang2023-01-193-4/+82
| | | | | | | | | | | | | | | | | | | | | This change updates IPMI header files to support build up SMBIOS 42 Redfish Host Interface record using the information retrieved via IPMI App/Net Function. In IpmiNetFnApp.h, we also remove the duplicate definition of IPMI_APP_GET_CHANNEL_INFO. Signed-off-by: Abner Chang <abner.chang@amd.com> Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Zhiguang Liu <zhiguang.liu@intel.com> Cc: Nickle Wang <nicklew@nvidia.com> Cc: Igor Kulchytskyy <igork@ami.com> Cc: Isaac Oram <isaac.w.oram@intel.com> Cc: Nate DeSimone <nathaniel.l.desimone@intel.com> Reviewed-by: Isaac Oram <isaac.w.oram@intel.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
* OvmfPkg/CcExitLib: Initialize Status in IoExitMin M Xu2023-01-181-4/+5
| | | | | | | | | | | | | Status should be initialized otherwise it may return unexpected value. Cc: Erdem Aktas <erdemaktas@google.com> Cc: James Bottomley <jejb@linux.ibm.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Gerd Hoffmann <kraxel@redhat.com> Cc: Tom Lendacky <thomas.lendacky@amd.com> Cc: Michael Roth <michael.roth@amd.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com> Signed-off-by: Min Xu <min.m.xu@intel.com>
* OvmfPkg/BaseMemEncryptTdxLib: Refactor error handle of SetOrClearSharedBitMin M Xu2023-01-181-8/+40
| | | | | | | | | | | | | | | The previous implementation of SetOrClearSharedBit doesn't handle the error correctly. In this patch SetOrClearSharedBit is changed to return error code so that the caller can handle it. Cc: Erdem Aktas <erdemaktas@google.com> Cc: James Bottomley <jejb@linux.ibm.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Gerd Hoffmann <kraxel@redhat.com> Cc: Tom Lendacky <thomas.lendacky@amd.com> Cc: Michael Roth <michael.roth@amd.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com> Signed-off-by: Min Xu <min.m.xu@intel.com>
* SecurityPkg/TdTcg2Dxe: Extend EFI boot variable to PCR[1]Min M Xu2023-01-181-5/+1
| | | | | | | | | | | According to TCG PC Client PFP spec 0021 Section 2.4.4.2 EFI boot variable should be measured and extended to PCR[1], not PCR[5]. This patch is proposed to fix this error. Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Jian J Wang <jian.j.wang@intel.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com> Signed-off-by: Min Xu <min.m.xu@intel.com>
* OvmfPkg/CcExitLib: Refactor TDX MmioExitMin M Xu2023-01-181-163/+381
| | | | | | | | | | | | | | | | | | | BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=4169 The previous TDX MmioExit doesn't handle the Mmio instructions correctly in some scenarios. This patch refactors the implementation to fix the issues. Cc: Erdem Aktas <erdemaktas@google.com> Cc: James Bottomley <jejb@linux.ibm.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Gerd Hoffmann <kraxel@redhat.com> Cc: Tom Lendacky <thomas.lendacky@amd.com> Cc: Ryan Afranji <afranji@google.com> Reported-by: Ryan Afranji <afranji@google.com> Signed-off-by: Min Xu <min.m.xu@intel.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com> Acked-by: Gerd Hoffmann <kraxel@redhat.com>
* OvmfPkg/CcExitLib: Move common X86 instruction code to separate fileMin M Xu2023-01-185-615/+735
| | | | | | | | | | | | | | | | | | https://bugzilla.tianocore.org/show_bug.cgi?id=4169 Move common X86 instruction codes from CcExitVcHandler.c to separate files (CcInstruction.h / CcInstruction.c) so that these codes can be re-used in TDX. Cc: Gerd Hoffmann <kraxel@redhat.com> Cc: Erdem Aktas <erdemaktas@google.com> Cc: James Bottomley <jejb@linux.ibm.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Tom Lendacky <thomas.lendacky@amd.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com> Reviewed-by: Tom Lendacky <thomas.lendacky@amd.com> Signed-off-by: Min Xu <min.m.xu@intel.com> Acked-by: Gerd Hoffmann <kraxel@redhat.com>
* OvmfPkg/PeilessStartupLib: Find NCCFV in non-td guestMin M Xu2023-01-183-1/+140
| | | | | | | | | | | | | | | | BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=4152 As described in BZ#4152, NCCFV includes the DXE phase drivers for non-cc guest. PeilessStartupLib is updated to find NCCFV for non-cc guest. Cc: Gerd Hoffmann <kraxel@redhat.com> Cc: Erdem Aktas <erdemaktas@google.com> Cc: James Bottomley <jejb@linux.ibm.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Tom Lendacky <thomas.lendacky@amd.com> Signed-off-by: Min Xu <min.m.xu@intel.com> Acked-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
* OvmfPkg/IntelTdx: Enable separate-fv in IntelTdx/IntelTdxX64.fdfMin M Xu2023-01-182-40/+83
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=4152 In current DXE FV there are 100+ drivers. Some of the drivers are not used in Td guest. (Such as USB support drivers, network related drivers, etc). From the security perspective if a driver is not used, we'd should prevent it from being loaded / started. There are 2 benefits: 1. Reduce the attack surface 2. Improve the boot performance So we separate DXEFV into 2 FVs: DXEFV and NCCFV. All the drivers which are not needed by a Confidential Computing guest are moved from DXEFV to NCCFV. The following patch will find NCCFV for non-cc guest and build FVHob so that NCCFV drivers can be loaded / started in DXE phase. Cc: Gerd Hoffmann <kraxel@redhat.com> Cc: Erdem Aktas <erdemaktas@google.com> Cc: James Bottomley <jejb@linux.ibm.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Tom Lendacky <thomas.lendacky@amd.com> Signed-off-by: Min Xu <min.m.xu@intel.com> Acked-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
* OvmfPkg: Add PCDs/GUID for NCCFVMin M Xu2023-01-181-0/+3
| | | | | | | | | | | | | | | BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=4152 NCCFV refers to Non-Confidential-Computing-FV. It includes the DXE phase drivers which are only loaded/started in non-cc guest. Hence the PCDs / GUID for NCCFV are defined in OvmfPkg.dec. Cc: Gerd Hoffmann <kraxel@redhat.com> Cc: Erdem Aktas <erdemaktas@google.com> Cc: James Bottomley <jejb@linux.ibm.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Tom Lendacky <thomas.lendacky@amd.com> Signed-off-by: Min Xu <min.m.xu@intel.com>
* EmbeddedPkg/PrePiLib: Add FFS_CHECK_SECTION_HOOK when finding sectionMin M Xu2023-01-183-18/+49
| | | | | | | | | | | | | | | | | | | | | | BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=4152 EmbeddedPkg/PrePiLib provides the service of finding sections based on the input SectionType. But sometimes there maybe multiple sections with the same SectionType. FFS_CHECK_SECTION_HOOK is a hook which can be called to do additional check. Cc: Leif Lindholm <quic_llindhol@quicinc.com> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Cc: Abner Chang <abner.chang@amd.com> Cc: Daniel Schaefer <git@danielschaefer.me> Cc: Gerd Hoffmann <kraxel@redhat.com> Cc: Erdem Aktas <erdemaktas@google.com> Cc: James Bottomley <jejb@linux.ibm.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Tom Lendacky <thomas.lendacky@amd.com> Acked-by: Ard Biesheuvel <ardb+tianocore@kernel.org> Signed-off-by: Min Xu <min.m.xu@intel.com> Acked-by: Gerd Hoffmann <kraxel@redhat.com>
* ShellPkg: Display SMBIOS Type38 fields in smbiosview in formatted viewPrakash.K2023-01-182-3/+27
| | | | | | | | | | | | | | | | | | | | | | | In smbiosview command in shell, below are the fields of SMBIOS Type38 table which can be displayed in formatted manner. 1. Base Address 1. IPMI Specification Version. 2. NV Storage Device Address. Base Address: As per spec, the value in Base Address field of SMBIOS type38 table should be right shifted by 1 if the interface type is SSIF. IPMI Specification Version: If the value in IPMI Specification Version field is 15H, it should be displayed 1.5. NV Storage Device Address: If the value in NV Storage Device Address field is 0xFF, it should be displayed as "No storage device is Present". Cc: Vasudevan Sambandan <vasudevans@ami.com> Cc: Sundaresan Selvaraj <sundaresans@ami.com> Cc: Gayathri Thunuguntla <gayathrit@ami.com> Signed-off-by: Prakash K <prakashk@ami.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
* CI: use ubuntu-22.04 image (Linux only)Oliver Steffen2023-01-171-1/+1
| | | | | | | | | | | Use the same vm_image as the other Linux CIs in ArmVirtPkg, EmulatorPkg, and OvmfPkg. Switch over to ubuntu-22.04 from ubuntu-latest. Signed-off-by: Oliver Steffen <osteffen@redhat.com> Reviewed-by: Michael Kubacki <michael.kubacki@microsoft.com> Acked-by: Ard Biesheuvel <ardb@kernel.org> Acked-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Chris Fernald <chfernal@microsoft.com>
* OvmfPkg: CI: use ubuntu-22.04 vm_image (Linux only)Oliver Steffen2023-01-171-1/+1
| | | | | | | | | | | | | Switch over to ubuntu-22.04 as the vm_image for Linux CI jobs. The previously used ubuntu-18.04 which is not available anymore since Dec 1st 2022. Signed-off-by: Oliver Steffen <osteffen@redhat.com> Reviewed-by: Michael Kubacki <michael.kubacki@microsoft.com> Acked-by: Jiewen Yao <jiewen.yao@intel.com> Acked-by: Ard Biesheuvel <ardb@kernel.org> Acked-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Chris Fernald <chfernal@microsoft.com>
* EmulatorPkg: CI: use ubuntu-22.04 vm_image (Linux only)Oliver Steffen2023-01-171-1/+1
| | | | | | | | | | | | Switch over to ubuntu-22.04 as the vm_image for Linux CI jobs. The previously used ubuntu-18.04 which is not available anymore since Dec 1st 2022. Signed-off-by: Oliver Steffen <osteffen@redhat.com> Reviewed-by: Michael Kubacki <michael.kubacki@microsoft.com> Acked-by: Ard Biesheuvel <ardb@kernel.org> Acked-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Chris Fernald <chfernal@microsoft.com>
* ArmVirtPkg: CI: use ubuntu-22.04 vm_image (Linux only)Oliver Steffen2023-01-171-1/+1
| | | | | | | | | | | | Switch over to ubuntu-22.04 as the vm_image for Linux CI jobs. The previously used ubuntu-18.04 which is not available anymore since Dec 1st 2022. Signed-off-by: Oliver Steffen <osteffen@redhat.com> Reviewed-by: Michael Kubacki <michael.kubacki@microsoft.com> Acked-by: Ard Biesheuvel <ardb@kernel.org> Acked-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Chris Fernald <chfernal@microsoft.com>
* BaseTools: remove ext_dep files for gccOliver Steffen2023-01-174-86/+0
| | | | | | | | | | | | Remove BaseTools/Bin/gcc_*_ext_dep.yaml to stop downloading gcc from external locations; use the gcc provided by the container image instead. The container image sets the variable GCC5_*_PREFIX accordingly. Signed-off-by: Oliver Steffen <osteffen@redhat.com> Reviewed-by: Michael Kubacki <michael.kubacki@microsoft.com> Acked-by: Ard Biesheuvel <ardb@kernel.org> Acked-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Chris Fernald <chfernal@microsoft.com>
* .pytool: CISettings.py: don't add scopes for GCCOliver Steffen2023-01-171-9/+0
| | | | | | | | | | | | All ext_dep.yml files for gcc have been removed and gcc is expected to be installed on the system (GCC5_*_PREFIX may indicate the location). No need to adjust the toolchain scopes for Linux builds anymore. Signed-off-by: Oliver Steffen <osteffen@redhat.com> Reviewed-by: Michael Kubacki <michael.kubacki@microsoft.com> Acked-by: Ard Biesheuvel <ardb@kernel.org> Acked-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Chris Fernald <chfernal@microsoft.com>
* OvmfPkg: CI: Use Fedora 35 container (Linux only)Oliver Steffen2023-01-171-5/+3
| | | | | | | | | | | | | | | | | | Run the Linux jobs of the OvmfPkg platform CI inside a container, in the same way the general CI does now. Make use of the default image specified in the defaults.yml template. Do not run apt-get in CI jobs to install qemu and gcc dependencies. Assume the container image provides these. Use Python from the container image, do not download at runtime. Signed-off-by: Oliver Steffen <osteffen@redhat.com> Acked-by: Jiewen Yao <jiewen.yao@intel.com> Reviewed-by: Michael Kubacki <michael.kubacki@microsoft.com> Acked-by: Ard Biesheuvel <ardb@kernel.org> Acked-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Chris Fernald <chfernal@microsoft.com>
* EmulatorPkg: CI: Use Fedora 35 container (Linux only)Oliver Steffen2023-01-171-1/+3
| | | | | | | | | | | | | | Run the Linux jobs of the EmulatorPkg platform CI inside a container, in the same way the general CI does now. Make use of the default image specified in the defaults.yml template. Use Python from the container image, do not download at runtime. Signed-off-by: Oliver Steffen <osteffen@redhat.com> Reviewed-by: Michael Kubacki <michael.kubacki@microsoft.com> Acked-by: Ard Biesheuvel <ardb@kernel.org> Acked-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Chris Fernald <chfernal@microsoft.com>
* ArmVirtPkg: CI: Use Fedora 35 container (Linux only)Oliver Steffen2023-01-171-5/+3
| | | | | | | | | | | | | | | | | Run the Linux jobs of the ArmVirtPkg platform CI inside a container, in the same way the general CI does now. Make use of the default image specified in the defaults.yml template. Do not run apt-get in CI jobs to install qemu and gcc dependencies. Assume the container image provides these. Use Python from the container image, do not download at runtime. Signed-off-by: Oliver Steffen <osteffen@redhat.com> Reviewed-by: Michael Kubacki <michael.kubacki@microsoft.com> Acked-by: Ard Biesheuvel <ardb@kernel.org> Acked-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Chris Fernald <chfernal@microsoft.com>
* CI: Use Fedora 35 container (Linux only)Ard Biesheuvel2023-01-173-10/+3
| | | | | | | | | | | | | | | | | | | | Run all Linux based jobs in a container, using a custom Fedora 35 image (gcc 11). The image URL specified in the defaults.yml template, so that all CI jobs can use it. The image is hosted on ghcr.io and the Dockerfiles are here: https://github.com/tianocore/containers The version numbers of gcc, iasl, and nasm are pinned to avoid unintended upgrades during image rebuild. Do not run apt-get in CI jobs to install qemu and gcc dependencies. Assume the container image provides these. Use Python from the container image, do not download at runtime. Signed-off-by: Oliver Steffen <osteffen@redhat.com> Reviewed-by: Michael Kubacki <michael.kubacki@microsoft.com> Acked-by: Ard Biesheuvel <ardb@kernel.org> Acked-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Chris Fernald <chfernal@microsoft.com>
* CI: Allow running in a container.Oliver Steffen2023-01-171-0/+4
| | | | | | | | | | | | Add a parameter of the pr-gate-build-job template to specify a container image URL. If the value is not '' (default), then the jobs will be run inside a container based on that image. Signed-off-by: Oliver Steffen <osteffen@redhat.com> Reviewed-by: Michael Kubacki <michael.kubacki@microsoft.com> Acked-by: Ard Biesheuvel <ardb@kernel.org> Acked-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Chris Fernald <chfernal@microsoft.com>
* CI: add ~/.local/bin to PATH (Linux only)Oliver Steffen2023-01-172-0/+12
| | | | | | | | | | | | Without adding ~/.local/bin to PATH, `pip install` will throw an error when running inside a container. Containers will be introduced to the CI in the following commits. Signed-off-by: Oliver Steffen <osteffen@redhat.com> Reviewed-by: Michael Kubacki <michael.kubacki@microsoft.com> Acked-by: Ard Biesheuvel <ardb@kernel.org> Acked-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Chris Fernald <chfernal@microsoft.com>
* OvmfPkg: CI: use Python version from defaults templateOliver Steffen2023-01-172-0/+9
| | | | | | | | | | | | | | | | | Use the default Python version from the defaults template (.azurepipelines/templates/defaults.yml) in the Windows and Linux CI jobs. Previous changes to the CI job templates make it necessary to specify a version number, if Python shall be pulled at CI runtime. Signed-off-by: Oliver Steffen <osteffen@redhat.com> Reviewed-by: Michael Kubacki <michael.kubacki@microsoft.com> Acked-by: Jiewen Yao <jiewen.yao@intel.com> Acked-by: Ard Biesheuvel <ardb@kernel.org> Acked-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Chris Fernald <chfernal@microsoft.com>
* EmulatorPkg: CI: use Python version from defaults templateOliver Steffen2023-01-172-0/+9
| | | | | | | | | | | | | | | | Use the default Python version from the defaults template (.azurepipelines/templates/defaults.yml) in the Windows and Linux CI jobs. Previous changes to the CI job templates make it necessary to specify a version number, if Python shall be pulled at CI runtime. Signed-off-by: Oliver Steffen <osteffen@redhat.com> Reviewed-by: Michael Kubacki <michael.kubacki@microsoft.com> Acked-by: Ard Biesheuvel <ardb@kernel.org> Acked-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Chris Fernald <chfernal@microsoft.com>
* ArmVirtPkg: CI: use Python version from defaults templateOliver Steffen2023-01-171-0/+4
| | | | | | | | | | | | | | | | Use the default Python version from the defaults template (.azurepipelines/templates/defaults.yml) in the Windows and Linux CI jobs. Previous changes to the CI job templates make it necessary to specify a version number, if Python shall be pulled at CI runtime. Signed-off-by: Oliver Steffen <osteffen@redhat.com> Reviewed-by: Michael Kubacki <michael.kubacki@microsoft.com> Acked-by: Ard Biesheuvel <ardb@kernel.org> Acked-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Chris Fernald <chfernal@microsoft.com>
* CI: make Python version configurableOliver Steffen2023-01-176-7/+30
| | | | | | | | | | | | | | | | Add a new parameter "usePythonVersion" to the CI job templates. This makes it possible to specify the version of Python to use. The default value is '', in which case Python will not be downloaded at runtime and the one provided by the VM/container image will be used. Additionally, add a template .azurepipelines/templates/defaults.yml, from which the default Pyhton version string can be obtained. Signed-off-by: Oliver Steffen <osteffen@redhat.com> Reviewed-by: Michael Kubacki <michael.kubacki@microsoft.com> Acked-by: Ard Biesheuvel <ardb@kernel.org> Acked-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Chris Fernald <chfernal@microsoft.com>
* OvmfPkg/PlatformInitLib: reorder PlatformQemuUc32BaseInitializationGerd Hoffmann2023-01-171-8/+8
| | | | | | | | | | First handle the cases which do not need know the value of PlatformInfoHob->LowMemory (microvm and cloudhv). Then call PlatformGetSystemMemorySizeBelow4gb() to get LowMemory. Finally handle the cases (q35 and pc) which need to look at LowMemory, Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
* OvmfPkg/PlatformInitLib: Add PlatformReservationConflictCBGerd Hoffmann2023-01-171-0/+46
| | | | | | | | | | | | | | | | | Add PlatformReservationConflictCB() callback function for use with PlatformScanE820(). It checks whenever the 64bit PCI MMIO window overlaps with a reservation from qemu. If so move down the MMIO window to resolve the conflict. Write any actions done (moving mmio window) to the firmware log with INFO loglevel. This happens on (virtual) AMD machines with 1TB address space, because the AMD IOMMU uses an address window just below 1TB. Bugzilla: https://bugzilla.tianocore.org/show_bug.cgi?id=4251 Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
* OvmfPkg/PlatformInitLib: Add PlatformAddHobCBGerd Hoffmann2023-01-171-138/+48
| | | | | | | | | | | | | | | | Add PlatformAddHobCB() callback function for use with PlatformScanE820(). It adds HOBs for high memory and reservations (low memory is handled elsewhere because there are some special cases to consider). This replaces calls to PlatformScanOrAdd64BitE820Ram() with AddHighHobs = TRUE. Write any actions done (adding HOBs, skip unknown types) to the firmware log with INFO loglevel. Also remove PlatformScanOrAdd64BitE820Ram() which is not used any more. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
* OvmfPkg/PlatformInitLib: Add PlatformGetLowMemoryCBGerd Hoffmann2023-01-176-33/+60
| | | | | | | | | | | | | | | | | Add PlatformGetLowMemoryCB() callback function for use with PlatformScanE820(). It stores the low memory size in PlatformInfoHob->LowMemory. This replaces calls to PlatformScanOrAdd64BitE820Ram() with non-NULL LowMemory. Write any actions done (setting LowMemory) to the firmware log with INFO loglevel. Also change PlatformGetSystemMemorySizeBelow4gb() to likewise set PlatformInfoHob->LowMemory instead of returning the value. Update all Callers to the new convention. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
* OvmfPkg/PlatformInitLib: Add PlatformScanE820 and GetFirstNonAddressCBGerd Hoffmann2023-01-171-23/+93
| | | | | | | | | | | | | | | | | | | | | First step replacing the PlatformScanOrAdd64BitE820Ram() function. Add a PlatformScanE820() function which loops over the e280 entries from FwCfg and calls a callback for each of them. Add a GetFirstNonAddressCB() function which will store the first free address (right after the last RAM block) in PlatformInfoHob->FirstNonAddress. This replaces calls to PlatformScanOrAdd64BitE820Ram() with non-NULL MaxAddress. Write any actions done (setting FirstNonAddress) to the firmware log with INFO loglevel. Also drop local FirstNonAddress variables and use PlatformInfoHob->FirstNonAddress instead everywhere. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
* BaseTools/tools_def CLANG38: Suppress unaligned access warningArd Biesheuvel2023-01-171-1/+1
| | | | | | | | | | | | Even though the presence of the 'packed' pragma should be a strong hint that the misaligned placement of a GUID in a struct is intentional, recent Clang versions will object nonetheless, and break the build due to the presence of such GUIDs in the FPDT ACPI tables. This is obviously not something we can fix in the code, so let's just suppress the warning/error instead. Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
* BaseTools/tools_def ARM: Make choice for soft float ABI explicitArd Biesheuvel2023-01-171-2/+2
| | | | | | | | | | | | | | Recent GCC for ARM will complain when selecting the hard float ABI without specifying the FPU implementation, even when just running the preprocessor. This all happens under the hood, and we never bothered in the past, given that we don't emit floating point code anyway. However, to placate newer compilers, make it explicit that the floating point ABI is always the softfloat one, by moving the -msoft-float compiler option to PLATFORM_FLAGS. Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
* BaseTools/tools_def ARM AARCH64: Get rid of ARCHCC and ARCHASM flagsArd Biesheuvel2023-01-171-48/+41
| | | | | | | ARCHCC_FLAGS and ARCHASM_FLAGS no longer serve a useful purpose so drop all the definitions and references. Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
* BaseTools/tools_def RISCV: Make OpenSBI references RISCV-onlyArd Biesheuvel2023-01-171-2/+1
| | | | | | | | | | | | | | | The global GCC_PP_FLAGS tools_def variable now contains a reference to OpenSBI specific C preprocessor variables, which means they are added to the command line on every architecture, not just RISC-V. This does not currently result in any issues, but it is a bit sloppy so let's clean this up. Given that the GCC_PP_FLAGS definition appears twice, drop the one that carries the OpenSBI reference, and move that reference to a new RISC-V specific variable. Acked-by: Abner Chang <abner.chang@amd.com> Reviewed-by: Sunil V L <sunilvl@ventanamicro.com> Signed-off-by: Ard Biesheuvel <ardb@kernel.org>