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.88; helo=mga01.intel.com; envelope-from=star.zeng@intel.com; receiver=edk2-devel@lists.01.org Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) (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 5AD8321B02845 for ; Fri, 20 Jul 2018 00:12:47 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 20 Jul 2018 00:12:46 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,377,1526367600"; d="scan'208";a="68650013" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by fmsmga002.fm.intel.com with ESMTP; 20 Jul 2018 00:10:37 -0700 Received: from fmsmsx120.amr.corp.intel.com (10.18.124.208) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.319.2; Fri, 20 Jul 2018 00:10:37 -0700 Received: from shsmsx104.ccr.corp.intel.com (10.239.4.70) by fmsmsx120.amr.corp.intel.com (10.18.124.208) with Microsoft SMTP Server (TLS) id 14.3.319.2; Fri, 20 Jul 2018 00:10:36 -0700 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.124]) by SHSMSX104.ccr.corp.intel.com ([169.254.5.81]) with mapi id 14.03.0319.002; Fri, 20 Jul 2018 15:10:34 +0800 From: "Zeng, Star" To: "Kinney, Michael D" , "edk2-devel@lists.01.org" CC: "Zeng, Star" Thread-Topic: [edk2] [staging/FmpDevicePkg-master][PATCH 2/2] FmpDevicePkg FmpDxe: Use Attributes to know whether reset is required Thread-Index: AQHUH/apWEmuk+0KsEybMoYBZ3dinqSXKROAgACH/5A= Date: Fri, 20 Jul 2018 07:10:33 +0000 Message-ID: <0C09AFA07DD0434D9E2A0C6AEB0483103BB86625@shsmsx102.ccr.corp.intel.com> References: <1532069710-32608-1-git-send-email-star.zeng@intel.com> <1532069710-32608-3-git-send-email-star.zeng@intel.com> In-Reply-To: Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [staging/FmpDevicePkg-master][PATCH 2/2] FmpDevicePkg FmpDxe: Use Attributes to know whether reset is required X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Jul 2018 07:12:48 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Oh, you are right. The flag mDescriptorPopulated means populated or not, bu= t not populating needed or not. Will send new patch soon. Thanks, Star -----Original Message----- From: Kinney, Michael D=20 Sent: Friday, July 20, 2018 3:02 PM To: Zeng, Star ; edk2-devel@lists.01.org; Kinney, Mich= ael D Cc: Zeng, Star Subject: RE: [edk2] [staging/FmpDevicePkg-master][PATCH 2/2] FmpDevicePkg F= mpDxe: Use Attributes to know whether reset is required Star, I think the logic may be reversed. The original logic tested !Pcd value. The new logic checks if the attribute and setting are !=3D 0. I think it should check if the attribute and setting are 0. Mike > -----Original Message----- > From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] > On Behalf Of Star Zeng > Sent: Thursday, July 19, 2018 11:55 PM > To: edk2-devel@lists.01.org > Cc: Kinney, Michael D ; Zeng, Star=20 > > Subject: [edk2] [staging/FmpDevicePkg-master][PATCH 2/2] FmpDevicePkg=20 > FmpDxe: Use Attributes to know whether reset is required >=20 > Use Attributes to know whether reset is required and remove=20 > PcdFmpDeviceSystemResetRequired. >=20 > Cc: Michael D Kinney > Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by: Star Zeng > --- > FmpDevicePkg/FmpDevicePkg.dec | 7 ------- > FmpDevicePkg/FmpDevicePkg.uni | 5 ----- > FmpDevicePkg/FmpDxe/FmpDxe.c | 8 ++++++-- > FmpDevicePkg/FmpDxe/FmpDxe.inf | 1 - > FmpDevicePkg/FmpDxe/FmpDxeLib.inf | 1 - > 5 files changed, 6 insertions(+), 16 deletions(-) >=20 > diff --git a/FmpDevicePkg/FmpDevicePkg.dec=20 > b/FmpDevicePkg/FmpDevicePkg.dec index 9ea0d7335901..ad0730a53263=20 > 100644 > --- a/FmpDevicePkg/FmpDevicePkg.dec > +++ b/FmpDevicePkg/FmpDevicePkg.dec > @@ -62,13 +62,6 @@ [Guids] > gFmpDevicePkgTokenSpaceGuid =3D { 0x40b2d964, 0xfe11, 0x40dc, { 0x82,= =20 > 0x83, 0x2e, 0xfb, 0xda, 0x29, 0x53, 0x56 } } >=20 > [PcdsFixedAtBuild] > - ## Indicates if a full system reset is required before a firmware=20 > update to a > - # firmware devices takes effect.

> - # TRUE - System reset is required.
> - # FALSE - System reset is not required.
> - # @Prompt FMP Device System Reset Required. > - > gFmpDevicePkgTokenSpaceGuid.PcdFmpDeviceSystemResetRequire > d|TRUE|BOOLEAN|0x40000008 > - > ## The SHA-256 hash of a PKCS7 test key that is used to detect if a=20 > test key > # is being used to authenticate capsules. Test key detection is=20 > disabled by > # setting the value to {0}. > diff --git a/FmpDevicePkg/FmpDevicePkg.uni=20 > b/FmpDevicePkg/FmpDevicePkg.uni index da31d0ac816a..fed1da48026e=20 > 100644 > --- a/FmpDevicePkg/FmpDevicePkg.uni > +++ b/FmpDevicePkg/FmpDevicePkg.uni > @@ -22,11 +22,6 @@ >=20 > #string STR_PACKAGE_DESCRIPTION #language en-US "This package=20 > provides libraries that support the implementation of a module that=20 > produces the Firmware Management Protocol to support the update of a=20 > system firmware component." >=20 > -#string > STR_gFmpDevicePkgTokenSpaceGuid_PcdFmpDeviceSystemResetReq > uired_PROMPT #language en-US "FMP Device System Reset Required." > -#string > STR_gFmpDevicePkgTokenSpaceGuid_PcdFmpDeviceSystemResetReq > uired_HELP #language en-US "Indicates if a full system > reset is required before a firmware update to a firmware device takes=20 > effect.

\n" > - > "TRUE - System reset is required.
\n" > - > "FALSE - System reset is not required.
" > - > #string > STR_gFmpDevicePkgTokenSpaceGuid_PcdFmpDeviceTestKeySha256D > igest_PROMPT #language en-US "SHA-256 hash of PKCS7 test key." > #string > STR_gFmpDevicePkgTokenSpaceGuid_PcdFmpDeviceTestKeySha256D > igest_HELP #language en-US "The SHA-256 hash of a PKCS7 > test key that is used to detect if a test key" >=20 > "is being used to authenticate capsules. Test key detection can be=20 > disabled" > diff --git a/FmpDevicePkg/FmpDxe/FmpDxe.c=20 > b/FmpDevicePkg/FmpDxe/FmpDxe.c index 091f950b95b2..8fe459405c28 100644 > --- a/FmpDevicePkg/FmpDxe/FmpDxe.c > +++ b/FmpDevicePkg/FmpDxe/FmpDxe.c > @@ -898,6 +898,8 @@ SetTheImage ( > UINT32 AllHeaderSize; > UINT32 IncommingFwVersion; > UINT32 LastAttemptStatus; > + UINT64 AttributesSupported; > + UINT64 AttributesSetting; >=20 > Status =3D EFI_SUCCESS; > Updateable =3D 0; > @@ -1110,9 +1112,11 @@ SetTheImage ( >=20 > // > // Set flag so the descriptor is repopulated > - // This only applied to devices that do not require system reboot > + // This is only applied to devices that do not require > system reboot > // > - if (!PcdGetBool (PcdFmpDeviceSystemResetRequired)) { > + FmpDeviceGetAttributes (&AttributesSupported, > &AttributesSetting); > + if (((AttributesSupported & > IMAGE_ATTRIBUTE_RESET_REQUIRED) !=3D 0) && > + ((AttributesSetting & > IMAGE_ATTRIBUTE_RESET_REQUIRED) !=3D 0)) { > mDescriptorPopulated =3D FALSE; > } >=20 > diff --git a/FmpDevicePkg/FmpDxe/FmpDxe.inf=20 > b/FmpDevicePkg/FmpDxe/FmpDxe.inf index 256c50bf0316..a5817f0a0dd0=20 > 100644 > --- a/FmpDevicePkg/FmpDxe/FmpDxe.inf > +++ b/FmpDevicePkg/FmpDxe/FmpDxe.inf > @@ -76,7 +76,6 @@ [Protocols] > gEdkiiFirmwareManagementProgressProtocolGuid ## PRODUCES >=20 > [Pcd] > - > gFmpDevicePkgTokenSpaceGuid.PcdFmpDeviceSystemResetRequire > d ## CONSUMES > gFmpDevicePkgTokenSpaceGuid.PcdFmpDeviceImageIdName > ## CONSUMES >=20 > gFmpDevicePkgTokenSpaceGuid.PcdFmpDeviceBuildTimeLowestSup > portedVersion ## CONSUMES > gFmpDevicePkgTokenSpaceGuid.PcdFmpDeviceLockEventGuid > ## CONSUMES > diff --git a/FmpDevicePkg/FmpDxe/FmpDxeLib.inf > b/FmpDevicePkg/FmpDxe/FmpDxeLib.inf > index c8fe49e0c0d7..a011dcf4f2a0 100644 > --- a/FmpDevicePkg/FmpDxe/FmpDxeLib.inf > +++ b/FmpDevicePkg/FmpDxe/FmpDxeLib.inf > @@ -76,7 +76,6 @@ [Protocols] > gEdkiiFirmwareManagementProgressProtocolGuid ## PRODUCES >=20 > [Pcd] > - > gFmpDevicePkgTokenSpaceGuid.PcdFmpDeviceSystemResetRequire > d ## CONSUMES > gFmpDevicePkgTokenSpaceGuid.PcdFmpDeviceImageIdName > ## CONSUMES >=20 > gFmpDevicePkgTokenSpaceGuid.PcdFmpDeviceBuildTimeLowestSup > portedVersion ## CONSUMES > gFmpDevicePkgTokenSpaceGuid.PcdFmpDeviceLockEventGuid > ## CONSUMES > -- > 2.7.0.windows.1 >=20 > _______________________________________________ > edk2-devel mailing list > edk2-devel@lists.01.org > https://lists.01.org/mailman/listinfo/edk2-devel