]> git.proxmox.com Git - mirror_edk2.git/blobdiff - OvmfPkg/Include/Library/MemEncryptSevLib.h
OvmfPkg/VmgExitLib: Support nested #VCs
[mirror_edk2.git] / OvmfPkg / Include / Library / MemEncryptSevLib.h
index ec470b8d036395b3e83ce33283228e62dde677f0..99f15a7d12719a35d0effaf6764e5e4a2f038f47 100644 (file)
 \r
 #include <Base.h>\r
 \r
+//\r
+// Define the maximum number of #VCs allowed (e.g. the level of nesting\r
+// that is allowed => 2 allows for 1 nested #VCs). I this value is changed,\r
+// be sure to increase the size of\r
+//   gUefiOvmfPkgTokenSpaceGuid.PcdOvmfSecGhcbBackupSize\r
+// in any FDF file using this PCD.\r
+//\r
+#define VMGEXIT_MAXIMUM_VC_COUNT   2\r
+\r
+//\r
+// Per-CPU data mapping structure\r
+//   Use UINT32 for cached indicators and compare to a specific value\r
+//   so that the hypervisor can't indicate a value is cached by just\r
+//   writing random data to that area.\r
+//\r
+typedef struct {\r
+  UINT32  Dr7Cached;\r
+  UINT64  Dr7;\r
+\r
+  UINTN   VcCount;\r
+  VOID    *GhcbBackupPages;\r
+} SEV_ES_PER_CPU_DATA;\r
+\r
 //\r
 // Internal structure for holding SEV-ES information needed during SEC phase\r
 // and valid only during SEC phase and early PEI during platform\r