]> git.proxmox.com Git - mirror_edk2.git/commitdiff
OvmfPkg/QemuFwCfgLib: Implement SEV internal function for SEC phase
authorBrijesh Singh <brijesh.singh@amd.com>
Thu, 6 Jul 2017 13:28:58 +0000 (09:28 -0400)
committerJordan Justen <jordan.l.justen@intel.com>
Tue, 11 Jul 2017 04:17:28 +0000 (21:17 -0700)
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Brijesh Singh <brijesh.singh@amd.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgSec.c

index 465ccbe90dadce76c54974c495267bc0213e5e0b..071b8d9b91d499f182482a6e6caa5d9788259359 100644 (file)
@@ -6,6 +6,7 @@
 \r
   Copyright (C) 2013, Red Hat, Inc.\r
   Copyright (c) 2011 - 2013, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2017, Advanced Micro Devices. All rights reserved.<BR>\r
 \r
   This program and the accompanying materials are licensed and made available\r
   under the terms and conditions of the BSD License which accompanies this\r
@@ -94,3 +95,59 @@ InternalQemuFwCfgDmaIsAvailable (
 {\r
   return FALSE;\r
 }\r
+\r
+/**\r
+\r
+ Returns a boolean indicating whether SEV is enabled\r
+\r
+ @retval    TRUE    SEV is enabled\r
+ @retval    FALSE   SEV is disabled\r
+**/\r
+BOOLEAN\r
+InternalQemuFwCfgSevIsEnabled (\r
+  VOID\r
+  )\r
+{\r
+  //\r
+  // DMA is not supported in SEC phase hence SEV support is irrelevant\r
+  //\r
+  return FALSE;\r
+}\r
+\r
+/**\r
+ Allocate a bounce buffer for SEV DMA.\r
+\r
+  @param[in]     NumPage  Number of pages.\r
+  @param[out]    Buffer   Allocated DMA Buffer pointer\r
+\r
+**/\r
+VOID\r
+InternalQemuFwCfgSevDmaAllocateBuffer (\r
+  OUT    VOID     **Buffer,\r
+  IN     UINT32   NumPages\r
+  )\r
+{\r
+  //\r
+  // We should never reach here\r
+  //\r
+  ASSERT (FALSE);\r
+}\r
+\r
+/**\r
+ Free the DMA buffer allocated using InternalQemuFwCfgSevDmaAllocateBuffer\r
+\r
+  @param[in]     NumPage  Number of pages.\r
+  @param[in]     Buffer   DMA Buffer pointer\r
+\r
+**/\r
+VOID\r
+InternalQemuFwCfgSevDmaFreeBuffer (\r
+  IN     VOID     *Buffer,\r
+  IN     UINT32   NumPages\r
+  )\r
+{\r
+  //\r
+  // We should never reach here\r
+  //\r
+  ASSERT (FALSE);\r
+}\r