Re: EFI Group Event Callback Order
Thanks for your explanation, it's very clear.toggle quoted messageShow quoted text
Is it possible to update spec that makes unspecified behavior to specified? I know the implementation is in accordance with spec but add some comments can make programmer use this mechanism flexible.
From: Laszlo Ersek [mailto:firstname.lastname@example.org]
Sent: Saturday, January 18, 2020 2:19 AM
To: Li, Walon <email@example.com>; firstname.lastname@example.org
Cc: Wei, Kent (HPS SW) <email@example.com>; Wang, Sunny (HPS SW) <firstname.lastname@example.org>; Chang, Abner (HPS SW/FW Technologist) <email@example.com>; Spottswood, Jason <firstname.lastname@example.org>; Shifflett, Joseph <email@example.com>; Haskell, Darrell <firstname.lastname@example.org>; Wiginton, Scott <email@example.com>
Subject: Re: [edk2-discuss] EFI Group Event Callback Order
On 01/17/20 14:24, Li, Walon wrote:
Laszlo,The FIFO order refers to something else. Here's a larger citation:
When the event is signaled, firmware changes its state to "signaled"
and, if EVT_NOTIFY_SIGNAL is specified, places a call to its
notification function in a FIFO queue. There is a queue for each of
the "basic" task priority levels defined in Section 7.1
(TPL_CALLBACK, and TPL_NOTIFY). The functions in these queues are
invoked in FIFO order, starting with the highest priority level
queue and proceeding to the lowest priority queue that is unmasked
by the current TPL.
It means that, within a given TPL, the notification function invocation order will reflect the enqueueing (= signaling) order.
But the spec does not specify the *signaling* order for such events that belong to the same event group, when one of those events is signaled.
The spec says,
Event groups are collections of events identified by a shared
EFI_GUID where, when one member event is signaled, all other events
are signaled and their individual notification actions are taken (as
described in CreateEvent). All events are guaranteed to be signaled
before the first notification action is taken. All notification
functions will be executed in the order specified by their
So if you have two events, A and B, and they belong to the same event group G, and NotifyTpl is the same for both, then if you signal either A or B, then the notification functions may be queued, *and invoked*, in either (A, B), or (B, A), order. The invocation order will reflect the queueing order, yes, but the latter is unspecified, when you go through an event group.