]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: SEV: Allow SEV intra-host migration of VM with mirrors
authorPeter Gonda <pgonda@google.com>
Fri, 11 Feb 2022 19:36:34 +0000 (11:36 -0800)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 18 Feb 2022 09:43:56 +0000 (04:43 -0500)
commit17f8673d41cb15b0f7c338a37c060012e4afd723
treedbc29c40e001addce3e94ac56eee7598a88a0aea
parent338e36730ea590ed70606133666c9624818334fc
KVM: SEV: Allow SEV intra-host migration of VM with mirrors

For SEV-ES VMs with mirrors to be intra-host migrated they need to be
able to migrate with the mirror. This is due to that fact that all VMSAs
need to be added into the VM with LAUNCH_UPDATE_VMSA before
lAUNCH_FINISH. Allowing migration with mirrors allows users of SEV-ES to
keep the mirror VMs VMSAs during migration.

Adds a list of mirror VMs for the original VM iterate through during its
migration. During the iteration the owner pointers can be updated from
the source to the destination. This fixes the ASID leaking issue which
caused the blocking of migration of VMs with mirrors.

Signed-off-by: Peter Gonda <pgonda@google.com>
Cc: Sean Christopherson <seanjc@google.com>
Cc: Marc Orr <marcorr@google.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: kvm@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Message-Id: <20220211193634.3183388-1-pgonda@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/svm/sev.c
arch/x86/kvm/svm/svm.h
tools/testing/selftests/kvm/x86_64/sev_migrate_tests.c