Re: [PATCH V11 2/5] KVM: SEV: Add support for SEV intra host migration

Sean Christopherson
2021-11-04T23:05:04Z

On Thu, Nov 04, 2021, Sean Christopherson wrote:
> On Thu, Oct 21, 2021, Peter Gonda wrote:
> > + if (!sev_guest(source_kvm) || sev_es_guest(source_kvm)) {
> > + ret = -EINVAL;
> > + goto out_source;
> > + }
> > + ret = sev_lock_vcpus_for_migration(kvm);
> > + if (ret)
> > + goto out_dst_vcpu;
> > + ret = sev_lock_vcpus_for_migration(source_kvm);
> > + if (ret)
> > + goto out_source_vcpu;
> > +
> > + sev_migrate_from(dst_sev, &to_kvm_svm(source_kvm)->sev_info);
> > + kvm_for_each_vcpu(i, vcpu, source_kvm) {
>
> Braces not needed.
>
> > + kvm_vcpu_reset(vcpu, /* init_event= */ false);

...

> That way the source vCPUs don't need to be locked

Scratch that particular idea, I keep forgetting the SEV-ES support needs to lock
the source vCPUs to transfer state.