diff options
author | Laszlo Ersek <lersek@redhat.com> | 2017-02-09 17:32:40 +0100 |
---|---|---|
committer | Laszlo Ersek <lersek@redhat.com> | 2017-02-21 13:10:42 +0100 |
commit | df73df138d9d53f7f7570f4fe97a6cde941a2656 (patch) | |
tree | 44476421f4a08c953cd16e5175b9fce511ba9394 /OvmfPkg/AcpiPlatformDxe/AcpiPlatform.h | |
parent | 9965cbd424f22b35e7743c2f59ab3ee1db15142a (diff) | |
download | edk2-df73df138d9d53f7f7570f4fe97a6cde941a2656.tar.gz |
OvmfPkg/AcpiPlatformDxe: replay QEMU_LOADER_WRITE_POINTER commands at S3
Ultimately, each QEMU_LOADER_WRITE_POINTER command creates a guest memory
reference in some QEMU device. When the virtual machine is reset, the
device willfully forgets the guest address, since the guest memory is
wholly invalidated during platform reset.
... Unless the reset is part of S3 resume. Then the guest memory is
preserved intact, and the firmware must reprogram those devices with the
original guest memory allocation addresses.
This patch accumulates the fw_cfg select, skip and write operations of
ProcessCmdWritePointer() in a validated / condensed form, and turns them
into an ACPI S3 Boot Script fragment at the very end of
InstallQemuFwCfgTables().
Cc: Jordan Justen <jordan.l.justen@intel.com>
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=359
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Diffstat (limited to 'OvmfPkg/AcpiPlatformDxe/AcpiPlatform.h')
-rw-r--r-- | OvmfPkg/AcpiPlatformDxe/AcpiPlatform.h | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/OvmfPkg/AcpiPlatformDxe/AcpiPlatform.h b/OvmfPkg/AcpiPlatformDxe/AcpiPlatform.h index 08dd7f8f7d..0f035a0d57 100644 --- a/OvmfPkg/AcpiPlatformDxe/AcpiPlatform.h +++ b/OvmfPkg/AcpiPlatformDxe/AcpiPlatform.h @@ -33,6 +33,8 @@ typedef struct { UINT64 PciAttributes;
} ORIGINAL_ATTRIBUTES;
+typedef struct S3_CONTEXT S3_CONTEXT;
+
EFI_STATUS
EFIAPI
InstallAcpiTable (
@@ -91,5 +93,30 @@ RestorePciDecoding ( IN UINTN Count
);
+EFI_STATUS
+AllocateS3Context (
+ OUT S3_CONTEXT **S3Context,
+ IN UINTN WritePointerCount
+ );
+
+VOID
+ReleaseS3Context (
+ IN S3_CONTEXT *S3Context
+ );
+
+EFI_STATUS
+SaveCondensedWritePointerToS3Context (
+ IN OUT S3_CONTEXT *S3Context,
+ IN UINT16 PointerItem,
+ IN UINT8 PointerSize,
+ IN UINT32 PointerOffset,
+ IN UINT64 PointerValue
+ );
+
+EFI_STATUS
+TransferS3ContextToBootScript (
+ IN CONST S3_CONTEXT *S3Context
+ );
+
#endif
|