public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Michael Brown" <mcb30@ipxe.org>
To: devel@edk2.groups.io, kraxel@redhat.com
Cc: Laszlo Ersek <lersek@redhat.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Ard Biesheuvel <ardb@kernel.org>
Subject: Re: [edk2-devel] [PATCH 2/3] OvmfPkg: Add library to handle TPL from within nested interrupt handlers
Date: Fri, 9 Dec 2022 15:22:46 +0000	[thread overview]
Message-ID: <01020184f77b5558-6781c306-bc9e-4040-88fb-55409427d5af-000000@eu-west-1.amazonses.com> (raw)
In-Reply-To: <20221209150227.wns5mhtcfismxtgd@sirius.home.kraxel.org>

On 09/12/2022 15:02, Gerd Hoffmann wrote:
>> Add the Nested Interrupt TPL Library (NestedInterruptTplLib) to
>> provide helper functions that can be used by nested interrupt handlers
>> in place of RaiseTPL()/RestoreTPL().
> 
> So, in a nutshell this makes inner interrupt handler only run callbacks
> with a priority higher than the priority of the outer interrupt handler.
> Anything with equal or lower priority is deferred to the outer handler.

Essentially, yes, though for accuracy I would replace "run callbacks 
with" with "restore TPL to":

   The inner interrupt handler will only restore TPL to a priority
   higher than the priority of the outer interrupt handler. Anything
   with equal or lower priority is deferred to the outer handler.

The distinction matters because in the deferral case the inner interrupt 
will not run any callbacks at all: the running of callbacks is then 
deferred in its entirety to the outer interrupt handler (with a hard 
guarantee that the deferred running of callbacks will take place 
immediately).

> That way we never nest at the same priority, which in turn limits
> nesting to the number of different priorities in use.
> 
> Correct?

Yes, limiting nesting to the number of different priorities in use is 
exactly what this patch does.

> The idea looks sane to me and I couldn't spot any logic errors in this.

Great! :)

Thanks,

Michael


  reply	other threads:[~2022-12-09 15:22 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <cover.1670328507.git.mcb30@ipxe.org>
2022-12-09 10:20 ` [PATCH 1/3] OvmfPkg: Send EOI before RestoreTPL() in timer interrupt handlers Michael Brown
2022-12-09 10:20 ` [PATCH 2/3] OvmfPkg: Add library to handle TPL from within nested " Michael Brown
2022-12-09 15:02   ` [edk2-devel] " Gerd Hoffmann
2022-12-09 15:22     ` Michael Brown [this message]
     [not found]     ` <ac60f07a-df27-bcfd-4129-0d6bfcf7ac77@ipxe.org>
2022-12-20 15:02       ` Michael Brown
2022-12-21  8:06         ` Laszlo Ersek
2022-12-23 14:25           ` Ard Biesheuvel
2022-12-09 10:20 ` [PATCH 3/3] OvmfPkg: Use NestedInterruptTplLib in " Michael Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=01020184f77b5558-6781c306-bc9e-4040-88fb-55409427d5af-000000@eu-west-1.amazonses.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox