On Thu, Jul 20, 2023 at 2:46 PM Ard Biesheuvel <a...@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?

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...

-- 
Pedro


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#107134): https://edk2.groups.io/g/devel/message/107134
Mute This Topic: https://groups.io/mt/100256049/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


Reply via email to