From: "Ard Biesheuvel" <ardb@kernel.org>
To: Pedro Falcato <pedro.falcato@gmail.com>
Cc: devel@edk2.groups.io, Gerd Hoffmann <kraxel@redhat.com>,
Jiewen Yao <jiewen.yao@intel.com>,
Michael Brown <mcb30@ipxe.org>
Subject: Re: [edk2-devel] [RFC/RFT PATCH] OvmfPkg/IoMmuDxe: don't rely on TPLs for re-entrancy
Date: Mon, 24 Jul 2023 16:21:22 +0200 [thread overview]
Message-ID: <CAMj1kXHnxHgpPuBARg=bLEJrbBu_pLZ78MvqPwrqeNhHBE=VBg@mail.gmail.com> (raw)
In-Reply-To: <CAKbZUD0J34_B6OoVpy674uWnVBO-=JHx4=t0Sadk7jLHd_mn7Q@mail.gmail.com>
On Sat, 22 Jul 2023 at 00:55, Pedro Falcato <pedro.falcato@gmail.com> wrote:
>
> On Thu, Jul 20, 2023 at 2:46 PM Ard Biesheuvel <ardb@kernel.org> wrote:
> >
> > Instead of relying on raising the TPL to protect the critical sections
> > that manipulate the global bitmask that keeps track of bounce buffer
> > allocations, use compare-and-exchange to manage the global variable, and
> > tweak the logic to line up with that.
> >
> > Given that IoMmuDxe implements a singleton protocol that is shared
> > between multiple drivers, and considering the elaborate and confusing
> > requirements in the UEFP spec regarding TPL levels at which protocol
> > methods may be invoked, not relying on TPL levels at all is a more
>
> Really good change (I had thought of this when reading through the
> other IoMmuDxe thread), but I'm wondering if this warrants the
> addition of bit ops (AND, OR at least) to SynchronizationLib?
>
Thanks.
Atomic AND/OR would only help on the free path in this case.
> Sidenote: the compiler can detect if atomic intrinsics use the "fetch"
> value in (fetch_or, or_fetch, etc) and thus use smaller, more
> efficient instruction sequences (https://godbolt.org/z/zWTTWacEd). if
> only we could use those...
>
In principle, I'd agree but these are rarely used so I'm not sure it's
worth the effort refactoring this.
-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#107171): https://edk2.groups.io/g/devel/message/107171
Mute This Topic: https://groups.io/mt/100256049/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-
next prev parent reply other threads:[~2023-07-24 14:21 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-20 13:45 [edk2-devel] [RFC/RFT PATCH] OvmfPkg/IoMmuDxe: don't rely on TPLs for re-entrancy Ard Biesheuvel
2023-07-21 22:55 ` Pedro Falcato
2023-07-24 14:21 ` Ard Biesheuvel [this message]
2023-07-24 17:08 ` Pedro Falcato
2023-08-22 6:25 ` Gerd Hoffmann
2023-08-22 7:57 ` Ard Biesheuvel
2023-08-23 11:07 ` Gerd Hoffmann
2023-08-23 15:11 ` Ard Biesheuvel
2023-08-23 17:18 ` Gerd Hoffmann
2023-08-23 18:10 ` Pedro Falcato
2023-08-24 8:06 ` Gerd Hoffmann
2023-08-24 10:31 ` Ard Biesheuvel
2023-08-28 9:16 ` Gerd Hoffmann
2023-08-28 11:13 ` Ard Biesheuvel
2023-08-31 16:01 ` Ard Biesheuvel
2023-09-04 11:45 ` Gerd Hoffmann
2023-09-04 12:06 ` Ard Biesheuvel
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='CAMj1kXHnxHgpPuBARg=bLEJrbBu_pLZ78MvqPwrqeNhHBE=VBg@mail.gmail.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