From nobody Fri Apr 26 13:52:07 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+48589+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+48589+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1570551394; cv=none; d=zoho.com; s=zohoarc; b=eWfJEjNqtZIK5zDmudUmR5w8uPZx95gHD/j+TJmljk1gFshWr33aRN6c5r7zyZ3w72en9nMfDMlYDsn74Z0z/cn9v67kuAIkeP1JsfHNhDnhupfpwuw6m45wvnOBx0w17ihg7UUJfzm6UGFTz3ZtrAzxAaJnolm4kzuSNwMl1JE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1570551394; h=Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:Message-ID:Reply-To:References:Sender:Subject:To; bh=nfMFBbA9XaLvrdgqLHiEDLvC4AUIqjSqtvhgzVKwLzs=; b=FctcXl/3s0WBcfkCfziX/inAuKkA5Odb+P12M0eNka4SSqDb5B6FGUwqpnmggriBZUIq1hGJfJGMRUmrw53Mx8RDoPdlMsLtQXafiEpvHqIc67UV1Py64G3ZIQi1KbpJmO/bg4DX+EFbtu9UDhqJx1l4qMRnvhiLE19qR6upJps= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+48589+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1570551394813508.053188674112; Tue, 8 Oct 2019 09:16:34 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id I95OYY1788612xhp6dEhkWPP; Tue, 08 Oct 2019 09:16:33 -0700 X-Received: from mga06.intel.com (mga06.intel.com []) by groups.io with SMTP; Tue, 08 Oct 2019 09:16:33 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 08 Oct 2019 09:16:32 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.67,270,1566889200"; d="scan'208";a="393392973" X-Received: from mrabeda-mobl.ger.corp.intel.com ([10.102.8.43]) by fmsmga005.fm.intel.com with ESMTP; 08 Oct 2019 09:16:31 -0700 From: "Rabeda, Maciej" To: devel@edk2.groups.io Cc: Siyuan Fu , Jiaxin Wu Subject: [edk2-devel] [PATCH v1 1/1] NetworkPkg/SnpDxe: Remove ExitBootServices event Date: Tue, 8 Oct 2019 18:16:29 +0200 Message-Id: <20191008161629.14668-2-maciej.rabeda@intel.com> In-Reply-To: <20191008161629.14668-1-maciej.rabeda@intel.com> References: <20191008161629.14668-1-maciej.rabeda@intel.com> Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,maciej.rabeda@intel.com X-Gm-Message-State: zScxsse57hL5Gwg1rycrPp3ax1787277AA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1570551393; bh=3ayN7moNIP34gmKe7N0rcUfAvX5ByC9H1NFIhAAHaak=; h=Cc:Date:From:Reply-To:Subject:To; b=tGN69B3M1Ywz3VRU79SlrYxeQFkBm4I7LMGUbSllG9hI/+R2MK5L8wqLD7tj/m4v0kt EhDQse+K4XUBpDXTKn1YigDnBw+Rx2Zpk3hZnKkcqSAYwvFITI9X/lD0AIodUqNz0le7j IIQw8lPBDlQ0K/4LF8furLB4KwkipObT1Fw= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Patch addresses Bugzilla #1972. During ExitBootServices stage, drivers should not call any functions known to use Memory Allocation Services. One of such functions (as per UEFI spec) is UNDI->Shutdown(). Since UNDI drivers during ExitBootServices phase are expected to put the adapter to such a state that it will not perform any DMA operations, there is no need to interface UNDI by SNP driver during that phase. Finally, since ExitBootServices event notification function in SNP only calls UNDI->Shutdown() and Stop() functions, there is no need to create this event at all. Signed-off-by: Maciej Rabeda Cc: Siyuan Fu Cc: Jiaxin Wu --- NetworkPkg/SnpDxe/Snp.c | 45 -------------------- NetworkPkg/SnpDxe/Snp.h | 2 - NetworkPkg/SnpDxe/SnpDxe.inf | 3 -- 3 files changed, 50 deletions(-) diff --git a/NetworkPkg/SnpDxe/Snp.c b/NetworkPkg/SnpDxe/Snp.c index a23af05078bc..7646a3ce0293 100644 --- a/NetworkPkg/SnpDxe/Snp.c +++ b/NetworkPkg/SnpDxe/Snp.c @@ -8,31 +8,6 @@ SPDX-License-Identifier: BSD-2-Clause-Patent =20 #include "Snp.h" =20 -/** - One notified function to stop UNDI device when gBS->ExitBootServices() c= alled. - - @param Event Pointer to this event - @param Context Event handler private data - -**/ -VOID -EFIAPI -SnpNotifyExitBootServices ( - EFI_EVENT Event, - VOID *Context - ) -{ - SNP_DRIVER *Snp; - - Snp =3D (SNP_DRIVER *)Context; - - // - // Shutdown and stop UNDI driver - // - PxeShutdown (Snp); - PxeStop (Snp); -} - /** Send command to UNDI. It does nothing currently. =20 @@ -647,21 +622,6 @@ SimpleNetworkDriverStart ( PxeShutdown (Snp); PxeStop (Snp); =20 - // - // Create EXIT_BOOT_SERIVES Event - // - Status =3D gBS->CreateEventEx ( - EVT_NOTIFY_SIGNAL, - TPL_NOTIFY, - SnpNotifyExitBootServices, - Snp, - &gEfiEventExitBootServicesGuid, - &Snp->ExitBootServicesEvent - ); - if (EFI_ERROR (Status)) { - goto Error_DeleteSNP; - } - // // add SNP to the undi handle // @@ -778,11 +738,6 @@ SimpleNetworkDriverStop ( return Status; } =20 - // - // Close EXIT_BOOT_SERIVES Event - // - gBS->CloseEvent (Snp->ExitBootServicesEvent); - Status =3D gBS->CloseProtocol ( Controller, &gEfiNetworkInterfaceIdentifierProtocolGuid_31, diff --git a/NetworkPkg/SnpDxe/Snp.h b/NetworkPkg/SnpDxe/Snp.h index e6b62930397d..f83a4f075adc 100644 --- a/NetworkPkg/SnpDxe/Snp.h +++ b/NetworkPkg/SnpDxe/Snp.h @@ -120,8 +120,6 @@ typedef struct { VOID *MapCookie; } MapList[MAX_MAP_LENGTH]; =20 - EFI_EVENT ExitBootServicesEvent; - // // Whether UNDI support reporting media status from GET_STATUS command, // i.e. PXE_STATFLAGS_GET_STATUS_NO_MEDIA_SUPPORTED or diff --git a/NetworkPkg/SnpDxe/SnpDxe.inf b/NetworkPkg/SnpDxe/SnpDxe.inf index afeb1526cc10..8d045cfcf4ca 100644 --- a/NetworkPkg/SnpDxe/SnpDxe.inf +++ b/NetworkPkg/SnpDxe/SnpDxe.inf @@ -64,9 +64,6 @@ DebugLib NetLib =20 -[Guids] - gEfiEventExitBootServicesGuid ## SOMETIMES_CONSUMES ## E= vent - [Protocols] gEfiSimpleNetworkProtocolGuid ## BY_START gEfiDevicePathProtocolGuid ## TO_START --=20 2.17.0.windows.1 -------------------------------------------------------------------- Intel Technology Poland sp. z o.o. ul. Slowackiego 173 | 80-298 Gdansk | Sad Rejonowy Gdansk Polnoc | VII Wydz= ial Gospodarczy Krajowego Rejestru Sadowego - KRS 101882 | NIP 957-07-52-31= 6 | Kapital zakladowy 200.000 PLN. Ta wiadomosc wraz z zalacznikami jest przeznaczona dla okreslonego adresata= i moze zawierac informacje poufne. W razie przypadkowego otrzymania tej wi= adomosci, prosimy o powiadomienie nadawcy oraz trwale jej usuniecie; jakiek= olwiek przegladanie lub rozpowszechnianie jest zabronione. This e-mail and any attachments may contain confidential material for the s= ole use of the intended recipient(s). If you are not the intended recipient= , please contact the sender and delete all copies; any review or distributi= on by others is strictly prohibited. -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#48589): https://edk2.groups.io/g/devel/message/48589 Mute This Topic: https://groups.io/mt/34444145/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-