a086f4a adds NestedInterruptTplLib call in OvmfPkg/LocalApicTimerDxe to avoid stack overflow due to interrupt storm in VM guest. REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2815 REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4162
The interrupt storm only happens in VM guest environment when the VM is heavily loaded. The UefiCpuPkg/LocalApicTimerDxe at current stage does not support the VM guest environment. So, this patch removes the NestedInterruptTplLib call. Signed-off-by: Ray Ni <ray...@intel.com> Cc: Michael D Kinney <michael.d.kin...@intel.com> Cc: Nate DeSimone <nathaniel.l.desim...@intel.com> Cc: Laszlo Ersek <ler...@redhat.com> Cc: Rahul Kumar <rahul1.ku...@intel.com> Cc: Gerd Hoffmann <kra...@redhat.com> --- UefiCpuPkg/LocalApicTimerDxe/LocalApicTimerDxe.c | 11 ++++------- UefiCpuPkg/LocalApicTimerDxe/LocalApicTimerDxe.inf | 4 +--- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/UefiCpuPkg/LocalApicTimerDxe/LocalApicTimerDxe.c b/UefiCpuPkg/LocalApicTimerDxe/LocalApicTimerDxe.c index 67f4dcde37..f36a0e6bf3 100644 --- a/UefiCpuPkg/LocalApicTimerDxe/LocalApicTimerDxe.c +++ b/UefiCpuPkg/LocalApicTimerDxe/LocalApicTimerDxe.c @@ -1,15 +1,13 @@ /** @file Timer Architectural Protocol as defined in the DXE CIS -Copyright (c) 2005 - 2018, Intel Corporation. All rights reserved.<BR> +Copyright (c) 2005 - 2024, Intel Corporation. All rights reserved.<BR> Copyright (c) 2019, Citrix Systems, Inc. SPDX-License-Identifier: BSD-2-Clause-Patent **/ -#include <Library/NestedInterruptTplLib.h> - #include "LocalApicTimerDxe.h" // @@ -60,10 +58,9 @@ TimerInterruptHandler ( IN EFI_SYSTEM_CONTEXT SystemContext ) { - STATIC NESTED_INTERRUPT_STATE NestedInterruptState; - EFI_TPL OriginalTPL; + EFI_TPL OriginalTPL; - OriginalTPL = NestedInterruptRaiseTPL (); + OriginalTPL = gBS->RaiseTPL (TPL_HIGH_LEVEL); SendApicEoi (); @@ -74,7 +71,7 @@ TimerInterruptHandler ( mTimerNotifyFunction (mTimerPeriod); } - NestedInterruptRestoreTPL (OriginalTPL, SystemContext, &NestedInterruptState); + gBS->RestoreTPL (OriginalTPL); } /** diff --git a/UefiCpuPkg/LocalApicTimerDxe/LocalApicTimerDxe.inf b/UefiCpuPkg/LocalApicTimerDxe/LocalApicTimerDxe.inf index 6c711bd163..874d58fa17 100644 --- a/UefiCpuPkg/LocalApicTimerDxe/LocalApicTimerDxe.inf +++ b/UefiCpuPkg/LocalApicTimerDxe/LocalApicTimerDxe.inf @@ -2,7 +2,7 @@ # Local APIC timer driver that provides Timer Arch protocol. # PcdFSBClock is defined in MdePkg and it should be set by the consumer. # -# Copyright (c) 2005 - 2019, Intel Corporation. All rights reserved.<BR> +# Copyright (c) 2005 - 2024, Intel Corporation. All rights reserved.<BR> # Copyright (c) 2019, Citrix Systems, Inc. # # SPDX-License-Identifier: BSD-2-Clause-Patent @@ -21,13 +21,11 @@ [Packages] MdePkg/MdePkg.dec UefiCpuPkg/UefiCpuPkg.dec - OvmfPkg/OvmfPkg.dec [LibraryClasses] UefiBootServicesTableLib BaseLib DebugLib - NestedInterruptTplLib UefiDriverEntryPoint LocalApicLib -- 2.39.1.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#113801): https://edk2.groups.io/g/devel/message/113801 Mute This Topic: https://groups.io/mt/103734962/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/leave/9847357/21656/1706620634/xyzzy [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-