Re: [edk2-devel] [PATCH] OvmfPkg: End timer interrupt later to avoid stack overflow under load

2020-06-18 Thread Laszlo Ersek
On 06/17/20 19:23, Igor Druzhinin wrote: > On 17/06/2020 17:59, Paolo Bonzini wrote: >> [CAUTION - EXTERNAL EMAIL] DO NOT reply, click links, or open attachments >> unless you have verified the sender and know the content is safe. >> >> On 17/06/20 17:46, Laszlo Ersek wrote: That said,

Re: [edk2-devel] [PATCH] OvmfPkg: End timer interrupt later to avoid stack overflow under load

2020-06-18 Thread Laszlo Ersek
On 06/18/20 10:36, Laszlo Ersek wrote: > On 06/17/20 19:23, Igor Druzhinin wrote: >> I will create a BZ ticket as requested. > > Thanks -- please follow up with the URL nevermind, I've found, in my bugmail: https://bugzilla.tianocore.org/show_bug.cgi?id=2815 Thanks Laszlo

Re: [edk2-devel] [PATCH] OvmfPkg: End timer interrupt later to avoid stack overflow under load

2020-06-18 Thread Laszlo Ersek
On 06/17/20 19:23, Igor Druzhinin wrote: > On 17/06/2020 17:59, Paolo Bonzini wrote: >> [CAUTION - EXTERNAL EMAIL] DO NOT reply, click links, or open attachments >> unless you have verified the sender and know the content is safe. >> >> On 17/06/20 17:46, Laszlo Ersek wrote: That said,

Re: [edk2-devel] [PATCH] OvmfPkg: End timer interrupt later to avoid stack overflow under load

2020-06-17 Thread Igor Druzhinin
On 17/06/2020 17:59, Paolo Bonzini wrote: > [CAUTION - EXTERNAL EMAIL] DO NOT reply, click links, or open attachments > unless you have verified the sender and know the content is safe. > > On 17/06/20 17:46, Laszlo Ersek wrote: >>> That said, Igor's patch seems correct to me. In fact, I'd even

Re: [edk2-devel] [PATCH] OvmfPkg: End timer interrupt later to avoid stack overflow under load

2020-06-17 Thread Paolo Bonzini
On 17/06/20 17:46, Laszlo Ersek wrote: >> That said, Igor's patch seems correct to me. In fact, I'd even move >> DisableInterrupts before gBS->RestoreTPL unless there's a good reason >> not to do so. > OK, thank you! > > Igor, please confirm if you'd like to submit v2 with the update > suggested

Re: [edk2-devel] [PATCH] OvmfPkg: End timer interrupt later to avoid stack overflow under load

2020-06-17 Thread Laszlo Ersek
On 06/17/20 15:51, Paolo Bonzini wrote: > On 16/06/20 20:42, Laszlo Ersek wrote: >> (Hmmm... maybe the hypervisor *has* to queue the timer interrupts, >> otherwise some of them would simply be lost, and the guest would lose >> track of time.) > > Yes, there are various kinds of coalescing of

Re: [edk2-devel] [PATCH] OvmfPkg: End timer interrupt later to avoid stack overflow under load

2020-06-17 Thread Paolo Bonzini
On 16/06/20 20:42, Laszlo Ersek wrote: > (Hmmm... maybe the hypervisor *has* to queue the timer interrupts, > otherwise some of them would simply be lost, and the guest would lose > track of time.) Yes, there are various kinds of coalescing of interrupts that hypervisors perform to help the guest

Re: [edk2-devel] [PATCH] OvmfPkg: End timer interrupt later to avoid stack overflow under load

2020-06-17 Thread Laszlo Ersek
On 06/17/20 05:16, Igor Druzhinin wrote: > On 16/06/2020 19:42, Laszlo Ersek wrote >> If I understand correctly, TimerInterruptHandler() >> [OvmfPkg/8254TimerDxe/Timer.c] currently does the following: >> >> - RaiseTPL (TPL_HIGH_LEVEL) --> mask interrupts from being delivered >> >> -

Re: [edk2-devel] [PATCH] OvmfPkg: End timer interrupt later to avoid stack overflow under load

2020-06-17 Thread Igor Druzhinin
On 16/06/2020 19:42, Laszlo Ersek wrote > If I understand correctly, TimerInterruptHandler() > [OvmfPkg/8254TimerDxe/Timer.c] currently does the following: > > - RaiseTPL (TPL_HIGH_LEVEL) --> mask interrupts from being delivered > > - mLegacy8259->EndOfInterrupt() --> permit the PIC to generate

Re: [edk2-devel] [PATCH] OvmfPkg: End timer interrupt later to avoid stack overflow under load

2020-06-16 Thread Laszlo Ersek
(+Paolo, +Ray) On 06/16/20 04:49, Igor Druzhinin wrote: > RestoreTPL called while at TPL_HIGH_LEVEL unconditionally enables interrupts > even if called in interrupt handler. That opens a window while interrupt > is not completely handled but another interrupt could be accepted. > > If a VM

[edk2-devel] [PATCH] OvmfPkg: End timer interrupt later to avoid stack overflow under load

2020-06-16 Thread Igor Druzhinin
RestoreTPL called while at TPL_HIGH_LEVEL unconditionally enables interrupts even if called in interrupt handler. That opens a window while interrupt is not completely handled but another interrupt could be accepted. If a VM starts on a heavily loaded host hundreds of periodic timer interrupts