* [PATCH] UefiCpuPkg/MpInitLib: Fix build of Microcode
@ 2018-07-19 14:58 Anthony PERARD
2018-07-19 15:27 ` Gao, Liming
0 siblings, 1 reply; 5+ messages in thread
From: Anthony PERARD @ 2018-07-19 14:58 UTC (permalink / raw)
To: edk2-devel; +Cc: Eric Dong, Laszlo Ersek, Anthony PERARD
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>
---
UefiCpuPkg/Library/MpInitLib/Microcode.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/UefiCpuPkg/Library/MpInitLib/Microcode.c b/UefiCpuPkg/Library/MpInitLib/Microcode.c
index efda143e67..60cf8bf409 100644
--- a/UefiCpuPkg/Library/MpInitLib/Microcode.c
+++ b/UefiCpuPkg/Library/MpInitLib/Microcode.c
@@ -60,7 +60,7 @@ MicrocodeDetect (
BOOLEAN CorrectMicrocode;
VOID *MicrocodeData;
MSR_IA32_PLATFORM_ID_REGISTER PlatformIdMsr;
- UINT32 ProcessorFlags;
+ UINT32 ProcessorFlags = 0;
UINT32 ThreadId;
if (CpuMpData->MicrocodePatchRegionSize == 0) {
--
Anthony PERARD
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] UefiCpuPkg/MpInitLib: Fix build of Microcode
2018-07-19 14:58 [PATCH] UefiCpuPkg/MpInitLib: Fix build of Microcode Anthony PERARD
@ 2018-07-19 15:27 ` Gao, Liming
2018-07-19 15:52 ` [PATCH v2] " Anthony PERARD
0 siblings, 1 reply; 5+ messages in thread
From: Gao, Liming @ 2018-07-19 15:27 UTC (permalink / raw)
To: Anthony PERARD, edk2-devel@lists.01.org; +Cc: Laszlo Ersek, Dong, Eric
Edk2 style doesn't initialize the local variable value in its declaration. Could you update this patch to separately set ProcessorFlags value?
Thanks
Liming
> -----Original Message-----
> From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Anthony PERARD
> Sent: Thursday, July 19, 2018 10:58 PM
> To: edk2-devel@lists.01.org
> Cc: Anthony PERARD <anthony.perard@citrix.com>; Laszlo Ersek <lersek@redhat.com>; Dong, Eric <eric.dong@intel.com>
> Subject: [edk2] [PATCH] UefiCpuPkg/MpInitLib: Fix build of Microcode
>
> 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>
> ---
> UefiCpuPkg/Library/MpInitLib/Microcode.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/UefiCpuPkg/Library/MpInitLib/Microcode.c b/UefiCpuPkg/Library/MpInitLib/Microcode.c
> index efda143e67..60cf8bf409 100644
> --- a/UefiCpuPkg/Library/MpInitLib/Microcode.c
> +++ b/UefiCpuPkg/Library/MpInitLib/Microcode.c
> @@ -60,7 +60,7 @@ MicrocodeDetect (
> BOOLEAN CorrectMicrocode;
> VOID *MicrocodeData;
> MSR_IA32_PLATFORM_ID_REGISTER PlatformIdMsr;
> - UINT32 ProcessorFlags;
> + UINT32 ProcessorFlags = 0;
> UINT32 ThreadId;
>
> if (CpuMpData->MicrocodePatchRegionSize == 0) {
> --
> Anthony PERARD
>
> _______________________________________________
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH v2] UefiCpuPkg/MpInitLib: Fix build of Microcode
2018-07-19 15:27 ` Gao, Liming
@ 2018-07-19 15:52 ` Anthony PERARD
2018-07-19 18:32 ` Laszlo Ersek
0 siblings, 1 reply; 5+ messages in thread
From: Anthony PERARD @ 2018-07-19 15:52 UTC (permalink / raw)
To: edk2-devel; +Cc: Eric Dong, Laszlo Ersek, Gao, Liming, Anthony PERARD
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
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH v2] UefiCpuPkg/MpInitLib: Fix build of Microcode
2018-07-19 15:52 ` [PATCH v2] " Anthony PERARD
@ 2018-07-19 18:32 ` Laszlo Ersek
2018-07-20 9:42 ` Anthony PERARD
0 siblings, 1 reply; 5+ messages in thread
From: Laszlo Ersek @ 2018-07-19 18:32 UTC (permalink / raw)
To: Anthony PERARD, edk2-devel; +Cc: Eric Dong, Gao, Liming, Dandan Bi
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
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v2] UefiCpuPkg/MpInitLib: Fix build of Microcode
2018-07-19 18:32 ` Laszlo Ersek
@ 2018-07-20 9:42 ` Anthony PERARD
0 siblings, 0 replies; 5+ messages in thread
From: Anthony PERARD @ 2018-07-20 9:42 UTC (permalink / raw)
To: Laszlo Ersek; +Cc: edk2-devel, Eric Dong, Gao, Liming, Dandan Bi
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
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2018-07-20 9:42 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-07-19 14:58 [PATCH] UefiCpuPkg/MpInitLib: Fix build of Microcode Anthony PERARD
2018-07-19 15:27 ` Gao, Liming
2018-07-19 15:52 ` [PATCH v2] " Anthony PERARD
2018-07-19 18:32 ` Laszlo Ersek
2018-07-20 9:42 ` Anthony PERARD
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox