From 98f13417fb11a67139f5a732080c0aabee04eee1 Mon Sep 17 00:00:00 2001 From: Mikhail Krichanov Date: Thu, 5 Dec 2024 12:35:16 +0300 Subject: [PATCH] CpuArchLib: Specified IdtTable size precisely. --- UefiCpuPkg/Library/CpuArchLib/CpuDxe.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/UefiCpuPkg/Library/CpuArchLib/CpuDxe.c b/UefiCpuPkg/Library/CpuArchLib/CpuDxe.c index 8fa87bf3d8..7250e6b6a2 100644 --- a/UefiCpuPkg/Library/CpuArchLib/CpuDxe.c +++ b/UefiCpuPkg/Library/CpuArchLib/CpuDxe.c @@ -728,9 +728,9 @@ InitInterruptDescriptorTable ( // // Increase Interrupt Descriptor Table and Copy the old IDT table in // - IdtTable = AllocatePages (1); + IdtTable = AllocatePages (EFI_SIZE_TO_PAGES (sizeof (IA32_IDT_GATE_DESCRIPTOR) * CPU_INTERRUPT_NUM)); ASSERT (IdtTable != NULL); - SetMem (IdtTable, EFI_PAGE_SIZE, 0); + SetMem (IdtTable, sizeof (IA32_IDT_GATE_DESCRIPTOR) * CPU_INTERRUPT_NUM, 0); CopyMem (IdtTable, (VOID *)IdtDescriptor.Base, sizeof (IA32_IDT_GATE_DESCRIPTOR) * IdtEntryCount); //