Add SEV guest live migration support
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v3 Latest14 patches 14 repliesIn review
- v213 patches 28 repliesSuperseded
- v1 RFC12 patches 2 repliesSuperseded
Changes in v3 from the cover letter
- Remove direct kvm_memcrpt calls from migration.
- Add MemoryEcryptionOps in machine which will be used by migration instead of kvm_memcrypt calls.
- drop the RAM_SAVE_FLAG_PAGE_ENCRYPTED_BITMAP. Now the RAM_SAVE_FLAG_ENCRYPTED_PAGE can be used for sending bitmap as well as guest RAM encrypted pages
- add some bound checks on incoming data
- drop migrate-sev-set-info object
- extend the migrate-parameters to include the SEV specific certificate fields.
- multiple fixes based on the review comments from Dave
Patches in v3 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/14 | doc: update AMD SEV API spec web linkdocs/ | +4 | 1 reply | |
| 2/14 | doc: update AMD SEV to include Live migration flowdocs/ | +39 | 1 reply | |
| 3/14 | migration.json: add AMD SEV specific migration parametersmigration/ monitor/ qapi/ | +116 | 4 replies | |
| 4/14 | linux-headers: update kernel header to include SEV migration commandslinux-headers/ | +53 | 0 replies | |
| 5/14 | hw/machine: add helper to query the memory encryption statehw/ include/ | +6 | 2 replies | |
| 6/14 | hw/machine: introduce MachineMemoryEncryptionOps for encrypted VMsinclude/ | +24 | 1 reply | |
| 7/14 | target/i386: sev: provide callback to setup outgoing contextaccel/ accel/ include/ +2 more | +71 | 1 reply | |
| 8/14 | target/i386: sev: do not create launch context for an incoming guesttarget/ | +10 | 0 replies | |
| 9/14 | target/i386: sev: add support to encrypt the outgoing pageaccel/ accel/ include/ +3 more | +238 | 1 reply | |
| 10/14 | target/i386: sev: add support to load incoming encrypted pageaccel/ accel/ include/ +2 more | +151 | 1 reply | |
| 11/14 | migration: add support to migrate page encryption bitmapaccel/ accel/ include/ +2 more | +139 | 1 reply | |
| 12/14 | kvm: add support to sync the page encryption state bitmapaccel/ include/ include/ +1 more | +255 | 0 replies | |
| 13/14 | migration/ram: add support to send encrypted pagesmigration/ | +130 | 1 reply | |
| 14/14 | target/i386: sev: remove migration blockertarget/ | +0 | 0 replies |
Reviews trailers per patch
10 of 14 patches have a Reviewed-by or Acked-by.
| Patch | Dr. David Alan Gilbert |
|---|---|
| 1/14 | R-b |
| 2/14 | R-b |
| 3/14 | |
| 4/14 | |
| 5/14 | R-b |
| 6/14 | R-b |
| 7/14 | |
| 8/14 | R-b |
| 9/14 | R-b |
| 10/14 | R-b |
| 11/14 | R-b |
| 12/14 | |
| 13/14 | R-b |
| 14/14 | R-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [Qemu-devel] [PATCH v3 00/14] Add SEV guest live migration support
AMD SEV encrypts the memory of VMs and because this encryption is done using an address tweak, the hypervisor will not be able to simply copy ciphertext between machines to migrate a VM. Instead the AMD SEV Key Management API provides a set of functions which the hypervisor can use to package a guest encrypted pages for migration, while maintaining the confidentiality provided by AMD SEV.
The patch series add the support required in Qemu to perform the SEV guest live migration. Before initiating the live migration a user should use newly added 'migrate-set-sev-info' command to pass the target machines certificate chain. See the docs/amd-memory-encryption.txt for further details.
The patch series depends on kernel patches available here:
https://marc.info/?l=kvm&m=156278967226011&w=2
The complete tree with patch is available at:
https://github.com/codomania/qemu/tree/sev-migration-v3
Known Issues:
- failed to reboot the guest after migration.
- The top 10 lines of the vga buffer is sent as encrypted and because of that we get a garage on destination. I am still debugging it.
Changes since v2:
- Remove direct kvm_memcrpt calls from migration.
- Add MemoryEcryptionOps in machine which will be used by migration instead of kvm_memcrypt calls.
- drop the RAM_SAVE_FLAG_PAGE_ENCRYPTED_BITMAP. Now the RAM_SAVE_FLAG_ENCRYPTED_PAGE can be used for sending bitmap as well as guest RAM encrypted pages
- add some bound checks on incoming data
- drop migrate-sev-set-info object
- extend the migrate-parameters to include the SEV specific certificate fields.
- multiple fixes based on the review comments from Dave
Changes since v1:
- use the dirty log sync APIs to also sync the page encryption bitmap when SEV is active.
Brijesh Singh (14):
doc: update AMD SEV API spec web link
doc: update AMD SEV to include Live migration flow migration.json: add AMD SEV specific migration parameters
linux-headers: update kernel header to include SEV migration commands hw/machine: add helper to query the memory encryption state hw/machine: introduce MachineMemoryEncryptionOps for encrypted VMs target/i386: sev: provide callback to setup outgoing context target/i386: sev: do not create launch context for an incoming guest target/i386: sev: add support to encrypt the outgoing page target/i386: sev: add support to load incoming encrypted page
migration: add support to migrate page encryption bitmap
kvm: add support to sync the page encryption state bitmap migration/ram: add support to send encrypted pages target/i386: sev: remove migration blocker
accel/kvm/kvm-all.c | 91 ++++++ accel/kvm/sev-stub.c | 28 ++ docs/amd-memory-encryption.txt | 48 ++- hw/core/machine.c | 5 + include/exec/ram_addr.h | 199 +++++++++++++ include/exec/ramlist.h | 3 +- include/hw/boards.h | 25 ++ include/sysemu/sev.h | 11 + linux-headers/linux/kvm.h | 53 ++++ migration/migration.c | 61 ++++ migration/ram.c | 148 +++++++++- monitor/hmp-cmds.c | 18 ++ qapi/migration.json | 41 ++- target/i386/sev.c | 513 ++++++++++++++++++++++++++++++++- target/i386/sev_i386.h | 8 + target/i386/trace-events | 8 + 16 files changed, 1234 insertions(+), 26 deletions(-)
Signature · 1 line
2.17.1