diff mbox

[edk2,2/4] OvmfPkg: increase the S3 permanent PEI RAM size by 8.5 MB

Message ID 1467918647-14721-3-git-send-email-lersek@redhat.com
State New
Headers show

Commit Message

Laszlo Ersek July 7, 2016, 7:10 p.m. UTC
When setting PcdCpuMaxLogicalProcessorNumber to 255, then CpuMpPei seems
to require a bit more than 8MB of permanent PEI RAM in the
PrepareAPStartupVector() function. (With the default PCD value of 64, it
needs one quarter of that: approximately 2MB.)

On the S3 resume path, we install only 32 KB of permanent PEI RAM however,
and even that is almost exhausted already:

> CpuMpPei: WakeupBuffer = 0x9F000

> AllocatePages failed: No 0x7FF Pages is available.

> There is only left 0x1 pages memory resource to be allocated.

>

> ASSERT_EFI_ERROR (Status = Out of Resources)

> ASSERT UefiCpuPkg/CpuMpPei/CpuMpPei.c(730): !EFI_ERROR (Status)


Increase PcdS3AcpiReservedMemorySize by 8.5 MB (0x880000 bytes, 0x880
pages). The areas above the S3 permanent PEI RAM (decompressed PEI FV,
decompressed DXE FV) are shifted up by the same amount. The
EfiACPIMemoryNVS footprint increases similarly (but only if QEMU is
instructed to enable S3).

Cc: Jeff Fan <jeff.fan@intel.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Michael Kinney <michael.d.kinney@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>

---
 OvmfPkg/OvmfPkgIa32.fdf    | 10 +++++-----
 OvmfPkg/OvmfPkgIa32X64.fdf | 10 +++++-----
 OvmfPkg/OvmfPkgX64.fdf     | 10 +++++-----
 3 files changed, 15 insertions(+), 15 deletions(-)

-- 
1.8.3.1


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

Comments

Laszlo Ersek July 11, 2016, 6:34 p.m. UTC | #1
Jeff,

On 07/07/16 21:10, Laszlo Ersek wrote:
> When setting PcdCpuMaxLogicalProcessorNumber to 255, then CpuMpPei seems

> to require a bit more than 8MB of permanent PEI RAM in the

> PrepareAPStartupVector() function. (With the default PCD value of 64, it

> needs one quarter of that: approximately 2MB.)


Do you think we could bring PcdS3AcpiReservedMemorySize closer to the
actual needs of CpuMpPei? For example, if there is a simple coefficient
between the memory needs of CpuMpPei and
PcdCpuMaxLogicalProcessorNumber, we could do that arithmetic in the FDF
file.

For example, we could create a macro, then set both
PcdCpuMaxLogicalProcessorNumber from it (directly) and also
PcdS3AcpiReservedMemorySize (indirectly, by multiplying the macro with a
coefficient we'd know from CpuMpPei).

Thanks
Laszlo

> On the S3 resume path, we install only 32 KB of permanent PEI RAM however,

> and even that is almost exhausted already:

> 

>> CpuMpPei: WakeupBuffer = 0x9F000

>> AllocatePages failed: No 0x7FF Pages is available.

>> There is only left 0x1 pages memory resource to be allocated.

>>

>> ASSERT_EFI_ERROR (Status = Out of Resources)

>> ASSERT UefiCpuPkg/CpuMpPei/CpuMpPei.c(730): !EFI_ERROR (Status)

> 

> Increase PcdS3AcpiReservedMemorySize by 8.5 MB (0x880000 bytes, 0x880

> pages). The areas above the S3 permanent PEI RAM (decompressed PEI FV,

> decompressed DXE FV) are shifted up by the same amount. The

> EfiACPIMemoryNVS footprint increases similarly (but only if QEMU is

> instructed to enable S3).

> 

> Cc: Jeff Fan <jeff.fan@intel.com>

> Cc: Jordan Justen <jordan.l.justen@intel.com>

> Cc: Michael Kinney <michael.d.kinney@intel.com>

> Contributed-under: TianoCore Contribution Agreement 1.0

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

> ---

>  OvmfPkg/OvmfPkgIa32.fdf    | 10 +++++-----

>  OvmfPkg/OvmfPkgIa32X64.fdf | 10 +++++-----

>  OvmfPkg/OvmfPkgX64.fdf     | 10 +++++-----

>  3 files changed, 15 insertions(+), 15 deletions(-)

> 

> diff --git a/OvmfPkg/OvmfPkgIa32.fdf b/OvmfPkg/OvmfPkgIa32.fdf

> index 59a4024ff026..a55ddf05594f 100644

> --- a/OvmfPkg/OvmfPkgIa32.fdf

> +++ b/OvmfPkg/OvmfPkgIa32.fdf

> @@ -67,10 +67,10 @@ [FD.OVMF_CODE]

>  

>  [FD.MEMFD]

>  BaseAddress   = $(MEMFD_BASE_ADDRESS)

> -Size          = 0xB00000

> +Size          = 0x1380000

>  ErasePolarity = 1

>  BlockSize     = 0x10000

> -NumBlocks     = 0xB0

> +NumBlocks     = 0x138

>  

>  0x000000|0x006000

>  gUefiOvmfPkgTokenSpaceGuid.PcdOvmfSecPageTablesBase|gUefiOvmfPkgTokenSpaceGuid.PcdOvmfSecPageTablesSize

> @@ -84,14 +84,14 @@ [FD.MEMFD]

>  0x010000|0x008000

>  gUefiOvmfPkgTokenSpaceGuid.PcdOvmfSecPeiTempRamBase|gUefiOvmfPkgTokenSpaceGuid.PcdOvmfSecPeiTempRamSize

>  

> -0x018000|0x008000

> +0x018000|0x888000

>  gUefiOvmfPkgTokenSpaceGuid.PcdS3AcpiReservedMemoryBase|gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdS3AcpiReservedMemorySize

>  

> -0x020000|0x0E0000

> +0x8A0000|0x0E0000

>  gUefiOvmfPkgTokenSpaceGuid.PcdOvmfPeiMemFvBase|gUefiOvmfPkgTokenSpaceGuid.PcdOvmfPeiMemFvSize

>  FV = PEIFV

>  

> -0x100000|0xA00000

> +0x980000|0xA00000

>  gUefiOvmfPkgTokenSpaceGuid.PcdOvmfDxeMemFvBase|gUefiOvmfPkgTokenSpaceGuid.PcdOvmfDxeMemFvSize

>  FV = DXEFV

>  

> diff --git a/OvmfPkg/OvmfPkgIa32X64.fdf b/OvmfPkg/OvmfPkgIa32X64.fdf

> index c6167a4176af..4503a9fdeb0f 100644

> --- a/OvmfPkg/OvmfPkgIa32X64.fdf

> +++ b/OvmfPkg/OvmfPkgIa32X64.fdf

> @@ -67,10 +67,10 @@ [FD.OVMF_CODE]

>  

>  [FD.MEMFD]

>  BaseAddress   = $(MEMFD_BASE_ADDRESS)

> -Size          = 0xB00000

> +Size          = 0x1380000

>  ErasePolarity = 1

>  BlockSize     = 0x10000

> -NumBlocks     = 0xB0

> +NumBlocks     = 0x138

>  

>  0x000000|0x006000

>  gUefiOvmfPkgTokenSpaceGuid.PcdOvmfSecPageTablesBase|gUefiOvmfPkgTokenSpaceGuid.PcdOvmfSecPageTablesSize

> @@ -84,14 +84,14 @@ [FD.MEMFD]

>  0x010000|0x008000

>  gUefiOvmfPkgTokenSpaceGuid.PcdOvmfSecPeiTempRamBase|gUefiOvmfPkgTokenSpaceGuid.PcdOvmfSecPeiTempRamSize

>  

> -0x018000|0x008000

> +0x018000|0x888000

>  gUefiOvmfPkgTokenSpaceGuid.PcdS3AcpiReservedMemoryBase|gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdS3AcpiReservedMemorySize

>  

> -0x020000|0x0E0000

> +0x8A0000|0x0E0000

>  gUefiOvmfPkgTokenSpaceGuid.PcdOvmfPeiMemFvBase|gUefiOvmfPkgTokenSpaceGuid.PcdOvmfPeiMemFvSize

>  FV = PEIFV

>  

> -0x100000|0xA00000

> +0x980000|0xA00000

>  gUefiOvmfPkgTokenSpaceGuid.PcdOvmfDxeMemFvBase|gUefiOvmfPkgTokenSpaceGuid.PcdOvmfDxeMemFvSize

>  FV = DXEFV

>  

> diff --git a/OvmfPkg/OvmfPkgX64.fdf b/OvmfPkg/OvmfPkgX64.fdf

> index 30b0c2ba3fc8..9a539aa7b3c6 100644

> --- a/OvmfPkg/OvmfPkgX64.fdf

> +++ b/OvmfPkg/OvmfPkgX64.fdf

> @@ -67,10 +67,10 @@ [FD.OVMF_CODE]

>  

>  [FD.MEMFD]

>  BaseAddress   = $(MEMFD_BASE_ADDRESS)

> -Size          = 0xB00000

> +Size          = 0x1380000

>  ErasePolarity = 1

>  BlockSize     = 0x10000

> -NumBlocks     = 0xB0

> +NumBlocks     = 0x138

>  

>  0x000000|0x006000

>  gUefiOvmfPkgTokenSpaceGuid.PcdOvmfSecPageTablesBase|gUefiOvmfPkgTokenSpaceGuid.PcdOvmfSecPageTablesSize

> @@ -84,14 +84,14 @@ [FD.MEMFD]

>  0x010000|0x008000

>  gUefiOvmfPkgTokenSpaceGuid.PcdOvmfSecPeiTempRamBase|gUefiOvmfPkgTokenSpaceGuid.PcdOvmfSecPeiTempRamSize

>  

> -0x018000|0x008000

> +0x018000|0x888000

>  gUefiOvmfPkgTokenSpaceGuid.PcdS3AcpiReservedMemoryBase|gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdS3AcpiReservedMemorySize

>  

> -0x020000|0x0E0000

> +0x8A0000|0x0E0000

>  gUefiOvmfPkgTokenSpaceGuid.PcdOvmfPeiMemFvBase|gUefiOvmfPkgTokenSpaceGuid.PcdOvmfPeiMemFvSize

>  FV = PEIFV

>  

> -0x100000|0xA00000

> +0x980000|0xA00000

>  gUefiOvmfPkgTokenSpaceGuid.PcdOvmfDxeMemFvBase|gUefiOvmfPkgTokenSpaceGuid.PcdOvmfDxeMemFvSize

>  FV = DXEFV

>  

> 


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

Patch

diff --git a/OvmfPkg/OvmfPkgIa32.fdf b/OvmfPkg/OvmfPkgIa32.fdf
index 59a4024ff026..a55ddf05594f 100644
--- a/OvmfPkg/OvmfPkgIa32.fdf
+++ b/OvmfPkg/OvmfPkgIa32.fdf
@@ -67,10 +67,10 @@  [FD.OVMF_CODE]
 
 [FD.MEMFD]
 BaseAddress   = $(MEMFD_BASE_ADDRESS)
-Size          = 0xB00000
+Size          = 0x1380000
 ErasePolarity = 1
 BlockSize     = 0x10000
-NumBlocks     = 0xB0
+NumBlocks     = 0x138
 
 0x000000|0x006000
 gUefiOvmfPkgTokenSpaceGuid.PcdOvmfSecPageTablesBase|gUefiOvmfPkgTokenSpaceGuid.PcdOvmfSecPageTablesSize
@@ -84,14 +84,14 @@  [FD.MEMFD]
 0x010000|0x008000
 gUefiOvmfPkgTokenSpaceGuid.PcdOvmfSecPeiTempRamBase|gUefiOvmfPkgTokenSpaceGuid.PcdOvmfSecPeiTempRamSize
 
-0x018000|0x008000
+0x018000|0x888000
 gUefiOvmfPkgTokenSpaceGuid.PcdS3AcpiReservedMemoryBase|gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdS3AcpiReservedMemorySize
 
-0x020000|0x0E0000
+0x8A0000|0x0E0000
 gUefiOvmfPkgTokenSpaceGuid.PcdOvmfPeiMemFvBase|gUefiOvmfPkgTokenSpaceGuid.PcdOvmfPeiMemFvSize
 FV = PEIFV
 
-0x100000|0xA00000
+0x980000|0xA00000
 gUefiOvmfPkgTokenSpaceGuid.PcdOvmfDxeMemFvBase|gUefiOvmfPkgTokenSpaceGuid.PcdOvmfDxeMemFvSize
 FV = DXEFV
 
diff --git a/OvmfPkg/OvmfPkgIa32X64.fdf b/OvmfPkg/OvmfPkgIa32X64.fdf
index c6167a4176af..4503a9fdeb0f 100644
--- a/OvmfPkg/OvmfPkgIa32X64.fdf
+++ b/OvmfPkg/OvmfPkgIa32X64.fdf
@@ -67,10 +67,10 @@  [FD.OVMF_CODE]
 
 [FD.MEMFD]
 BaseAddress   = $(MEMFD_BASE_ADDRESS)
-Size          = 0xB00000
+Size          = 0x1380000
 ErasePolarity = 1
 BlockSize     = 0x10000
-NumBlocks     = 0xB0
+NumBlocks     = 0x138
 
 0x000000|0x006000
 gUefiOvmfPkgTokenSpaceGuid.PcdOvmfSecPageTablesBase|gUefiOvmfPkgTokenSpaceGuid.PcdOvmfSecPageTablesSize
@@ -84,14 +84,14 @@  [FD.MEMFD]
 0x010000|0x008000
 gUefiOvmfPkgTokenSpaceGuid.PcdOvmfSecPeiTempRamBase|gUefiOvmfPkgTokenSpaceGuid.PcdOvmfSecPeiTempRamSize
 
-0x018000|0x008000
+0x018000|0x888000
 gUefiOvmfPkgTokenSpaceGuid.PcdS3AcpiReservedMemoryBase|gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdS3AcpiReservedMemorySize
 
-0x020000|0x0E0000
+0x8A0000|0x0E0000
 gUefiOvmfPkgTokenSpaceGuid.PcdOvmfPeiMemFvBase|gUefiOvmfPkgTokenSpaceGuid.PcdOvmfPeiMemFvSize
 FV = PEIFV
 
-0x100000|0xA00000
+0x980000|0xA00000
 gUefiOvmfPkgTokenSpaceGuid.PcdOvmfDxeMemFvBase|gUefiOvmfPkgTokenSpaceGuid.PcdOvmfDxeMemFvSize
 FV = DXEFV
 
diff --git a/OvmfPkg/OvmfPkgX64.fdf b/OvmfPkg/OvmfPkgX64.fdf
index 30b0c2ba3fc8..9a539aa7b3c6 100644
--- a/OvmfPkg/OvmfPkgX64.fdf
+++ b/OvmfPkg/OvmfPkgX64.fdf
@@ -67,10 +67,10 @@  [FD.OVMF_CODE]
 
 [FD.MEMFD]
 BaseAddress   = $(MEMFD_BASE_ADDRESS)
-Size          = 0xB00000
+Size          = 0x1380000
 ErasePolarity = 1
 BlockSize     = 0x10000
-NumBlocks     = 0xB0
+NumBlocks     = 0x138
 
 0x000000|0x006000
 gUefiOvmfPkgTokenSpaceGuid.PcdOvmfSecPageTablesBase|gUefiOvmfPkgTokenSpaceGuid.PcdOvmfSecPageTablesSize
@@ -84,14 +84,14 @@  [FD.MEMFD]
 0x010000|0x008000
 gUefiOvmfPkgTokenSpaceGuid.PcdOvmfSecPeiTempRamBase|gUefiOvmfPkgTokenSpaceGuid.PcdOvmfSecPeiTempRamSize
 
-0x018000|0x008000
+0x018000|0x888000
 gUefiOvmfPkgTokenSpaceGuid.PcdS3AcpiReservedMemoryBase|gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdS3AcpiReservedMemorySize
 
-0x020000|0x0E0000
+0x8A0000|0x0E0000
 gUefiOvmfPkgTokenSpaceGuid.PcdOvmfPeiMemFvBase|gUefiOvmfPkgTokenSpaceGuid.PcdOvmfPeiMemFvSize
 FV = PEIFV
 
-0x100000|0xA00000
+0x980000|0xA00000
 gUefiOvmfPkgTokenSpaceGuid.PcdOvmfDxeMemFvBase|gUefiOvmfPkgTokenSpaceGuid.PcdOvmfDxeMemFvSize
 FV = DXEFV