lkml.org 
[lkml]   [2020]   [Dec]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    SubjectRe: [PATCH v8 18/18] KVM: SVM: Enable SEV live migration feature implicitly on Incoming VM(s).
    From
    Date
    On 05/05/20 23:22, Ashish Kalra wrote:
    > From: Ashish Kalra <ashish.kalra@amd.com>
    >
    > For source VM, live migration feature is enabled explicitly
    > when the guest is booting, for the incoming VM(s) it is implied.
    > This is required for handling A->B->C->... VM migrations case.
    >
    > Signed-off-by: Ashish Kalra <ashish.kalra@amd.com>
    > ---
    > arch/x86/kvm/svm/sev.c | 7 +++++++
    > 1 file changed, 7 insertions(+)
    >
    > diff --git a/arch/x86/kvm/svm/sev.c b/arch/x86/kvm/svm/sev.c
    > index 6f69c3a47583..ba7c0ebfa1f3 100644
    > --- a/arch/x86/kvm/svm/sev.c
    > +++ b/arch/x86/kvm/svm/sev.c
    > @@ -1592,6 +1592,13 @@ int svm_set_page_enc_bitmap(struct kvm *kvm,
    > if (ret)
    > goto unlock;
    >
    > + /*
    > + * For source VM, live migration feature is enabled
    > + * explicitly when the guest is booting, for the
    > + * incoming VM(s) it is implied.
    > + */
    > + sev_update_migration_flags(kvm, KVM_SEV_LIVE_MIGRATION_ENABLED);
    > +
    > bitmap_copy(sev->page_enc_bmap + BIT_WORD(gfn_start), bitmap,
    > (gfn_end - gfn_start));

    Why? I'd prefer the host to do this manually using a KVM_ENABLE_CAP.
    The hook in patch 12 would also be enabled/disabled using KVM_ENABLE_CAP.

    Paolo

    \
     
     \ /
      Last update: 2020-12-04 12:13    [W:4.960 / U:0.464 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site