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.136; helo=mga12.intel.com; envelope-from=michael.d.kinney@intel.com; receiver=edk2-devel@lists.01.org Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) (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 0F662210D5151 for ; Wed, 1 Aug 2018 16:29:33 -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 fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 01 Aug 2018 16:29:32 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,433,1526367600"; d="scan'208";a="72579787" Received: from mdkinney-mobl2.amr.corp.intel.com ([10.241.98.38]) by fmsmga002.fm.intel.com with ESMTP; 01 Aug 2018 16:29:32 -0700 From: "Kinney, Michael D" To: edk2-devel@lists.01.org Cc: Star Zeng , Michael D Kinney Date: Wed, 1 Aug 2018 16:29:15 -0700 Message-Id: <20180801232923.18720-16-michael.d.kinney@intel.com> X-Mailer: git-send-email 2.14.2.windows.3 In-Reply-To: <20180801232923.18720-1-michael.d.kinney@intel.com> References: <20180801232923.18720-1-michael.d.kinney@intel.com> Subject: [Patch v6 15/23] 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: Wed, 01 Aug 2018 23:29:33 -0000 From: Star Zeng REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1040 Use Attributes to know whether reset is required and remove PcdFmpDeviceSystemResetRequired. Cc: Michael D Kinney Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Star Zeng Reviewed-by: Michael D Kinney --- FmpDevicePkg/FmpDevicePkg.dec | 7 ------- FmpDevicePkg/FmpDevicePkg.uni | 5 ----- FmpDevicePkg/FmpDxe/FmpDxe.c | 13 ++++++++++--- FmpDevicePkg/FmpDxe/FmpDxe.inf | 1 - FmpDevicePkg/FmpDxe/FmpDxeLib.inf | 1 - 5 files changed, 10 insertions(+), 17 deletions(-) diff --git a/FmpDevicePkg/FmpDevicePkg.dec b/FmpDevicePkg/FmpDevicePkg.dec index 9ea0d73359..ad0730a532 100644 --- a/FmpDevicePkg/FmpDevicePkg.dec +++ b/FmpDevicePkg/FmpDevicePkg.dec @@ -62,13 +62,6 @@ [Guids] gFmpDevicePkgTokenSpaceGuid = { 0x40b2d964, 0xfe11, 0x40dc, { 0x82, 0x83, 0x2e, 0xfb, 0xda, 0x29, 0x53, 0x56 } } [PcdsFixedAtBuild] - ## Indicates if a full system reset is required before a firmware 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.PcdFmpDeviceSystemResetRequired|TRUE|BOOLEAN|0x40000008 - ## The SHA-256 hash of a PKCS7 test key that is used to detect if a test key # is being used to authenticate capsules. Test key detection is disabled by # setting the value to {0}. diff --git a/FmpDevicePkg/FmpDevicePkg.uni b/FmpDevicePkg/FmpDevicePkg.uni index da31d0ac81..fed1da4802 100644 --- a/FmpDevicePkg/FmpDevicePkg.uni +++ b/FmpDevicePkg/FmpDevicePkg.uni @@ -22,11 +22,6 @@ #string STR_PACKAGE_DESCRIPTION #language en-US "This package provides libraries that support the implementation of a module that produces the Firmware Management Protocol to support the update of a system firmware component." -#string STR_gFmpDevicePkgTokenSpaceGuid_PcdFmpDeviceSystemResetRequired_PROMPT #language en-US "FMP Device System Reset Required." -#string STR_gFmpDevicePkgTokenSpaceGuid_PcdFmpDeviceSystemResetRequired_HELP #language en-US "Indicates if a full system reset is required before a firmware update to a firmware device takes effect.

\n" - "TRUE - System reset is required.
\n" - "FALSE - System reset is not required.
" - #string STR_gFmpDevicePkgTokenSpaceGuid_PcdFmpDeviceTestKeySha256Digest_PROMPT #language en-US "SHA-256 hash of PKCS7 test key." #string STR_gFmpDevicePkgTokenSpaceGuid_PcdFmpDeviceTestKeySha256Digest_HELP #language en-US "The SHA-256 hash of a PKCS7 test key that is used to detect if a test key" "is being used to authenticate capsules. Test key detection can be disabled" diff --git a/FmpDevicePkg/FmpDxe/FmpDxe.c b/FmpDevicePkg/FmpDxe/FmpDxe.c index 94fdf56085..3544afd3de 100644 --- a/FmpDevicePkg/FmpDxe/FmpDxe.c +++ b/FmpDevicePkg/FmpDxe/FmpDxe.c @@ -898,6 +898,9 @@ SetTheImage ( UINT32 AllHeaderSize; UINT32 IncommingFwVersion; UINT32 LastAttemptStatus; + EFI_STATUS GetAttributesStatus; + UINT64 AttributesSupported; + UINT64 AttributesSetting; Status = EFI_SUCCESS; Updateable = 0; @@ -1110,10 +1113,14 @@ SetTheImage ( // // 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 reset // - if (!PcdGetBool (PcdFmpDeviceSystemResetRequired)) { - mDescriptorPopulated = FALSE; + GetAttributesStatus = FmpDeviceGetAttributes (&AttributesSupported, &AttributesSetting); + if (!EFI_ERROR (GetAttributesStatus)) { + if (((AttributesSupported & IMAGE_ATTRIBUTE_RESET_REQUIRED) == 0) || + ((AttributesSetting & IMAGE_ATTRIBUTE_RESET_REQUIRED) == 0)) { + mDescriptorPopulated = FALSE; + } } cleanup: diff --git a/FmpDevicePkg/FmpDxe/FmpDxe.inf b/FmpDevicePkg/FmpDxe/FmpDxe.inf index ec2bb2d052..228e53658a 100644 --- a/FmpDevicePkg/FmpDxe/FmpDxe.inf +++ b/FmpDevicePkg/FmpDxe/FmpDxe.inf @@ -76,7 +76,6 @@ [Protocols] gEdkiiFirmwareManagementProgressProtocolGuid ## PRODUCES [Pcd] - gFmpDevicePkgTokenSpaceGuid.PcdFmpDeviceSystemResetRequired ## CONSUMES gFmpDevicePkgTokenSpaceGuid.PcdFmpDeviceImageIdName ## CONSUMES gFmpDevicePkgTokenSpaceGuid.PcdFmpDeviceBuildTimeLowestSupportedVersion ## CONSUMES gFmpDevicePkgTokenSpaceGuid.PcdFmpDeviceLockEventGuid ## CONSUMES diff --git a/FmpDevicePkg/FmpDxe/FmpDxeLib.inf b/FmpDevicePkg/FmpDxe/FmpDxeLib.inf index 41acf45fcf..5484531155 100644 --- a/FmpDevicePkg/FmpDxe/FmpDxeLib.inf +++ b/FmpDevicePkg/FmpDxe/FmpDxeLib.inf @@ -76,7 +76,6 @@ [Protocols] gEdkiiFirmwareManagementProgressProtocolGuid ## PRODUCES [Pcd] - gFmpDevicePkgTokenSpaceGuid.PcdFmpDeviceSystemResetRequired ## CONSUMES gFmpDevicePkgTokenSpaceGuid.PcdFmpDeviceImageIdName ## CONSUMES gFmpDevicePkgTokenSpaceGuid.PcdFmpDeviceBuildTimeLowestSupportedVersion ## CONSUMES gFmpDevicePkgTokenSpaceGuid.PcdFmpDeviceLockEventGuid ## CONSUMES -- 2.14.2.windows.3