Date
1 - 1 of 1
[PATCH 1/3] OvmfPkg: Send EOI before RestoreTPL() in timer interrupt handlers
Michael Brown
Deferring the EOI until after the call to RestoreTPL() means that any
callbacks invoked by RestoreTPL() will run with timer interrupt delivery disabled. If any such callbacks themselves rely on timers to implement timeout loops, then the callbacks will get stuck in an infinite loop from which the system will never recover. This reverts commit 239b50a86 ("OvmfPkg: End timer interrupt later to avoid stack overflow under load"). Cc: Laszlo Ersek <lersek@...> Cc: Paolo Bonzini <pbonzini@...> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=4162 Signed-off-by: Michael Brown <mcb30@...> --- OvmfPkg/8254TimerDxe/Timer.c | 5 ++--- OvmfPkg/LocalApicTimerDxe/LocalApicTimerDxe.c | 5 ++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/OvmfPkg/8254TimerDxe/Timer.c b/OvmfPkg/8254TimerDxe/Timer.c index e49a438b44..7feaaaba2b 100644 --- a/OvmfPkg/8254TimerDxe/Timer.c +++ b/OvmfPkg/8254TimerDxe/Timer.c @@ -80,6 +80,8 @@ TimerInterruptHandler ( OriginalTPL = gBS->RaiseTPL (TPL_HIGH_LEVEL); + mLegacy8259->EndOfInterrupt (mLegacy8259, Efi8259Irq0); + if (mTimerNotifyFunction != NULL) { // // @bug : This does not handle missed timer interrupts @@ -88,9 +90,6 @@ TimerInterruptHandler ( } gBS->RestoreTPL (OriginalTPL); - - DisableInterrupts (); - mLegacy8259->EndOfInterrupt (mLegacy8259, Efi8259Irq0); } /** diff --git a/OvmfPkg/LocalApicTimerDxe/LocalApicTimerDxe.c b/OvmfPkg/LocalApicTimerDxe/LocalApicTimerDxe.c index cbc17c979c..3e04b49d6b 100644 --- a/OvmfPkg/LocalApicTimerDxe/LocalApicTimerDxe.c +++ b/OvmfPkg/LocalApicTimerDxe/LocalApicTimerDxe.c @@ -62,6 +62,8 @@ TimerInterruptHandler ( OriginalTPL = gBS->RaiseTPL (TPL_HIGH_LEVEL); + SendApicEoi (); + if (mTimerNotifyFunction != NULL) { // // @bug : This does not handle missed timer interrupts @@ -70,9 +72,6 @@ TimerInterruptHandler ( } gBS->RestoreTPL (OriginalTPL); - - DisableInterrupts (); - SendApicEoi (); } /** -- 2.38.1 |
|