]> git.proxmox.com Git - mirror_edk2.git/commitdiff
NetworkPkg/SnpDxe: Register SnpNotifyExitBootServices at TPL_CALLBACK
authorMichael Kubacki <michael.kubacki@microsoft.com>
Thu, 9 Apr 2020 18:16:20 +0000 (11:16 -0700)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Fri, 17 Apr 2020 17:34:33 +0000 (17:34 +0000)
REF:https://bugzilla.tianocore.org/show_bug.cgi?id=1562

The current SnpDxe implementation registers its ExitBootServices event
notification function (SnpNotifyExitBootServices ()) at TPL_NOTIFY. This
function calls PxeShutdown() which issues an UNDI  shutdown operation.
Ultimately, this may invoke Shutdown() in EFI_SIMPLE_NETWORK_PROTOCOL.

The UEFI specification 2.8A Table 27 "TPL Restrictions" restricts the
TPL
for Simple Network Protocol to <= TPL_CALLBACK. In addition, it has been
observed in some 3rd party UNDI drivers to cause an issue further down
the call stack if the TPL is higher than TPL_CALLBACK on invocation.

Therefore, this commit changes the TPL of SnpNotifyExitBootServices() to
TPL_CALLBACK.

Cc: Siyuan Fu <siyuan.fu@intel.com>
Cc: Maciej Rabeda <maciej.rabeda@linux.intel.com>
Cc: Jiaxin Wu <jiaxin.wu@intel.com>
Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Maciej Rabeda <maciej.rabeda@linux.intel.com>
NetworkPkg/SnpDxe/Snp.c

index 078b27cf5edd007d46ed5fb4beeebde138478395..fe022e16eacc5584423182e27136736dc13d4898 100644 (file)
@@ -2,6 +2,7 @@
   Implementation of driver entry point and driver binding protocol.\r
 \r
 Copyright (c) 2004 - 2019, Intel Corporation. All rights reserved.<BR>\r
   Implementation of driver entry point and driver binding protocol.\r
 \r
 Copyright (c) 2004 - 2019, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) Microsoft Corporation.<BR>\r
 SPDX-License-Identifier: BSD-2-Clause-Patent\r
 \r
 **/\r
 SPDX-License-Identifier: BSD-2-Clause-Patent\r
 \r
 **/\r
@@ -653,7 +654,7 @@ SimpleNetworkDriverStart (
     //\r
     Status = gBS->CreateEventEx (\r
                     EVT_NOTIFY_SIGNAL,\r
     //\r
     Status = gBS->CreateEventEx (\r
                     EVT_NOTIFY_SIGNAL,\r
-                    TPL_NOTIFY,\r
+                    TPL_CALLBACK,\r
                     SnpNotifyExitBootServices,\r
                     Snp,\r
                     &gEfiEventExitBootServicesGuid,\r
                     SnpNotifyExitBootServices,\r
                     Snp,\r
                     &gEfiEventExitBootServicesGuid,\r