public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Zeng, Star" <star.zeng@intel.com>
To: "Kinney, Michael D" <michael.d.kinney@intel.com>,
	"edk2-devel@lists.01.org" <edk2-devel@lists.01.org>
Cc: "Zeng, Star" <star.zeng@intel.com>
Subject: Re: [staging/FmpDevicePkg-master][PATCH 2/2] FmpDevicePkg FmpDxe: Use Attributes to know whether reset is required
Date: Fri, 20 Jul 2018 07:10:33 +0000	[thread overview]
Message-ID: <0C09AFA07DD0434D9E2A0C6AEB0483103BB86625@shsmsx102.ccr.corp.intel.com> (raw)
In-Reply-To: <E92EE9817A31E24EB0585FDF735412F5B8A99197@ORSMSX113.amr.corp.intel.com>

Oh, you are right. The flag mDescriptorPopulated means populated or not, but not populating needed or not.

Will send new patch soon.

Thanks,
Star
-----Original Message-----
From: Kinney, Michael D 
Sent: Friday, July 20, 2018 3:02 PM
To: Zeng, Star <star.zeng@intel.com>; edk2-devel@lists.01.org; Kinney, Michael D <michael.d.kinney@intel.com>
Cc: Zeng, Star <star.zeng@intel.com>
Subject: RE: [edk2] [staging/FmpDevicePkg-master][PATCH 2/2] FmpDevicePkg FmpDxe: 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 != 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 <michael.d.kinney@intel.com>; Zeng, Star 
> <star.zeng@intel.com>
> Subject: [edk2] [staging/FmpDevicePkg-master][PATCH 2/2] FmpDevicePkg 
> FmpDxe: Use Attributes to know whether reset is required
> 
> Use Attributes to know whether reset is required and remove 
> PcdFmpDeviceSystemResetRequired.
> 
> Cc: Michael D Kinney <michael.d.kinney@intel.com>
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Star Zeng <star.zeng@intel.com>
> ---
>  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(-)
> 
> diff --git a/FmpDevicePkg/FmpDevicePkg.dec 
> b/FmpDevicePkg/FmpDevicePkg.dec index 9ea0d7335901..ad0730a53263 
> 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.<BR><BR>
> -  #   TRUE  - System reset is required.<BR>
> -  #   FALSE - System reset is not required.<BR>
> -  # @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 
> 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 da31d0ac816a..fed1da48026e 
> 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_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 
> effect.<BR><BR>\n"
> -
> "TRUE  - System reset is required.<BR>\n"
> -
> "FALSE - System reset is not required.<BR>"
> -
>  #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"
> 
> "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 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;
> 
>    Status             = EFI_SUCCESS;
>    Updateable         = 0;
> @@ -1110,9 +1112,11 @@ 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
> system reboot
>    //
> -  if (!PcdGetBool (PcdFmpDeviceSystemResetRequired)) {
> +  FmpDeviceGetAttributes (&AttributesSupported,
> &AttributesSetting);
> +  if (((AttributesSupported &
> IMAGE_ATTRIBUTE_RESET_REQUIRED) != 0) &&
> +      ((AttributesSetting &
> IMAGE_ATTRIBUTE_RESET_REQUIRED) != 0)) {
>      mDescriptorPopulated = FALSE;
>    }
> 
> diff --git a/FmpDevicePkg/FmpDxe/FmpDxe.inf 
> b/FmpDevicePkg/FmpDxe/FmpDxe.inf index 256c50bf0316..a5817f0a0dd0 
> 100644
> --- a/FmpDevicePkg/FmpDxe/FmpDxe.inf
> +++ b/FmpDevicePkg/FmpDxe/FmpDxe.inf
> @@ -76,7 +76,6 @@ [Protocols]
>    gEdkiiFirmwareManagementProgressProtocolGuid  ## PRODUCES
> 
>  [Pcd]
> -
> gFmpDevicePkgTokenSpaceGuid.PcdFmpDeviceSystemResetRequire
> d              ## CONSUMES
>    gFmpDevicePkgTokenSpaceGuid.PcdFmpDeviceImageIdName
> ## CONSUMES
> 
> 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
> 
>  [Pcd]
> -
> gFmpDevicePkgTokenSpaceGuid.PcdFmpDeviceSystemResetRequire
> d              ## CONSUMES
>    gFmpDevicePkgTokenSpaceGuid.PcdFmpDeviceImageIdName
> ## CONSUMES
> 
> gFmpDevicePkgTokenSpaceGuid.PcdFmpDeviceBuildTimeLowestSup
> portedVersion  ## CONSUMES
>    gFmpDevicePkgTokenSpaceGuid.PcdFmpDeviceLockEventGuid
> ## CONSUMES
> --
> 2.7.0.windows.1
> 
> _______________________________________________
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel


      reply	other threads:[~2018-07-20  7:12 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-20  6:55 [staging/FmpDevicePkg-master][PATCH 0/2] Remove PcdFmpDeviceSystemResetRequired Star Zeng
2018-07-20  6:55 ` [staging/FmpDevicePkg-master][PATCH 1/2] Remove PcdFmpDeviceSystemResetRequired from platform and Readme Star Zeng
2018-07-20  6:55 ` [staging/FmpDevicePkg-master][PATCH 2/2] FmpDevicePkg FmpDxe: Use Attributes to know whether reset is required Star Zeng
2018-07-20  7:02   ` Kinney, Michael D
2018-07-20  7:10     ` Zeng, Star [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0C09AFA07DD0434D9E2A0C6AEB0483103BB86625@shsmsx102.ccr.corp.intel.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox