[edk2,v3,09/16] ArmPkg/CpuPei: base GCD memory space size on CPU's PA range

Message ID 20181128143357.991-10-ard.biesheuvel@linaro.org
State New
Headers show
Series
  • Pkg: lift 40-bit IPA space limit
Related show

Commit Message

Ard Biesheuvel Nov. 28, 2018, 2:33 p.m.
Derive the size of the GCD memory space map directly from the CPU's
information registers rather than from the PcdPrePiCpuMemorySize PCD,
which will be removed.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>

---
 ArmPkg/Drivers/CpuPei/CpuPei.inf | 1 -
 ArmPkg/Drivers/CpuPei/CpuPei.c   | 2 +-
 2 files changed, 1 insertion(+), 2 deletions(-)

-- 
2.19.1

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

Comments

Philippe Mathieu-Daudé Nov. 28, 2018, 3:01 p.m. | #1
On 28/11/18 15:33, Ard Biesheuvel wrote:
> Derive the size of the GCD memory space map directly from the CPU's
> information registers rather than from the PcdPrePiCpuMemorySize PCD,
> which will be removed.
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
> ---
>  ArmPkg/Drivers/CpuPei/CpuPei.inf | 1 -
>  ArmPkg/Drivers/CpuPei/CpuPei.c   | 2 +-
>  2 files changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/ArmPkg/Drivers/CpuPei/CpuPei.inf b/ArmPkg/Drivers/CpuPei/CpuPei.inf
> index eafccd600983..dcea012fd8f9 100644
> --- a/ArmPkg/Drivers/CpuPei/CpuPei.inf
> +++ b/ArmPkg/Drivers/CpuPei/CpuPei.inf
> @@ -50,7 +50,6 @@ [Guids]
>    gArmMpCoreInfoGuid
>  
>  [FixedPcd]
> -  gEmbeddedTokenSpaceGuid.PcdPrePiCpuMemorySize
>    gEmbeddedTokenSpaceGuid.PcdPrePiCpuIoSize
>  
>  [Depex]
> diff --git a/ArmPkg/Drivers/CpuPei/CpuPei.c b/ArmPkg/Drivers/CpuPei/CpuPei.c
> index d54f42acfcc8..e63519ff6481 100644
> --- a/ArmPkg/Drivers/CpuPei/CpuPei.c
> +++ b/ArmPkg/Drivers/CpuPei/CpuPei.c
> @@ -73,7 +73,7 @@ InitializeCpuPeim (
>    ArmEnableBranchPrediction ();
>  
>    // Publish the CPU memory and io spaces sizes

This comment is misleading, maybe 'sizes' -> 'addressable bits'?
(not related to this series)

> -  BuildCpuHob (PcdGet8 (PcdPrePiCpuMemorySize), PcdGet8 (PcdPrePiCpuIoSize));
> +  BuildCpuHob (ArmGetPhysicalAddressBits (), PcdGet8 (PcdPrePiCpuIoSize));

Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>

>  
>    // Only MP Core platform need to produce gArmMpCoreInfoPpiGuid
>    Status = PeiServicesLocatePpi (&gArmMpCoreInfoPpiGuid, 0, NULL, (VOID**)&ArmMpCoreInfoPpi);
>
Laszlo Ersek Nov. 28, 2018, 7:51 p.m. | #2
On 11/28/18 15:33, Ard Biesheuvel wrote:
> Derive the size of the GCD memory space map directly from the CPU's

> information registers rather than from the PcdPrePiCpuMemorySize PCD,

> which will be removed.

> 

> Contributed-under: TianoCore Contribution Agreement 1.1

> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>

> ---

>  ArmPkg/Drivers/CpuPei/CpuPei.inf | 1 -

>  ArmPkg/Drivers/CpuPei/CpuPei.c   | 2 +-

>  2 files changed, 1 insertion(+), 2 deletions(-)

> 

> diff --git a/ArmPkg/Drivers/CpuPei/CpuPei.inf b/ArmPkg/Drivers/CpuPei/CpuPei.inf

> index eafccd600983..dcea012fd8f9 100644

> --- a/ArmPkg/Drivers/CpuPei/CpuPei.inf

> +++ b/ArmPkg/Drivers/CpuPei/CpuPei.inf

> @@ -50,7 +50,6 @@ [Guids]

>    gArmMpCoreInfoGuid

>  

>  [FixedPcd]

> -  gEmbeddedTokenSpaceGuid.PcdPrePiCpuMemorySize

>    gEmbeddedTokenSpaceGuid.PcdPrePiCpuIoSize

>  

>  [Depex]

> diff --git a/ArmPkg/Drivers/CpuPei/CpuPei.c b/ArmPkg/Drivers/CpuPei/CpuPei.c

> index d54f42acfcc8..e63519ff6481 100644

> --- a/ArmPkg/Drivers/CpuPei/CpuPei.c

> +++ b/ArmPkg/Drivers/CpuPei/CpuPei.c

> @@ -73,7 +73,7 @@ InitializeCpuPeim (

>    ArmEnableBranchPrediction ();

>  

>    // Publish the CPU memory and io spaces sizes

> -  BuildCpuHob (PcdGet8 (PcdPrePiCpuMemorySize), PcdGet8 (PcdPrePiCpuIoSize));

> +  BuildCpuHob (ArmGetPhysicalAddressBits (), PcdGet8 (PcdPrePiCpuIoSize));

>  

>    // Only MP Core platform need to produce gArmMpCoreInfoPpiGuid

>    Status = PeiServicesLocatePpi (&gArmMpCoreInfoPpiGuid, 0, NULL, (VOID**)&ArmMpCoreInfoPpi);

> 


Reviewed-by: Laszlo Ersek <lersek@redhat.com>


_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
Leif Lindholm Nov. 29, 2018, 3:43 p.m. | #3
On Wed, Nov 28, 2018 at 03:33:50PM +0100, Ard Biesheuvel wrote:
> Derive the size of the GCD memory space map directly from the CPU's

> information registers rather than from the PcdPrePiCpuMemorySize PCD,

> which will be removed.

> 

> Contributed-under: TianoCore Contribution Agreement 1.1

> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>


Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>


> ---

>  ArmPkg/Drivers/CpuPei/CpuPei.inf | 1 -

>  ArmPkg/Drivers/CpuPei/CpuPei.c   | 2 +-

>  2 files changed, 1 insertion(+), 2 deletions(-)

> 

> diff --git a/ArmPkg/Drivers/CpuPei/CpuPei.inf b/ArmPkg/Drivers/CpuPei/CpuPei.inf

> index eafccd600983..dcea012fd8f9 100644

> --- a/ArmPkg/Drivers/CpuPei/CpuPei.inf

> +++ b/ArmPkg/Drivers/CpuPei/CpuPei.inf

> @@ -50,7 +50,6 @@ [Guids]

>    gArmMpCoreInfoGuid

>  

>  [FixedPcd]

> -  gEmbeddedTokenSpaceGuid.PcdPrePiCpuMemorySize

>    gEmbeddedTokenSpaceGuid.PcdPrePiCpuIoSize

>  

>  [Depex]

> diff --git a/ArmPkg/Drivers/CpuPei/CpuPei.c b/ArmPkg/Drivers/CpuPei/CpuPei.c

> index d54f42acfcc8..e63519ff6481 100644

> --- a/ArmPkg/Drivers/CpuPei/CpuPei.c

> +++ b/ArmPkg/Drivers/CpuPei/CpuPei.c

> @@ -73,7 +73,7 @@ InitializeCpuPeim (

>    ArmEnableBranchPrediction ();

>  

>    // Publish the CPU memory and io spaces sizes

> -  BuildCpuHob (PcdGet8 (PcdPrePiCpuMemorySize), PcdGet8 (PcdPrePiCpuIoSize));

> +  BuildCpuHob (ArmGetPhysicalAddressBits (), PcdGet8 (PcdPrePiCpuIoSize));

>  

>    // Only MP Core platform need to produce gArmMpCoreInfoPpiGuid

>    Status = PeiServicesLocatePpi (&gArmMpCoreInfoPpiGuid, 0, NULL, (VOID**)&ArmMpCoreInfoPpi);

> -- 

> 2.19.1

> 

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

Patch

diff --git a/ArmPkg/Drivers/CpuPei/CpuPei.inf b/ArmPkg/Drivers/CpuPei/CpuPei.inf
index eafccd600983..dcea012fd8f9 100644
--- a/ArmPkg/Drivers/CpuPei/CpuPei.inf
+++ b/ArmPkg/Drivers/CpuPei/CpuPei.inf
@@ -50,7 +50,6 @@  [Guids]
   gArmMpCoreInfoGuid
 
 [FixedPcd]
-  gEmbeddedTokenSpaceGuid.PcdPrePiCpuMemorySize
   gEmbeddedTokenSpaceGuid.PcdPrePiCpuIoSize
 
 [Depex]
diff --git a/ArmPkg/Drivers/CpuPei/CpuPei.c b/ArmPkg/Drivers/CpuPei/CpuPei.c
index d54f42acfcc8..e63519ff6481 100644
--- a/ArmPkg/Drivers/CpuPei/CpuPei.c
+++ b/ArmPkg/Drivers/CpuPei/CpuPei.c
@@ -73,7 +73,7 @@  InitializeCpuPeim (
   ArmEnableBranchPrediction ();
 
   // Publish the CPU memory and io spaces sizes
-  BuildCpuHob (PcdGet8 (PcdPrePiCpuMemorySize), PcdGet8 (PcdPrePiCpuIoSize));
+  BuildCpuHob (ArmGetPhysicalAddressBits (), PcdGet8 (PcdPrePiCpuIoSize));
 
   // Only MP Core platform need to produce gArmMpCoreInfoPpiGuid
   Status = PeiServicesLocatePpi (&gArmMpCoreInfoPpiGuid, 0, NULL, (VOID**)&ArmMpCoreInfoPpi);