summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2024-02-29RedfishPkg: implement Redfish HTTP protocolNickle Wang11-4/+3164
implement Redfish HTTP protocol driver. Signed-off-by: Nickle Wang <nicklew@nvidia.com> Co-authored-by: Igor Kulchytskyy <igork@ami.com> Cc: Abner Chang <abner.chang@amd.com> Cc: Igor Kulchytskyy <igork@ami.com> Cc: Nick Ramirez <nramirez@nvidia.com> Reviewed-by: Abner Chang <abner.chang@amd.com> Reviewed-by: Igor Kulchytskyy <igork@ami.com> Reviewed-by: Mike Maslenkin <mike.maslenkin@gmail.com>
2024-02-29RedfishPkg: introduce Redfish HTTP protocolNickle Wang3-1/+374
Introduce Redfish HTTP protocol to improve Redfish performance and communication stability between BIOS and Redfish service. - Feature drivers often query same Redfish resource multiple times for different purpose. Implement HTTP cache mechanism to improve HTTP GET performance. "UseCache" parameter is provided if application likes to send HTTP GET request to Redfish service without using cache data. - This driver will retire stale cache data automatically when application modify Redfish resource at service side. - PCD PcdHttpCacheDisabled is used to disable cache mechanism in this driver for debugging purpose. - PCD PcdRedfishServiceContentEncoding is used to enable content encoding while sending data to Redfish service. - Redfish HTTP protocol also implement retry mechanism to retry HTTP request when BIOS receive unexpected response from Redfish service. This function helps BIOS Redfish to finish its job as much as possible. - PCDs are defined to control how many times BIOS will retry the request and how many time BIOS will wait between retries. Signed-off-by: Nickle Wang <nicklew@nvidia.com> Co-authored-by: Igor Kulchytskyy <igork@ami.com> Cc: Abner Chang <abner.chang@amd.com> Cc: Igor Kulchytskyy <igork@ami.com> Cc: Nick Ramirez <nramirez@nvidia.com> Reviewed-by: Abner Chang <abner.chang@amd.com> Reviewed-by: Igor Kulchytskyy <igork@ami.com>
2024-02-28BaseTools: Syntax warning invalid escape sequence \CJayaprakash, N1-1/+1
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4666 This commit fixes the issue reported through BZ4666. The Syntax warning related to invalid escape sequence for \C is seen on Windows OS based builds of edk2 sources. On Windows the path seperator needs to prefixed with \ so essentially we need to use \\ as path seperator. Cc: Rebecca Cran <rebecca@bsdio.com> Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Laszlo Ersek <lersek@redhat.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Bob Feng <bob.c.feng@intel.com> Cc: Yuwei Chen <yuwei.chen@intel.com> Cc: Jayaprakash N <n.jayaprakash@intel.com> Signed-off-by: Jayaprakash N <n.jayaprakash@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Rebecca Cran <rebecca@bsdio.com>
2024-02-27BaseTools/Scripts/PatchCheck: Error if commit modifies multiple packagesMichael D Kinney1-1/+76
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4679 Update PatchCheck.py to evaluate all the files modified in each commit and generate an error if: * A commit adds/modifies files in multiple package directories * A commit adds/modifies files in multiple non-package directories * A commit adds/modifies files in both a package and a non-package directory * A commit deletes files from multiple package directories * A commit deletes files from multiple non-package directories * A commit deletes files from both a package and a non-package directory Modifications to files in the root of the repository are not evaluated. This check is skipped if PatchCheck.py is run on a patch file or input from stdin because this multiple package commit check depends on information from a git repository. If --ignore-multi-package option is set, then reduce the multiple package commit check from an error to a warning for all commits in the commit range provided to PatchCheck.py. Add check for a 'Continuous-integration-options:' commit message tag that allows one or more options to be specified at the individual commit scope to enable/disable continuous integration checks. This tag must start at the beginning of a commit message line and may appear more than once in a commit message. Add support for a Continuous-integration-options tag value of 'PatchCheck.ignore-multi-package' that reduces the multiple package commit check from an error to a warning for the specific commits that specify this option. Example: Continuous-integration-options: PatchCheck.ignore-multi-package The set of packages are found by searching for DEC files in a git repository. The list of DEC files in a git repository is collected with the following git command: git ls-files *.dec The set of files added/modified by each commit is found using the following git command: git diff-tree --no-commit-id --name-only --diff-filter=AM -r <commit> The set of files deleted by each commit is found using the following git command: git diff-tree --no-commit-id --name-only --diff-filter=D -r <commit> Cc: Rebecca Cran <rebecca@bsdio.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Bob Feng <bob.c.feng@intel.com> Cc: Yuwei Chen <yuwei.chen@intel.com> Cc: Michael Kubacki <mikuback@linux.microsoft.com> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Cc: Leif Lindholm <quic_llindhol@quicinc.com> Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Michael Kubacki <michael.kubacki@microsoft.com> Reviewed-by: Rebecca Cran <rebecca@bsdio.com>
2024-02-27BaseTools/Scripts/PatchCheck: Error if no Cc tags are presentMichael D Kinney1-2/+4
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4694 If no Cc tags are detected in a commit message, then generate an error. All patches sent for review are required to provide the set of maintainers and reviewers responsible for the directories/files modified. The set of maintainers and reviewers are documented in Maintainers.txt and can be retrieved using the script BaseTools/Scripts/GetMaintainer.py. Cc: Rebecca Cran <rebecca@bsdio.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Bob Feng <bob.c.feng@intel.com> Cc: Yuwei Chen <yuwei.chen@intel.com> Cc: Michael Kubacki <mikuback@linux.microsoft.com> Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Michael Kubacki <michael.kubacki@microsoft.com> Reviewed-by: Rebecca Cran <rebecca@bsdio.com>
2024-02-27BaseTools/Scripts/PatchCheck: Return CommitMessageCheck errorsMichael D Kinney1-1/+1
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4693 Commit signatures are checked and error messages are logged but errors are not captured and returned from find_signatures() in the CommitMessageCheck class. This causes signature errors to be silently ignored by CI. Update logic in CommitMessageCheck class to return errors detected in commit message signatures. Cc: Rebecca Cran <rebecca@bsdio.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Bob Feng <bob.c.feng@intel.com> Cc: Yuwei Chen <yuwei.chen@intel.com> Cc: Michael Kubacki <mikuback@linux.microsoft.com> Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Michael Kubacki <michael.kubacki@microsoft.com> Reviewed-by: Rebecca Cran <rebecca@bsdio.com>
2024-02-27BaseTools/Scripts/PatchCheck: Update Author checksMichael D Kinney1-1/+5
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4680 * Reject patches that match Author email "devel@edk2.groups.io" * Update the current check for " via Groups.Io" to perform a case insensitive match. It appears that groups.io has changed the format of this string to use all lower case. Cc: Rebecca Cran <rebecca@bsdio.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Bob Feng <bob.c.feng@intel.com> Cc: Yuwei Chen <yuwei.chen@intel.com> Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Rebecca Cran <rebecca@bsdio.com> Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
2024-02-27EmbeddedPkg/Scripts/LauterbachT32: Fix EfiLoadDxe.cmmRebecca Cran3-73/+19
There have been many changes since EfiLoadDxe.cmm was last updated in 2011. The EFI_SYSTEM_TABLE can no longer be found by scanning memory on 4KB boundaries, so require users pass in its address instead. Update various offsets so that the debug information can be found and loaded with a recent version of TRACE32. Signed-off-by: Rebecca Cran <rebecca@os.amperecomputing.com> Reviewed-by: Leif Lindholm <quic_llindhol@quicinc.com>
2024-02-27OvmfPkg/PlatformPei: log pei memory cap detailsGerd Hoffmann1-0/+24
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Message-Id: <20240214104504.2931339-5-kraxel@redhat.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
2024-02-27OvmfPkg/PlatformPei: rewrite page table calculationGerd Hoffmann1-22/+36
Consider 5-level paging. Simplify calculation to make it easier to understand. Add some comments, improve ASSERTs. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Message-Id: <20240214104504.2931339-4-kraxel@redhat.com>
2024-02-27OvmfPkg/PlatformPei: consider AP stacks for pei memory capGerd Hoffmann1-3/+14
Needed to avoid running out of memory when booting with a large (~2048) number of vcpus. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Message-Id: <20240214104504.2931339-3-kraxel@redhat.com>
2024-02-27OvmfPkg/PlatformPei: log a warning when memory is tightGerd Hoffmann1-0/+8
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Message-Id: <20240214104504.2931339-2-kraxel@redhat.com>
2024-02-27StandaloneMmPkg: Arm: Update to use the new StandaloneMmCpu driverTuan Phan4-64/+67
Update entry point library for Arm to use the new architecture independent StandaloneMmCpu driver. Signed-off-by: Tuan Phan <tphan@ventanamicro.com> Reviewed-by: levi.yun <yeoreum.yun@arm.com> Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
2024-02-27StandaloneMmPkg: Make StandaloneMmCpu driver architecture independentTuan Phan5-54/+46
StandaloneMmCpu now can supports more architectures like RISC-V besides ARM/AARCH64. Signed-off-by: Tuan Phan <tphan@ventanamicro.com> Reviewed-by: levi.yun <yeoreum.yun@arm.com> Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
2024-02-27RedfishPkg/RestJsonStructureDxe: Refine REST JSON C Structure DXE driverAbner Chang3-6/+96
BZ #: 4711 - Add mode debug messages. - Remove the references of "Redfish" from this driver. As REST JSON C Structure was not designed for Redfish only. Any RESTful applications can register the converter and provide JSON-C structure conversions through EFI_REST_JSON_STRUCTURE_PROTOCOL. Therefore this driver shouldn't have a dependency on Redfish package and the references of "Redfish" terminology. - Fix the missing parameter of DEBUG macros used in this driver. Signed-off-by: Abner Chang <abner.chang@amd.com> Cc: Nickle Wang <nicklew@nvidia.com> Cc: Igor Kulchytskyy <igork@ami.com> Reviewed-by: Nickle Wang <nicklew@nvidia.com>
2024-02-26MdeModulePkg/TraceHubDebugSysTLib: Use wider type for loop comparisonsMichael Kubacki3-4/+4
Resolves a new CodeQL error due to the value being incremented in the loop being a narrower type than the variable it is being compared against. The variable is changed to a UINT32 type so it has the same width as the type it is being compared against. Issue explanation: In a loop condition, comparison of a value of a narrow type with a value of a wide type may result in unexpected behavior if the wider value is sufficiently large (or small). This is because the narrower value may overflow. This can lead to an infinite loop. Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Gua Guo <gua.guo@intel.com> Cc: Prakashan Krishnadas Veliyathuparambil <krishnadas.veliyathuparambil.prakashan@intel.com> Cc: K N Karthik <karthik.k.n@intel.com> Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com> Reviewed-by: Gua Guo <gua.guo@intel.com>
2024-02-26UefiCpuPkg/MpInitLib: return early in GetBspNumber()Gerd Hoffmann1-7/+4
After finding the BSP Number return the result instead of continuing to loop over the remaining processors. Suggested-by: Laszlo Ersek <lersek@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Message-Id: <20240222160106.686484-7-kraxel@redhat.com> Reviewed-by: Ray Ni <ray.ni@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> [lersek@redhat.com: s/ASSERT (FALSE)/ASSERT_EFI_ERROR (EFI_NOT_FOUND)/ [Ray]]
2024-02-26UefiCpuPkg/MpInitLib: Add support for multiple HOBs to SaveCpuMpData()Gerd Hoffmann1-18/+30
Add support for splitting Hand-Off data into multiple HOBs. This is required for VMs with thousands of CPUs. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Message-Id: <20240222160106.686484-6-kraxel@redhat.com> Reviewed-by: Ray Ni <ray.ni@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> [lersek@redhat.com: define one local variable per line [Ray]]
2024-02-26UefiCpuPkg/MpInitLib: Add support for multiple HOBs to MpInitLibInitializeGerd Hoffmann1-21/+47
Loop over all MP_HAND_OFF HOBs instead of expecting a single HOB covering all CPUs in the system. Add a new FirstMpHandOff variable, which caches the first HOB body for faster lookups. It is also used to check whenever MP_HAND_OFF HOBs are present. Using the MpHandOff pointer for that does not work any more because the variable will be NULL at the end of HOB loops. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Ray Ni <ray.ni@intel.com> Message-Id: <20240222160106.686484-5-kraxel@redhat.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
2024-02-26UefiCpuPkg/MpInitLib: Add support for multiple HOBs to SwitchApContext()Gerd Hoffmann2-13/+24
Rename the MpHandOff parameter to FirstMpHandOff. Add loops so the function inspects all HOBs present in the system. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Ray Ni <ray.ni@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Message-Id: <20240222160106.686484-4-kraxel@redhat.com>
2024-02-26UefiCpuPkg/MpInitLib: Add support for multiple HOBs to GetBspNumber()Gerd Hoffmann1-8/+15
Rename the MpHandOff parameter to FirstMpHandOff. Add a loop so the function inspects all HOBs present in the system. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Ray Ni <ray.ni@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Message-Id: <20240222160106.686484-3-kraxel@redhat.com>
2024-02-26UefiCpuPkg/MpInitLib: Add support for multiple HOBs to GetMpHandOffHobGerd Hoffmann2-10/+28
Rename the function to GetNextMpHandOffHob(), add MP_HAND_OFF parameter. When called with NULL pointer return the body of the first HOB, otherwise return the next in the chain. Also add the function prototype to the MpLib.h header file. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Message-Id: <20240222160106.686484-2-kraxel@redhat.com> Reviewed-by: Ray Ni <ray.ni@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
2024-02-26MdeModulePkg/Bus/Usb/UsbNetwork: Check array index range before accessMichael Kubacki3-3/+3
Checks that an offset used to access array elements is within the expected range before accessing the array item. Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Ray Ni <ray.ni@intel.com> Cc: Rebecca Cran <rebecca@bsdio.com> Cc: Richard Ho <richardho@ami.com> Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
2024-02-26MdePkg Updated the comments of EFI_SYSTEM_TABLE and ReadKeyStrokeJunfeng Guan3-3/+9
1. Refer to Uefi spec 2.10 section 4.3.1, Updated the comments of EFI_SYSTEM_TABLE to satisfy ConIn/ConOut/StdErr requirements. 2. Refer to Uefi spec 2.10 section 13.3.3, Add a new retval EFI_UNSUPPORTED to EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL.ReadKeyStrokeEx and EFI_SIMPLE_TEXT_INPUT_PROTOCOL.ReadKeyStroke(). Signed-off-by: Junfeng Guan <junfengx.guan@intel.com> Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Zhiguang Liu <zhiguang.liu@intel.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
2024-02-26BaseTools: Update keybaord map based on UEFI spec 2.10Yi Li1-1/+11
REF: UEFI SPEC 2.10 34.8.10 EFI_KEY Add EfiKeyIntl0-9. Signed-off-by: Yi Li <yi1.li@intel.com> Cc: Rebecca Cran <rebecca@bsdio.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Bob Feng <bob.c.feng@intel.com> Cc: Yuwei Chen <yuwei.chen@intel.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
2024-02-26MdePkg: Update keybaord map based on UEFI spec 2.10Yi Li1-1/+11
REF: UEFI SPEC 2.10 34.8.10 EFI_KEY Add EfiKeyIntl0-9. Signed-off-by: Yi Li <yi1.li@intel.com> Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Zhiguang Liu <zhiguang.liu@intel.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
2024-02-25ArmVirtPkg/XenAcpiPlatformDxe: Install FACS table from DTDavid Woodhouse1-8/+29
The FACS may still exist when the reduced hardware flag is set in FADT; it is optional. Since it contains the hardware signature field which indicates that a hibernated system should boot cleanly instead of attempting to resume, a platform may choose to expose it. Propagate it correctly. Also avoid a NULL pointer dereference if the platform doesn't provide a DSDT. Signed-off-by: David Woodhouse <dwmw@amazon.co.uk> Message-Id: <881dd0a2558ecbdfa02c844722d8a1103ab97ab3.camel@infradead.org> Reviewed-by: Laszlo Ersek <lersek@redhat.com> [lersek@redhat.com: uncrustify]
2024-02-25OvmfPkg: only add shell to FV in case secure boot is disabledGerd Hoffmann1-1/+1
The EFI Shell allows to bypass secure boot, do not allow to include the shell in the firmware images of secure boot enabled builds. This prevents misconfigured downstream builds. Ref: https://bugs.launchpad.net/ubuntu/+source/edk2/+bug/2040137 Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=4641 Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Acked-by: Jiewen Yao <Jiewen.yao@intel.com> Message-Id: <20240222101358.67818-13-kraxel@redhat.com>
2024-02-25OvmfPkg/CI: copy shell to virtual driveGerd Hoffmann1-1/+11
Place the EFI shell as EFI/BOOT/BOOT{ARCH}.EFI on the virtual drive. This allows the "run to shell" CI test case to work even in case the shell is not included in the firmware image. This is needed because an followup patch will exclude the shell from secure boot enabled firmware images. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Acked-by: Laszlo Ersek <lersek@redhat.com> Acked-by: Jiewen Yao <Jiewen.yao@intel.com> Message-Id: <20240222101358.67818-12-kraxel@redhat.com>
2024-02-25OvmfPkg: switch MicrovmX64 to new shell include filesGerd Hoffmann2-48/+10
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Acked-by: Laszlo Ersek <lersek@redhat.com> Acked-by: Jiewen Yao <Jiewen.yao@intel.com> Message-Id: <20240222101358.67818-11-kraxel@redhat.com>
2024-02-25OvmfPkg: switch IntelTdxX64 to new shell include filesGerd Hoffmann2-36/+5
Note that IntelTdxX64 is compiled without network support, so thanks to the network conditionals in the include files the build result (network shell commands excluded) should be identical before and after the patch. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Acked-by: Laszlo Ersek <lersek@redhat.com> Acked-by: Jiewen Yao <Jiewen.yao@intel.com> Message-Id: <20240222101358.67818-10-kraxel@redhat.com>
2024-02-25OvmfPkg: switch AmdSevX64 to new shell include filesGerd Hoffmann2-35/+5
Note that AmdSevX64 is compiled without network support, so thanks to the network conditionals in the include files the build result (network shell commands excluded) should be identical before and after the patch. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Acked-by: Laszlo Ersek <lersek@redhat.com> Acked-by: Jiewen Yao <Jiewen.yao@intel.com> Message-Id: <20240222101358.67818-9-kraxel@redhat.com>
2024-02-25OvmfPkg: switch OvmfPkgIa32X64 to new shell include filesGerd Hoffmann2-54/+4
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Acked-by: Jiewen Yao <Jiewen.yao@intel.com> Message-Id: <20240222101358.67818-8-kraxel@redhat.com>
2024-02-25OvmfPkg: switch OvmfPkgIa32 to new shell include filesGerd Hoffmann2-54/+4
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Acked-by: Jiewen Yao <Jiewen.yao@intel.com> Message-Id: <20240222101358.67818-7-kraxel@redhat.com>
2024-02-25OvmfPkg: ShellDxe.fdf.inc: add VariablePolicyDynamicCommand to FVGerd Hoffmann1-0/+1
Needed to make the new 'varpolicy' EFI shell command actually available in the OVMF firmware builds. Fixes: fe6cd1c18721 ("OvmfPkg: Add varpolicy shell command") Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Acked-by: Jiewen Yao <Jiewen.yao@intel.com> Message-Id: <20240222101358.67818-6-kraxel@redhat.com>
2024-02-25OvmfPkg: Shell*.inc: allow building without network supportGerd Hoffmann2-0/+8
Add NETWORK_ENABLE conditionals for the components which need network support. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Acked-by: Jiewen Yao <Jiewen.yao@intel.com> Message-Id: <20240222101358.67818-5-kraxel@redhat.com>
2024-02-25OvmfPkg: add ShellDxe.fdf.incGerd Hoffmann2-9/+16
Move EFI Shell firmware volume files to the new ShellDxe.fdf.inc file. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Acked-by: Jiewen Yao <Jiewen.yao@intel.com> Message-Id: <20240222101358.67818-4-kraxel@redhat.com>
2024-02-25OvmfPkg: add ShellLibs.dsc.incGerd Hoffmann2-3/+11
Move EFI Shell libraries from OvmfPkgX64.dsc to the new ShellComponents.dsc.inc include file. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Acked-by: Jiewen Yao <Jiewen.yao@intel.com> Message-Id: <20240222101358.67818-3-kraxel@redhat.com>
2024-02-25OvmfPkg: add ShellComponents.dsc.incGerd Hoffmann2-42/+50
Move EFI Shell components from OvmfPkgX64.dsc to the new ShellComponents.dsc.inc include file. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Acked-by: Jiewen Yao <Jiewen.yao@intel.com> Message-Id: <20240222101358.67818-2-kraxel@redhat.com>
2024-02-24UefiPayloadPkg/Gop: Clean up unused protocol and GuidGua Guo1-11/+0
Below Guid is redundant code on UefiPayloadPkg.dec 1. gBmpImageGuid 2. gPlatformGOPPolicyGuid Reviewed-by: Chasel Chiu <chasel.chiu@intel.com> Cc: Guo Dong <guo.dong@intel.com> Cc: Sean Rhodes <sean@starlabs.systems> Cc: James Lu <james.lu@intel.com> Reviewed-by: Gua Guo <gua.guo@intel.com> Signed-off-by: Gua Guo <gua.guo@intel.com>
2024-02-23UefiPayloadPkg: Make UPL build script arch agnosticDhaval4-22/+26
Current implementation makes assumptions about arch it will be built for. Need to make it more generic to add follow up support for RISCV. Right now it does not build for RV until relevant dsc file is available. Cc: Guo Dong <guo.dong@intel.com> Cc: Sean Rhodes <sean@starlabs.systems> Cc: James Lu <james.lu@intel.com> Reviewed-by: Gua Guo <gua.guo@intel.com> Signed-off-by: Dhaval Sharma <dhaval@rivosinc.com>
2024-02-22UefiCpuPkg: Fix issue that IsModified is wrongly set in PageTableMapZhiguang Liu2-6/+16
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4614 About the IsModified, current function doesn't consider that hardware also may change the pagetable. The issue is that in the first call of internal function PageTableLibMapInLevel, the function assume page table is not changed, and add ASSERT to check. But hardware may change the page table, which cause the ASSERT happens. Fix the issue by adding addtional condition to only check if the page table is changed when the software want to modify the page table. Also, add more comment to explain this behavior. Reviewed-by: Ray Ni <ray.ni@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Cc: Rahul Kumar <rahul1.kumar@intel.com> Cc: Gerd Hoffmann <kraxel@redhat.com> Cc: Crystal Lee <CrystalLee@ami.com.tw> Cc: Pedro Falcato <pedro.falcato@gmail.com> Signed-off-by: Zhiguang Liu <zhiguang.liu@intel.com>
2024-02-22UefiCpuPkg/CpuMpPei: Don't write CR3 in ConvertMemoryPageToNotPresentZhiguang Liu1-2/+2
The purpose of writing CR3 in ConvertMemoryPageToNotPresent is just to flush TLB, because CR3 won't be changed in function ConvertMemoryPageToNotPresent. After ConvertMemoryPageToNotPresent, there is always a flush TLB function. Also, because ConvertMemoryPageToNotPresent in called in a loop, to improve performance, there is no need to flush TLB inside ConvertMemoryPageToNotPresent. Just flushing TLB after the loop is enough. Reviewed-by: Ray Ni <ray.ni@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Cc: Rahul Kumar <rahul1.kumar@intel.com> Cc: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Zhiguang Liu <zhiguang.liu@intel.com>
2024-02-22UefiCpuPkg/CpuPageTableLib: Enhance function header for PageTableMap()Zhiguang Liu2-0/+2
PageTableMap() only modifies the PageTable root pointer when creating from zero. Explicitly explain it in function header. Reviewed-by: Ray Ni <ray.ni@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Cc: Rahul Kumar <rahul1.kumar@intel.com> Cc: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Zhiguang Liu <zhiguang.liu@intel.com>
2024-02-21UefiCpuPkg/PiSmmCpuDxeSmm: Check BspIndex first before lock cmpxchgJiaxin Wu1-5/+7
This patch is to check BspIndex first before lock cmpxchg operation. If BspIndex has not been set, then do the lock cmpxchg, otherwise, the APs don't need to lock cmpxchg the BspIndex value since the BSP election has been done. It's the optimization to lower the resource contention caused by the atomic compare exchange operation, so as to improve the SMI performance for BSP election. Cc: Ray Ni <ray.ni@intel.com> Cc: Laszlo Ersek <lersek@redhat.com> Cc: Eric Dong <eric.dong@intel.com> Cc: Zeng Star <star.zeng@intel.com> Cc: Gerd Hoffmann <kraxel@redhat.com> Cc: Rahul Kumar <rahul1.kumar@intel.com> Cc: Kinney Michael D <michael.d.kinney@intel.com> Signed-off-by: Jiaxin Wu <jiaxin.wu@intel.com> Reviewed-by: Ray Ni <ray.ni@intel.com>
2024-02-21UefiCpuPkg/PiSmmCpuDxeSmm: Avoid BspIndex typecastingJiaxin Wu1-6/+6
Use MAX_UINT32 directly instead of typecasting from signed to unsigned value. Cc: Ray Ni <ray.ni@intel.com> Cc: Laszlo Ersek <lersek@redhat.com> Cc: Eric Dong <eric.dong@intel.com> Cc: Zeng Star <star.zeng@intel.com> Cc: Gerd Hoffmann <kraxel@redhat.com> Cc: Rahul Kumar <rahul1.kumar@intel.com> Cc: Kinney Michael D <michael.d.kinney@intel.com> Signed-off-by: Jiaxin Wu <jiaxin.wu@intel.com> Reviewed-by: Ray Ni <ray.ni@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
2024-02-14UefiCpuPkg/PiSmmCpuDxeSmm: fix NULL deref when gSmmBaseHobGuid is missingedk2-stable202402Laszlo Ersek1-0/+7
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=4682 Fixes: 725acd0b9cc0 Before commit 725acd0b9cc0 ("UefiCpuPkg: Avoid assuming only one smmbasehob", 2023-12-12), PiCpuSmmEntry() used to look up "gSmmBaseHobGuid", and allocate "mCpuHotPlugData.SmBase" regardless of the GUID's presence: > - mCpuHotPlugData.SmBase = (UINTN *)AllocatePool (sizeof (UINTN) * mMaxNumberOfCpus); > - ASSERT (mCpuHotPlugData.SmBase != NULL); After commit 725acd0b9cc0, PiCpuSmmEntry() -> GetSmBase() would allocate "mCpuHotPlugData.SmBase" only on the success path, and no allocation would be performed on *any* of the error paths. This caused a problem: if "mCpuHotPlugData.SmBase" was left NULL because the GUID HOB was missing, PiCpuSmmEntry() would still be supposed to allocate "mCpuHotPlugData.SmBase", just like earlier. However, because commit 725acd0b9cc0 conflated the two possible error modes (out of SMRAM, and no GUID HOB), PiCpuSmmEntry() could not decide whether it should allocate "mCpuHotPlugData.SmBase", or not. Currently, we never allocate if GetSmBase() fails -- for any reason --, which means that on platforms that don't produce the GUID HOB, "mCpuHotPlugData.SmBase" is left NULL, leading to null pointer dereferences later, in PiCpuSmmEntry(). Now that a prior patch in the series distinguishes the two error modes from each other, we can tell exactly when the GUID HOB is not found, and reinstate the earlier "mCpuHotPlugData.SmBase" allocation for that case. (With an actual error check thrown in, in addition to the original "assertion".) Cc: Dun Tan <dun.tan@intel.com> Cc: Gerd Hoffmann <kraxel@redhat.com> Cc: Rahul Kumar <rahul1.kumar@intel.com> Cc: Ray Ni <ray.ni@intel.com> Reported-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Leif Lindholm <quic_llindhol@quicinc.com> Reviewed-by: Rahul Kumar <rahul1.kumar@intel.com> Reviewed-by: Gerd Hoffmann <kraxel@redhat.com> Tested-by: Gerd Hoffmann <kraxel@redhat.com>
2024-02-14UefiCpuPkg/PiSmmCpuDxeSmm: distinguish GetSmBase() failure modesLaszlo Ersek1-12/+28
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=4682 Commit 725acd0b9cc0 ("UefiCpuPkg: Avoid assuming only one smmbasehob", 2023-12-12) introduced a helper function called GetSmBase(), replacing the lookup of the first and only "gSmmBaseHobGuid" GUID HOB and unconditional "mCpuHotPlugData.SmBase" allocation, with iterated lookups plus conditional memory allocation. This introduced a new failure mode for setting "mCpuHotPlugData.SmBase". Namely, before commit 725acd0b9cc0, "mCpuHotPlugData.SmBase" would be allocated regardless of the GUID HOB being absent. After the commit, "mCpuHotPlugData.SmBase" could remain NULL if the GUID HOB was absent, *or* one of the memory allocations inside GetSmBase() failed; and in the former case, we'd even proceed to the rest of PiCpuSmmEntry(). In relation to this conflation of distinct failure modes, commit 725acd0b9cc0 actually introduced a NULL pointer dereference. Namely, a NULL "mCpuHotPlugData.SmBase" is not handled properly at all now. We're going to fix that NULL pointer dereference in a subsequent patch; however, as a pre-requisite for that we need to tell apart the failure modes of GetSmBase(). For memory allocation failures, return EFI_OUT_OF_RESOURCES. Move the "assertion" that SMRAM cannot be exhausted happen out to the caller (PiCpuSmmEntry()). Strengthen the assertion by adding an explicit CpuDeadLoop() call. (Note: GetSmBase() *already* calls CpuDeadLoop() if (NumberOfProcessors != MaxNumberOfCpus).) For the absence of the GUID HOB, return EFI_NOT_FOUND. For good measure, make GetSmBase() STATIC (it should have been STATIC from the start). This is just a refactoring, no behavioral difference is intended (beyond the explicit CpuDeadLoop() upon SMRAM exhaustion). Cc: Dun Tan <dun.tan@intel.com> Cc: Gerd Hoffmann <kraxel@redhat.com> Cc: Rahul Kumar <rahul1.kumar@intel.com> Cc: Ray Ni <ray.ni@intel.com> Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Leif Lindholm <quic_llindhol@quicinc.com> Reviewed-by: Rahul Kumar <rahul1.kumar@intel.com> Reviewed-by: Gerd Hoffmann <kraxel@redhat.com> Tested-by: Gerd Hoffmann <kraxel@redhat.com>
2024-02-14NetworkPkg: : Updating SecurityFixes.yamlDoug Flick1-0/+1
This captures the related security change for Dhcp6Dxe that is related to CVE-2023-45229 Cc: Saloni Kasbekar <saloni.kasbekar@intel.com> Cc: Zachary Clark-williams <zachary.clark-williams@intel.com> Signed-off-by: Doug Flick [MSFT] <doug.edk2@gmail.com> Reviewed-by: Saloni Kasbekar <saloni.kasbekar@intel.com> Reviewed-by: Leif Lindholm <quic_llindhol@quicinc.com>
2024-02-14NetworkPkg: Dhcp6Dxe: Packet-Length is not updated before appendingDoug Flick1-5/+5
In order for Dhcp6AppendIaAddrOption (..) to safely append the IA Address option, the Packet-Length field must be updated before appending the option. Cc: Saloni Kasbekar <saloni.kasbekar@intel.com> Cc: Zachary Clark-williams <zachary.clark-williams@intel.com> Signed-off-by: Doug Flick [MSFT] <doug.edk2@gmail.com> Reviewed-by: Saloni Kasbekar <saloni.kasbekar@intel.com> Reviewed-by: Leif Lindholm <quic_llindhol@quicinc.com>