sev/i386: register the guest memory range which may contain encrypted data
commit2b308e4431f518c7e9bb068ae33da18e11888863
authorBrijesh Singh <brijesh.singh@amd.com>
Thu, 8 Mar 2018 12:48:45 +0000 (8 06:48 -0600)
committerPaolo Bonzini <pbonzini@redhat.com>
Tue, 13 Mar 2018 16:35:41 +0000 (13 17:35 +0100)
tree29c96cff054f313e3b58798f08db3c9c003e9ed7
parentd8575c6c0242bb1457589111e879f46348704534
sev/i386: register the guest memory range which may contain encrypted data

When SEV is enabled, the hardware encryption engine uses a tweak such
that the two identical plaintext at different location will have a
different ciphertexts. So swapping or moving a ciphertexts of two guest
pages will not result in plaintexts being swapped. Hence relocating
a physical backing pages of the SEV guest will require some additional
steps in KVM driver. The KVM_MEMORY_ENCRYPT_{UN,}REG_REGION ioctl can be
used to register/unregister the guest memory region which may contain the
encrypted data. KVM driver will internally handle the relocating physical
backing pages of registered memory regions.

Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Richard Henderson <rth@twiddle.net>
Cc: Eduardo Habkost <ehabkost@redhat.com>
Signed-off-by: Brijesh Singh <brijesh.singh@amd.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
target/i386/sev.c
target/i386/trace-events