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>
This commit is contained in:
Ard Biesheuvel 2025-01-29 12:05:09 +01:00 committed by mergify[bot]
parent e5b56d6ef9
commit 0422dd0669
3 changed files with 5 additions and 43 deletions

View File

@ -317,7 +317,7 @@ CpuDxeInitialize (
EFI_EVENT IdleLoopEvent;
EFI_HANDLE CpuHandle;
InitializeExceptions (&mCpu);
InitializeExceptions ();
InitializeDma (&mCpu);

View File

@ -99,7 +99,7 @@ CpuSetMemoryAttributes (
EFI_STATUS
InitializeExceptions (
IN EFI_CPU_ARCH_PROTOCOL *Cpu
VOID
);
EFI_STATUS

View File

@ -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;
}
/**