Skip to content

Add AMD SEV page encryption bitmap support.

Ashish Kalra kvm lkml 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest9 patches 28 repliesIn review
  2. v19 patches 0 repliesSuperseded

Changes in v2 from the cover letter

- Fix in sev_dbg_crypt() to release RCU read lock if hva_to_gfn() fails when bypassing DBG_DECRYPT API calls for unencrypted guest memory.
- Comment fix for Patch 7/9.

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/9KVM: x86: Add AMD SEV specific Hypercall3arch/x86/include/asm/kvm_para.h+12 -023 replies
2/9KVM: X86: Introduce KVM_HC_PAGE_ENC_STATUS hypercallDocumentation/virt/kvm/hypercalls.rst arch/x86/include/asm/kvm_host.h arch/x86/kvm/svm/sev.c +5 more+121 -03 replies
3/9KVM: x86: Introduce KVM_GET_PAGE_ENC_BITMAP ioctlDocumentation/virt/kvm/api.rst arch/x86/include/asm/kvm_host.h arch/x86/kvm/svm/sev.c +4 more+125 -02 replies
4/9mm: x86: Invoke hypercall when page encryption status is changed.arch/x86/include/asm/paravirt.h arch/x86/include/asm/paravirt_types.h arch/x86/kernel/paravirt.c +2 more+76 -10 replies
5/9KVM: x86: Introduce KVM_SET_PAGE_ENC_BITMAP ioctlDocumentation/virt/kvm/api.rst arch/x86/include/asm/kvm_host.h arch/x86/kvm/svm/sev.c +4 more+111 -00 replies
6/9KVM: SVM: Add support for static allocation of unified Page Encryption Bitmap.arch/x86/include/asm/kvm_host.h arch/x86/kvm/svm/sev.c arch/x86/kvm/svm/svm.c +2 more+43 -00 replies
7/9KVM: x86: Mark _bss_decrypted section variables as decrypted in page encryption bitmap.arch/x86/include/asm/mem_encrypt.h arch/x86/kernel/kvmclock.c arch/x86/mm/mem_encrypt.c+22 -00 replies
8/9KVM: x86: Add kexec support for SEV page encryption bitmap.arch/x86/kernel/kvm.c+28 -00 replies
9/9KVM: SVM: Bypass DBG_DECRYPT API calls for unecrypted guest memory.arch/x86/kvm/svm/sev.c+76 -00 replies

Reviews trailers per patch

5 of 9 patches have a Reviewed-by or Acked-by.

PatchSteve RutherfordVenu Busireddy
1/9R-b R-b
2/9R-b
3/9R-b
4/9R-b
5/9R-b
6/9
7/9
8/9
9/9

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH v2 0/9] Add AMD SEV page encryption bitmap support.

From: Ashish Kalra <[email protected]>

The series add support for AMD SEV page encryption bitmap.

SEV guest VMs have the concept of private and shared memory. Private memory is encrypted with the guest-specific key, while shared memory may be encrypted with hypervisor key. The patch series introduces a new hypercall. The guest OS can use this hypercall to notify the page encryption status.

The patch adds new ioctls KVM_{SET,GET}_PAGE_ENC_BITMAP. The ioctl can be used by qemu to get the page encryption bitmap. Qemu can consult this bitmap during guest live migration / page migration and/or guest debugging to know whether the page is encrypted.

The page encryption bitmap support is required for SEV guest live migration, guest page migration and guest debugging.

The patch-set also adds support for bypassing unencrypted guest memory regions for DBG_DECRYPT API calls, guest memory region encryption status in sev_dbg_decrypt() is now referenced using the page encryption bitmap.

A branch containing these patches is available here:
https://github.com/AMDESE/linux/tree/sev-page-encryption-bitmap-v2

Changes since v1:
- Fix in sev_dbg_crypt() to release RCU read lock if hva_to_gfn() fails when bypassing DBG_DECRYPT API calls for unencrypted guest memory.
- Comment fix for Patch 7/9.

Ashish Kalra (4):
KVM: SVM: Add support for static allocation of unified Page Encryption
Bitmap.
KVM: x86: Mark _bss_decrypted section variables as decrypted in page
encryption bitmap.
KVM: x86: Add kexec support for SEV page encryption bitmap.
KVM: SVM: Bypass DBG_DECRYPT API calls for unecrypted guest memory.

Brijesh Singh (5):
KVM: x86: Add AMD SEV specific Hypercall3
KVM: X86: Introduce KVM_HC_PAGE_ENC_STATUS hypercall
KVM: x86: Introduce KVM_GET_PAGE_ENC_BITMAP ioctl
mm: x86: Invoke hypercall when page encryption status is changed.
KVM: x86: Introduce KVM_SET_PAGE_ENC_BITMAP ioctl

 Documentation/virt/kvm/api.rst        |  71 ++++++
 Documentation/virt/kvm/hypercalls.rst |  15 ++
 arch/x86/include/asm/kvm_host.h       |   7 +
 arch/x86/include/asm/kvm_para.h       |  12 +
 arch/x86/include/asm/mem_encrypt.h    |   4 +
 arch/x86/include/asm/paravirt.h       |  10 +
 arch/x86/include/asm/paravirt_types.h |   2 +
 arch/x86/kernel/kvm.c                 |  28 +++
 arch/x86/kernel/kvmclock.c            |  12 +
 arch/x86/kernel/paravirt.c            |   1 +
 arch/x86/kvm/svm/sev.c                | 321 ++++++++++++++++++++++++++
 arch/x86/kvm/svm/svm.c                |   5 +
 arch/x86/kvm/svm/svm.h                |   7 +
 arch/x86/kvm/vmx/vmx.c                |   1 +
 arch/x86/kvm/x86.c                    |  35 +++
 arch/x86/mm/mem_encrypt.c             |  63 ++++-
 arch/x86/mm/pat/set_memory.c          |   7 +
 include/uapi/linux/kvm.h              |  13 ++
 include/uapi/linux/kvm_para.h         |   1 +
 19 files changed, 614 insertions(+), 1 deletion(-)
Signature · 1 line
2.17.1