Re: [RFC] KVM: x86: Support KVM VMs sharing SEV context

From: Nathan Tempelman
Date: Fri Mar 05 2021 - 15:44:23 EST


On Fri, Mar 5, 2021 at 7:13 AM Paolo Bonzini <pbonzini@xxxxxxxxxx> wrote:
>
> On 05/03/21 15:04, Ashish Kalra wrote:
> >> + /* Mirrors of mirrors should work, but let's not get silly */
> >> + if (is_mirroring_enc_context(kvm)) {
> >> + ret = -ENOTTY;
> >> + goto failed;
> >> + }
> > How will A->B->C->... type of live migration work if mirrors of
> > mirrors are not supported ?
>
> Each host would only run one main VM and one mirror, wouldn't it?

That's correct. You could create a second mirror vm of the original
(A->B, A->C) if you needed two in-guest workers, but I don't see a use
for a chain. If anyone can see one I can write it that way, but in the interest
of keeping it simple I've blocked it. Originally I'd built it with
that functionality,
but allowing a chain like that smells like recursion and from what I
understand we don't like recursion in the kernel. There's also the fear as
steve mentioned that we could blow the callstack with a long chain of
destroys starting from the leaf.
Ideally we give userspace one less gun to shoot itself in the foot with.