On 22 September 2015 at 02:11, Laszlo Ersek <ler...@redhat.com> wrote:
> On 09/21/15 20:51, Ard Biesheuvel wrote:
>> Commit SVN r18503 ("MdeModulePkg DxeCore: Take the range in resource
>> HOB for PHIT as higher priority") changed the GCD init logic to take
>> the sum of the region sizes in gMemoryTypeInformation[] into account
>> when estimating the minimal amount of memory needed to boot the system.
>>
>> Unfortunately, as an unintended side effect, this change results in boot
>> failures of ArmVirtQemu when running with QEMU's default memory size of
>> 128 MB. The reason is that the sum of the gMemoryTypeInformation region
>> sizes plus the size of the inital PEI region exceeds 128 MB. Since we do
>> not actually need to preallocate 20,000 pages' worth of BootServicesData
>> memory, reduce this figure to the more reasonable 12,000.
>>
>> Reported-by: Mark Rutland <mark.rutl...@arm.com>
>> Contributed-under: TianoCore Contribution Agreement 1.0
>> Signed-off-by: Ard Biesheuvel <ard.biesheu...@linaro.org>
>> ---
>>  ArmVirtPkg/ArmVirt.dsc.inc | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/ArmVirtPkg/ArmVirt.dsc.inc b/ArmVirtPkg/ArmVirt.dsc.inc
>> index bc308f527130..0e7a1098a380 100644
>> --- a/ArmVirtPkg/ArmVirt.dsc.inc
>> +++ b/ArmVirtPkg/ArmVirt.dsc.inc
>> @@ -349,7 +349,7 @@ [PcdsFixedAtBuild.common]
>>    gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiRuntimeServicesCode|150
>>    gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiBootServicesCode|1000
>>  !endif
>> -  gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiBootServicesData|20000
>> +  gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiBootServicesData|12000
>>    gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiLoaderCode|20
>>    gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiLoaderData|0
>>
>>
>
> ~46MB instead of ~78MB should suffice, I agree.
>
> (I recently looked into improving the UEFI memmap fragmentation for
> OVMF, like you had done for ArmVirtPkg. I didn't have good results; I
> could only reduce the number of memmap entries from 50-55 to about 40.
> Which is why I didn't post the prealloc tuning patch ultimately. But,
> and I'm getting to why it is relevant here, it did require me to look at
> the tallies printed by the UEFI shell's MEMMAP command. For OVMF,
> preallocating approximately 41 MB for BS_Data is not only sufficient, it
> already contains a 15% future proofing margin. OVMF is quite memory
> hungrier than ArmVirtPkg, so preallocating 46MB for ArmVirtPkg is still
> plenty.)
>
> Reviewed-by: Laszlo Ersek <ler...@redhat.com>

Thanks

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

Reply via email to