]> git.proxmox.com Git - mirror_edk2.git/commit
OvmfPkg: install DxeSmmReadyToLock in PlatformBdsLib
authorLaszlo Ersek <lersek@redhat.com>
Sun, 26 Jul 2015 08:02:24 +0000 (08:02 +0000)
committerjljusten <jljusten@Edk2>
Sun, 26 Jul 2015 08:02:24 +0000 (08:02 +0000)
commit9d7051b7a09281f86533bc3ce65cfe69638e14a9
treeb2dbb362de031972420c6076b04f60b51911139e
parent155f9d424c549356688021881377a55fc99dacf5
OvmfPkg: install DxeSmmReadyToLock in PlatformBdsLib

Currently we have the following call chain in OVMF:

  PlatformBdsPolicyBehavior()
                            [OvmfPkg/Library/PlatformBdsLib/BdsPlatform.c]
    //
    // signals End-of-Dxe
    //
    OnEndOfDxe()                      [OvmfPkg/AcpiS3SaveDxe/AcpiS3Save.c]
      S3Ready()                       [OvmfPkg/AcpiS3SaveDxe/AcpiS3Save.c]
        //
        // 1. saves S3 state
        //

        SaveS3BootScript()            [OvmfPkg/AcpiS3SaveDxe/AcpiS3Save.c]
          //
          // 2. saves INFO opcode in S3 boot script
          // 3. installs DxeSmmReadyToLockProtocol
          //

The bottom of this call chain was introduced in git commit 5a217a06 (SVN
r15305, "OvmfPkg: S3 Suspend: save boot script after ACPI context"). That
patch was necessary because there was no other way, due to GenericBdsLib
calling S3Save() from BdsLibBootViaBootOption(), to perform the necessary
steps in the right order:
- save S3 system information,
- save a final (well, only) boot script opcode,
- signal DxeSmmReadyToLock, closing the boot script, and locking down
  LockBox and SMM.

The GenericBdsLib bug has been fixed in the previous patch -- the call in
BdsLibBootViaBootOption() has been eliminated.

Therefore, hoist the SaveS3BootScript() code, and call, from
OvmfPkg/AcpiS3SaveDxe, to PlatformBdsLib:

  PlatformBdsPolicyBehavior()
                            [OvmfPkg/Library/PlatformBdsLib/BdsPlatform.c]
    //
    // signals End-of-Dxe
    //
    OnEndOfDxe()                      [OvmfPkg/AcpiS3SaveDxe/AcpiS3Save.c]
      S3Ready()                       [OvmfPkg/AcpiS3SaveDxe/AcpiS3Save.c]
        //
        // 1. saves S3 state
        //

    <---
    SaveS3BootScript()      [OvmfPkg/Library/PlatformBdsLib/BdsPlatform.c]
      //
      // 2. saves INFO opcode in S3 boot script
      // 3. installs DxeSmmReadyToLockProtocol
      //

The installation of DxeSmmReadyToLockProtocol belongs with Platform BDS,
not AcpiS3SaveDxe, and we can now undo the hack in SVN r15305, without
upsetting the relative order of the steps.

Cc: Jordan Justen <jordan.l.justen@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18037 6f19259b-4bc3-4df7-8a09-765794883524
OvmfPkg/AcpiS3SaveDxe/AcpiS3Save.c
OvmfPkg/AcpiS3SaveDxe/AcpiS3SaveDxe.inf
OvmfPkg/Library/PlatformBdsLib/BdsPlatform.c
OvmfPkg/Library/PlatformBdsLib/BdsPlatform.h
OvmfPkg/Library/PlatformBdsLib/PlatformBdsLib.inf