summaryrefslogtreecommitdiffstats
path: root/OvmfPkg/Include
diff options
context:
space:
mode:
authorDionna Glaze <dionnaglaze@google.com>2023-01-26 21:17:38 +0000
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2023-01-26 23:00:51 +0000
commit26847fb6be7fff83a834a3154224588afede0073 (patch)
tree24555c1bbba0af3e302115ea8b500b0a9ee9fd63 /OvmfPkg/Include
parenta00e2e5513926a4031d96dc707113d13e1cdf814 (diff)
downloadedk2-26847fb6be7fff83a834a3154224588afede0073.tar.gz
edk2-26847fb6be7fff83a834a3154224588afede0073.tar.bz2
edk2-26847fb6be7fff83a834a3154224588afede0073.zip
OvmfPkg: Introduce the OvmfSevMemoryAcceptance protocol
The default behavior for unaccepted memory in SEV-SNP is to accept all memory when ExitBootServices is called. An OS loader can use this protocol to disable this behavior to assume responsibility for memory acceptance and to affirm that the OS can handle the unaccepted memory type. Cc: Gerd Hoffmann <kraxel@redhat.com> Cc: James Bottomley <jejb@linux.ibm.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Tom Lendacky <thomas.lendacky@amd.com> Cc: Ard Biesheuvel <ardb@kernel.org> Cc: "Min M. Xu" <min.m.xu@intel.com> Cc: Andrew Fish <afish@apple.com> Cc: "Michael D. Kinney" <michael.d.kinney@intel.com> Signed-off-by: Dionna Glaze <dionnaglaze@google.com> Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
Diffstat (limited to 'OvmfPkg/Include')
-rw-r--r--OvmfPkg/Include/Protocol/SevMemoryAcceptance.h43
1 files changed, 43 insertions, 0 deletions
diff --git a/OvmfPkg/Include/Protocol/SevMemoryAcceptance.h b/OvmfPkg/Include/Protocol/SevMemoryAcceptance.h
new file mode 100644
index 0000000000..c5ea3f383a
--- /dev/null
+++ b/OvmfPkg/Include/Protocol/SevMemoryAcceptance.h
@@ -0,0 +1,43 @@
+/** @file
+ The file provides the protocol that disables the behavior that all memory
+ gets accepted at ExitBootServices(). This protocol is only meant to be called
+ by the OS loader, and not EDK2 itself. The SEV naming is due to the
+ coincidence that only SEV-SNP needs this protocol, since SEV-SNP Linux
+ support was released before it had support for unaccepted memory. The
+ technology enablement thus does not strictly imply support for the unaccepted
+ memory type.
+
+ Copyright (c) 2023, Google LLC. All rights reserved.<BR>
+ SPDX-License-Identifier: BSD-2-Clause-Patent
+**/
+
+#ifndef SEV_MEMORY_ACCEPTANCE_H_
+#define SEV_MEMORY_ACCEPTANCE_H_
+
+#define OVMF_SEV_MEMORY_ACCEPTANCE_PROTOCOL_GUID \
+ {0xc5a010fe, \
+ 0x38a7, \
+ 0x4531, \
+ {0x8a, 0x4a, 0x05, 0x00, 0xd2, 0xfd, 0x16, 0x49}}
+
+typedef struct _OVMF_SEV_MEMORY_ACCEPTANCE_PROTOCOL
+ OVMF_SEV_MEMORY_ACCEPTANCE_PROTOCOL;
+
+/**
+ @param This A pointer to a OVMF_SEV_MEMORY_ACCEPTANCE_PROTOCOL.
+**/
+typedef
+ EFI_STATUS
+(EFIAPI *OVMF_SEV_ALLOW_UNACCEPTED_MEMORY)(
+ IN OVMF_SEV_MEMORY_ACCEPTANCE_PROTOCOL *This
+ );
+
+///
+/// The OVMF_SEV_MEMORY_ACCEPTANCE_PROTOCOL allows the OS loader to
+/// indicate to EDK2 that ExitBootServices should not accept all memory.
+///
+struct _OVMF_SEV_MEMORY_ACCEPTANCE_PROTOCOL {
+ OVMF_SEV_ALLOW_UNACCEPTED_MEMORY AllowUnacceptedMemory;
+};
+
+#endif