* [Patch] UefiCpuPkg/MpInitLib: Avoid call PcdGe* in Ap & Bsp.
@ 2017-10-19 2:42 Eric Dong
2017-10-19 8:08 ` Laszlo Ersek
0 siblings, 1 reply; 4+ messages in thread
From: Eric Dong @ 2017-10-19 2:42 UTC (permalink / raw)
To: edk2-devel; +Cc: Crystal Lee, Ruiyu Ni
MicrocodeDetect function will run by every threads, and it will
use PcdGet to get PcdCpuMicrocodePatchAddress and
PcdCpuMicrocodePatchRegionSize, if change both PCD default to dynamic,
system will in non-deterministic behavior.
By design, UEFI/PI services are single threaded and not re-entrant
so Multi processor code should not use UEFI/PI services. Here, Pcd
protocol/PPI is used to access dynamic PCDs so it would result in
non-deterministic behavior.
This code get PCD value in BSP and save them in CPU_MP_DATA for Ap.
https://bugzilla.tianocore.org/show_bug.cgi?id=726
Cc: Crystal Lee <CrystalLee@ami.com.tw>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Eric Dong <eric.dong@intel.com>
---
UefiCpuPkg/Library/MpInitLib/Microcode.c | 10 +++-------
UefiCpuPkg/Library/MpInitLib/MpLib.c | 2 ++
UefiCpuPkg/Library/MpInitLib/MpLib.h | 2 ++
3 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/UefiCpuPkg/Library/MpInitLib/Microcode.c b/UefiCpuPkg/Library/MpInitLib/Microcode.c
index 982995b..35f66f7 100644
--- a/UefiCpuPkg/Library/MpInitLib/Microcode.c
+++ b/UefiCpuPkg/Library/MpInitLib/Microcode.c
@@ -42,8 +42,6 @@ MicrocodeDetect (
IN CPU_MP_DATA *CpuMpData
)
{
- UINT64 MicrocodePatchAddress;
- UINT64 MicrocodePatchRegionSize;
UINT32 ExtendedTableLength;
UINT32 ExtendedTableCount;
CPU_MICROCODE_EXTENDED_TABLE *ExtendedTable;
@@ -61,9 +59,7 @@ MicrocodeDetect (
VOID *MicrocodeData;
MSR_IA32_PLATFORM_ID_REGISTER PlatformIdMsr;
- MicrocodePatchAddress = PcdGet64 (PcdCpuMicrocodePatchAddress);
- MicrocodePatchRegionSize = PcdGet64 (PcdCpuMicrocodePatchRegionSize);
- if (MicrocodePatchRegionSize == 0) {
+ if (CpuMpData->MicrocodePatchRegionSize == 0) {
//
// There is no microcode patches
//
@@ -93,8 +89,8 @@ MicrocodeDetect (
LatestRevision = 0;
MicrocodeData = NULL;
- MicrocodeEnd = (UINTN) (MicrocodePatchAddress + MicrocodePatchRegionSize);
- MicrocodeEntryPoint = (CPU_MICROCODE_HEADER *) (UINTN) MicrocodePatchAddress;
+ MicrocodeEnd = (UINTN) (CpuMpData->MicrocodePatchAddress + CpuMpData->MicrocodePatchRegionSize);
+ MicrocodeEntryPoint = (CPU_MICROCODE_HEADER *) (UINTN) CpuMpData->MicrocodePatchAddress;
do {
//
// Check if the microcode is for the Cpu and the version is newer
diff --git a/UefiCpuPkg/Library/MpInitLib/MpLib.c b/UefiCpuPkg/Library/MpInitLib/MpLib.c
index 924b909..f3ee6d4 100644
--- a/UefiCpuPkg/Library/MpInitLib/MpLib.c
+++ b/UefiCpuPkg/Library/MpInitLib/MpLib.c
@@ -1458,6 +1458,8 @@ MpInitLibInitialize (
CpuMpData->SwitchBspFlag = FALSE;
CpuMpData->CpuData = (CPU_AP_DATA *) (CpuMpData + 1);
CpuMpData->CpuInfoInHob = (UINT64) (UINTN) (CpuMpData->CpuData + MaxLogicalProcessorNumber);
+ CpuMpData->MicrocodePatchAddress = PcdGet64 (PcdCpuMicrocodePatchAddress);
+ CpuMpData->MicrocodePatchRegionSize = PcdGet64 (PcdCpuMicrocodePatchRegionSize);
InitializeSpinLock(&CpuMpData->MpLock);
//
// Save BSP's Control registers to APs
diff --git a/UefiCpuPkg/Library/MpInitLib/MpLib.h b/UefiCpuPkg/Library/MpInitLib/MpLib.h
index 19defda..84ae24f 100644
--- a/UefiCpuPkg/Library/MpInitLib/MpLib.h
+++ b/UefiCpuPkg/Library/MpInitLib/MpLib.h
@@ -233,6 +233,8 @@ struct _CPU_MP_DATA {
UINT8 Vector;
BOOLEAN PeriodicMode;
BOOLEAN TimerInterruptState;
+ UINT64 MicrocodePatchAddress;
+ UINT64 MicrocodePatchRegionSize;
};
extern EFI_GUID mCpuInitMpLibHobGuid;
--
2.7.0.windows.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [Patch] UefiCpuPkg/MpInitLib: Avoid call PcdGe* in Ap & Bsp.
2017-10-19 2:42 [Patch] UefiCpuPkg/MpInitLib: Avoid call PcdGe* in Ap & Bsp Eric Dong
@ 2017-10-19 8:08 ` Laszlo Ersek
2017-10-19 9:22 ` Ni, Ruiyu
0 siblings, 1 reply; 4+ messages in thread
From: Laszlo Ersek @ 2017-10-19 8:08 UTC (permalink / raw)
To: Eric Dong, edk2-devel; +Cc: Ruiyu Ni, Crystal Lee
On 10/19/17 04:42, Eric Dong wrote:
> MicrocodeDetect function will run by every threads, and it will
> use PcdGet to get PcdCpuMicrocodePatchAddress and
> PcdCpuMicrocodePatchRegionSize, if change both PCD default to dynamic,
> system will in non-deterministic behavior.
>
> By design, UEFI/PI services are single threaded and not re-entrant
> so Multi processor code should not use UEFI/PI services. Here, Pcd
> protocol/PPI is used to access dynamic PCDs so it would result in
> non-deterministic behavior.
>
> This code get PCD value in BSP and save them in CPU_MP_DATA for Ap.
>
> https://bugzilla.tianocore.org/show_bug.cgi?id=726
>
> Cc: Crystal Lee <CrystalLee@ami.com.tw>
> Cc: Ruiyu Ni <ruiyu.ni@intel.com>
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Eric Dong <eric.dong@intel.com>
> ---
> UefiCpuPkg/Library/MpInitLib/Microcode.c | 10 +++-------
> UefiCpuPkg/Library/MpInitLib/MpLib.c | 2 ++
> UefiCpuPkg/Library/MpInitLib/MpLib.h | 2 ++
> 3 files changed, 7 insertions(+), 7 deletions(-)
Eric, can you please fix up the subject line after you get an R-b and
are about to push the patch?
-UefiCpuPkg/MpInitLib: Avoid call PcdGe* in Ap & Bsp.
+UefiCpuPkg/MpInitLib: Avoid call PcdGet* in Ap & Bsp.
Thanks!
Laszlo
> diff --git a/UefiCpuPkg/Library/MpInitLib/Microcode.c b/UefiCpuPkg/Library/MpInitLib/Microcode.c
> index 982995b..35f66f7 100644
> --- a/UefiCpuPkg/Library/MpInitLib/Microcode.c
> +++ b/UefiCpuPkg/Library/MpInitLib/Microcode.c
> @@ -42,8 +42,6 @@ MicrocodeDetect (
> IN CPU_MP_DATA *CpuMpData
> )
> {
> - UINT64 MicrocodePatchAddress;
> - UINT64 MicrocodePatchRegionSize;
> UINT32 ExtendedTableLength;
> UINT32 ExtendedTableCount;
> CPU_MICROCODE_EXTENDED_TABLE *ExtendedTable;
> @@ -61,9 +59,7 @@ MicrocodeDetect (
> VOID *MicrocodeData;
> MSR_IA32_PLATFORM_ID_REGISTER PlatformIdMsr;
>
> - MicrocodePatchAddress = PcdGet64 (PcdCpuMicrocodePatchAddress);
> - MicrocodePatchRegionSize = PcdGet64 (PcdCpuMicrocodePatchRegionSize);
> - if (MicrocodePatchRegionSize == 0) {
> + if (CpuMpData->MicrocodePatchRegionSize == 0) {
> //
> // There is no microcode patches
> //
> @@ -93,8 +89,8 @@ MicrocodeDetect (
>
> LatestRevision = 0;
> MicrocodeData = NULL;
> - MicrocodeEnd = (UINTN) (MicrocodePatchAddress + MicrocodePatchRegionSize);
> - MicrocodeEntryPoint = (CPU_MICROCODE_HEADER *) (UINTN) MicrocodePatchAddress;
> + MicrocodeEnd = (UINTN) (CpuMpData->MicrocodePatchAddress + CpuMpData->MicrocodePatchRegionSize);
> + MicrocodeEntryPoint = (CPU_MICROCODE_HEADER *) (UINTN) CpuMpData->MicrocodePatchAddress;
> do {
> //
> // Check if the microcode is for the Cpu and the version is newer
> diff --git a/UefiCpuPkg/Library/MpInitLib/MpLib.c b/UefiCpuPkg/Library/MpInitLib/MpLib.c
> index 924b909..f3ee6d4 100644
> --- a/UefiCpuPkg/Library/MpInitLib/MpLib.c
> +++ b/UefiCpuPkg/Library/MpInitLib/MpLib.c
> @@ -1458,6 +1458,8 @@ MpInitLibInitialize (
> CpuMpData->SwitchBspFlag = FALSE;
> CpuMpData->CpuData = (CPU_AP_DATA *) (CpuMpData + 1);
> CpuMpData->CpuInfoInHob = (UINT64) (UINTN) (CpuMpData->CpuData + MaxLogicalProcessorNumber);
> + CpuMpData->MicrocodePatchAddress = PcdGet64 (PcdCpuMicrocodePatchAddress);
> + CpuMpData->MicrocodePatchRegionSize = PcdGet64 (PcdCpuMicrocodePatchRegionSize);
> InitializeSpinLock(&CpuMpData->MpLock);
> //
> // Save BSP's Control registers to APs
> diff --git a/UefiCpuPkg/Library/MpInitLib/MpLib.h b/UefiCpuPkg/Library/MpInitLib/MpLib.h
> index 19defda..84ae24f 100644
> --- a/UefiCpuPkg/Library/MpInitLib/MpLib.h
> +++ b/UefiCpuPkg/Library/MpInitLib/MpLib.h
> @@ -233,6 +233,8 @@ struct _CPU_MP_DATA {
> UINT8 Vector;
> BOOLEAN PeriodicMode;
> BOOLEAN TimerInterruptState;
> + UINT64 MicrocodePatchAddress;
> + UINT64 MicrocodePatchRegionSize;
> };
>
> extern EFI_GUID mCpuInitMpLibHobGuid;
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Patch] UefiCpuPkg/MpInitLib: Avoid call PcdGe* in Ap & Bsp.
2017-10-19 8:08 ` Laszlo Ersek
@ 2017-10-19 9:22 ` Ni, Ruiyu
2017-10-20 2:42 ` Dong, Eric
0 siblings, 1 reply; 4+ messages in thread
From: Ni, Ruiyu @ 2017-10-19 9:22 UTC (permalink / raw)
To: Laszlo Ersek, Dong, Eric, edk2-devel@lists.01.org; +Cc: Crystal Lee
With the subject change suggested by Laszlo, Reviewed-by: Ruiyu Ni <Ruiyu.ni@Intel.com>
Thanks/Ray
> -----Original Message-----
> From: Laszlo Ersek [mailto:lersek@redhat.com]
> Sent: Thursday, October 19, 2017 4:08 PM
> To: Dong, Eric <eric.dong@intel.com>; edk2-devel@lists.01.org
> Cc: Ni, Ruiyu <ruiyu.ni@intel.com>; Crystal Lee <CrystalLee@ami.com.tw>
> Subject: Re: [edk2] [Patch] UefiCpuPkg/MpInitLib: Avoid call PcdGe* in Ap &
> Bsp.
>
> On 10/19/17 04:42, Eric Dong wrote:
> > MicrocodeDetect function will run by every threads, and it will use
> > PcdGet to get PcdCpuMicrocodePatchAddress and
> > PcdCpuMicrocodePatchRegionSize, if change both PCD default to dynamic,
> > system will in non-deterministic behavior.
> >
> > By design, UEFI/PI services are single threaded and not re-entrant so
> > Multi processor code should not use UEFI/PI services. Here, Pcd
> > protocol/PPI is used to access dynamic PCDs so it would result in
> > non-deterministic behavior.
> >
> > This code get PCD value in BSP and save them in CPU_MP_DATA for Ap.
> >
> > https://bugzilla.tianocore.org/show_bug.cgi?id=726
> >
> > Cc: Crystal Lee <CrystalLee@ami.com.tw>
> > Cc: Ruiyu Ni <ruiyu.ni@intel.com>
> > Contributed-under: TianoCore Contribution Agreement 1.1
> > Signed-off-by: Eric Dong <eric.dong@intel.com>
> > ---
> > UefiCpuPkg/Library/MpInitLib/Microcode.c | 10 +++-------
> > UefiCpuPkg/Library/MpInitLib/MpLib.c | 2 ++
> > UefiCpuPkg/Library/MpInitLib/MpLib.h | 2 ++
> > 3 files changed, 7 insertions(+), 7 deletions(-)
>
> Eric, can you please fix up the subject line after you get an R-b and are about
> to push the patch?
>
> -UefiCpuPkg/MpInitLib: Avoid call PcdGe* in Ap & Bsp.
> +UefiCpuPkg/MpInitLib: Avoid call PcdGet* in Ap & Bsp.
>
> Thanks!
> Laszlo
>
>
> > diff --git a/UefiCpuPkg/Library/MpInitLib/Microcode.c
> > b/UefiCpuPkg/Library/MpInitLib/Microcode.c
> > index 982995b..35f66f7 100644
> > --- a/UefiCpuPkg/Library/MpInitLib/Microcode.c
> > +++ b/UefiCpuPkg/Library/MpInitLib/Microcode.c
> > @@ -42,8 +42,6 @@ MicrocodeDetect (
> > IN CPU_MP_DATA *CpuMpData
> > )
> > {
> > - UINT64 MicrocodePatchAddress;
> > - UINT64 MicrocodePatchRegionSize;
> > UINT32 ExtendedTableLength;
> > UINT32 ExtendedTableCount;
> > CPU_MICROCODE_EXTENDED_TABLE *ExtendedTable;
> > @@ -61,9 +59,7 @@ MicrocodeDetect (
> > VOID *MicrocodeData;
> > MSR_IA32_PLATFORM_ID_REGISTER PlatformIdMsr;
> >
> > - MicrocodePatchAddress = PcdGet64 (PcdCpuMicrocodePatchAddress);
> > - MicrocodePatchRegionSize = PcdGet64
> > (PcdCpuMicrocodePatchRegionSize);
> > - if (MicrocodePatchRegionSize == 0) {
> > + if (CpuMpData->MicrocodePatchRegionSize == 0) {
> > //
> > // There is no microcode patches
> > //
> > @@ -93,8 +89,8 @@ MicrocodeDetect (
> >
> > LatestRevision = 0;
> > MicrocodeData = NULL;
> > - MicrocodeEnd = (UINTN) (MicrocodePatchAddress +
> > MicrocodePatchRegionSize);
> > - MicrocodeEntryPoint = (CPU_MICROCODE_HEADER *) (UINTN)
> > MicrocodePatchAddress;
> > + MicrocodeEnd = (UINTN) (CpuMpData->MicrocodePatchAddress +
> > + CpuMpData->MicrocodePatchRegionSize);
> > + MicrocodeEntryPoint = (CPU_MICROCODE_HEADER *) (UINTN)
> > + CpuMpData->MicrocodePatchAddress;
> > do {
> > //
> > // Check if the microcode is for the Cpu and the version is newer
> > diff --git a/UefiCpuPkg/Library/MpInitLib/MpLib.c
> > b/UefiCpuPkg/Library/MpInitLib/MpLib.c
> > index 924b909..f3ee6d4 100644
> > --- a/UefiCpuPkg/Library/MpInitLib/MpLib.c
> > +++ b/UefiCpuPkg/Library/MpInitLib/MpLib.c
> > @@ -1458,6 +1458,8 @@ MpInitLibInitialize (
> > CpuMpData->SwitchBspFlag = FALSE;
> > CpuMpData->CpuData = (CPU_AP_DATA *) (CpuMpData + 1);
> > CpuMpData->CpuInfoInHob = (UINT64) (UINTN) (CpuMpData-
> >CpuData + MaxLogicalProcessorNumber);
> > + CpuMpData->MicrocodePatchAddress = PcdGet64
> (PcdCpuMicrocodePatchAddress);
> > + CpuMpData->MicrocodePatchRegionSize = PcdGet64
> > + (PcdCpuMicrocodePatchRegionSize);
> > InitializeSpinLock(&CpuMpData->MpLock);
> > //
> > // Save BSP's Control registers to APs diff --git
> > a/UefiCpuPkg/Library/MpInitLib/MpLib.h
> > b/UefiCpuPkg/Library/MpInitLib/MpLib.h
> > index 19defda..84ae24f 100644
> > --- a/UefiCpuPkg/Library/MpInitLib/MpLib.h
> > +++ b/UefiCpuPkg/Library/MpInitLib/MpLib.h
> > @@ -233,6 +233,8 @@ struct _CPU_MP_DATA {
> > UINT8 Vector;
> > BOOLEAN PeriodicMode;
> > BOOLEAN TimerInterruptState;
> > + UINT64 MicrocodePatchAddress;
> > + UINT64 MicrocodePatchRegionSize;
> > };
> >
> > extern EFI_GUID mCpuInitMpLibHobGuid;
> >
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Patch] UefiCpuPkg/MpInitLib: Avoid call PcdGe* in Ap & Bsp.
2017-10-19 9:22 ` Ni, Ruiyu
@ 2017-10-20 2:42 ` Dong, Eric
0 siblings, 0 replies; 4+ messages in thread
From: Dong, Eric @ 2017-10-20 2:42 UTC (permalink / raw)
To: Ni, Ruiyu, Laszlo Ersek, edk2-devel@lists.01.org; +Cc: Crystal Lee
Hi Laszlo & Ruiyu,
I have fix the typo and push the change. Thanks.
Thanks,
Eric
> -----Original Message-----
> From: Ni, Ruiyu
> Sent: Thursday, October 19, 2017 5:23 PM
> To: Laszlo Ersek <lersek@redhat.com>; Dong, Eric <eric.dong@intel.com>;
> edk2-devel@lists.01.org
> Cc: Crystal Lee <CrystalLee@ami.com.tw>
> Subject: RE: [edk2] [Patch] UefiCpuPkg/MpInitLib: Avoid call PcdGe* in Ap &
> Bsp.
>
> With the subject change suggested by Laszlo, Reviewed-by: Ruiyu Ni
> <Ruiyu.ni@Intel.com>
>
> Thanks/Ray
>
> > -----Original Message-----
> > From: Laszlo Ersek [mailto:lersek@redhat.com]
> > Sent: Thursday, October 19, 2017 4:08 PM
> > To: Dong, Eric <eric.dong@intel.com>; edk2-devel@lists.01.org
> > Cc: Ni, Ruiyu <ruiyu.ni@intel.com>; Crystal Lee
> > <CrystalLee@ami.com.tw>
> > Subject: Re: [edk2] [Patch] UefiCpuPkg/MpInitLib: Avoid call PcdGe* in
> > Ap & Bsp.
> >
> > On 10/19/17 04:42, Eric Dong wrote:
> > > MicrocodeDetect function will run by every threads, and it will use
> > > PcdGet to get PcdCpuMicrocodePatchAddress and
> > > PcdCpuMicrocodePatchRegionSize, if change both PCD default to
> > > dynamic, system will in non-deterministic behavior.
> > >
> > > By design, UEFI/PI services are single threaded and not re-entrant
> > > so Multi processor code should not use UEFI/PI services. Here, Pcd
> > > protocol/PPI is used to access dynamic PCDs so it would result in
> > > non-deterministic behavior.
> > >
> > > This code get PCD value in BSP and save them in CPU_MP_DATA for Ap.
> > >
> > > https://bugzilla.tianocore.org/show_bug.cgi?id=726
> > >
> > > Cc: Crystal Lee <CrystalLee@ami.com.tw>
> > > Cc: Ruiyu Ni <ruiyu.ni@intel.com>
> > > Contributed-under: TianoCore Contribution Agreement 1.1
> > > Signed-off-by: Eric Dong <eric.dong@intel.com>
> > > ---
> > > UefiCpuPkg/Library/MpInitLib/Microcode.c | 10 +++-------
> > > UefiCpuPkg/Library/MpInitLib/MpLib.c | 2 ++
> > > UefiCpuPkg/Library/MpInitLib/MpLib.h | 2 ++
> > > 3 files changed, 7 insertions(+), 7 deletions(-)
> >
> > Eric, can you please fix up the subject line after you get an R-b and
> > are about to push the patch?
> >
> > -UefiCpuPkg/MpInitLib: Avoid call PcdGe* in Ap & Bsp.
> > +UefiCpuPkg/MpInitLib: Avoid call PcdGet* in Ap & Bsp.
> >
> > Thanks!
> > Laszlo
> >
> >
> > > diff --git a/UefiCpuPkg/Library/MpInitLib/Microcode.c
> > > b/UefiCpuPkg/Library/MpInitLib/Microcode.c
> > > index 982995b..35f66f7 100644
> > > --- a/UefiCpuPkg/Library/MpInitLib/Microcode.c
> > > +++ b/UefiCpuPkg/Library/MpInitLib/Microcode.c
> > > @@ -42,8 +42,6 @@ MicrocodeDetect (
> > > IN CPU_MP_DATA *CpuMpData
> > > )
> > > {
> > > - UINT64 MicrocodePatchAddress;
> > > - UINT64 MicrocodePatchRegionSize;
> > > UINT32 ExtendedTableLength;
> > > UINT32 ExtendedTableCount;
> > > CPU_MICROCODE_EXTENDED_TABLE *ExtendedTable;
> > > @@ -61,9 +59,7 @@ MicrocodeDetect (
> > > VOID *MicrocodeData;
> > > MSR_IA32_PLATFORM_ID_REGISTER PlatformIdMsr;
> > >
> > > - MicrocodePatchAddress = PcdGet64
> (PcdCpuMicrocodePatchAddress);
> > > - MicrocodePatchRegionSize = PcdGet64
> > > (PcdCpuMicrocodePatchRegionSize);
> > > - if (MicrocodePatchRegionSize == 0) {
> > > + if (CpuMpData->MicrocodePatchRegionSize == 0) {
> > > //
> > > // There is no microcode patches
> > > //
> > > @@ -93,8 +89,8 @@ MicrocodeDetect (
> > >
> > > LatestRevision = 0;
> > > MicrocodeData = NULL;
> > > - MicrocodeEnd = (UINTN) (MicrocodePatchAddress +
> > > MicrocodePatchRegionSize);
> > > - MicrocodeEntryPoint = (CPU_MICROCODE_HEADER *) (UINTN)
> > > MicrocodePatchAddress;
> > > + MicrocodeEnd = (UINTN) (CpuMpData->MicrocodePatchAddress +
> > > + CpuMpData->MicrocodePatchRegionSize);
> > > + MicrocodeEntryPoint = (CPU_MICROCODE_HEADER *) (UINTN)
> > > + CpuMpData->MicrocodePatchAddress;
> > > do {
> > > //
> > > // Check if the microcode is for the Cpu and the version is
> > > newer diff --git a/UefiCpuPkg/Library/MpInitLib/MpLib.c
> > > b/UefiCpuPkg/Library/MpInitLib/MpLib.c
> > > index 924b909..f3ee6d4 100644
> > > --- a/UefiCpuPkg/Library/MpInitLib/MpLib.c
> > > +++ b/UefiCpuPkg/Library/MpInitLib/MpLib.c
> > > @@ -1458,6 +1458,8 @@ MpInitLibInitialize (
> > > CpuMpData->SwitchBspFlag = FALSE;
> > > CpuMpData->CpuData = (CPU_AP_DATA *) (CpuMpData + 1);
> > > CpuMpData->CpuInfoInHob = (UINT64) (UINTN) (CpuMpData-
> > >CpuData + MaxLogicalProcessorNumber);
> > > + CpuMpData->MicrocodePatchAddress = PcdGet64
> > (PcdCpuMicrocodePatchAddress);
> > > + CpuMpData->MicrocodePatchRegionSize = PcdGet64
> > > + (PcdCpuMicrocodePatchRegionSize);
> > > InitializeSpinLock(&CpuMpData->MpLock);
> > > //
> > > // Save BSP's Control registers to APs diff --git
> > > a/UefiCpuPkg/Library/MpInitLib/MpLib.h
> > > b/UefiCpuPkg/Library/MpInitLib/MpLib.h
> > > index 19defda..84ae24f 100644
> > > --- a/UefiCpuPkg/Library/MpInitLib/MpLib.h
> > > +++ b/UefiCpuPkg/Library/MpInitLib/MpLib.h
> > > @@ -233,6 +233,8 @@ struct _CPU_MP_DATA {
> > > UINT8 Vector;
> > > BOOLEAN PeriodicMode;
> > > BOOLEAN TimerInterruptState;
> > > + UINT64 MicrocodePatchAddress;
> > > + UINT64 MicrocodePatchRegionSize;
> > > };
> > >
> > > extern EFI_GUID mCpuInitMpLibHobGuid;
> > >
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2017-10-20 2:38 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-10-19 2:42 [Patch] UefiCpuPkg/MpInitLib: Avoid call PcdGe* in Ap & Bsp Eric Dong
2017-10-19 8:08 ` Laszlo Ersek
2017-10-19 9:22 ` Ni, Ruiyu
2017-10-20 2:42 ` Dong, Eric
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox