On 2/29/24 20:22, Michael Brown wrote:
The design of NestedInterruptTplLib is that each nested interrupt must increase
the TPL, but if I understand correctly there is a hole here:
//
// Call RestoreTPL() to allow event notifications to be
// dispatched. This will implicitly re-enable interrupts.
//
gBS->RestoreTPL (InterruptedTPL);
//
// Re-disable interrupts after the call to RestoreTPL() to ensure
// that we have exclusive access to the shared state.
//
DisableInterrupts ();
because gBS->RestoreTPL will unconditionally enable interrupts if InterruptedTPL
< TPL_HIGH_LEVEL.
There's no hole there.
Yes, what I meant is that the whole of NestedInterruptTplLib is designed
around plugging that hole. But if you can avoid re-enabling interrupts
at the end of CoreRestoreTpl(), you don't need DisableInterruptsOnIret()
anymore.
See the comments in the code for further details - I made them fairly
extensive. 🙂
Yup, I remember. :)
If possible, the easiest solution would be to merge
NestedInterruptTplLib into Core DXE.
The question with that approach would be how to cleanly violate the
abstraction layer that separates the timer interrupt handler (existing
in a separate DXE driver executable) from the implementation of
CoreRestoreTplInternal() (existing in core DXE and not exposed via the
boot services table).
See outline in the other mail I have sent.
Paolo
-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#116190): https://edk2.groups.io/g/devel/message/116190
Mute This Topic: https://groups.io/mt/104642317/21656
Group Owner: [email protected]
Unsubscribe: https://edk2.groups.io/g/devel/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-