]> git.proxmox.com Git - mirror_edk2.git/blobdiff - OvmfPkg/Include/Protocol/SevMemoryAcceptance.h
OvmfPkg: Introduce the OvmfSevMemoryAcceptance protocol
[mirror_edk2.git] / OvmfPkg / Include / Protocol / SevMemoryAcceptance.h
diff --git a/OvmfPkg/Include/Protocol/SevMemoryAcceptance.h b/OvmfPkg/Include/Protocol/SevMemoryAcceptance.h
new file mode 100644 (file)
index 0000000..c5ea3f3
--- /dev/null
@@ -0,0 +1,43 @@
+/** @file\r
+  The file provides the protocol that disables the behavior that all memory\r
+  gets accepted at ExitBootServices(). This protocol is only meant to be called\r
+  by the OS loader, and not EDK2 itself. The SEV naming is due to the\r
+  coincidence that only SEV-SNP needs this protocol, since SEV-SNP Linux\r
+  support was released before it had support for unaccepted memory. The\r
+  technology enablement thus does not strictly imply support for the unaccepted\r
+  memory type.\r
+\r
+  Copyright (c) 2023, Google LLC. All rights reserved.<BR>\r
+  SPDX-License-Identifier: BSD-2-Clause-Patent\r
+**/\r
+\r
+#ifndef SEV_MEMORY_ACCEPTANCE_H_\r
+#define SEV_MEMORY_ACCEPTANCE_H_\r
+\r
+#define OVMF_SEV_MEMORY_ACCEPTANCE_PROTOCOL_GUID \\r
+  {0xc5a010fe, \\r
+   0x38a7, \\r
+   0x4531, \\r
+   {0x8a, 0x4a, 0x05, 0x00, 0xd2, 0xfd, 0x16, 0x49}}\r
+\r
+typedef struct _OVMF_SEV_MEMORY_ACCEPTANCE_PROTOCOL\r
+    OVMF_SEV_MEMORY_ACCEPTANCE_PROTOCOL;\r
+\r
+/**\r
+  @param This A pointer to a OVMF_SEV_MEMORY_ACCEPTANCE_PROTOCOL.\r
+**/\r
+typedef\r
+  EFI_STATUS\r
+(EFIAPI *OVMF_SEV_ALLOW_UNACCEPTED_MEMORY)(\r
+  IN  OVMF_SEV_MEMORY_ACCEPTANCE_PROTOCOL  *This\r
+  );\r
+\r
+///\r
+/// The OVMF_SEV_MEMORY_ACCEPTANCE_PROTOCOL allows the OS loader to\r
+/// indicate to EDK2 that ExitBootServices should not accept all memory.\r
+///\r
+struct _OVMF_SEV_MEMORY_ACCEPTANCE_PROTOCOL {\r
+  OVMF_SEV_ALLOW_UNACCEPTED_MEMORY    AllowUnacceptedMemory;\r
+};\r
+\r
+#endif\r