public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH] MdeModulePkg PCD: FSP NotifyPhase APIs caused 100ms delay
@ 2021-08-09  2:27 GregX Yeh
  2021-08-11  6:45 ` Wang, Jian J
  2021-08-12  3:47 ` Dandan Bi
  0 siblings, 2 replies; 5+ messages in thread
From: GregX Yeh @ 2021-08-09  2:27 UTC (permalink / raw)
  To: devel; +Cc: Jian J Wang, Hao A Wu, Dandan Bi, Liming Gao

https://bugzilla.tianocore.org/show_bug.cgi?id=3525

After PciSegmentLib using Dynamic PCD for Pcie base address such
long delay found in FSP. The root cause is some of the PCD service
PPIs not shadowed to memory and flash cache may have been disabled
in NotifyPhase stage. Solution is to shadow all PCD service PPIs
to memory.

Signed-off-by: GregX Yeh <gregx.yeh@intel.com>
Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Hao A Wu <hao.a.wu@intel.com>
Cc: Dandan Bi <dandan.bi@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
---
 MdeModulePkg/Universal/PCD/Pei/Pcd.c | 71 +++++++++++++++++++++++++++-
 1 file changed, 70 insertions(+), 1 deletion(-)

diff --git a/MdeModulePkg/Universal/PCD/Pei/Pcd.c b/MdeModulePkg/Universal/PCD/Pei/Pcd.c
index 9c6346924f..f31e0be35f 100644
--- a/MdeModulePkg/Universal/PCD/Pei/Pcd.c
+++ b/MdeModulePkg/Universal/PCD/Pei/Pcd.c
@@ -1,7 +1,7 @@
 /** @file
   All Pcd Ppi services are implemented here.
 
-Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2006 - 2021, Intel Corporation. All rights reserved.<BR>
 (C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>
 SPDX-License-Identifier: BSD-2-Clause-Patent
 
@@ -339,6 +339,75 @@ PcdPeimInit (
 {
   EFI_STATUS Status;
 
+  Status = PeiServicesRegisterForShadow (FileHandle);
+  if (Status == EFI_ALREADY_STARTED) {
+    //
+    // This is now starting in memory, the second time starting.
+    //
+    EFI_PEI_PPI_DESCRIPTOR *OldPpiList;
+    EFI_PEI_PPI_DESCRIPTOR *OldPpiList2;
+    VOID *Ppi;
+    VOID *Ppi2;
+
+    OldPpiList = NULL;
+    Status = PeiServicesLocatePpi (
+               &gPcdPpiGuid,
+               0,
+               &OldPpiList,
+               &Ppi
+               );
+    ASSERT_EFI_ERROR (Status);
+
+    if (OldPpiList != NULL) {
+      Status = PeiServicesReInstallPpi (OldPpiList, &mPpiList[0]);
+      ASSERT_EFI_ERROR (Status);
+    }
+
+    OldPpiList2 = NULL;
+    Status = PeiServicesLocatePpi (
+               &gGetPcdInfoPpiGuid,
+               0,
+               &OldPpiList2,
+               &Ppi2
+               );
+    ASSERT_EFI_ERROR (Status);
+
+    if (OldPpiList2 != NULL) {
+      Status = PeiServicesReInstallPpi (OldPpiList2, &mPpiList2[0]);
+      ASSERT_EFI_ERROR (Status);
+    }
+
+    OldPpiList = NULL;
+    Status = PeiServicesLocatePpi (
+               &gEfiPeiPcdPpiGuid,
+               0,
+               &OldPpiList,
+               &Ppi
+               );
+    ASSERT_EFI_ERROR (Status);
+
+    if (OldPpiList != NULL) {
+      Status = PeiServicesReInstallPpi (OldPpiList, &mPpiList[1]);
+      ASSERT_EFI_ERROR (Status);
+    }
+
+    OldPpiList2 = NULL;
+    Status = PeiServicesLocatePpi (
+               &gEfiGetPcdInfoPpiGuid,
+               0,
+               &OldPpiList2,
+               &Ppi2
+               );
+    ASSERT_EFI_ERROR (Status);
+
+    if (OldPpiList2 != NULL) {
+      Status = PeiServicesReInstallPpi (OldPpiList2, &mPpiList2[1]);
+      ASSERT_EFI_ERROR (Status);
+    }
+
+    return Status;
+  }
+
   BuildPcdDatabase (FileHandle);
 
   //
-- 
2.32.0.windows.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] MdeModulePkg PCD: FSP NotifyPhase APIs caused 100ms delay
  2021-08-09  2:27 [PATCH] MdeModulePkg PCD: FSP NotifyPhase APIs caused 100ms delay GregX Yeh
@ 2021-08-11  6:45 ` Wang, Jian J
  2021-08-12  3:47 ` Dandan Bi
  1 sibling, 0 replies; 5+ messages in thread
From: Wang, Jian J @ 2021-08-11  6:45 UTC (permalink / raw)
  To: Yeh, GregX, devel@edk2.groups.io; +Cc: Wu, Hao A, Bi, Dandan, Liming Gao

Reviewed-by: Jian J Wang <jian.j.wang@intel.com>

Regards,
Jian

> -----Original Message-----
> From: Yeh, GregX <gregx.yeh@intel.com>
> Sent: Monday, August 09, 2021 10:28 AM
> To: devel@edk2.groups.io
> Cc: Wang, Jian J <jian.j.wang@intel.com>; Wu, Hao A <hao.a.wu@intel.com>;
> Bi, Dandan <dandan.bi@intel.com>; Liming Gao <gaoliming@byosoft.com.cn>
> Subject: [PATCH] MdeModulePkg PCD: FSP NotifyPhase APIs caused 100ms delay
> 
> https://bugzilla.tianocore.org/show_bug.cgi?id=3525
> 
> After PciSegmentLib using Dynamic PCD for Pcie base address such
> long delay found in FSP. The root cause is some of the PCD service
> PPIs not shadowed to memory and flash cache may have been disabled
> in NotifyPhase stage. Solution is to shadow all PCD service PPIs
> to memory.
> 
> Signed-off-by: GregX Yeh <gregx.yeh@intel.com>
> Cc: Jian J Wang <jian.j.wang@intel.com>
> Cc: Hao A Wu <hao.a.wu@intel.com>
> Cc: Dandan Bi <dandan.bi@intel.com>
> Cc: Liming Gao <gaoliming@byosoft.com.cn>
> ---
>  MdeModulePkg/Universal/PCD/Pei/Pcd.c | 71
> +++++++++++++++++++++++++++-
>  1 file changed, 70 insertions(+), 1 deletion(-)
> 
> diff --git a/MdeModulePkg/Universal/PCD/Pei/Pcd.c
> b/MdeModulePkg/Universal/PCD/Pei/Pcd.c
> index 9c6346924f..f31e0be35f 100644
> --- a/MdeModulePkg/Universal/PCD/Pei/Pcd.c
> +++ b/MdeModulePkg/Universal/PCD/Pei/Pcd.c
> @@ -1,7 +1,7 @@
>  /** @file
> 
>    All Pcd Ppi services are implemented here.
> 
> 
> 
> -Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
> 
> +Copyright (c) 2006 - 2021, Intel Corporation. All rights reserved.<BR>
> 
>  (C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>
> 
>  SPDX-License-Identifier: BSD-2-Clause-Patent
> 
> 
> 
> @@ -339,6 +339,75 @@ PcdPeimInit (
>  {
> 
>    EFI_STATUS Status;
> 
> 
> 
> +  Status = PeiServicesRegisterForShadow (FileHandle);
> 
> +  if (Status == EFI_ALREADY_STARTED) {
> 
> +    //
> 
> +    // This is now starting in memory, the second time starting.
> 
> +    //
> 
> +    EFI_PEI_PPI_DESCRIPTOR *OldPpiList;
> 
> +    EFI_PEI_PPI_DESCRIPTOR *OldPpiList2;
> 
> +    VOID *Ppi;
> 
> +    VOID *Ppi2;
> 
> +
> 
> +    OldPpiList = NULL;
> 
> +    Status = PeiServicesLocatePpi (
> 
> +               &gPcdPpiGuid,
> 
> +               0,
> 
> +               &OldPpiList,
> 
> +               &Ppi
> 
> +               );
> 
> +    ASSERT_EFI_ERROR (Status);
> 
> +
> 
> +    if (OldPpiList != NULL) {
> 
> +      Status = PeiServicesReInstallPpi (OldPpiList, &mPpiList[0]);
> 
> +      ASSERT_EFI_ERROR (Status);
> 
> +    }
> 
> +
> 
> +    OldPpiList2 = NULL;
> 
> +    Status = PeiServicesLocatePpi (
> 
> +               &gGetPcdInfoPpiGuid,
> 
> +               0,
> 
> +               &OldPpiList2,
> 
> +               &Ppi2
> 
> +               );
> 
> +    ASSERT_EFI_ERROR (Status);
> 
> +
> 
> +    if (OldPpiList2 != NULL) {
> 
> +      Status = PeiServicesReInstallPpi (OldPpiList2, &mPpiList2[0]);
> 
> +      ASSERT_EFI_ERROR (Status);
> 
> +    }
> 
> +
> 
> +    OldPpiList = NULL;
> 
> +    Status = PeiServicesLocatePpi (
> 
> +               &gEfiPeiPcdPpiGuid,
> 
> +               0,
> 
> +               &OldPpiList,
> 
> +               &Ppi
> 
> +               );
> 
> +    ASSERT_EFI_ERROR (Status);
> 
> +
> 
> +    if (OldPpiList != NULL) {
> 
> +      Status = PeiServicesReInstallPpi (OldPpiList, &mPpiList[1]);
> 
> +      ASSERT_EFI_ERROR (Status);
> 
> +    }
> 
> +
> 
> +    OldPpiList2 = NULL;
> 
> +    Status = PeiServicesLocatePpi (
> 
> +               &gEfiGetPcdInfoPpiGuid,
> 
> +               0,
> 
> +               &OldPpiList2,
> 
> +               &Ppi2
> 
> +               );
> 
> +    ASSERT_EFI_ERROR (Status);
> 
> +
> 
> +    if (OldPpiList2 != NULL) {
> 
> +      Status = PeiServicesReInstallPpi (OldPpiList2, &mPpiList2[1]);
> 
> +      ASSERT_EFI_ERROR (Status);
> 
> +    }
> 
> +
> 
> +    return Status;
> 
> +  }
> 
> +
> 
>    BuildPcdDatabase (FileHandle);
> 
> 
> 
>    //
> 
> --
> 2.32.0.windows.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] MdeModulePkg PCD: FSP NotifyPhase APIs caused 100ms delay
  2021-08-09  2:27 [PATCH] MdeModulePkg PCD: FSP NotifyPhase APIs caused 100ms delay GregX Yeh
  2021-08-11  6:45 ` Wang, Jian J
@ 2021-08-12  3:47 ` Dandan Bi
  2021-08-12  7:06   ` GregX Yeh
  1 sibling, 1 reply; 5+ messages in thread
From: Dandan Bi @ 2021-08-12  3:47 UTC (permalink / raw)
  To: Yeh, GregX, devel@edk2.groups.io; +Cc: Wang, Jian J, Wu, Hao A, Liming Gao

Hi Greg,

One minor comment, could we update the subject to reflect what have done in this patch for PCD module before submitting the patch? 
With that addressed Reviewed-by: Dandan Bi <dandan.bi@intel.com>



Thanks,
Dandan

> -----Original Message-----
> From: Yeh, GregX <gregx.yeh@intel.com>
> Sent: Monday, August 9, 2021 10:28 AM
> To: devel@edk2.groups.io
> Cc: Wang, Jian J <jian.j.wang@intel.com>; Wu, Hao A <hao.a.wu@intel.com>;
> Bi, Dandan <dandan.bi@intel.com>; Liming Gao <gaoliming@byosoft.com.cn>
> Subject: [PATCH] MdeModulePkg PCD: FSP NotifyPhase APIs caused 100ms
> delay
> 
> https://bugzilla.tianocore.org/show_bug.cgi?id=3525
> 
> After PciSegmentLib using Dynamic PCD for Pcie base address such long delay
> found in FSP. The root cause is some of the PCD service PPIs not shadowed
> to memory and flash cache may have been disabled in NotifyPhase stage.
> Solution is to shadow all PCD service PPIs to memory.
> 
> Signed-off-by: GregX Yeh <gregx.yeh@intel.com>
> Cc: Jian J Wang <jian.j.wang@intel.com>
> Cc: Hao A Wu <hao.a.wu@intel.com>
> Cc: Dandan Bi <dandan.bi@intel.com>
> Cc: Liming Gao <gaoliming@byosoft.com.cn>
> ---
>  MdeModulePkg/Universal/PCD/Pei/Pcd.c | 71
> +++++++++++++++++++++++++++-
>  1 file changed, 70 insertions(+), 1 deletion(-)
> 
> diff --git a/MdeModulePkg/Universal/PCD/Pei/Pcd.c
> b/MdeModulePkg/Universal/PCD/Pei/Pcd.c
> index 9c6346924f..f31e0be35f 100644
> --- a/MdeModulePkg/Universal/PCD/Pei/Pcd.c
> +++ b/MdeModulePkg/Universal/PCD/Pei/Pcd.c
> @@ -1,7 +1,7 @@
>  /** @file   All Pcd Ppi services are implemented here. -Copyright (c) 2006 -
> 2018, Intel Corporation. All rights reserved.<BR>+Copyright (c) 2006 - 2021,
> Intel Corporation. All rights reserved.<BR> (C) Copyright 2016 Hewlett
> Packard Enterprise Development LP<BR> SPDX-License-Identifier: BSD-2-
> Clause-Patent @@ -339,6 +339,75 @@ PcdPeimInit (
>  {   EFI_STATUS Status; +  Status = PeiServicesRegisterForShadow
> (FileHandle);+  if (Status == EFI_ALREADY_STARTED) {+    //+    // This is now
> starting in memory, the second time starting.+    //+
> EFI_PEI_PPI_DESCRIPTOR *OldPpiList;+    EFI_PEI_PPI_DESCRIPTOR
> *OldPpiList2;+    VOID *Ppi;+    VOID *Ppi2;++    OldPpiList = NULL;+    Status =
> PeiServicesLocatePpi (+               &gPcdPpiGuid,+               0,+
> &OldPpiList,+               &Ppi+               );+    ASSERT_EFI_ERROR (Status);++    if
> (OldPpiList != NULL) {+      Status = PeiServicesReInstallPpi (OldPpiList,
> &mPpiList[0]);+      ASSERT_EFI_ERROR (Status);+    }++    OldPpiList2 = NULL;+
> Status = PeiServicesLocatePpi (+               &gGetPcdInfoPpiGuid,+               0,+
> &OldPpiList2,+               &Ppi2+               );+    ASSERT_EFI_ERROR (Status);++    if
> (OldPpiList2 != NULL) {+      Status = PeiServicesReInstallPpi (OldPpiList2,
> &mPpiList2[0]);+      ASSERT_EFI_ERROR (Status);+    }++    OldPpiList = NULL;+
> Status = PeiServicesLocatePpi (+               &gEfiPeiPcdPpiGuid,+               0,+
> &OldPpiList,+               &Ppi+               );+    ASSERT_EFI_ERROR (Status);++    if
> (OldPpiList != NULL) {+      Status = PeiServicesReInstallPpi (OldPpiList,
> &mPpiList[1]);+      ASSERT_EFI_ERROR (Status);+    }++    OldPpiList2 = NULL;+
> Status = PeiServicesLocatePpi (+               &gEfiGetPcdInfoPpiGuid,+               0,+
> &OldPpiList2,+               &Ppi2+               );+    ASSERT_EFI_ERROR (Status);++    if
> (OldPpiList2 != NULL) {+      Status = PeiServicesReInstallPpi (OldPpiList2,
> &mPpiList2[1]);+      ASSERT_EFI_ERROR (Status);+    }++    return Status;+  }+
> BuildPcdDatabase (FileHandle);    //--
> 2.32.0.windows.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] MdeModulePkg PCD: FSP NotifyPhase APIs caused 100ms delay
  2021-08-12  3:47 ` Dandan Bi
@ 2021-08-12  7:06   ` GregX Yeh
  2021-08-12  7:11     ` Dandan Bi
  0 siblings, 1 reply; 5+ messages in thread
From: GregX Yeh @ 2021-08-12  7:06 UTC (permalink / raw)
  To: Bi, Dandan, devel@edk2.groups.io; +Cc: Wang, Jian J, Wu, Hao A, Liming Gao

Hi Dandan,

So I need create new patch file with new subject then send-email again?

Thanks,
Greg

-----Original Message-----
From: Bi, Dandan <dandan.bi@intel.com> 
Sent: Thursday, August 12, 2021 11:47 AM
To: Yeh, GregX <gregx.yeh@intel.com>; devel@edk2.groups.io
Cc: Wang, Jian J <jian.j.wang@intel.com>; Wu, Hao A <hao.a.wu@intel.com>; Liming Gao <gaoliming@byosoft.com.cn>
Subject: RE: [PATCH] MdeModulePkg PCD: FSP NotifyPhase APIs caused 100ms delay

Hi Greg,

One minor comment, could we update the subject to reflect what have done in this patch for PCD module before submitting the patch? 
With that addressed Reviewed-by: Dandan Bi <dandan.bi@intel.com>



Thanks,
Dandan

> -----Original Message-----
> From: Yeh, GregX <gregx.yeh@intel.com>
> Sent: Monday, August 9, 2021 10:28 AM
> To: devel@edk2.groups.io
> Cc: Wang, Jian J <jian.j.wang@intel.com>; Wu, Hao A 
> <hao.a.wu@intel.com>; Bi, Dandan <dandan.bi@intel.com>; Liming Gao 
> <gaoliming@byosoft.com.cn>
> Subject: [PATCH] MdeModulePkg PCD: FSP NotifyPhase APIs caused 100ms 
> delay
> 
> https://bugzilla.tianocore.org/show_bug.cgi?id=3525
> 
> After PciSegmentLib using Dynamic PCD for Pcie base address such long 
> delay found in FSP. The root cause is some of the PCD service PPIs not 
> shadowed to memory and flash cache may have been disabled in NotifyPhase stage.
> Solution is to shadow all PCD service PPIs to memory.
> 
> Signed-off-by: GregX Yeh <gregx.yeh@intel.com>
> Cc: Jian J Wang <jian.j.wang@intel.com>
> Cc: Hao A Wu <hao.a.wu@intel.com>
> Cc: Dandan Bi <dandan.bi@intel.com>
> Cc: Liming Gao <gaoliming@byosoft.com.cn>
> ---
>  MdeModulePkg/Universal/PCD/Pei/Pcd.c | 71
> +++++++++++++++++++++++++++-
>  1 file changed, 70 insertions(+), 1 deletion(-)
> 
> diff --git a/MdeModulePkg/Universal/PCD/Pei/Pcd.c
> b/MdeModulePkg/Universal/PCD/Pei/Pcd.c
> index 9c6346924f..f31e0be35f 100644
> --- a/MdeModulePkg/Universal/PCD/Pei/Pcd.c
> +++ b/MdeModulePkg/Universal/PCD/Pei/Pcd.c
> @@ -1,7 +1,7 @@
>  /** @file   All Pcd Ppi services are implemented here. -Copyright (c) 2006 -
> 2018, Intel Corporation. All rights reserved.<BR>+Copyright (c) 2006 - 
> 2021, Intel Corporation. All rights reserved.<BR> (C) Copyright 2016 
> Hewlett Packard Enterprise Development LP<BR> SPDX-License-Identifier: 
> BSD-2- Clause-Patent @@ -339,6 +339,75 @@ PcdPeimInit (
>  {   EFI_STATUS Status; +  Status = PeiServicesRegisterForShadow
> (FileHandle);+  if (Status == EFI_ALREADY_STARTED) {+    //+    // This is now
> starting in memory, the second time starting.+    //+
> EFI_PEI_PPI_DESCRIPTOR *OldPpiList;+    EFI_PEI_PPI_DESCRIPTOR
> *OldPpiList2;+    VOID *Ppi;+    VOID *Ppi2;++    OldPpiList = NULL;+    Status =
> PeiServicesLocatePpi (+               &gPcdPpiGuid,+               0,+
> &OldPpiList,+               &Ppi+               );+    ASSERT_EFI_ERROR (Status);++    if
> (OldPpiList != NULL) {+      Status = PeiServicesReInstallPpi (OldPpiList,
> &mPpiList[0]);+      ASSERT_EFI_ERROR (Status);+    }++    OldPpiList2 = NULL;+
> Status = PeiServicesLocatePpi (+               &gGetPcdInfoPpiGuid,+               0,+
> &OldPpiList2,+               &Ppi2+               );+    ASSERT_EFI_ERROR (Status);++    if
> (OldPpiList2 != NULL) {+      Status = PeiServicesReInstallPpi (OldPpiList2,
> &mPpiList2[0]);+      ASSERT_EFI_ERROR (Status);+    }++    OldPpiList = NULL;+
> Status = PeiServicesLocatePpi (+               &gEfiPeiPcdPpiGuid,+               0,+
> &OldPpiList,+               &Ppi+               );+    ASSERT_EFI_ERROR (Status);++    if
> (OldPpiList != NULL) {+      Status = PeiServicesReInstallPpi (OldPpiList,
> &mPpiList[1]);+      ASSERT_EFI_ERROR (Status);+    }++    OldPpiList2 = NULL;+
> Status = PeiServicesLocatePpi (+               &gEfiGetPcdInfoPpiGuid,+               0,+
> &OldPpiList2,+               &Ppi2+               );+    ASSERT_EFI_ERROR (Status);++    if
> (OldPpiList2 != NULL) {+      Status = PeiServicesReInstallPpi (OldPpiList2,
> &mPpiList2[1]);+      ASSERT_EFI_ERROR (Status);+    }++    return Status;+  }+
> BuildPcdDatabase (FileHandle);    //--
> 2.32.0.windows.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] MdeModulePkg PCD: FSP NotifyPhase APIs caused 100ms delay
  2021-08-12  7:06   ` GregX Yeh
@ 2021-08-12  7:11     ` Dandan Bi
  0 siblings, 0 replies; 5+ messages in thread
From: Dandan Bi @ 2021-08-12  7:11 UTC (permalink / raw)
  To: Yeh, GregX, devel@edk2.groups.io; +Cc: Wang, Jian J, Wu, Hao A, Liming Gao

You may send a new one with R-B,  then can submit the new updated one.



Thanks,
Dandan

> -----Original Message-----
> From: Yeh, GregX <gregx.yeh@intel.com>
> Sent: Thursday, August 12, 2021 3:06 PM
> To: Bi, Dandan <dandan.bi@intel.com>; devel@edk2.groups.io
> Cc: Wang, Jian J <jian.j.wang@intel.com>; Wu, Hao A <hao.a.wu@intel.com>;
> Liming Gao <gaoliming@byosoft.com.cn>
> Subject: RE: [PATCH] MdeModulePkg PCD: FSP NotifyPhase APIs caused
> 100ms delay
> 
> Hi Dandan,
> 
> So I need create new patch file with new subject then send-email again?
> 
> Thanks,
> Greg
> 
> -----Original Message-----
> From: Bi, Dandan <dandan.bi@intel.com>
> Sent: Thursday, August 12, 2021 11:47 AM
> To: Yeh, GregX <gregx.yeh@intel.com>; devel@edk2.groups.io
> Cc: Wang, Jian J <jian.j.wang@intel.com>; Wu, Hao A <hao.a.wu@intel.com>;
> Liming Gao <gaoliming@byosoft.com.cn>
> Subject: RE: [PATCH] MdeModulePkg PCD: FSP NotifyPhase APIs caused
> 100ms delay
> 
> Hi Greg,
> 
> One minor comment, could we update the subject to reflect what have done
> in this patch for PCD module before submitting the patch?
> With that addressed Reviewed-by: Dandan Bi <dandan.bi@intel.com>
> 
> 
> 
> Thanks,
> Dandan
> 
> > -----Original Message-----
> > From: Yeh, GregX <gregx.yeh@intel.com>
> > Sent: Monday, August 9, 2021 10:28 AM
> > To: devel@edk2.groups.io
> > Cc: Wang, Jian J <jian.j.wang@intel.com>; Wu, Hao A
> > <hao.a.wu@intel.com>; Bi, Dandan <dandan.bi@intel.com>; Liming Gao
> > <gaoliming@byosoft.com.cn>
> > Subject: [PATCH] MdeModulePkg PCD: FSP NotifyPhase APIs caused 100ms
> > delay
> >
> > https://bugzilla.tianocore.org/show_bug.cgi?id=3525
> >
> > After PciSegmentLib using Dynamic PCD for Pcie base address such long
> > delay found in FSP. The root cause is some of the PCD service PPIs not
> > shadowed to memory and flash cache may have been disabled in
> NotifyPhase stage.
> > Solution is to shadow all PCD service PPIs to memory.
> >
> > Signed-off-by: GregX Yeh <gregx.yeh@intel.com>
> > Cc: Jian J Wang <jian.j.wang@intel.com>
> > Cc: Hao A Wu <hao.a.wu@intel.com>
> > Cc: Dandan Bi <dandan.bi@intel.com>
> > Cc: Liming Gao <gaoliming@byosoft.com.cn>
> > ---
> >  MdeModulePkg/Universal/PCD/Pei/Pcd.c | 71
> > +++++++++++++++++++++++++++-
> >  1 file changed, 70 insertions(+), 1 deletion(-)
> >
> > diff --git a/MdeModulePkg/Universal/PCD/Pei/Pcd.c
> > b/MdeModulePkg/Universal/PCD/Pei/Pcd.c
> > index 9c6346924f..f31e0be35f 100644
> > --- a/MdeModulePkg/Universal/PCD/Pei/Pcd.c
> > +++ b/MdeModulePkg/Universal/PCD/Pei/Pcd.c
> > @@ -1,7 +1,7 @@
> >  /** @file   All Pcd Ppi services are implemented here. -Copyright (c) 2006 -
> > 2018, Intel Corporation. All rights reserved.<BR>+Copyright (c) 2006 -
> > 2021, Intel Corporation. All rights reserved.<BR> (C) Copyright 2016
> > Hewlett Packard Enterprise Development LP<BR> SPDX-License-Identifier:
> > BSD-2- Clause-Patent @@ -339,6 +339,75 @@ PcdPeimInit (
> >  {   EFI_STATUS Status; +  Status = PeiServicesRegisterForShadow
> > (FileHandle);+  if (Status == EFI_ALREADY_STARTED) {+    //+    // This is now
> > starting in memory, the second time starting.+    //+
> > EFI_PEI_PPI_DESCRIPTOR *OldPpiList;+    EFI_PEI_PPI_DESCRIPTOR
> > *OldPpiList2;+    VOID *Ppi;+    VOID *Ppi2;++    OldPpiList = NULL;+    Status
> =
> > PeiServicesLocatePpi (+               &gPcdPpiGuid,+               0,+
> > &OldPpiList,+               &Ppi+               );+    ASSERT_EFI_ERROR (Status);++    if
> > (OldPpiList != NULL) {+      Status = PeiServicesReInstallPpi (OldPpiList,
> > &mPpiList[0]);+      ASSERT_EFI_ERROR (Status);+    }++    OldPpiList2 =
> NULL;+
> > Status = PeiServicesLocatePpi (+               &gGetPcdInfoPpiGuid,+               0,+
> > &OldPpiList2,+               &Ppi2+               );+    ASSERT_EFI_ERROR (Status);++
> if
> > (OldPpiList2 != NULL) {+      Status = PeiServicesReInstallPpi (OldPpiList2,
> > &mPpiList2[0]);+      ASSERT_EFI_ERROR (Status);+    }++    OldPpiList =
> NULL;+
> > Status = PeiServicesLocatePpi (+               &gEfiPeiPcdPpiGuid,+               0,+
> > &OldPpiList,+               &Ppi+               );+    ASSERT_EFI_ERROR (Status);++    if
> > (OldPpiList != NULL) {+      Status = PeiServicesReInstallPpi (OldPpiList,
> > &mPpiList[1]);+      ASSERT_EFI_ERROR (Status);+    }++    OldPpiList2 =
> NULL;+
> > Status = PeiServicesLocatePpi (+               &gEfiGetPcdInfoPpiGuid,+
> 0,+
> > &OldPpiList2,+               &Ppi2+               );+    ASSERT_EFI_ERROR (Status);++
> if
> > (OldPpiList2 != NULL) {+      Status = PeiServicesReInstallPpi (OldPpiList2,
> > &mPpiList2[1]);+      ASSERT_EFI_ERROR (Status);+    }++    return Status;+  }+
> > BuildPcdDatabase (FileHandle);    //--
> > 2.32.0.windows.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-08-12  7:11 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-08-09  2:27 [PATCH] MdeModulePkg PCD: FSP NotifyPhase APIs caused 100ms delay GregX Yeh
2021-08-11  6:45 ` Wang, Jian J
2021-08-12  3:47 ` Dandan Bi
2021-08-12  7:06   ` GregX Yeh
2021-08-12  7:11     ` Dandan Bi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox