public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH 1/1] MdeModulePkg: correct TPL level check CoreCreateEventEx
@ 2021-01-06 17:24 Heinrich Schuchardt
  2021-01-06 17:33 ` [edk2-devel] " Michael D Kinney
  0 siblings, 1 reply; 2+ messages in thread
From: Heinrich Schuchardt @ 2021-01-06 17:24 UTC (permalink / raw)
  To: devel; +Cc: Dandan Bi, Liming Gao, Heinrich Schuchardt

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3058

According to table Table 27. TPL Restrictions in UEFI spec 2.8 B:

Event Notification Levels must be > TPL_APPLICATION and <= TPL_HIGH_LEVEL.

Adjust the test TPL level test.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
---
 MdeModulePkg/Core/Dxe/Event/Event.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/MdeModulePkg/Core/Dxe/Event/Event.c b/MdeModulePkg/Core/Dxe/Event/Event.c
index c83c572c8f84..e25856eaaa5f 100644
--- a/MdeModulePkg/Core/Dxe/Event/Event.c
+++ b/MdeModulePkg/Core/Dxe/Event/Event.c
@@ -339,9 +339,9 @@ CoreCreateEventEx (
   // If it's a notify type of event, check for invalid NotifyTpl
   //
   if ((Type & (EVT_NOTIFY_WAIT | EVT_NOTIFY_SIGNAL)) != 0) {
-    if (NotifyTpl != TPL_APPLICATION &&
-        NotifyTpl != TPL_CALLBACK &&
-        NotifyTpl != TPL_NOTIFY) {
+    if (NotifyTpl != TPL_CALLBACK &&
+        NotifyTpl != TPL_NOTIFY &&
+        NotifyTpl != TPL_HIGH_LEVEL) {
       return EFI_INVALID_PARAMETER;
     }
   }
--
2.29.2


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [edk2-devel] [PATCH 1/1] MdeModulePkg: correct TPL level check CoreCreateEventEx
  2021-01-06 17:24 [PATCH 1/1] MdeModulePkg: correct TPL level check CoreCreateEventEx Heinrich Schuchardt
@ 2021-01-06 17:33 ` Michael D Kinney
  0 siblings, 0 replies; 2+ messages in thread
From: Michael D Kinney @ 2021-01-06 17:33 UTC (permalink / raw)
  To: devel@edk2.groups.io, xypron.glpk@gmx.de, Kinney, Michael D
  Cc: Bi, Dandan, Liming Gao

Heinrich,

Section 7.1 of the UEFI Spec states that TPL_HIGH_LEVEL is designed for 
exclusive use by the firmware.  The creation of events by UEFI applications,
UEFI drivers, and UEFI OS Loaders should not use this TPL level.

I agree with removing TPL_APPLICATION form this check, but I do not think
TPL_HIGH_LEVEL should be added.

Thanks,

Mike

> -----Original Message-----
> From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Heinrich Schuchardt
> Sent: Wednesday, January 6, 2021 9:24 AM
> To: devel@edk2.groups.io
> Cc: Bi, Dandan <dandan.bi@intel.com>; Liming Gao <gaoliming@byosoft.com.cn>; Heinrich Schuchardt <xypron.glpk@gmx.de>
> Subject: [edk2-devel] [PATCH 1/1] MdeModulePkg: correct TPL level check CoreCreateEventEx
> 
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3058
> 
> According to table Table 27. TPL Restrictions in UEFI spec 2.8 B:
> 
> Event Notification Levels must be > TPL_APPLICATION and <= TPL_HIGH_LEVEL.
> 
> Adjust the test TPL level test.
> 
> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
> ---
>  MdeModulePkg/Core/Dxe/Event/Event.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/MdeModulePkg/Core/Dxe/Event/Event.c b/MdeModulePkg/Core/Dxe/Event/Event.c
> index c83c572c8f84..e25856eaaa5f 100644
> --- a/MdeModulePkg/Core/Dxe/Event/Event.c
> +++ b/MdeModulePkg/Core/Dxe/Event/Event.c
> @@ -339,9 +339,9 @@ CoreCreateEventEx (
>    // If it's a notify type of event, check for invalid NotifyTpl
>    //
>    if ((Type & (EVT_NOTIFY_WAIT | EVT_NOTIFY_SIGNAL)) != 0) {
> -    if (NotifyTpl != TPL_APPLICATION &&
> -        NotifyTpl != TPL_CALLBACK &&
> -        NotifyTpl != TPL_NOTIFY) {
> +    if (NotifyTpl != TPL_CALLBACK &&
> +        NotifyTpl != TPL_NOTIFY &&
> +        NotifyTpl != TPL_HIGH_LEVEL) {
>        return EFI_INVALID_PARAMETER;
>      }
>    }
> --
> 2.29.2
> 
> 
> 
> -=-=-=-=-=-=
> Groups.io Links: You receive all messages sent to this group.
> View/Reply Online (#69851): https://edk2.groups.io/g/devel/message/69851
> Mute This Topic: https://groups.io/mt/79479680/1643496
> Group Owner: devel+owner@edk2.groups.io
> Unsubscribe: https://edk2.groups.io/g/devel/unsub [michael.d.kinney@intel.com]
> -=-=-=-=-=-=
> 


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-01-06 17:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-01-06 17:24 [PATCH 1/1] MdeModulePkg: correct TPL level check CoreCreateEventEx Heinrich Schuchardt
2021-01-06 17:33 ` [edk2-devel] " Michael D Kinney

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox