[edk2] [PATCH v2] UefiCpuPkg/MpInitLib: Fix build of Microcode

Anthony PERARD posted 1 patch 5 years, 8 months ago
Failed in applying to current master (apply log)
UefiCpuPkg/Library/MpInitLib/Microcode.c | 1 +
1 file changed, 1 insertion(+)
[edk2] [PATCH v2] UefiCpuPkg/MpInitLib: Fix build of Microcode
Posted by Anthony PERARD 5 years, 8 months ago
On Debian Jessie, this fail to build with:

/build/UefiCpuPkg/Library/MpInitLib/Microcode.c: In function 'MicrocodeDetect':
/build/UefiCpuPkg/Library/MpInitLib/Microcode.c:248:37: error: 'ProcessorFlags' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     CpuMpData->ProcessorFlags       = ProcessorFlags;
                                     ^

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
---

Notes:
    v2:
        Fix coding style.

 UefiCpuPkg/Library/MpInitLib/Microcode.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/UefiCpuPkg/Library/MpInitLib/Microcode.c b/UefiCpuPkg/Library/MpInitLib/Microcode.c
index efda143e67..cea1d34c0a 100644
--- a/UefiCpuPkg/Library/MpInitLib/Microcode.c
+++ b/UefiCpuPkg/Library/MpInitLib/Microcode.c
@@ -87,6 +87,7 @@ MicrocodeDetect (
   }
 
   ExtendedTableLength = 0;
+  ProcessorFlags = 0;
   //
   // Here data of CPUID leafs have not been collected into context buffer, so
   // GetProcessorCpuid() cannot be used here to retrieve CPUID data.
-- 
Anthony PERARD

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
Re: [edk2] [PATCH v2] UefiCpuPkg/MpInitLib: Fix build of Microcode
Posted by Laszlo Ersek 5 years, 8 months ago
Hi Anthony,

(I'm seeing your v1 and v2 postings at the same time now:)

On 07/19/18 17:52, Anthony PERARD wrote:
> On Debian Jessie, this fail to build with:
> 
> /build/UefiCpuPkg/Library/MpInitLib/Microcode.c: In function 'MicrocodeDetect':
> /build/UefiCpuPkg/Library/MpInitLib/Microcode.c:248:37: error: 'ProcessorFlags' may be used uninitialized in this function [-Werror=maybe-uninitialized]
>      CpuMpData->ProcessorFlags       = ProcessorFlags;
>                                      ^
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
> ---
> 
> Notes:
>     v2:
>         Fix coding style.
> 
>  UefiCpuPkg/Library/MpInitLib/Microcode.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/UefiCpuPkg/Library/MpInitLib/Microcode.c b/UefiCpuPkg/Library/MpInitLib/Microcode.c
> index efda143e67..cea1d34c0a 100644
> --- a/UefiCpuPkg/Library/MpInitLib/Microcode.c
> +++ b/UefiCpuPkg/Library/MpInitLib/Microcode.c
> @@ -87,6 +87,7 @@ MicrocodeDetect (
>    }
>  
>    ExtendedTableLength = 0;
> +  ProcessorFlags = 0;
>    //
>    // Here data of CPUID leafs have not been collected into context buffer, so
>    // GetProcessorCpuid() cannot be used here to retrieve CPUID data.
> 

a patch for fixing this issue is on its way to being committed (Dandan
posted it just ~10 hours before your v1). Please see the thread

  [edk2] [patch] UefiCpuPkg/MpInitLib: Fix VS2012 build failure
  http://mid.mail-archive.com/20180719045059.55868-1-dandan.bi@intel.com

I think when Liming commented on your v1, he was unaware of Dandan's
patch. And, I'm seeing your v1+v2 just now, at the same time. Sorry
about the inconvenience!

Thanks
Laszlo
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
Re: [edk2] [PATCH v2] UefiCpuPkg/MpInitLib: Fix build of Microcode
Posted by Anthony PERARD 5 years, 8 months ago
On Thu, Jul 19, 2018 at 08:32:48PM +0200, Laszlo Ersek wrote:
> a patch for fixing this issue is on its way to being committed (Dandan
> posted it just ~10 hours before your v1). Please see the thread
> 
>   [edk2] [patch] UefiCpuPkg/MpInitLib: Fix VS2012 build failure
>   http://mid.mail-archive.com/20180719045059.55868-1-dandan.bi@intel.com
> 
> I think when Liming commented on your v1, he was unaware of Dandan's
> patch. And, I'm seeing your v1+v2 just now, at the same time. Sorry
> about the inconvenience!

Hi Laszlo,

Sorry for the duplicate, I need to improve my search skill :-(.

Dandan's patch works fine.

Thanks,

-- 
Anthony PERARD
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel