summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2024-03-04ShellPkg/SmbiosView: Support New ProcessorFamily for SMBIOS Type4Jason Lou1-1/+33
The patch updates SmbiosView to support new ProcessorFamily for SMBIOS Type4 based on SMBIOS 3.8.0. Signed-off-by: Jason Lou <yun.lou@intel.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn> Reviewed-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Zhichao Gao <zhichao.gao@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Zhichao Gao <zhichao.gao@intel.com>
2024-03-04MdePkg/SmBios.h: Add New ProcessorFamily definitions for SMBIOS Type4Jason Lou1-3/+11
The patch adds new ProcessorFamily definitions for SMBIOS Type4 based on SMBIOS 3.8.0. Signed-off-by: Jason Lou <yun.lou@intel.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn> Reviewed-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Zhichao Gao <zhichao.gao@intel.com> Cc: Zhiguang Liu <zhiguang.liu@intel.com> Cc: Dandan Bi <dandan.bi@intel.com> Cc: Star Zeng <star.zeng@intel.com> Cc: Zhichao Gao <zhichao.gao@intel.com> Cc: Benny Lin <benny.lin@intel.com> Cc: Gua Guo <gua.guo@intel.com> Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn>
2024-03-01OvmfPkg/ResetVector: wire up 5-level paging for TDXGerd Hoffmann2-1/+28
BSP workflow is quite simliar to the non-coco case. TDX_WORK_AREA_PGTBL_READY is used to record the paging mode: 1 == 4-level paging 2 == 5-level paging APs will look at TDX_WORK_AREA_PGTBL_READY to figure whenever they should enable 5-level paging or not. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Message-Id: <20240301074402.98625-9-kraxel@redhat.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> [lersek@redhat.com: move "CheckForSev:" label into "%if PG_5_LEVEL" scope, as discussed with Gerd] Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Oliver Steffen <osteffen@redhat.com> Cc: Michael Roth <michael.roth@amd.com> Cc: Erdem Aktas <erdemaktas@google.com> Cc: Min Xu <min.m.xu@intel.com> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Cc: Tom Lendacky <thomas.lendacky@amd.com> [lersek@redhat.com: turn the "Cc:" message headers from Gerd's on-list posting into "Cc:" tags in the commit message, in order to pacify "PatchCheck.py"]
2024-03-01OvmfPkg/ResetVector: print post codes for 4/5 level pagingGerd Hoffmann1-0/+8
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Message-Id: <20240301074402.98625-8-kraxel@redhat.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Oliver Steffen <osteffen@redhat.com> Cc: Michael Roth <michael.roth@amd.com> Cc: Erdem Aktas <erdemaktas@google.com> Cc: Min Xu <min.m.xu@intel.com> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Cc: Tom Lendacky <thomas.lendacky@amd.com> [lersek@redhat.com: turn the "Cc:" message headers from Gerd's on-list posting into "Cc:" tags in the commit message, in order to pacify "PatchCheck.py"]
2024-03-01OvmfPkg/ResetVector: add 5-level paging supportGerd Hoffmann3-0/+102
Add macros to check for 5-level paging and gigabyte page support. Enable 5-level paging for the non-confidential-computing case. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Message-Id: <20240301074402.98625-7-kraxel@redhat.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Oliver Steffen <osteffen@redhat.com> Cc: Michael Roth <michael.roth@amd.com> Cc: Erdem Aktas <erdemaktas@google.com> Cc: Min Xu <min.m.xu@intel.com> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Cc: Tom Lendacky <thomas.lendacky@amd.com> [lersek@redhat.com: turn the "Cc:" message headers from Gerd's on-list posting into "Cc:" tags in the commit message, in order to pacify "PatchCheck.py"]
2024-03-01OvmfPkg/ResetVector: split SEV and non-CoCo workflowsGerd Hoffmann2-16/+15
Use separate control flows for SEV and non-CoCo cases. SevClearPageEncMaskForGhcbPage and GetSevCBitMaskAbove31 will now only be called when running in SEV mode, so the SEV check in these functions is not needed any more. No functional change. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Message-Id: <20240301074402.98625-6-kraxel@redhat.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Oliver Steffen <osteffen@redhat.com> Cc: Michael Roth <michael.roth@amd.com> Cc: Erdem Aktas <erdemaktas@google.com> Cc: Min Xu <min.m.xu@intel.com> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Cc: Tom Lendacky <thomas.lendacky@amd.com> [lersek@redhat.com: turn the "Cc:" message headers from Gerd's on-list posting into "Cc:" tags in the commit message, in order to pacify "PatchCheck.py"]
2024-03-01OvmfPkg/ResetVector: split TDX BSP workflowGerd Hoffmann2-9/+10
Create a separate control flow for TDX BSP. TdxPostBuildPageTables will now only be called when running in TDX mode, so the TDX check in that function is not needed any more. No functional change. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Message-Id: <20240301074402.98625-5-kraxel@redhat.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Oliver Steffen <osteffen@redhat.com> Cc: Michael Roth <michael.roth@amd.com> Cc: Erdem Aktas <erdemaktas@google.com> Cc: Min Xu <min.m.xu@intel.com> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Cc: Tom Lendacky <thomas.lendacky@amd.com> [lersek@redhat.com: turn the "Cc:" message headers from Gerd's on-list posting into "Cc:" tags in the commit message, in order to pacify "PatchCheck.py"]
2024-03-01OvmfPkg/ResetVector: add CreatePageTables4Level macroGerd Hoffmann1-31/+39
Move code to create 4-level page tables to a nasm macro. No functional change. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Message-Id: <20240301074402.98625-4-kraxel@redhat.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Oliver Steffen <osteffen@redhat.com> Cc: Michael Roth <michael.roth@amd.com> Cc: Erdem Aktas <erdemaktas@google.com> Cc: Min Xu <min.m.xu@intel.com> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Cc: Tom Lendacky <thomas.lendacky@amd.com> [lersek@redhat.com: turn the "Cc:" message headers from Gerd's on-list posting into "Cc:" tags in the commit message, in order to pacify "PatchCheck.py"]
2024-03-01OvmfPkg/ResetVector: add ClearOvmfPageTables macroGerd Hoffmann1-16/+19
Move code to clear the page tables to a nasm macro. No functional change. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Message-Id: <20240301074402.98625-3-kraxel@redhat.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Oliver Steffen <osteffen@redhat.com> Cc: Michael Roth <michael.roth@amd.com> Cc: Erdem Aktas <erdemaktas@google.com> Cc: Min Xu <min.m.xu@intel.com> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Cc: Tom Lendacky <thomas.lendacky@amd.com> [lersek@redhat.com: turn the "Cc:" message headers from Gerd's on-list posting into "Cc:" tags in the commit message, in order to pacify "PatchCheck.py"]
2024-03-01OvmfPkg/ResetVector: improve page table flag namesGerd Hoffmann1-17/+22
Add comments, rename some of the PAGE_* flags and combined attributes. Specifically use "LARGEPAGE" instead of "2M" because that bit is used for both 2M and 1G large pages. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Message-Id: <20240301074402.98625-2-kraxel@redhat.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Oliver Steffen <osteffen@redhat.com> Cc: Michael Roth <michael.roth@amd.com> Cc: Erdem Aktas <erdemaktas@google.com> Cc: Min Xu <min.m.xu@intel.com> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Cc: Tom Lendacky <thomas.lendacky@amd.com> [lersek@redhat.com: turn the "Cc:" message headers from Gerd's on-list posting into "Cc:" tags in the commit message, in order to pacify "PatchCheck.py"]
2024-03-01MdeModulePkg/Core/Pei: Improve the copy performanceLi, Zhihao1-2/+2
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4697 EvacuateTempRam function will copy the temporary memory context to the rebased pages and the raw pages. Migrations of rebased PEIMs is from cache to memory, while raw PEIMs is from memory to memory. So the migrations of raw PEIMs is slower than rebased PEIMs. Experimental data indicates that changing the source address of raw PEIMs migration will improve performance by 35%. Cc: Liming Gao <gaoliming@byosoft.com.cn> Signed-off-by: Zhihao Li <zhihao.li@intel.com> Message-Id: <20240301071147.519-1-zhihao.li@intel.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn> Reviewed-by: Michael Kubacki <michael.kubacki@microsoft.com>
2024-03-01StandaloneMmPkg: Disallow unregister MMI handler in other MMI handlerZhiguang Liu1-9/+23
In last patch, we add code support to unregister MMI handler inside itself. However, the code doesn't support unregister MMI handler insider other MMI handler. While this is not a must-have usage. So add check to disallow unregister MMI handler in other MMI handler. Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Jiaxin Wu <jiaxin.wu@intel.com> Cc: Ray Ni <ray.ni@intel.com> Cc: Laszlo Ersek <lersek@redhat.com> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Cc: Sami Mujawar <sami.mujawar@arm.com> Cc: Ray Ni <ray.ni@intel.com> Signed-off-by: Zhiguang Liu <zhiguang.liu@intel.com> Message-Id: <20240301030133.628-5-zhiguang.liu@intel.com> Reviewed-by: Ray Ni <ray.ni@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
2024-03-01StandaloneMmPkg: Support to unregister MMI handler inside MMI handlerZhiguang Liu1-2/+7
To support unregister MMI handler inside MMI handler itself, get next node before MMI handler is executed, since LIST_ENTRY that Link points to may be freed if unregister MMI handler in MMI handler itself. Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Jiaxin Wu <jiaxin.wu@intel.com> Reviewed-by: Ray Ni <ray.ni@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Cc: Sami Mujawar <sami.mujawar@arm.com> Signed-off-by: Zhiguang Liu <zhiguang.liu@intel.com> Message-Id: <20240301030133.628-4-zhiguang.liu@intel.com>
2024-03-01MdeModulePkg/SMM: Disallow unregister SMI handler in other SMI handlerZhiguang Liu1-8/+21
In last patch, we add code support to unregister SMI handler inside itself. However, the code doesn't support unregister SMI handler insider other SMI handler. While this is not a must-have usage. So add check to disallow unregister SMI handler in other SMI handler. Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Jiaxin Wu <jiaxin.wu@intel.com> Cc: Ray Ni <ray.ni@intel.com> Cc: Laszlo Ersek <lersek@redhat.com> Signed-off-by: Zhiguang Liu <zhiguang.liu@intel.com> Message-Id: <20240301030133.628-3-zhiguang.liu@intel.com> Reviewed-by: Ray Ni <ray.ni@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
2024-03-01MdeModulePkg/SMM: Support to unregister SMI handler inside SMI handlerZhiguang Liu1-1/+7
To support unregister SMI handler inside SMI handler itself, get next node before SMI handler is executed, since LIST_ENTRY that Link points to may be freed if unregister SMI handler in SMI handler itself. Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Jiaxin Wu <jiaxin.wu@intel.com> Reviewed-by: Ray Ni <ray.ni@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Signed-off-by: Zhiguang Liu <zhiguang.liu@intel.com> Message-Id: <20240301030133.628-2-zhiguang.liu@intel.com>
2024-03-01UefiCpuPkg/CpuPageTableLib: qualify page table accesses as volatileZhou Jianfeng1-18/+18
Add volatile qualifier to page table related variable to prevent compiler from optimizing away the variables which may lead to unexpected result. Signed-off-by: Zhou Jianfeng <jianfeng.zhou@intel.com> Cc: Ray Ni <ray.ni@intel.com> Cc: Laszlo Ersek <lersek@redhat.com> Cc: Rahul Kumar <rahul1.kumar@intel.com> Cc: Gerd Hoffmann <kraxel@redhat.com> Cc: Pedro Falcato <pedro.falcato@gmail.com> Cc: Zhang Di <di.zhang@intel.com> Cc: Tan Dun <dun.tan@intel.com> Cc: Michael Brown <mcb30@ipxe.org> Message-Id: <20240301025447.41170-1-jianfeng.zhou@intel.com> Reviewed-by: Michael Brown <mcb30@ipxe.org> Reviewed-by: Laszlo Ersek <lersek@redhat.com> [lersek@redhat.com: reconstruct commit manually, from corrupt patch email on-list]
2024-03-01UefiCpuPkg/CpuPageTableLib: Fix IN OUT parameters marked as INZhou Jianfeng1-16/+16
Some IN OUT parameters in CpuPageTableMap.c were mistakenly marked as IN. "IN" replaced with "IN OUT" in the following interfaces: PageTableLibSetPte4K(): Pte4K PageTableLibSetPleB(): PleB PageTableLibSetPle(): Ple PageTableLibSetPnle(): Pnle Reviewed-by: Ray Ni <ray.ni@intel.com> Signed-off-by: Zhou Jianfeng <jianfeng.zhou@intel.com> Cc: Ray Ni <ray.ni@intel.com> Cc: Laszlo Ersek <lersek@redhat.com> Cc: Rahul Kumar <rahul1.kumar@intel.com> Cc: Gerd Hoffmann <kraxel@redhat.com> Message-Id: <20240222023922.29275-1-jianfeng.zhou@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
2024-02-29UefiCpuPkg/MpInitLib: add struct MP_HAND_OFF_CONFIGGerd Hoffmann4-22/+75
Move the WaitLoopExecutionMode and StartupSignalValue fields to a separate HOB with the new struct. WaitLoopExecutionMode and StartupSignalValue are independent of processor index ranges; they are global to MpInitLib (i.e., the entire system). Therefore they shouldn't be repeated in every MpHandOff GUID HOB. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Message-Id: <20240228114855.1615788-1-kraxel@redhat.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Cc: Rahul Kumar <rahul1.kumar@intel.com> Cc: Ray Ni <ray.ni@intel.com> Cc: Laszlo Ersek <lersek@redhat.com> Cc: Oliver Steffen <osteffen@redhat.com> Cc: Gerd Hoffmann <kraxel@redhat.com> [lersek@redhat.com: turn the "Cc:" message headers from Gerd's on-list posting into "Cc:" tags in the commit message, in order to pacify "PatchCheck.py"]
2024-02-29BaseTools/AutoGen: declare ProcessLibraryConstructorList() for SEC modulesLaszlo Ersek1-0/+8
Most module types have standardized entry point function prototypes. They are declared in headers like - MdePkg/Include/Library/PeiCoreEntryPoint.h - MdePkg/Include/Library/PeimEntryPoint.h - MdePkg/Include/Library/DxeCoreEntryPoint.h - MdePkg/Include/Library/UefiDriverEntryPoint.h - MdePkg/Include/Library/UefiApplicationEntryPoint.h These header files also declare matching ProcessLibraryConstructorList() prototypes. The SEC module type does not have a standardized entry point prototype (aka parameter list), therefore no header file like the above ones exists for SEC. Consequently, no header file *declares* ProcessLibraryConstructorList() for SEC modules, even though AutoGen always *defines* ProcessLibraryConstructorList() with the same, empty, parameter list (i.e., just (VOID)). The lack of a central declaration is a problem because in SEC code, ProcessLibraryConstructorList() needs to be called manually, and those calls need a prototype. Most SEC modules in edk2 get around this by declaring ProcessLibraryConstructorList() manually, while some others use an incorrect (PEIM) prototype. Liming suggested in <https://bugzilla.tianocore.org/show_bug.cgi?id=991#c2> that AutoGen provide the declaration as well; implement that in this patch. Mike suggested that the feature be gated with INF_VERSION, for compatibility reasons. (INF_VERSION >= 1.30) reflects that the latest (draft) version of the INF specification, as of this writing, is commit a31e3c842bee / version 1.29. For example, if we modify "OvmfPkg/Sec/SecMain.inf" as follows: > diff --git a/OvmfPkg/Sec/SecMain.inf b/OvmfPkg/Sec/SecMain.inf > index 3c47a664a95d..dca932a474ee 100644 > --- a/OvmfPkg/Sec/SecMain.inf > +++ b/OvmfPkg/Sec/SecMain.inf > @@ -8,7 +8,7 @@ > ## > > [Defines] > - INF_VERSION = 0x00010005 > + INF_VERSION = 1.30 > BASE_NAME = SecMain > FILE_GUID = df1ccef6-f301-4a63-9661-fc6030dcc880 > MODULE_TYPE = SEC then the patch produces the following difference in "Build/OvmfX64/NOOPT_GCC5/X64/OvmfPkg/Sec/SecMain/DEBUG/AutoGen.h": > --- AutoGen.h.orig 2024-02-06 23:10:23.469535345 +0100 > +++ AutoGen.h 2024-02-07 00:00:57.361294055 +0100 > @@ -220,6 +220,13 @@ > > // Definition of PCDs used in libraries is in AutoGen.c > > +// ProcessLibraryConstructorList() declared here because SEC has no standard entry point. > +VOID > +EFIAPI > +ProcessLibraryConstructorList ( > + VOID > + ); > + > > #ifdef __cplusplus > } which presently (as of edk2 commit edc6681206c1) triggers the following build error: > In file included from OvmfPkg/Sec/SecMain.c:14: > MdePkg/Include/Library/PeimEntryPoint.h:74:1: error: conflicting types for > ‘ProcessLibraryConstructorList’; have ‘void(void *, const > EFI_PEI_SERVICES **)’ {aka ‘void(void *, const struct _EFI_PEI_SERVICES > **)’} > 74 | ProcessLibraryConstructorList ( > | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > In file included from <command-line>: > Build/OvmfX64/NOOPT_GCC5/X64/OvmfPkg/Sec/SecMain/DEBUG/AutoGen.h:226:1: note: > previous declaration of ‘ProcessLibraryConstructorList’ with type > ‘void(void)’ > 226 | ProcessLibraryConstructorList ( > | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ That's a genuine bug in OvmfPkg that needs to be fixed, but we keep compatibility with existent SEC modules until/unless they upgrade INF_VERSION to 1.30+. Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Rebecca Cran <rebecca@bsdio.com> Cc: Yuwei Chen <yuwei.chen@intel.com> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=991 Suggested-by: Liming Gao <gaoliming@byosoft.com.cn> Suggested-by: Michael D Kinney <michael.d.kinney@intel.com> Signed-off-by: Laszlo Ersek <lersek@redhat.com> Message-Id: <20240224210504.41873-1-lersek@redhat.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
2024-02-29OvmfPkg/PlatformInitLib: add 5-level paging supportGerd Hoffmann1-19/+44
Adjust physical address space logic for la57 mode (5-level paging). With a larger logical address space we can identity-map a larger physical address space. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Acked-by: Ard Biesheuvel <ardb@kernel.org> Message-Id: <20240222105407.75735-4-kraxel@redhat.com> Cc: Michael Roth <michael.roth@amd.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Laszlo Ersek <lersek@redhat.com> Cc: Tom Lendacky <thomas.lendacky@amd.com> Cc: Paolo Bonzini <pbonzini@redhat.com> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Cc: Gerd Hoffmann <kraxel@redhat.com> Cc: Min Xu <min.m.xu@intel.com> Cc: Erdem Aktas <erdemaktas@google.com> Cc: Oliver Steffen <osteffen@redhat.com> Cc: Ard Biesheuvel <ardb@kernel.org> [lersek@redhat.com: turn the "Cc:" message headers from Gerd's on-list posting into "Cc:" tags in the commit message, in order to pacify "PatchCheck.py"]
2024-02-29MdeModulePkg/DxeIplPeim: rename variableGerd Hoffmann1-11/+11
Rename Page5LevelSupported to Page5LevelEnabled. The variable is set to true in case 5-paging level is enabled (64-bit PEI) or will be enabled (32-bit PEI), it does *not* tell whenever the 5-level paging is supported by the CPU. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Acked-by: Ard Biesheuvel <ardb@kernel.org> Message-Id: <20240222105407.75735-3-kraxel@redhat.com> Cc: Michael Roth <michael.roth@amd.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Laszlo Ersek <lersek@redhat.com> Cc: Tom Lendacky <thomas.lendacky@amd.com> Cc: Paolo Bonzini <pbonzini@redhat.com> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Cc: Gerd Hoffmann <kraxel@redhat.com> Cc: Min Xu <min.m.xu@intel.com> Cc: Erdem Aktas <erdemaktas@google.com> Cc: Oliver Steffen <osteffen@redhat.com> Cc: Ard Biesheuvel <ardb@kernel.org> [lersek@redhat.com: turn the "Cc:" message headers from Gerd's on-list posting into "Cc:" tags in the commit message, in order to pacify "PatchCheck.py"]
2024-02-29MdeModulePkg/DxeIplPeim: fix PcdUse5LevelPageTable assertGerd Hoffmann1-1/+3
PcdUse5LevelPageTable documentation says: Indicates if 5-Level Paging will be enabled in long mode. 5-Level Paging will not be enabled when the PCD is TRUE but CPU doesn't support 5-Level Paging. So running in 4-level paging mode with PcdUse5LevelPageTable=TRUE is possible. The only invalid combination is 5-level paging being active with PcdUse5LevelPageTable=FALSE. Fix the ASSERT accordingly. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Acked-by: Ard Biesheuvel <ardb@kernel.org> Message-Id: <20240222105407.75735-2-kraxel@redhat.com> Cc: Michael Roth <michael.roth@amd.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Laszlo Ersek <lersek@redhat.com> Cc: Tom Lendacky <thomas.lendacky@amd.com> Cc: Paolo Bonzini <pbonzini@redhat.com> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Cc: Gerd Hoffmann <kraxel@redhat.com> Cc: Min Xu <min.m.xu@intel.com> Cc: Erdem Aktas <erdemaktas@google.com> Cc: Oliver Steffen <osteffen@redhat.com> Cc: Ard Biesheuvel <ardb@kernel.org> [lersek@redhat.com: turn the "Cc:" message headers from Gerd's on-list posting into "Cc:" tags in the commit message, in order to pacify "PatchCheck.py"]
2024-02-29RedfishPkg/RedfishCrtLib: fix unresolved external symbol issueNickle Wang3-1/+45
-Fix below compiler error reported in edk2 CI. ERROR - Linker #2001 from JsonLib.lib(load.obj) : unresolved external symbol __ftol2 -The file MathFtol.c is copied from IntrinsicLib in CryptoPkg. -Add MathFtol.c to EccCheck IgnoreFiles. Signed-off-by: Nickle Wang <nicklew@nvidia.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-29RedfishPkg/RedfishDebugLib: use RedfishHttpLibNickle Wang3-3/+4
Remove RedfishLib and use RedfishHttpLib for debug printing Redfish response data. Signed-off-by: Nickle Wang <nicklew@nvidia.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-29RedfishPkg/RedfishLib: include RedfishServiceData.hNickle Wang1-16/+1
Redfish common structures are moved to RedfishServiceData.h. Remove them from RedfishLib.h Signed-off-by: Nickle Wang <nicklew@nvidia.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-29RedfishPkg: introduce RedfishHttpLibNickle Wang6-2/+963
RedfishHttpLib is a wrapper library for Redfish feature drivers to call Redfish HTTP Protocol easily. Signed-off-by: Nickle Wang <nicklew@nvidia.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-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>