diff --git a/91d9680f50f1922936458bde283030f2e9459f00.patch b/91d9680f50f1922936458bde283030f2e9459f00.patch new file mode 100644 index 0000000000000000000000000000000000000000..6bcd11555202e6fdd30b8205c2883ca6f238ce8b --- /dev/null +++ b/91d9680f50f1922936458bde283030f2e9459f00.patch @@ -0,0 +1,27 @@ +commit 91d9680f50f1922936458bde283030f2e9459f00 +Author: Taylor Beebe +Date: Thu Nov 30 16:34:29 2023 -0800 + + Platform/Loongson/LoongArchQemuPkg: Add ImagePropertiesRecordLib Instance + + ImagePropertiesRecordLib is used by DxeMain and PiSmmCore, so it + needs to be added to most platforms. + + Signed-off-by: Taylor Beebe + Cc: Bibo Mao + Cc: Xianglai li + Cc: Chao Li + Acked-by: Chao Li + +diff --git a/Platform/Loongson/LoongArchQemuPkg/Loongson.dsc b/Platform/Loongson/LoongArchQemuPkg/Loongson.dsc +index 00b28cfa50..58aa16d3a9 100644 +--- a/Platform/Loongson/LoongArchQemuPkg/Loongson.dsc ++++ b/Platform/Loongson/LoongArchQemuPkg/Loongson.dsc +@@ -155,6 +155,7 @@ + PciHostBridgeUtilityLib | OvmfPkg/Library/PciHostBridgeUtilityLib/PciHostBridgeUtilityLib.inf + MmuLib | Platform/Loongson/LoongArchQemuPkg/Library/MmuLib/MmuBaseLib.inf + FileExplorerLib | MdeModulePkg/Library/FileExplorerLib/FileExplorerLib.inf ++ ImagePropertiesRecordLib | MdeModulePkg/Library/ImagePropertiesRecordLib/ImagePropertiesRecordLib.inf + + !if $(HTTP_BOOT_ENABLE) == TRUE + HttpLib | MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.inf diff --git a/QEMU_EFI.fd b/QEMU_EFI.fd deleted file mode 100644 index 69b4abaae816589b39748da3b6cc5dce5fc39dc3..0000000000000000000000000000000000000000 Binary files a/QEMU_EFI.fd and /dev/null differ diff --git a/QEMU_VARS.fd b/QEMU_VARS.fd deleted file mode 100644 index fca24ccc73bd6462fbc098d4be07eacfe01674f3..0000000000000000000000000000000000000000 Binary files a/QEMU_VARS.fd and /dev/null differ diff --git a/a81b9f2815da1bacb91aa5ece1caa730ac5d80bb.patch b/a81b9f2815da1bacb91aa5ece1caa730ac5d80bb.patch new file mode 100644 index 0000000000000000000000000000000000000000..273acca8762d67403e8055a50831070c76ccb1a0 --- /dev/null +++ b/a81b9f2815da1bacb91aa5ece1caa730ac5d80bb.patch @@ -0,0 +1,59 @@ +commit a81b9f2815da1bacb91aa5ece1caa730ac5d80bb +Author: Laszlo Ersek +Date: Tue Mar 5 13:01:25 2024 +0100 + + LoongArchQemuPkg: auto-gen & fix SEC ProcessLibraryConstructorList() decl + + declares a bogus + ProcessLibraryConstructorList() for LoongArchQemuPkg's SEC module. Rely on + AutoGen for (properly) declaring ProcessLibraryConstructorList(). Update + the call. + + Build-tested with: + + build -a LOONGARCH64 -b DEBUG \ + -m Platform/Loongson/LoongArchQemuPkg/Sec/SecMain.inf \ + -p Platform/Loongson/LoongArchQemuPkg/Loongson.dsc -t GCC5 + + Cc: Bibo Mao + Cc: Chao Li + Cc: Xianglai li + Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=990 + Signed-off-by: Laszlo Ersek + Message-Id: <20240305120126.70259-4-lersek@redhat.com> + Reviewed-by: Chao Li + +diff --git a/Platform/Loongson/LoongArchQemuPkg/Sec/SecMain.c b/Platform/Loongson/LoongArchQemuPkg/Sec/SecMain.c +index 3f1998c48c..50d898859a 100644 +--- a/Platform/Loongson/LoongArchQemuPkg/Sec/SecMain.c ++++ b/Platform/Loongson/LoongArchQemuPkg/Sec/SecMain.c +@@ -9,7 +9,6 @@ + + #include + +-#include + #include + #include + #include +@@ -378,7 +377,7 @@ SecCoreStartupWithStack ( + + DEBUG ((DEBUG_INFO, "Entering C environment\n")); + +- ProcessLibraryConstructorList (NULL, NULL); ++ ProcessLibraryConstructorList (); + + DEBUG ((DEBUG_INFO, + "SecCoreStartupWithStack (0x%lx, 0x%lx)\n", +diff --git a/Platform/Loongson/LoongArchQemuPkg/Sec/SecMain.inf b/Platform/Loongson/LoongArchQemuPkg/Sec/SecMain.inf +index c0d5439d53..bb86c7c774 100644 +--- a/Platform/Loongson/LoongArchQemuPkg/Sec/SecMain.inf ++++ b/Platform/Loongson/LoongArchQemuPkg/Sec/SecMain.inf +@@ -8,7 +8,7 @@ + ## + + [Defines] +- INF_VERSION = 0x00010005 ++ INF_VERSION = 1.30 + BASE_NAME = SecMain + FILE_GUID = 57d02d4f-5a5d-4bfa-b7d6-ba0a4d2c72ce + MODULE_TYPE = SEC diff --git a/edk2-platforms-5374f6cd4af3.tar.gz b/edk2-platforms-35bca3ca71c0.tar.xz similarity index 52% rename from edk2-platforms-5374f6cd4af3.tar.gz rename to edk2-platforms-35bca3ca71c0.tar.xz index f13f75aa8fdd79b56580490f1ddef2fdcc11cf7c..1fcb69c28fbd37fe29dcd78b64482c52317cc8f2 100644 Binary files a/edk2-platforms-5374f6cd4af3.tar.gz and b/edk2-platforms-35bca3ca71c0.tar.xz differ diff --git a/edk2.spec b/edk2.spec index e8b7487af16b7674fa566e22c15c2b075191cb61..4270840659486228b01f0436760476aafa2e2145 100644 --- a/edk2.spec +++ b/edk2.spec @@ -7,7 +7,7 @@ Name: edk2 Version: %{stable_date} -Release: 8 +Release: 9 Summary: EFI Development Kit II License: BSD-2-Clause-Patent and OpenSSL and MIT URL: https://github.com/tianocore/edk2 @@ -18,9 +18,7 @@ Source3: public-mipi-sys-t.%{public_mipi_sys_t_commitid}.tar.gz Source4: edk2-aarch64-verbose-raw.json Source5: edk2-ovmf-x64-nosb.json Source6: edk2-loongarch64.json -Source7: edk2-platforms-5374f6cd4af3.tar.gz -Source8: QEMU_EFI.fd -Source9: QEMU_VARS.fd +Source7: edk2-platforms-35bca3ca71c0.tar.xz patch0: 0001-OvmfPkg-VirtioNetDxe-Extend-the-RxBufferSize-to-avoi.patch patch1: 0002-add-Wno-maybe-uninitialized-to-fix-build-error.patch @@ -74,6 +72,11 @@ patch44: 0044-Add-a-test-for-session-cache-overflow.patch patch45: 0045-Limit-the-execution-time-of-RSA-public-key-check.patch patch46: relax_edk2_gcc14.diff +# revert these patches for edk2-platforms to build with edk2-2308 +patch101: 91d9680f50f1922936458bde283030f2e9459f00.patch +patch102: ef0b6c0cb556957798c3ca5025aced871525dfae.patch +patch103: a81b9f2815da1bacb91aa5ece1caa730ac5d80bb.patch + BuildRequires: acpica-tools gcc gcc-c++ libuuid-devel python3 bc nasm python3-unversioned-command isl %description @@ -145,7 +148,12 @@ tar -xf %{SOURCE2} -C BaseTools/Source/C/BrotliCompress/brotli --strip-component tar -xf %{SOURCE3} -C MdePkg/Library/MipiSysTLib/mipisyst --strip-components=1 tar -xf %{SOURCE7} edk2-platforms/Platform --strip-components=1 -%autopatch -p1 +%autopatch -p1 -M 46 + +# revert these edk2-platforms patches +%{__patch} -p1 -R -i %{PATCH101} +%{__patch} -p1 -R -i %{PATCH102} +%{__patch} -p1 -R -i %{PATCH103} cp -a -- %{SOURCE4} %{SOURCE5} %{SOURCE6} . @@ -180,11 +188,11 @@ BUILD_OPTION="$BUILD_OPTION -D TPM_CONFIG_ENABLE=TRUE" BUILD_OPTION="-t GCC5 -n $NCPUS -b RELEASE -a RISCV64 -p OvmfPkg/RiscVVirt/RiscVVirtQemu.dsc -D SECURE_BOOT_ENABLE=TRUE -D TPM_ENABLE=TRUE -D TPM_CONFIG_ENABLE=TRUE" %endif -#%ifarch loongarch64 -# BUILD_OPTION="-t GCC5 -n $NCPUS -b RELEASE -a LOONGARCH64 -p Platform/Loongson/LoongArchQemuPkg/Loongson.dsc -D SECURE_BOOT_ENABLE=TRUE -D TPM_ENABLE=TRUE -D TPM_CONFIG_ENABLE=TRUE" -#%endif +%ifarch loongarch64 + BUILD_OPTION="-t GCC5 -n $NCPUS -b RELEASE -a LOONGARCH64 -p Platform/Loongson/LoongArchQemuPkg/Loongson.dsc -D SECURE_BOOT_ENABLE=TRUE -D TPM_ENABLE=TRUE -D TPM_CONFIG_ENABLE=TRUE" +%endif -#build $BUILD_OPTION +build $BUILD_OPTION %install cp CryptoPkg/Library/OpensslLib/openssl/LICENSE.txt LICENSE.openssl @@ -250,7 +258,7 @@ chmod +x %{buildroot}%{_bindir}/Rsa2048Sha256GenerateKeys %ifarch loongarch64 mkdir -p %{buildroot}/usr/share/%{name}/loongarch64 - cp %{SOURCE8} %{SOURCE9} %{buildroot}/usr/share/%{name}/loongarch64 + cp Build/LoongArchQemu/RELEASE_*/FV/*.fd %{buildroot}/usr/share/%{name}/loongarch64 dd of="%{buildroot}/usr/share/%{name}/loongarch64/QEMU_EFI-silent-pflash.raw" if="/dev/zero" bs=1M count=4 dd of="%{buildroot}/usr/share/%{name}/loongarch64/QEMU_EFI-silent-pflash.raw" if="%{buildroot}/usr/share/%{name}/loongarch64/QEMU_EFI.fd" conv=notrunc dd of="%{buildroot}/usr/share/%{name}/loongarch64/vars-template-pflash.raw" if="/dev/zero" bs=1M count=16 @@ -343,6 +351,10 @@ chmod +x %{buildroot}%{_bindir}/Rsa2048Sha256GenerateKeys %endif %changelog +* Tue Jun 4 2024 Xiaotian Wu - 202308-9 +- add LoongArch support +- backport edk2-platform to build with edk2-2308 + * Fri May 31 2024 Xiaotian Wu - 202308-8 - add LoongArch support diff --git a/ef0b6c0cb556957798c3ca5025aced871525dfae.patch b/ef0b6c0cb556957798c3ca5025aced871525dfae.patch new file mode 100644 index 0000000000000000000000000000000000000000..4938efccc26303e02dc848fd77c83f371b421d32 --- /dev/null +++ b/ef0b6c0cb556957798c3ca5025aced871525dfae.patch @@ -0,0 +1,45 @@ +commit ef0b6c0cb556957798c3ca5025aced871525dfae +Author: Xianglai Li +Date: Wed May 15 17:29:37 2024 +0800 + + Platform/Loongson: Fix compile error + + QemuFwCfgLibMmio has been removed, + using the latest FwCfgLib to fix compilation errors + + Cc: Bibo Mao + Cc: Chao Li + Cc: Gerd Hoffmann + Signed-off-by: Xianglai Li + +diff --git a/Platform/Loongson/LoongArchQemuPkg/Loongson.dsc b/Platform/Loongson/LoongArchQemuPkg/Loongson.dsc +index 58aa16d3a9..7e891ad225 100644 +--- a/Platform/Loongson/LoongArchQemuPkg/Loongson.dsc ++++ b/Platform/Loongson/LoongArchQemuPkg/Loongson.dsc +@@ -180,7 +180,7 @@ + # + VirtioLib | OvmfPkg/Library/VirtioLib/VirtioLib.inf + FrameBufferBltLib | MdeModulePkg/Library/FrameBufferBltLib/FrameBufferBltLib.inf +- QemuFwCfgLib | OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLibMmio.inf ++ QemuFwCfgLib | OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgMmioPeiLib.inf + DebugLib | MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf + PeiServicesLib | MdePkg/Library/PeiServicesLib/PeiServicesLib.inf + VariableFlashInfoLib | MdeModulePkg/Library/BaseVariableFlashInfoLib/BaseVariableFlashInfoLib.inf +@@ -257,7 +257,7 @@ + ReportStatusCodeLib | MdeModulePkg/Library/DxeReportStatusCodeLib/DxeReportStatusCodeLib.inf + UefiScsiLib | MdePkg/Library/UefiScsiLib/UefiScsiLib.inf + ExtractGuidedSectionLib | MdePkg/Library/PeiExtractGuidedSectionLib/PeiExtractGuidedSectionLib.inf +- QemuFwCfgLib | OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLibMmio.inf ++ QemuFwCfgLib | OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgMmioDxeLib.inf + PciPcdProducerLib | OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf + + [LibraryClasses.common.DXE_DRIVER] +@@ -269,7 +269,7 @@ + CpuExceptionHandlerLib | UefiCpuPkg/Library/CpuExceptionHandlerLib/DxeCpuExceptionHandlerLib.inf + ExtractGuidedSectionLib | MdePkg/Library/DxeExtractGuidedSectionLib/DxeExtractGuidedSectionLib.inf + QemuFwCfgS3Lib | OvmfPkg/Library/QemuFwCfgS3Lib/DxeQemuFwCfgS3LibFwCfg.inf +- QemuFwCfgLib | OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLibMmio.inf ++ QemuFwCfgLib | OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgMmioDxeLib.inf + PciPcdProducerLib | OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf + PciExpressLib | MdePkg/Library/BasePciExpressLib/BasePciExpressLib.inf + AcpiPlatformLib | OvmfPkg/Library/AcpiPlatformLib/DxeAcpiPlatformLib.inf