Reviewed-by: Giri P Mudusuru <[email protected]> 

> -----Original Message-----
> From: Fan, Jeff
> Sent: Friday, July 1, 2016 12:02 AM
> To: [email protected]
> Cc: Kinney, Michael D <[email protected]>; Tian, Feng
> <[email protected]>; Mudusuru, Giri P <[email protected]>
> Subject: [Patch 1/3] UefiCpuPkg/CpuMpPei: Skip microcode check/load if it
> has been loaded
> 
> Actually, there is only one microcode region in platform. If microcode has
> been
> loaded, its signature will not be zero and should be loaded successfully.
> We needn't to check microcode region and load microcode again. This update
> is to
> skip checking/loading microcode if current microcode signature is not zero.
> 
> Cc: Michael Kinney <[email protected]>
> Cc: Feng Tian <[email protected]>
> Cc: Giri P Mudusuru <[email protected]>
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Jeff Fan <[email protected]>
> ---
>  UefiCpuPkg/CpuMpPei/Microcode.c | 9 +++++++++
>  1 file changed, 9 insertions(+)
> 
> diff --git a/UefiCpuPkg/CpuMpPei/Microcode.c
> b/UefiCpuPkg/CpuMpPei/Microcode.c
> index 9dcbf99..8e7f3b0 100644
> --- a/UefiCpuPkg/CpuMpPei/Microcode.c
> +++ b/UefiCpuPkg/CpuMpPei/Microcode.c
> @@ -53,6 +53,7 @@ MicrocodeDetect (
>    UINTN                                   Index;
>    UINT8                                   PlatformId;
>    UINT32                                  RegEax;
> +  UINT32                                  CurrentRevision;
>    UINT32                                  LatestRevision;
>    UINTN                                   TotalSize;
>    UINT32                                  CheckSum32;
> @@ -69,6 +70,14 @@ MicrocodeDetect (
>      return;
>    }
> 
> +  CurrentRevision = GetCurrentMicrocodeSignature ();
> +  if (CurrentRevision != 0) {
> +    //
> +    // Skip loading microcode if it has been loaded successfully
> +    //
> +    return;
> +  }
> +
>    ExtendedTableLength = 0;
>    //
>    // Here data of CPUID leafs have not been collected into context buffer, so
> --
> 2.7.4.windows.1

_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.01.org/mailman/listinfo/edk2-devel

Reply via email to