From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.43; helo=mga05.intel.com; envelope-from=michael.d.kinney@intel.com; receiver=edk2-devel@lists.01.org Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 8896720359A8B for ; Thu, 9 Nov 2017 09:37:50 -0800 (PST) Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga105.fm.intel.com with ESMTP; 09 Nov 2017 09:41:51 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.44,370,1505804400"; d="scan'208";a="174388510" Received: from orsmsx103.amr.corp.intel.com ([10.22.225.130]) by fmsmga006.fm.intel.com with ESMTP; 09 Nov 2017 09:41:51 -0800 Received: from orsmsx113.amr.corp.intel.com ([169.254.9.80]) by ORSMSX103.amr.corp.intel.com ([169.254.5.89]) with mapi id 14.03.0319.002; Thu, 9 Nov 2017 09:41:51 -0800 From: "Kinney, Michael D" To: "Zeng, Star" , "edk2-devel@lists.01.org" , "Kinney, Michael D" CC: "Dong, Eric" Thread-Topic: [Patch] MdeModulePkg/Core/Dxe: Remove extra connects for UEFI Applications Thread-Index: AQHTWVwIbu5AM0HoUEuSHbv96l/jhqMMULRQ Date: Thu, 9 Nov 2017 17:41:50 +0000 Message-ID: References: <20171108175447.21220-1-michael.d.kinney@intel.com> <0C09AFA07DD0434D9E2A0C6AEB0483103B9B3AB7@shsmsx102.ccr.corp.intel.com> In-Reply-To: <0C09AFA07DD0434D9E2A0C6AEB0483103B9B3AB7@shsmsx102.ccr.corp.intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ctpclassification: CTP_IC x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiZGMyODE1ZjEtNGJmNC00ZTA5LWI2ZjMtMmM0OTRlOGEzOWNkIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjIuNS4xOCIsIlRydXN0ZWRMYWJlbEhhc2giOiIyNTBxMk8yNytmYXlxWjNxUjFHVFRuUkFDcXpGaEFSM2pNVzZyXC8xcUs2OXVLb1czU09oUGRNT2VaZmt2czZ1aCJ9 dlp-product: dlpe-windows dlp-version: 11.0.0.116 dlp-reaction: no-action x-originating-ip: [10.22.254.138] MIME-Version: 1.0 Subject: Re: [Patch] MdeModulePkg/Core/Dxe: Remove extra connects for UEFI Applications X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Nov 2017 17:37:50 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Star, Thanks for noticing the inconsistency. I agree that Image->Type is a better choice. Mike > -----Original Message----- > From: Zeng, Star > Sent: Thursday, November 9, 2017 5:10 AM > To: Kinney, Michael D ; > edk2-devel@lists.01.org > Cc: Dong, Eric ; Zeng, Star > > Subject: RE: [Patch] MdeModulePkg/Core/Dxe: Remove > extra connects for UEFI Applications >=20 > Reviewed-by: Star Zeng >=20 > BTW: I see the code is using Image- > >ImageContext.ImageType at some places and Image->Type > at other place, it seems a little inconsistent. >=20 > Thanks, > Star > -----Original Message----- > From: Kinney, Michael D > Sent: Thursday, November 9, 2017 1:55 AM > To: edk2-devel@lists.01.org > Cc: Zeng, Star ; Dong, Eric > > Subject: [Patch] MdeModulePkg/Core/Dxe: Remove extra > connects for UEFI Applications >=20 > https://bugzilla.tianocore.org/show_bug.cgi?id=3D765 >=20 > The UEFI Specification Boot Services chapter, > StartImage() service, > EFF 1.10 Extension requires extra calls to > ConnectController() > if a UEFI Driver produces handles. The DXE Core is > performing these > extra calls to ConnectController() without evaluating > the ImageType. >=20 > A filter is added to not make extra calls to > ConnectController() > if the ImageType is > EFI_IMAGE_SUBSYSTEM_EFI_APPLICATION. >=20 > Without this filter, extra calls to ConnectController() > may be > performed by UEFI Applications or a UEFI Shell > Applications that > also call ConnectController(). >=20 > Cc: Star Zeng > Cc: Eric Dong > Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by: Michael D Kinney > > --- > MdeModulePkg/Core/Dxe/Image/Image.c | 12 ++++++++++-- > 1 file changed, 10 insertions(+), 2 deletions(-) >=20 > diff --git a/MdeModulePkg/Core/Dxe/Image/Image.c > b/MdeModulePkg/Core/Dxe/Image/Image.c > index 4e22aa6dc7..c6b8ff44b9 100644 > --- a/MdeModulePkg/Core/Dxe/Image/Image.c > +++ b/MdeModulePkg/Core/Dxe/Image/Image.c > @@ -1703,9 +1703,17 @@ CoreStartImage ( > mCurrentImage =3D LastImage; >=20 > // > - // Go connect any handles that were created or > modified while the image executed. > + // UEFI Specification - StartImage() - EFI 1.10 > Extension > + // To maintain compatibility with UEFI drivers that > are written to the EFI > + // 1.02 Specification, StartImage() must monitor the > handle database before > + // and after each image is started. If any handles > are created or modified > + // when an image is started, then > EFI_BOOT_SERVICES.ConnectController() must > + // be called with the Recursive parameter set to > TRUE for each of the newly > + // created or modified handles before StartImage() > returns. > // > - CoreConnectHandlesByKey (HandleDatabaseKey); > + if (Image->ImageContext.ImageType !=3D > EFI_IMAGE_SUBSYSTEM_EFI_APPLICATION) { > + CoreConnectHandlesByKey (HandleDatabaseKey); > + } >=20 > // > // Handle the image's returned ExitData > -- > 2.14.2.windows.3