From ca08f3d4533caf152170fe9ec0ce585e452d995e Mon Sep 17 00:00:00 2001 From: Michael Kubacki Date: Thu, 9 Apr 2020 11:16:20 -0700 Subject: [PATCH] NetworkPkg/SnpDxe: Register SnpNotifyExitBootServices at TPL_CALLBACK 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 Cc: Maciej Rabeda Cc: Jiaxin Wu Signed-off-by: Michael Kubacki Reviewed-by: Laszlo Ersek Reviewed-by: Maciej Rabeda --- NetworkPkg/SnpDxe/Snp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/NetworkPkg/SnpDxe/Snp.c b/NetworkPkg/SnpDxe/Snp.c index 078b27cf5e..fe022e16ea 100644 --- a/NetworkPkg/SnpDxe/Snp.c +++ b/NetworkPkg/SnpDxe/Snp.c @@ -2,6 +2,7 @@ Implementation of driver entry point and driver binding protocol. Copyright (c) 2004 - 2019, Intel Corporation. All rights reserved.
+Copyright (c) Microsoft Corporation.
SPDX-License-Identifier: BSD-2-Clause-Patent **/ @@ -653,7 +654,7 @@ SimpleNetworkDriverStart ( // Status = gBS->CreateEventEx ( EVT_NOTIFY_SIGNAL, - TPL_NOTIFY, + TPL_CALLBACK, SnpNotifyExitBootServices, Snp, &gEfiEventExitBootServicesGuid, -- 2.39.2