X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=OvmfPkg%2FLibrary%2FPlatformBdsLib%2FBdsPlatform.c;fp=OvmfPkg%2FLibrary%2FPlatformBdsLib%2FBdsPlatform.c;h=b22f2a74a9d8a3ff9c6a0a2da266cf748e7d8f3b;hp=0bc02baf0371818528c656645fc03b71173768af;hb=70017e446125a454b6dc8f8fe6e4cfe5ff35b38e;hpb=058196bbb3451a1a342ca9e8679b3c3218b28538 diff --git a/OvmfPkg/Library/PlatformBdsLib/BdsPlatform.c b/OvmfPkg/Library/PlatformBdsLib/BdsPlatform.c index 0bc02baf03..b22f2a74a9 100644 --- a/OvmfPkg/Library/PlatformBdsLib/BdsPlatform.c +++ b/OvmfPkg/Library/PlatformBdsLib/BdsPlatform.c @@ -88,6 +88,20 @@ InstallDevicePathCallback ( VOID ); +EFI_STATUS +EFIAPI +ConnectRootBridge ( + IN EFI_HANDLE RootBridgeHandle, + IN VOID *Instance, + IN VOID *Context + ); + +STATIC +VOID +SaveS3BootScript ( + VOID + ); + // // BDS Platform Functions // @@ -113,6 +127,31 @@ Returns: { DEBUG ((EFI_D_INFO, "PlatformBdsInit\n")); InstallDevicePathCallback (); + + VisitAllInstancesOfProtocol (&gEfiPciRootBridgeIoProtocolGuid, + ConnectRootBridge, NULL); + + // + // Signal the ACPI platform driver that it can download QEMU ACPI tables. + // + EfiEventGroupSignal (&gRootBridgesConnectedEventGroupGuid); + + // + // We can't signal End-of-Dxe earlier than this. Namely, End-of-Dxe triggers + // the preparation of S3 system information. That logic has a hard dependency + // on the presence of the FACS ACPI table. Since our ACPI tables are only + // installed after PCI enumeration completes, we must not trigger the S3 save + // earlier, hence we can't signal End-of-Dxe earlier. + // + EfiEventGroupSignal (&gEfiEndOfDxeEventGroupGuid); + + if (QemuFwCfgS3Enabled ()) { + // + // Save the boot script too. Note that this requires/includes emitting the + // DxeSmmReadyToLock event, which in turn locks down SMM. + // + SaveS3BootScript (); + } } @@ -1242,31 +1281,6 @@ Returns: DEBUG ((EFI_D_INFO, "PlatformBdsPolicyBehavior\n")); - VisitAllInstancesOfProtocol (&gEfiPciRootBridgeIoProtocolGuid, - ConnectRootBridge, NULL); - - // - // Signal the ACPI platform driver that it can download QEMU ACPI tables. - // - EfiEventGroupSignal (&gRootBridgesConnectedEventGroupGuid); - - // - // We can't signal End-of-Dxe earlier than this. Namely, End-of-Dxe triggers - // the preparation of S3 system information. That logic has a hard dependency - // on the presence of the FACS ACPI table. Since our ACPI tables are only - // installed after PCI enumeration completes, we must not trigger the S3 save - // earlier, hence we can't signal End-of-Dxe earlier. - // - EfiEventGroupSignal (&gEfiEndOfDxeEventGroupGuid); - - if (QemuFwCfgS3Enabled ()) { - // - // Save the boot script too. Note that this requires/includes emitting the - // DxeSmmReadyToLock event, which in turn locks down SMM. - // - SaveS3BootScript (); - } - if (PcdGetBool (PcdOvmfFlashVariablesEnable)) { DEBUG ((EFI_D_INFO, "PlatformBdsPolicyBehavior: not restoring NvVars " "from disk since flash variables appear to be supported.\n"));