[edk2-devel] [PATCH 00/14] OvmfPkg: avoid global variables in PEI

Gerd Hoffmann posted 14 patches 2 months, 1 week ago
Failed in applying to current master (apply log)
OvmfPkg/AmdSev/AmdSevX64.dsc                  |   4 +-
OvmfPkg/Bhyve/BhyveX64.dsc                    |   4 +-
OvmfPkg/Microvm/MicrovmX64.dsc                |   4 +-
OvmfPkg/OvmfPkgIa32.dsc                       |   4 +-
OvmfPkg/OvmfPkgIa32X64.dsc                    |   4 +-
OvmfPkg/OvmfPkgX64.dsc                        |   4 +-
.../PlatformRomDebugLibIoPort.inf             |   2 +-
.../Library/QemuFwCfgLib/QemuFwCfgPeiLib.inf  |   5 +-
OvmfPkg/Include/Library/PlatformInitLib.h     |   6 +
OvmfPkg/PlatformPei/Platform.h                |  18 +--
OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgPei.c   | 143 ++++++++++--------
OvmfPkg/PlatformPei/AmdSev.c                  |  14 +-
OvmfPkg/PlatformPei/FeatureControl.c          |  44 ++++--
OvmfPkg/PlatformPei/Fv.c                      |   6 +-
OvmfPkg/PlatformPei/MemDetect.c               |  56 +++----
OvmfPkg/PlatformPei/MemTypeInfo.c             |   4 +-
OvmfPkg/PlatformPei/Platform.c                |  92 ++++++-----
BaseTools/Conf/tools_def.template             |   6 +-
18 files changed, 232 insertions(+), 188 deletions(-)
[edk2-devel] [PATCH 00/14] OvmfPkg: avoid global variables in PEI
Posted by Gerd Hoffmann 2 months, 1 week ago
Writing to global variables changes the PEI firmware volume which in
turn screws up firmware volume measurements.  Fix OvmfPkg to avoid that,
for the most part by using the PlatformInfoHob instead.

Gerd Hoffmann (14):
  tools_def: remove GCC_IA32_CC_FLAGS/GCC_X64_CC_FLAGS
  tools_def: add -fno-omit-frame-pointer to GCC48_{IA32,X64}_CC_FLAGS
  OvmfPkg/PlatformPei: AmdSev: stop using mPlatformInfoHob
  OvmfPkg/PlatformPei: PeiFv: stop using mPlatformInfoHob
  OvmfPkg/PlatformPei Q35 SMM helpers: stop using mPlatformInfoHob
  OvmfPkg/PlatformPei: PeiMemory: stop using mPlatformInfoHob
  OvmfPkg/PlatformPei: MemTypeInfo: stop using mPlatformInfoHob
  OvmfPkg/PlatformPei: NoExec: stop using mPlatformInfoHob
  OvmfPkg/PlatformPei: Verification: stop using mPlatformInfoHob
  OvmfPkg/PlatformPei: remove mPlatformInfoHob
  OvmfPkg/PlatformPei: remove mFeatureControlValue
  OvmfPkg/DebugLibIoPort: use Rom version for PEI
  OvmfPkg/QemuFwCfgLib: rewrite fw_cfg probe
  OvmfPkg/QemuFwCfgLib: remove mQemuFwCfgSupported +
    mQemuFwCfgDmaSupported

 OvmfPkg/AmdSev/AmdSevX64.dsc                  |   4 +-
 OvmfPkg/Bhyve/BhyveX64.dsc                    |   4 +-
 OvmfPkg/Microvm/MicrovmX64.dsc                |   4 +-
 OvmfPkg/OvmfPkgIa32.dsc                       |   4 +-
 OvmfPkg/OvmfPkgIa32X64.dsc                    |   4 +-
 OvmfPkg/OvmfPkgX64.dsc                        |   4 +-
 .../PlatformRomDebugLibIoPort.inf             |   2 +-
 .../Library/QemuFwCfgLib/QemuFwCfgPeiLib.inf  |   5 +-
 OvmfPkg/Include/Library/PlatformInitLib.h     |   6 +
 OvmfPkg/PlatformPei/Platform.h                |  18 +--
 OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgPei.c   | 143 ++++++++++--------
 OvmfPkg/PlatformPei/AmdSev.c                  |  14 +-
 OvmfPkg/PlatformPei/FeatureControl.c          |  44 ++++--
 OvmfPkg/PlatformPei/Fv.c                      |   6 +-
 OvmfPkg/PlatformPei/MemDetect.c               |  56 +++----
 OvmfPkg/PlatformPei/MemTypeInfo.c             |   4 +-
 OvmfPkg/PlatformPei/Platform.c                |  92 ++++++-----
 BaseTools/Conf/tools_def.template             |   6 +-
 18 files changed, 232 insertions(+), 188 deletions(-)

-- 
2.38.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#96899): https://edk2.groups.io/g/devel/message/96899
Mute This Topic: https://groups.io/mt/95405198/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [PATCH 00/14] OvmfPkg: avoid global variables in PEI
Posted by Lendacky, Thomas via groups.io 1 month, 4 weeks ago
On 12/2/22 07:09, Gerd Hoffmann wrote:
> Writing to global variables changes the PEI firmware volume which in
> turn screws up firmware volume measurements.  Fix OvmfPkg to avoid that,
> for the most part by using the PlatformInfoHob instead.

Boot tested SEV, SEV-ES and SEV-SNP guests without issues. For the series:

Tested-by: Tom Lendacky <thomas.lendacky@amd.com>

> 
> Gerd Hoffmann (14):
>    tools_def: remove GCC_IA32_CC_FLAGS/GCC_X64_CC_FLAGS
>    tools_def: add -fno-omit-frame-pointer to GCC48_{IA32,X64}_CC_FLAGS
>    OvmfPkg/PlatformPei: AmdSev: stop using mPlatformInfoHob
>    OvmfPkg/PlatformPei: PeiFv: stop using mPlatformInfoHob
>    OvmfPkg/PlatformPei Q35 SMM helpers: stop using mPlatformInfoHob
>    OvmfPkg/PlatformPei: PeiMemory: stop using mPlatformInfoHob
>    OvmfPkg/PlatformPei: MemTypeInfo: stop using mPlatformInfoHob
>    OvmfPkg/PlatformPei: NoExec: stop using mPlatformInfoHob
>    OvmfPkg/PlatformPei: Verification: stop using mPlatformInfoHob
>    OvmfPkg/PlatformPei: remove mPlatformInfoHob
>    OvmfPkg/PlatformPei: remove mFeatureControlValue
>    OvmfPkg/DebugLibIoPort: use Rom version for PEI
>    OvmfPkg/QemuFwCfgLib: rewrite fw_cfg probe
>    OvmfPkg/QemuFwCfgLib: remove mQemuFwCfgSupported +
>      mQemuFwCfgDmaSupported
> 
>   OvmfPkg/AmdSev/AmdSevX64.dsc                  |   4 +-
>   OvmfPkg/Bhyve/BhyveX64.dsc                    |   4 +-
>   OvmfPkg/Microvm/MicrovmX64.dsc                |   4 +-
>   OvmfPkg/OvmfPkgIa32.dsc                       |   4 +-
>   OvmfPkg/OvmfPkgIa32X64.dsc                    |   4 +-
>   OvmfPkg/OvmfPkgX64.dsc                        |   4 +-
>   .../PlatformRomDebugLibIoPort.inf             |   2 +-
>   .../Library/QemuFwCfgLib/QemuFwCfgPeiLib.inf  |   5 +-
>   OvmfPkg/Include/Library/PlatformInitLib.h     |   6 +
>   OvmfPkg/PlatformPei/Platform.h                |  18 +--
>   OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgPei.c   | 143 ++++++++++--------
>   OvmfPkg/PlatformPei/AmdSev.c                  |  14 +-
>   OvmfPkg/PlatformPei/FeatureControl.c          |  44 ++++--
>   OvmfPkg/PlatformPei/Fv.c                      |   6 +-
>   OvmfPkg/PlatformPei/MemDetect.c               |  56 +++----
>   OvmfPkg/PlatformPei/MemTypeInfo.c             |   4 +-
>   OvmfPkg/PlatformPei/Platform.c                |  92 ++++++-----
>   BaseTools/Conf/tools_def.template             |   6 +-
>   18 files changed, 232 insertions(+), 188 deletions(-)
> 


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#97276): https://edk2.groups.io/g/devel/message/97276
Mute This Topic: https://groups.io/mt/95405198/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [PATCH 00/14] OvmfPkg: avoid global variables in PEI
Posted by Ard Biesheuvel 1 month, 3 weeks ago
On Mon, 12 Dec 2022 at 17:58, Tom Lendacky <thomas.lendacky@amd.com> wrote:
>
> On 12/2/22 07:09, Gerd Hoffmann wrote:
> > Writing to global variables changes the PEI firmware volume which in
> > turn screws up firmware volume measurements.  Fix OvmfPkg to avoid that,
> > for the most part by using the PlatformInfoHob instead.
>
> Boot tested SEV, SEV-ES and SEV-SNP guests without issues. For the series:
>
> Tested-by: Tom Lendacky <thomas.lendacky@amd.com>
>

Thanks, this look good to me so i'll pick up the OvmfPkg patches right away.

Liming, Bob, any objections against the BaseTools/ patches? (#1 and #2)


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#97379): https://edk2.groups.io/g/devel/message/97379
Mute This Topic: https://groups.io/mt/95405198/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-