summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArd Biesheuvel <ardb@kernel.org>2025-01-29 12:05:09 +0100
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2025-01-30 13:07:05 +0000
commit0422dd0669b9e6f50c4d07e3496a2173b8eb611f (patch)
tree2cb825c15d2e6c5985362ff5c54f90f4ab9254a4
parente5b56d6ef9fb028957683fd546347edf5232a024 (diff)
downloadedk2-0422dd0669b9e6f50c4d07e3496a2173b8eb611f.tar.gz
ArmPkg/CpuDxe: Remove rudimentary vector handoff logic
There is some fossilized code in the CpuDxe driver startup code that permits a vector table to be inherited from the PEI stage, but this code is essentially dead on ARM platforms, given that the VectorInfo argument passed to InitializeCpuExceptionHandlers() is ignored, and no code appears to exist that would result in the gEfiVectorHandoffTableGuid configuration table ever being populated. Also, due to prior refactoring, the code that disables and re-enables IRQs and FIQs is completely pointless, and can simply be removed. That, in turn, allows the CPU arch protocol parameter to be dropped from the prototype of InitializeExceptions(). Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
-rw-r--r--ArmPkg/Drivers/CpuDxe/CpuDxe.c2
-rw-r--r--ArmPkg/Drivers/CpuDxe/CpuDxe.h2
-rw-r--r--ArmPkg/Drivers/CpuDxe/Exception.c44
3 files changed, 5 insertions, 43 deletions
diff --git a/ArmPkg/Drivers/CpuDxe/CpuDxe.c b/ArmPkg/Drivers/CpuDxe/CpuDxe.c
index f109a8e0cf..191eb1c20b 100644
--- a/ArmPkg/Drivers/CpuDxe/CpuDxe.c
+++ b/ArmPkg/Drivers/CpuDxe/CpuDxe.c
@@ -317,7 +317,7 @@ CpuDxeInitialize (
EFI_EVENT IdleLoopEvent;
EFI_HANDLE CpuHandle;
- InitializeExceptions (&mCpu);
+ InitializeExceptions ();
InitializeDma (&mCpu);
diff --git a/ArmPkg/Drivers/CpuDxe/CpuDxe.h b/ArmPkg/Drivers/CpuDxe/CpuDxe.h
index c6613b939a..80d53e3577 100644
--- a/ArmPkg/Drivers/CpuDxe/CpuDxe.h
+++ b/ArmPkg/Drivers/CpuDxe/CpuDxe.h
@@ -99,7 +99,7 @@ CpuSetMemoryAttributes (
EFI_STATUS
InitializeExceptions (
- IN EFI_CPU_ARCH_PROTOCOL *Cpu
+ VOID
);
EFI_STATUS
diff --git a/ArmPkg/Drivers/CpuDxe/Exception.c b/ArmPkg/Drivers/CpuDxe/Exception.c
index 441f92d502..bd27f24994 100644
--- a/ArmPkg/Drivers/CpuDxe/Exception.c
+++ b/ArmPkg/Drivers/CpuDxe/Exception.c
@@ -13,49 +13,11 @@
EFI_STATUS
InitializeExceptions (
- IN EFI_CPU_ARCH_PROTOCOL *Cpu
+ VOID
)
{
- EFI_STATUS Status;
- EFI_VECTOR_HANDOFF_INFO *VectorInfoList;
- EFI_VECTOR_HANDOFF_INFO *VectorInfo;
- BOOLEAN IrqEnabled;
- BOOLEAN FiqEnabled;
-
- VectorInfo = (EFI_VECTOR_HANDOFF_INFO *)NULL;
- Status = EfiGetSystemConfigurationTable (&gEfiVectorHandoffTableGuid, (VOID **)&VectorInfoList);
- if ((Status == EFI_SUCCESS) && (VectorInfoList != NULL)) {
- VectorInfo = VectorInfoList;
- }
-
// initialize the CpuExceptionHandlerLib so we take over the exception vector table from the DXE Core
- InitializeCpuExceptionHandlers (VectorInfo);
-
- Status = EFI_SUCCESS;
-
- //
- // Disable interrupts
- //
- Cpu->GetInterruptState (Cpu, &IrqEnabled);
- Cpu->DisableInterrupt (Cpu);
-
- //
- // EFI does not use the FIQ, but a debugger might so we must disable
- // as we take over the exception vectors.
- //
- FiqEnabled = ArmGetFiqState ();
- ArmDisableFiq ();
-
- if (FiqEnabled) {
- ArmEnableFiq ();
- }
-
- if (IrqEnabled) {
- //
- // Restore interrupt state
- //
- Status = Cpu->EnableInterrupt (Cpu);
- }
+ InitializeCpuExceptionHandlers (NULL);
//
// On a DEBUG build, unmask SErrors so they are delivered right away rather
@@ -66,7 +28,7 @@ InitializeExceptions (
ArmEnableAsynchronousAbort ();
);
- return Status;
+ return EFI_SUCCESS;
}
/**