audk/OvmfPkg/PlatformPei
Min Xu 9a9b33b3d6 OvmfPkg/PlatformPei: Move global variables to PlatformInfoHob
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3863

The intention of PlatformInitLib is to extract the common function used
in OvmfPkg/PlatformPei. This lib will be used not only in PEI phase but
also in SEC phase. SEC phase cannot use global variables between
different functions. So PlatformInfoHob is created to hold the
informations shared between functions. For example, HostBridgeDevId
corespond to mHostBridgeDevId in PlatformPei.

In this patch we will first move below global variables to
PlatformInfoHob.
 - mBootMode
 - mS3Supported
 - mPhysMemAddressWidth
 - mMaxCpuCount
 - mHostBridgeDevId
 - mQ35SmramAtDefaultSmbase
 - mQemuUc32Base
 - mS3AcpiReservedMemorySize
 - mS3AcpiReservedMemoryBase

PlatformInfoHob also holds other information, for example,
PciIoBase / PciIoSize. This is because in SEC phase, PcdSetxxx
doesn't work. So we will restruct the functions which set PCDs
into two, one for PlatformInfoLib, one for PlatformPei.

So in this patch we first move global variables and PCDs to
PlatformInfoHob. All the changes are in OvmfPkg/PlatformPei.

Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Brijesh Singh <brijesh.singh@amd.com>
Cc: Erdem Aktas <erdemaktas@google.com>
Cc: James Bottomley <jejb@linux.ibm.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Tom Lendacky <thomas.lendacky@amd.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Sebastien Boeuf <sebastien.boeuf@intel.com>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
Signed-off-by: Min Xu <min.m.xu@intel.com>
2022-04-02 08:15:12 +00:00
..
AmdSev.c OvmfPkg/PlatformPei: Move global variables to PlatformInfoHob 2022-04-02 08:15:12 +00:00
ClearCache.c OvmfPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
FeatureControl.c OvmfPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
Fv.c OvmfPkg/PlatformPei: Move global variables to PlatformInfoHob 2022-04-02 08:15:12 +00:00
MemDetect.c OvmfPkg/PlatformPei: Move global variables to PlatformInfoHob 2022-04-02 08:15:12 +00:00
MemTypeInfo.c OvmfPkg/PlatformPei: Move global variables to PlatformInfoHob 2022-04-02 08:15:12 +00:00
Platform.c OvmfPkg/PlatformPei: Move global variables to PlatformInfoHob 2022-04-02 08:15:12 +00:00
Platform.h OvmfPkg/PlatformPei: Move global variables to PlatformInfoHob 2022-04-02 08:15:12 +00:00
PlatformPei.inf OvmfPkg: Create initial version of PlatformInitLib 2022-04-02 08:15:12 +00:00