public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH v4 0/4] SEV Live Migration support for OVMF.
@ 2021-06-21 13:56 Ashish Kalra
  2021-06-21 13:56 ` [PATCH v4 1/4] OvmfPkg/MemEncryptHypercallLib: add library to support SEV hypercalls Ashish Kalra
                   ` (4 more replies)
  0 siblings, 5 replies; 25+ messages in thread
From: Ashish Kalra @ 2021-06-21 13:56 UTC (permalink / raw)
  To: devel
  Cc: brijesh.singh, Thomas.Lendacky, jejb, erdemaktas, jiewen.yao,
	min.m.xu, lersek, jordan.l.justen, ard.biesheuvel

From: Ashish Kalra <ashish.kalra@amd.com>

By default all the SEV guest memory regions are considered encrypted,
if a guest changes the encryption attribute of the page (e.g mark a
page as decrypted) then notify hypervisor. Hypervisor will need to
track the unencrypted pages. The information will be used during
guest live migration, guest page migration and guest debugging.

The patch-set adds a new SEV and SEV-ES hypercall abstraction
library to support SEV Page encryption/decryption status hypercalls
for SEV and SEV-ES guests.

BaseMemEncryptSevLib invokes hypercalls via this new hypercall library.

The patch-set detects if it is running under KVM hypervisor and then
checks for SEV live migration feature support via KVM_FEATURE_CPUID,
if detected setup a new UEFI enviroment variable to indicate OVMF
support for SEV live migration.

A branch containing these patches is available here:
https://github.com/ashkalra/edk2/tree/sev_live_migration_v4

Changes since v3:
 - Fix all DSC files under OvmfPkg except X64 to add support for 
   BaseMemEncryptLib and add NULL instance of BaseMemEncryptLib
   for 32 bit platforms.
 - Add the MemEncryptHypercallLib-related files to Maintainers.txt,
   in section "OvmfPkg: Confidential Computing".
 - Add support for the new KVM_HC_MAP_GPA_RANGE hypercall interface.
 - Add patch for SEV live migration support.

Changes since v2:
 - GHCB_BASE setup during reset-vector as decrypted is marked explicitly
   in the hypervisor page encryption bitmap after setting the 
   PcdSevEsIsEnabled PCD.

Changes since v1:
 - Mark GHCB_BASE setup during reset-vector as decrypted explicitly in
   the hypervisor page encryption bitmap.
 - Resending the series with correct shallow threading.

Ashish Kalra (3):
  OvmfPkg/MemEncryptHypercallLib: add library to support SEV hypercalls.
  OvmfPkg/PlatformPei: Mark SEC GHCB page as unencrypted via hypercall
  OvmfPkg/PlatformDxe: Add support for SEV live migration.

Brijesh Singh (1):
  OvmfPkg/BaseMemEncryptLib: Support to issue unencrypted hypercall

 Maintainers.txt                               |   2 +
 OvmfPkg/Include/Guid/MemEncryptLib.h          |  20 ++++
 .../Include/Library/MemEncryptHypercallLib.h  |  43 +++++++
 .../DxeMemEncryptSevLib.inf                   |   1 +
 .../PeiMemEncryptSevLib.inf                   |   1 +
 .../X64/PeiDxeVirtualMemory.c                 |  22 ++++
 .../Ia32/MemEncryptHypercallLib.c             |  37 ++++++
 .../MemEncryptHypercallLib.inf                |  42 +++++++
 .../X64/AsmHelperStub.nasm                    |  28 +++++
 .../X64/MemEncryptHypercallLib.c              | 105 +++++++++++++++++
 OvmfPkg/OvmfPkg.dec                           |   1 +
 OvmfPkg/OvmfPkgIa32.dsc                       |   1 +
 OvmfPkg/OvmfPkgIa32X64.dsc                    |   1 +
 OvmfPkg/OvmfPkgX64.dsc                        |   1 +
 OvmfPkg/OvmfXen.dsc                           |   1 +
 OvmfPkg/PlatformDxe/AmdSev.c                  | 108 ++++++++++++++++++
 OvmfPkg/PlatformDxe/Platform.c                |   5 +
 OvmfPkg/PlatformDxe/Platform.inf              |   2 +
 OvmfPkg/PlatformDxe/PlatformConfig.h          |   5 +
 OvmfPkg/PlatformPei/AmdSev.c                  |  10 ++
 20 files changed, 436 insertions(+)
 create mode 100644 OvmfPkg/Include/Guid/MemEncryptLib.h
 create mode 100644 OvmfPkg/Include/Library/MemEncryptHypercallLib.h
 create mode 100644 OvmfPkg/Library/MemEncryptHypercallLib/Ia32/MemEncryptHypercallLib.c
 create mode 100644 OvmfPkg/Library/MemEncryptHypercallLib/MemEncryptHypercallLib.inf
 create mode 100644 OvmfPkg/Library/MemEncryptHypercallLib/X64/AsmHelperStub.nasm
 create mode 100644 OvmfPkg/Library/MemEncryptHypercallLib/X64/MemEncryptHypercallLib.c
 create mode 100644 OvmfPkg/PlatformDxe/AmdSev.c

-- 
2.17.1


^ permalink raw reply	[flat|nested] 25+ messages in thread

end of thread, other threads:[~2021-06-30 16:25 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-06-21 13:56 [PATCH v4 0/4] SEV Live Migration support for OVMF Ashish Kalra
2021-06-21 13:56 ` [PATCH v4 1/4] OvmfPkg/MemEncryptHypercallLib: add library to support SEV hypercalls Ashish Kalra
2021-06-22 19:47   ` Brijesh Singh
2021-06-22 19:58     ` Brijesh Singh
2021-06-22 22:47   ` Lendacky, Thomas
2021-06-22 23:20     ` Ashish Kalra
2021-06-22 23:38       ` Brijesh Singh
2021-06-23  1:47     ` Ashish Kalra
2021-06-23 15:02       ` Ashish Kalra
2021-06-21 13:57 ` [PATCH v4 2/4] OvmfPkg/BaseMemEncryptLib: Support to issue unencrypted hypercall Ashish Kalra
2021-06-22 22:50   ` Lendacky, Thomas
2021-06-21 13:57 ` [PATCH v4 3/4] OvmfPkg/PlatformPei: Mark SEC GHCB page as unencrypted via hypercall Ashish Kalra
2021-06-22 20:35   ` Brijesh Singh
2021-06-21 13:57 ` [PATCH v4 4/4] OvmfPkg/PlatformDxe: Add support for SEV live migration Ashish Kalra
2021-06-22 23:06   ` Lendacky, Thomas
2021-06-24 16:29     ` Ashish Kalra
2021-06-22 17:20 ` [PATCH v4 0/4] SEV Live Migration support for OVMF Laszlo Ersek
2021-06-22 17:45   ` Brijesh Singh
2021-06-22 17:46   ` Ashish Kalra
2021-06-23 13:18     ` [edk2-devel] " Dov Murik
2021-06-23 16:42     ` Laszlo Ersek
2021-06-23 16:49       ` Laszlo Ersek
2021-06-23 17:03         ` Ashish Kalra
2021-06-30  9:11         ` Ashish Kalra
2021-06-30 16:25           ` [edk2-devel] " Laszlo Ersek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox