From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 134.134.136.65, mailfrom: ray.ni@intel.com) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by groups.io with SMTP; Tue, 17 Sep 2019 13:17:15 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 17 Sep 2019 13:17:15 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,518,1559545200"; d="scan'208";a="387684080" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by fmsmga006.fm.intel.com with ESMTP; 17 Sep 2019 13:17:15 -0700 Received: from fmsmsx114.amr.corp.intel.com (10.18.116.8) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 17 Sep 2019 13:17:14 -0700 Received: from shsmsx108.ccr.corp.intel.com (10.239.4.97) by FMSMSX114.amr.corp.intel.com (10.18.116.8) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 17 Sep 2019 13:17:14 -0700 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.32]) by SHSMSX108.ccr.corp.intel.com ([169.254.8.146]) with mapi id 14.03.0439.000; Wed, 18 Sep 2019 04:17:12 +0800 From: "Ni, Ray" To: Laszlo Ersek , edk2-devel-groups-io CC: "Wu, Hao A" , "Wang, Jian J" , "Gao, Liming" , "Gao, Zhichao" Subject: Re: [PATCH 09/35] MdeModulePkg: stop abusing EFI_EVENT for protocol notify registration Thread-Topic: [PATCH 09/35] MdeModulePkg: stop abusing EFI_EVENT for protocol notify registration Thread-Index: AQHVbZEbv5adfdMd00yxfWSfHSzAI6cwTmZA Date: Tue, 17 Sep 2019 20:17:11 +0000 Deferred-Delivery: Tue, 17 Sep 2019 20:17:00 +0000 Message-ID: <734D49CCEBEEF84792F5B80ED585239D5C2E3D43@SHSMSX104.ccr.corp.intel.com> References: <20190917194935.24322-1-lersek@redhat.com> <20190917194935.24322-10-lersek@redhat.com> In-Reply-To: <20190917194935.24322-10-lersek@redhat.com> Accept-Language: en-US, zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiMzcxMTZiMzUtNWNmZi00OGJmLTkxNTYtZmEyMWE1YjlkMjMwIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiSHUwUkxIRkhaSkxZVWNDbmlIZ2owZHJQOVpLS2lCY1B4Uk84b09KXC9LTzgzTzRLaHJHVGtOMGIzcmwzQTZNRTMifQ== x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.2.0.6 dlp-reaction: no-action x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Return-Path: ray.ni@intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Ray Ni > -----Original Message----- > From: Laszlo Ersek > Sent: Tuesday, September 17, 2019 12:49 PM > To: edk2-devel-groups-io > Cc: Wu, Hao A ; Wang, Jian J ;= Gao, Liming ; Ni, Ray > ; Gao, Zhichao > Subject: [PATCH 09/35] MdeModulePkg: stop abusing EFI_EVENT for protocol = notify registration >=20 > EfiCreateProtocolNotifyEvent() takes a (VOID**) for "Registration", > similarly to gBS->RegisterProtocolNotify(). We should pass the address of > an actual pointer-to-VOID, and not the address of an EFI_EVENT. EFI_EVENT > just happens to be specified as (VOID*), and has nothing to do with the > registration. >=20 > The same applies to gMmst->MmRegisterProtocolNotify(). >=20 > "mFtwRegistration", "mFvRegistration", and "mFvbRegistration" are used fo= r > nothing else. >=20 > This change is a no-op in practice; it's a semantic improvement. >=20 > Cc: Hao A Wu > Cc: Jian J Wang > Cc: Liming Gao > Cc: Ray Ni > Cc: Zhichao Gao > Signed-off-by: Laszlo Ersek > --- >=20 > Notes: > lightly tested, as these modules (except LoadFileOnFv2) are part of t= he > ArmVirt and/or OVMF platforms >=20 > MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteDxe.c | 2= +- > MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteSmm.c | 2= +- > MdeModulePkg/Universal/LoadFileOnFv2/LoadFileOnFv2.c | 2= +- > MdeModulePkg/Universal/Variable/RuntimeDxe/VariableDxe.c | 2= +- > 4 files changed, 4 insertions(+), 4 deletions(-) >=20 > diff --git a/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWr= iteDxe.c > b/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteDxe.c > index ae8f117905cd..de38ea028af1 100644 > --- a/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteDxe.= c > +++ b/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteDxe.= c > @@ -47,7 +47,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent >=20 > #include > #include "FaultTolerantWrite.h" > -EFI_EVENT mFvbRegistration =3D NULL; > +VOID *mFvbRegistration =3D NULL; >=20 >=20 > /** > diff --git a/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWr= iteSmm.c > b/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteSmm.c > index e8e935a85b5b..9612b394865b 100644 > --- a/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteSmm.= c > +++ b/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteSmm.= c > @@ -56,7 +56,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent > #include "FaultTolerantWriteSmmCommon.h" > #include >=20 > -EFI_EVENT mFvbRegistration =3D NULL; > +VOID *mFvbRegistration =3D NULL; > EFI_FTW_DEVICE *mFtwDevice =3D NULL; >=20 > /// > diff --git a/MdeModulePkg/Universal/LoadFileOnFv2/LoadFileOnFv2.c > b/MdeModulePkg/Universal/LoadFileOnFv2/LoadFileOnFv2.c > index 4af2da05e145..43fa6ce12875 100644 > --- a/MdeModulePkg/Universal/LoadFileOnFv2/LoadFileOnFv2.c > +++ b/MdeModulePkg/Universal/LoadFileOnFv2/LoadFileOnFv2.c > @@ -36,7 +36,7 @@ typedef struct { > #define LOAD_FILE_ON_FV2_PRIVATE_DATA_FROM_THIS(a) CR (a, LOAD_FILE_ON_F= V2_PRIVATE_DATA, LoadFile, > LOAD_FILE_ON_FV2_PRIVATE_DATA_SIGNATURE) > #define LOAD_FILE_ON_FV2_PRIVATE_DATA_FROM_LINK(a) CR (a, LOAD_FILE_ON_F= V2_PRIVATE_DATA, Link, > LOAD_FILE_ON_FV2_PRIVATE_DATA_SIGNATURE) >=20 > -EFI_EVENT mFvRegistration; > +VOID *mFvRegistration; > LIST_ENTRY mPrivateDataList; >=20 > /** > diff --git a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableDxe.c > b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableDxe.c > index 3d232bb36cb4..7d2b6c8e1fad 100644 > --- a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableDxe.c > +++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableDxe.c > @@ -13,7 +13,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent >=20 > EFI_HANDLE mHandle =3D NULL; > EFI_EVENT mVirtualAddressChangeEvent =3D NULL; > -EFI_EVENT mFtwRegistration =3D NULL; > +VOID *mFtwRegistration =3D NULL; > VOID ***mVarCheckAddressPointer =3D NULL; > UINTN mVarCheckAddressPointerCount =3D 0; > EDKII_VARIABLE_LOCK_PROTOCOL mVariableLock =3D { Var= iableLockRequestToLock }; > -- > 2.19.1.3.g30247aa5d201 >=20