--- Begin Message ---
Source: edk2
Version: 2024.11-2
Severity: normal
Tags: FTBFS patch
User: [email protected]
Usertags: loong64
Hi maintainers,
The edk2 package is built for arch=all architectures in the Debian
Package Auto-Building environment.
When we tested Loongrch virtualization locally, we find that there is a
lack of loongarch64 support in Debian edk2.
Obviously, qemu-efi-loongarch64 package and efi-shell-loongarch64
package are not built for loong64.
Please consider the patch I attached for edk2 source package.
For the patch, I have the following 2 explanations,
Firstly, about patch:
debian/patches/debian-edk2-202411-Cherry-pick-from-upstream.patch.
1. I cherry pick upstream PR for Debian edk2 (2024.11-2).
Due to we hope to enable $(COMMON_FLAGS) in d/rules for loongarch64
referring to other architectures.
2. The PR was merged in upstream which is Signed-Off-By [email protected].
Details can be found at https://github.com/tianocore/edk2/pull/6550.
```
LOONGARCH64_FLAGS = $(COMMON_FLAGS)
set -e; . ./edksetup.sh; \
build -a LOONGARCH64 \
-t $(EDK2_TOOLCHAIN) \
-p OvmfPkg/LoongArchVirt/LoongArchVirtQemu.dsc \
$(LOONGARCH64_FLAGS) -b $(BUILD_TYPE)
```
Secondly, about patch:
0001-edk2-12-18-enable-loongarch64-build-in-debian.patch
1. I have added loongarch64 build support for Debian edk2 (2024.11-2).
In order to building qemu-efi-loongarch64 package and
efi-shell-loongarch64 package.
2. I have built edk2 package successfully on my local ENV.
```
dpkg-deb: 正在 '../efi-shell-aa64_2024.11-2+loong64_all.deb' 中构建软件包
'efi-shell-aa64'。
......
dpkg-deb: 正在 '../qemu-efi-loongarch64_2024.11-2+loong64_all.deb'
中构建软件包 'qemu-efi-loongarch64'。
dpkg-deb: 正在 '../ovmf_2024.11-2+loong64_all.deb' 中构建软件包 'ovmf'。
dpkg-deb: 正在 '../efi-shell-riscv64_2024.11-2+loong64_all.deb' 中构建软件包
'efi-shell-riscv64'。
dpkg-deb: 正在 '../efi-shell-arm_2024.11-2+loong64_all.deb' 中构建软件包
'efi-shell-arm'。
dpkg-deb: 正在 '../qemu-efi-riscv64_2024.11-2+loong64_all.deb' 中构建软件包
'qemu-efi-riscv64'。
dpkg-deb: 正在 '../efi-shell-loongarch64_2024.11-2+loong64_all.deb'
中构建软件包 'efi-shell-loongarch64'。
dpkg-genbuildinfo -O../edk2_2024.11-2+loong64_amd64.buildinfo
dpkg-genchanges -O../edk2_2024.11-2+loong64_amd64.changes
```
Could you add loong64 support in the next upload?
You opinions are always welcome.
Best regards,
Dandan Zhang
>From 5e3952568f20eb1d0e65d7a0eed7fe2ba8ef547c Mon Sep 17 00:00:00 2001
From: Dandan Zhang <[email protected]>
Date: Tue, 17 Dec 2024 20:07:07 +0800
Subject: [PATCH] edk2 12 18 enable loongarch64 build in debian
---
debian/changelog | 12 ++++++++
debian/control | 19 +++++++++++++
debian/descriptors/60-edk2-loongarch64.json | 31 +++++++++++++++++++++
debian/efi-shell-loongarch64.install | 2 ++
debian/python/UEFI/Qemu.py | 14 ++++++++++
debian/qemu-efi-loongarch64.install | 3 ++
debian/rules | 29 +++++++++++++++++--
debian/tests/control | 2 ++
debian/tests/shell.py | 4 +++
9 files changed, 114 insertions(+), 2 deletions(-)
create mode 100644 debian/descriptors/60-edk2-loongarch64.json
create mode 100755 debian/efi-shell-loongarch64.install
create mode 100644 debian/qemu-efi-loongarch64.install
diff --git a/debian/changelog b/debian/changelog
index 95082e1b..f56b35a1 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,15 @@
+edk2 (2024.11-2+loong64) unstable; urgency=medium
+
+ * Add loongarch64 support.
+ - Add qemu-efi-loongarch64 package.
+ + qemu-efi-loongarch64/QEMU_EFI.fd
+ + qemu-efi-loongarch64/QEMU_VARS.fd
+ + qemu/firmware/60-edk2-loongarch64.json
+ - Add efi-shell-loongarch64 package.
+ + efi-shell-loongarch64/shellloongarch64.efi
+
+ -- Dandan Zhang <[email protected]> Mon, 16 Dec 2024 18:44:12 +0800
+
edk2 (2024.11-2) unstable; urgency=medium
* qemu-efi-riscv64: Add 60-edk2-riscv64.json firmware descriptor,
diff --git a/debian/control b/debian/control
index 25e6b735..2ff210bc 100644
--- a/debian/control
+++ b/debian/control
@@ -12,6 +12,7 @@ Build-Depends: bc,
gcc-arm-linux-gnueabi,
gcc-multilib [i386],
gcc-riscv64-linux-gnu,
+ gcc-loongarch64-linux-gnu,
iasl,
lsb-release,
mtools,
@@ -77,6 +78,14 @@ Multi-Arch: foreign
Description: UEFI firmware for RISCV64 virtual machines
qemu-efi-riscv64 is a build of EDK II for RISCV64 virtual machines.
+Package: qemu-efi-loongarch64
+Architecture: all
+Depends: ${misc:Depends}
+Suggests: qemu-system-misc
+Multi-Arch: foreign
+Description: UEFI firmware for LoongArch64 virtual machines
+ qemu-efi-loongarch64 is a build of EDK II for LoongArch64 virtual machines.
+
Package: efi-shell-ia32
Architecture: all
Depends: ${misc:Depends}
@@ -126,3 +135,13 @@ Description: UEFI Shell for 64-bit RISC-V architecture
options, or to display details of installed devices, drivers, and protocols.
This package contains the shellriscv64.efi binary for the 64-bit RISC-V
architecture.
+
+Package: efi-shell-loongarch64
+Architecture: all
+Depends: ${misc:Depends}
+Description: UEFI Shell for 64-bit LoongArch architecture
+ The UEFI Shell provides a command line interface running on top of the EFI API.
+ It can be used to execute EFI binaries, to manage EFI variables and boot
+ options, or to display details of installed devices, drivers, and protocols.
+ This package contains the shellloongarch64.efi binary for the 64-bit LoongArch
+ architecture.
diff --git a/debian/descriptors/60-edk2-loongarch64.json b/debian/descriptors/60-edk2-loongarch64.json
new file mode 100644
index 00000000..ed8de045
--- /dev/null
+++ b/debian/descriptors/60-edk2-loongarch64.json
@@ -0,0 +1,31 @@
+{
+ "description": "UEFI firmware for loongarch64",
+ "interface-types": [
+ "uefi"
+ ],
+ "mapping": {
+ "device": "flash",
+ "executable": {
+ "filename": "/usr/share/qemu-efi-loongarch64/QEMU_EFI.fd",
+ "format": "raw"
+ },
+ "nvram-template": {
+ "filename": "/usr/share/qemu-efi-loongarch64/QEMU_VARS.fd",
+ "format": "raw"
+ }
+ },
+ "targets": [
+ {
+ "architecture": "loongarch64",
+ "machines": [
+ "virt*"
+ ]
+ }
+ ],
+ "features": [
+
+ ],
+ "tags": [
+
+ ]
+}
diff --git a/debian/efi-shell-loongarch64.install b/debian/efi-shell-loongarch64.install
new file mode 100755
index 00000000..03cddc14
--- /dev/null
+++ b/debian/efi-shell-loongarch64.install
@@ -0,0 +1,2 @@
+#!/usr/bin/dh-exec
+debian/loongarch64-install/Shell.efi => /usr/share/efi-shell-loongarch64/shellloongarch64.efi
diff --git a/debian/python/UEFI/Qemu.py b/debian/python/UEFI/Qemu.py
index adf04928..624667a3 100644
--- a/debian/python/UEFI/Qemu.py
+++ b/debian/python/UEFI/Qemu.py
@@ -30,6 +30,7 @@ class QemuEfiMachine(enum.Enum):
AAVMF = enum.auto()
AAVMF32 = enum.auto()
RISCV64 = enum.auto()
+ LOONGARCH64 = enum.auto()
class QemuEfiVariant(enum.Enum):
@@ -61,6 +62,9 @@ class QemuCommand:
RiscV_Common_Params = Qemu_Common_Params + [
'-machine', 'virt', '-device', 'virtio-serial-device',
]
+ LoongArch_Common_Params = Qemu_Common_Params + [
+ '-machine', 'virt', '-device', 'virtio-serial-device',
+ ]
Machine_Base_Command = {
QemuEfiMachine.AAVMF: [
'qemu-system-aarch64', '-cpu', 'cortex-a57',
@@ -83,6 +87,9 @@ class QemuCommand:
QemuEfiMachine.RISCV64: [
'qemu-system-riscv64',
] + RiscV_Common_Params,
+ QemuEfiMachine.LOONGARCH64: [
+ 'qemu-system-loongarch64',
+ ] + LoongArch_Common_Params,
}
def _get_default_flash_paths(self, machine, variant, flash_size):
@@ -123,6 +130,13 @@ class QemuCommand:
'/usr/share/qemu-efi-riscv64/RISCV_VIRT_CODE.fd',
'/usr/share/qemu-efi-riscv64/RISCV_VIRT_VARS.fd',
)
+ if machine == QemuEfiMachine.LOONGARCH64:
+ assert(variant is None)
+ assert(flash_size == QemuEfiFlashSize.DEFAULT)
+ return (
+ '/usr/share/qemu-efi-loongarch64/QEMU_EFI.fd',
+ '/usr/share/qemu-efi-loongarch64/QEMU_VARS.fd',
+ )
# Remaining possibilities are OVMF variants
assert(
flash_size in [
diff --git a/debian/qemu-efi-loongarch64.install b/debian/qemu-efi-loongarch64.install
new file mode 100644
index 00000000..ea45da4f
--- /dev/null
+++ b/debian/qemu-efi-loongarch64.install
@@ -0,0 +1,3 @@
+debian/loongarch64-install/QEMU_EFI.fd /usr/share/qemu-efi-loongarch64
+debian/loongarch64-install/QEMU_VARS.fd /usr/share/qemu-efi-loongarch64
+debian/descriptors/60-edk2-loongarch64.json /usr/share/qemu/firmware
diff --git a/debian/rules b/debian/rules
index c038a6d2..12e91b89 100755
--- a/debian/rules
+++ b/debian/rules
@@ -9,6 +9,7 @@ EDK2_TOOLCHAIN = GCC5
export $(EDK2_TOOLCHAIN)_AARCH64_PREFIX=aarch64-linux-gnu-
export $(EDK2_TOOLCHAIN)_ARM_PREFIX=arm-linux-gnueabi-
export $(EDK2_TOOLCHAIN)_RISCV64_PREFIX=riscv64-linux-gnu-
+export $(EDK2_TOOLCHAIN)_LOONGARCH64_PREFIX=loongarch64-linux-gnu-
export PYTHON3_ENABLE=TRUE
@@ -48,6 +49,7 @@ AAVMF_COMMON_FLAGS += -DCAVIUM_ERRATUM_27456=TRUE
AAVMF_SECBOOT_FLAGS = $(AAVMF_COMMON_FLAGS) -DBUILD_SHELL=FALSE -DSECURE_BOOT_ENABLE=TRUE
RISCV64_FLAGS = $(COMMON_FLAGS)
+LOONGARCH64_FLAGS = $(COMMON_FLAGS)
# Clear variables used internally by the edk2 build system
undefine WORKSPACE
@@ -60,7 +62,7 @@ undefine CONF_PATH
%:
dh $@
-override_dh_auto_build: build-qemu-efi-aarch64 build-qemu-efi-arm build-ovmf build-ovmf32 build-qemu-efi-riscv64
+override_dh_auto_build: build-qemu-efi-aarch64 build-qemu-efi-arm build-ovmf build-ovmf32 build-qemu-efi-riscv64 build-qemu-efi-loongarch64
debian/setup-build-stamp:
set -e; . ./edksetup.sh; \
@@ -102,6 +104,11 @@ RISCV64_BUILD_ROOT = Build/RiscVVirtQemu
RISCV64_BUILD_DIR = $(RISCV64_BUILD_ROOT)/$(BUILD_TYPE)_$(EDK2_TOOLCHAIN)
RISCV64_IMAGES = $(addprefix $(RISCV64_INSTALL_DIR)/,RISCV_VIRT_CODE.fd RISCV_VIRT_VARS.fd)
+LOONGARCH64_INSTALL_DIR = debian/loongarch64-install
+LOONGARCH64_BUILD_ROOT = Build/LoongArchVirtQemu
+LOONGARCH64_BUILD_DIR = $(LOONGARCH64_BUILD_ROOT)/$(BUILD_TYPE)_$(EDK2_TOOLCHAIN)
+LOONGARCH64_IMAGES = $(addprefix $(LOONGARCH64_INSTALL_DIR)/,QEMU_EFI.fd QEMU_VARS.fd)
+
build-ovmf32: $(OVMF32_BINARIES) $(OVMF32_IMAGES)
$(OVMF32_BINARIES) $(OVMF32_IMAGES): debian/setup-build-stamp
rm -rf $(OVMF32_INSTALL_DIR)
@@ -284,6 +291,24 @@ $(RISCV64_IMAGES): debian/setup-build-stamp
truncate -s 32M $(RISCV64_INSTALL_DIR)/RISCV_VIRT_CODE.fd
truncate -s 32M $(RISCV64_INSTALL_DIR)/RISCV_VIRT_VARS.fd
+build-qemu-efi-loongarch64: $(LOONGARCH64_IMAGES)
+$(LOONGARCH64_IMAGES): debian/setup-build-stamp
+ rm -rf $(LOONGARCH64_INSTALL_DIR)
+ mkdir $(LOONGARCH64_INSTALL_DIR)
+ set -e; . ./edksetup.sh; \
+ build -a LOONGARCH64 \
+ -t $(EDK2_TOOLCHAIN) \
+ -p OvmfPkg/LoongArchVirt/LoongArchVirtQemu.dsc \
+ $(LOONGARCH64_FLAGS) -b $(BUILD_TYPE)
+ cp $(LOONGARCH64_BUILD_DIR)/LOONGARCH64/Shell.efi \
+ $(LOONGARCH64_INSTALL_DIR)/
+ cp $(LOONGARCH64_BUILD_DIR)/FV/QEMU_EFI.fd \
+ $(LOONGARCH64_INSTALL_DIR)/
+ cp $(LOONGARCH64_BUILD_DIR)/FV/QEMU_VARS.fd \
+ $(LOONGARCH64_INSTALL_DIR)/
+ truncate -s 16M $(LOONGARCH64_INSTALL_DIR)/QEMU_EFI.fd
+ truncate -s 16M $(LOONGARCH64_INSTALL_DIR)/QEMU_VARS.fd
+
override_dh_auto_clean:
-. ./edksetup.sh; build clean
make -C BaseTools clean
@@ -322,4 +347,4 @@ get-orig-source:
edk2-$(DEB_VERSION_UPSTREAM)
rm -rf edk2.tmp edk2-$(DEB_VERSION_UPSTREAM)
-.PHONY: build-ovmf build-ovmf32 build-qemu-efi build-qemu-efi-aarch64 build-qemu-efi-arm build-qemu-efi-riscv64
+.PHONY: build-ovmf build-ovmf32 build-qemu-efi build-qemu-efi-aarch64 build-qemu-efi-arm build-qemu-efi-riscv64 build-qemu-efi-loongarch64
diff --git a/debian/tests/control b/debian/tests/control
index 90632672..560085ec 100644
--- a/debian/tests/control
+++ b/debian/tests/control
@@ -12,9 +12,11 @@ Depends:
qemu-efi-aarch64,
qemu-efi-arm,
qemu-efi-riscv64,
+ qemu-efi-loongarch64,
qemu-system-arm,
qemu-system-riscv64,
qemu-system-x86,
+ qemu-system-misc,
sbsigntool [amd64 arm64],
shim-signed [amd64 arm64],
xorriso [amd64 arm64],
diff --git a/debian/tests/shell.py b/debian/tests/shell.py
index 8e90d6c0..70d7a8ab 100755
--- a/debian/tests/shell.py
+++ b/debian/tests/shell.py
@@ -273,5 +273,9 @@ class BootToShellTest(unittest.TestCase):
q = Qemu.QemuCommand(QemuEfiMachine.RISCV64)
self.run_cmd_check_shell(q.command)
+ def test_loongarch64(self):
+ q = Qemu.QemuCommand(QemuEfiMachine.LOONGARCH64)
+ self.run_cmd_check_shell(q.command)
+
if __name__ == '__main__':
unittest.main(verbosity=2)
--
2.43.0
Description: Cherry pick from upstream for loongarch64.
TODO: Put a short summary on the line above and replace this paragraph
with a longer explanation of this change. Complete the meta-information
with other relevant fields (see below for details). To make it easier, the
information below has been extracted from the changelog. Adjust it or drop
it.
.
edk2 (2024.11-2+loong64) unstable; urgency=medium
.
* Add loongarch64 support.
- Add qemu-efi-loongarch64 package.
+ qemu-efi-loongarch64/QEMU_EFI.fd
+ qemu-efi-loongarch64/QEMU_VARS.fd
+ qemu/firmware/60-edk2-loongarch64.json
- Add efi-shell-loongarch64 package.
+ efi-shell-loongarch64/shellloongarch64.efi
Author: Dandan Zhang <[email protected]>
---
Applied-Upstream: master, (https://github.com/tianocore/edk2/pull/6550)
Last-Update: 2024-12-23
--- edk2-2024.11.orig/OvmfPkg/LoongArchVirt/LoongArchVirtQemu.dsc
+++ edk2-2024.11/OvmfPkg/LoongArchVirt/LoongArchVirtQemu.dsc
@@ -155,6 +155,18 @@
FileExplorerLib | MdeModulePkg/Library/FileExplorerLib/FileExplorerLib.inf
ImagePropertiesRecordLib | MdeModulePkg/Library/ImagePropertiesRecordLib/ImagePropertiesRecordLib.inf
+ #
+ # CryptoPkg libraries needed by multiple firmware features
+ #
+ IntrinsicLib | CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf
+!if $(NETWORK_TLS_ENABLE) == TRUE
+ OpensslLib | CryptoPkg/Library/OpensslLib/OpensslLib.inf
+!else
+ OpensslLib | CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf
+!endif
+ BaseCryptLib | CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf
+ RngLib | MdeModulePkg/Library/BaseRngLibTimerLib/BaseRngLibTimerLib.inf
+
!if $(HTTP_BOOT_ENABLE) == TRUE
HttpLib | MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.inf
!endif
--- edk2-2024.11.orig/UefiCpuPkg/Library/CpuExceptionHandlerLib/LoongArch/DxeExceptionLib.c
+++ edk2-2024.11/UefiCpuPkg/Library/CpuExceptionHandlerLib/LoongArch/DxeExceptionLib.c
@@ -115,23 +115,22 @@ CommonExceptionHandler (
// Interrupt
//
InterruptType = GetInterruptType (SystemContext);
- if (InterruptType == 0xFF) {
- ExceptionType = InterruptType;
- } else {
+ if (InterruptType != 0xFF) {
if ((ExternalInterruptHandler != NULL) && (ExternalInterruptHandler[InterruptType] != NULL)) {
ExternalInterruptHandler[InterruptType](InterruptType, SystemContext);
return;
}
}
- } else if (ExceptionType == EXCEPT_LOONGARCH_FPD) {
- EnableFloatingPointUnits ();
- InitializeFloatingPointUnits ();
- return;
} else {
//
// Exception
//
- ExceptionType >>= CSR_ESTAT_EXC_SHIFT;
+ if (ExceptionType == EXCEPT_LOONGARCH_FPD) {
+ EnableFloatingPointUnits ();
+ InitializeFloatingPointUnits ();
+ return;
+ }
+
if ((ExceptionHandler != NULL) && (ExceptionHandler[ExceptionType] != NULL)) {
ExceptionHandler[ExceptionType](ExceptionType, SystemContext);
return;
--- edk2-2024.11.orig/UefiCpuPkg/Library/CpuExceptionHandlerLib/LoongArch/ExceptionCommon.c
+++ edk2-2024.11/UefiCpuPkg/Library/CpuExceptionHandlerLib/LoongArch/ExceptionCommon.c
@@ -43,8 +43,24 @@ CONST CHAR8 *mExceptionNameStr[] = {
"#GCXC - Guest CSR Software/Hardware Change exception",
"#TBR - TLB refill exception" // !!! NOTICE: Because the TLB refill exception is not instructed in ECODE, so the TLB refill exception must be the last one!
};
+CONST CHAR8 *mInterruptNameStr[] = {
+ "#SIP0 - Software interrupt 0",
+ "#SIP1 - Software interrupt 1",
+ "#IP0 - Hardware interrupt 0",
+ "#IP1 - Hardware interrupt 1",
+ "#IP2 - Hardware interrupt 2",
+ "#IP3 - Hardware interrupt 3",
+ "#IP4 - Hardware interrupt 4",
+ "#IP5 - Hardware interrupt 5",
+ "#IP6 - Hardware interrupt 6",
+ "#IP7 - Hardware interrupt 7",
+ "#PMC - Performance counter overflow interrupt",
+ "#TIMER - Timer interrupt",
+ "#IPI - Inter-Processor interrupt"
+};
INTN mExceptionKnownNameNum = (sizeof (mExceptionNameStr) / sizeof (CHAR8 *));
+INTN mInterruptKnownNameNum = (sizeof (mInterruptNameStr) / sizeof (CHAR8 *));
/**
Get ASCII format string exception name by exception type.
@@ -64,6 +80,26 @@ GetExceptionNameStr (
} else {
return mExceptionReservedStr;
}
+}
+
+/**
+ Get ASCII format string interrupt name by exception type.
+
+ @param InterruptType Interrupt type.
+
+ @return ASCII format string interrupt name.
+
+**/
+CONST CHAR8 *
+GetInterruptNameStr (
+ IN EFI_EXCEPTION_TYPE InterruptType
+ )
+{
+ if ((UINTN)InterruptType < mInterruptKnownNameNum) {
+ return mInterruptNameStr[InterruptType];
+ } else {
+ return mExceptionReservedStr;
+ }
}
/**
--- edk2-2024.11.orig/UefiCpuPkg/Library/CpuExceptionHandlerLib/LoongArch/ExceptionCommon.h
+++ edk2-2024.11/UefiCpuPkg/Library/CpuExceptionHandlerLib/LoongArch/ExceptionCommon.h
@@ -20,6 +20,7 @@
#define MAX_LOONGARCH_EXCEPTION 64
extern INTN mExceptionKnownNameNum;
+extern INTN mInterruptKnownNameNum;
/**
Get ASCII format string exception name by exception type.
@@ -35,6 +36,19 @@ GetExceptionNameStr (
);
/**
+ Get ASCII format string interrupt name by exception type.
+
+ @param InterruptType Interrupt type.
+
+ @return ASCII format string interrupt name.
+
+**/
+CONST CHAR8 *
+GetInterruptNameStr (
+ IN EFI_EXCEPTION_TYPE InterruptType
+ );
+
+/**
Prints a message to the serial port.
@param[in] Format Format string for the message to print.
--- edk2-2024.11.orig/UefiCpuPkg/Library/CpuExceptionHandlerLib/LoongArch/LoongArch64/ArchExceptionHandler.c
+++ edk2-2024.11/UefiCpuPkg/Library/CpuExceptionHandlerLib/LoongArch/LoongArch64/ArchExceptionHandler.c
@@ -27,7 +27,7 @@ GetExceptionType (
{
EFI_EXCEPTION_TYPE ExceptionType;
- ExceptionType = (SystemContext.SystemContextLoongArch64->ESTAT & CSR_ESTAT_EXC);
+ ExceptionType = (SystemContext.SystemContextLoongArch64->ESTAT & CSR_ESTAT_EXC) >> CSR_ESTAT_EXC_SHIFT;
return ExceptionType;
}
@@ -96,6 +96,17 @@ DumpCpuContext (
);
//
+ // Dump interrupt type if the exception type is INT.
+ //
+ if (ExceptionType == EXCEPT_LOONGARCH_INT) {
+ InternalPrintMessage (
+ "\n!!!! Unhandled interrupt Type - %02x(%a) !!!!\n",
+ GetInterruptType (SystemContext),
+ GetInterruptNameStr (GetInterruptType (SystemContext))
+ );
+ }
+
+ //
// Dump TLB refill ERA and BADV
//
if (ExceptionType == (mExceptionKnownNameNum - 1)) {
--- edk2-2024.11.orig/UefiCpuPkg/Library/CpuExceptionHandlerLib/LoongArch/SecPeiExceptionLib.c
+++ edk2-2024.11/UefiCpuPkg/Library/CpuExceptionHandlerLib/LoongArch/SecPeiExceptionLib.c
@@ -68,14 +68,7 @@ CommonExceptionHandler (
//
IpiInterruptHandler (InterruptType, SystemContext);
return;
- } else {
- ExceptionType = InterruptType;
}
- } else {
- //
- // Exception
- //
- ExceptionType >>= CSR_ESTAT_EXC_SHIFT;
}
DefaultExceptionHandler (ExceptionType, SystemContext);
--- End Message ---