OSDN Git Service

x86/kvm: Add guest support for detecting and enabling SEV Live Migration feature.
authorAshish Kalra <ashish.kalra@amd.com>
Tue, 24 Aug 2021 11:07:07 +0000 (11:07 +0000)
committerPaolo Bonzini <pbonzini@redhat.com>
Thu, 11 Nov 2021 12:37:36 +0000 (07:37 -0500)
commitf4495615d76cfe5a633b0886b5c30310ed94c357
tree725ee991b1464fe1820a01bab53032d156a4d72f
parent2f70ddb1f71814aae525c58086fcb2f6974e6591
x86/kvm: Add guest support for detecting and enabling SEV Live Migration feature.

The guest support for detecting and enabling SEV Live migration
feature uses the following logic :

 - kvm_init_plaform() checks if its booted under the EFI

   - If not EFI,

     i) if kvm_para_has_feature(KVM_FEATURE_MIGRATION_CONTROL), issue a wrmsrl()
         to enable the SEV live migration support

   - If EFI,

     i) If kvm_para_has_feature(KVM_FEATURE_MIGRATION_CONTROL), read
        the UEFI variable which indicates OVMF support for live migration

     ii) the variable indicates live migration is supported, issue a wrmsrl() to
          enable the SEV live migration support

The EFI live migration check is done using a late_initcall() callback.

Also, ensure that _bss_decrypted section is marked as decrypted in the
hypervisor's guest page encryption status tracking.

Signed-off-by: Ashish Kalra <ashish.kalra@amd.com>
Reviewed-by: Steve Rutherford <srutherford@google.com>
Message-Id: <b4453e4c87103ebef12217d2505ea99a1c3e0f0f.1629726117.git.ashish.kalra@amd.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/include/asm/mem_encrypt.h
arch/x86/kernel/kvm.c
arch/x86/mm/mem_encrypt.c