Reserve IDT and other exception-related memory as runtime so it won't be overwritten by the OS while the MH is running.
Signed-off-by: Tobin Feldman-Fitzthum <to...@linux.ibm.com> --- UefiCpuPkg/Library/CpuExceptionHandlerLib/DxeException.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/UefiCpuPkg/Library/CpuExceptionHandlerLib/DxeException.c b/UefiCpuPkg/Library/CpuExceptionHandlerLib/DxeException.c index fd59f09ecd..35610f8cf5 100644 --- a/UefiCpuPkg/Library/CpuExceptionHandlerLib/DxeException.c +++ b/UefiCpuPkg/Library/CpuExceptionHandlerLib/DxeException.c @@ -102,7 +102,7 @@ InitializeCpuInterruptHandlers ( EFI_CPU_INTERRUPT_HANDLER *ExternalInterruptHandler; Status = gBS->AllocatePool ( - EfiBootServicesCode, + EfiRuntimeServicesCode, sizeof (RESERVED_VECTORS_DATA) * CPU_INTERRUPT_NUM, (VOID **)&ReservedVectors ); @@ -116,7 +116,7 @@ InitializeCpuInterruptHandlers ( } } - ExternalInterruptHandler = AllocateZeroPool (sizeof (EFI_CPU_INTERRUPT_HANDLER) * CPU_INTERRUPT_NUM); + ExternalInterruptHandler = AllocateRuntimeZeroPool (sizeof (EFI_CPU_INTERRUPT_HANDLER) * CPU_INTERRUPT_NUM); ASSERT (ExternalInterruptHandler != NULL); // @@ -130,7 +130,7 @@ InitializeCpuInterruptHandlers ( // // Create Interrupt Descriptor Table and Copy the old IDT table in // - IdtTable = AllocateZeroPool (sizeof (IA32_IDT_GATE_DESCRIPTOR) * CPU_INTERRUPT_NUM); + IdtTable = AllocateRuntimeZeroPool (sizeof (IA32_IDT_GATE_DESCRIPTOR) * CPU_INTERRUPT_NUM); ASSERT (IdtTable != NULL); CopyMem (IdtTable, (VOID *)IdtDescriptor.Base, sizeof (IA32_IDT_GATE_DESCRIPTOR) * IdtEntryCount); @@ -138,7 +138,7 @@ InitializeCpuInterruptHandlers ( ASSERT (TemplateMap.ExceptionStubHeaderSize <= HOOKAFTER_STUB_SIZE); Status = gBS->AllocatePool ( - EfiBootServicesCode, + EfiRuntimeServicesCode, TemplateMap.ExceptionStubHeaderSize * CPU_INTERRUPT_NUM, (VOID **)&InterruptEntryCode ); -- 2.20.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#72360): https://edk2.groups.io/g/devel/message/72360 Mute This Topic: https://groups.io/mt/81036375/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-