[edk2-devel] [PATCH V2] UefiCpuPkg PiSmmCpuDxeSmm: Reduce SMRAM consumption in CpuS3.c

Ni, Ray ray.ni at intel.com
Thu Jan 7 05:23:37 UTC 2021


> This patch is a step in the right direction, but, IMO, it can be improved.
> 
> The IsRegisterTableEmpty() function should also handle the case when the
> "RegisterTable" parameter is NULL. The function should then also return
> TRUE.
> 
> And then, two more patches would be nice:
> 
> 
> (2) The register table allocation in
> "UefiCpuPkg/CpuS3DataDxe/CpuS3Data.c" should be removed.
> 
> Right now, the code there allocates memory just so it can set the
> "TableLength" and "AllocatedSize" fields to zero, for each "InitialApicId".
> 
> It's a waste -- the memory is allocated only for ensuring that
> PiSmmCpuDxeSmm does not program any CPU registers during S3 resume.
> 
> Setting "AcpiCpuData->RegisterTable" and
> "AcpiCpuData->PreSmmInitRegisterTable" should have the same effect.

Laszlo,
It's a good suggestion.
We also need to change CpuS3.c:SetRegister() to directly return
when mAcpiCpuData.[PreSmmInit]RegisterTable is NULL.

Considering the urgency of this patch (fix a system hang caused by smram shortage),
do you agree that we can first let this patch in?

Thanks,
Ray


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#69893): https://edk2.groups.io/g/devel/message/69893
Mute This Topic: https://groups.io/mt/79470147/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-






More information about the edk2-devel-archive mailing list