s390-pv-dump.rst 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. .. SPDX-License-Identifier: GPL-2.0
  2. ===========================================
  3. s390 (IBM Z) Protected Virtualization dumps
  4. ===========================================
  5. Summary
  6. -------
  7. Dumping a VM is an essential tool for debugging problems inside
  8. it. This is especially true when a protected VM runs into trouble as
  9. there's no way to access its memory and registers from the outside
  10. while it's running.
  11. However when dumping a protected VM we need to maintain its
  12. confidentiality until the dump is in the hands of the VM owner who
  13. should be the only one capable of analysing it.
  14. The confidentiality of the VM dump is ensured by the Ultravisor who
  15. provides an interface to KVM over which encrypted CPU and memory data
  16. can be requested. The encryption is based on the Customer
  17. Communication Key which is the key that's used to encrypt VM data in a
  18. way that the customer is able to decrypt.
  19. Dump process
  20. ------------
  21. A dump is done in 3 steps:
  22. **Initiation**
  23. This step initializes the dump process, generates cryptographic seeds
  24. and extracts dump keys with which the VM dump data will be encrypted.
  25. **Data gathering**
  26. Currently there are two types of data that can be gathered from a VM:
  27. the memory and the vcpu state.
  28. The vcpu state contains all the important registers, general, floating
  29. point, vector, control and tod/timers of a vcpu. The vcpu dump can
  30. contain incomplete data if a vcpu is dumped while an instruction is
  31. emulated with help of the hypervisor. This is indicated by a flag bit
  32. in the dump data. For the same reason it is very important to not only
  33. write out the encrypted vcpu state, but also the unencrypted state
  34. from the hypervisor.
  35. The memory state is further divided into the encrypted memory and its
  36. metadata comprised of the encryption tweaks and status flags. The
  37. encrypted memory can simply be read once it has been exported. The
  38. time of the export does not matter as no re-encryption is
  39. needed. Memory that has been swapped out and hence was exported can be
  40. read from the swap and written to the dump target without need for any
  41. special actions.
  42. The tweaks / status flags for the exported pages need to be requested
  43. from the Ultravisor.
  44. **Finalization**
  45. The finalization step will provide the data needed to be able to
  46. decrypt the vcpu and memory data and end the dump process. When this
  47. step completes successfully a new dump initiation can be started.