Re: [PATCH 0/2 V5] Add AMD SEV and SEV-ES intra host migration support

From: Sean Christopherson
Date: Mon Aug 23 2021 - 13:19:20 EST


On Mon, Aug 23, 2021, Peter Gonda wrote:
> V5:
> * Fix up locking scheme

Please add a selftest to prove/verify the anti-deadlock scheme actually works.
Unless I'm mistaken, only KVM_SEV_INIT needs to be invoked, i.e. the selftest
wouldn't need anything remotely close to full SEV support. And that means it
should be trivial to verify the success path as well. E.g. create three SEV VMs
(A, B, and C) and verify migrating from any VM to any other VM works (since none
of the VMs have memory regions). Then spin up eight pthreads and have each thread
concurrently migrate a specific combination an arbitrary number of times. Ignore
whether the migration failed or succeeded, "success" from the test's perspective
is purely that it completed, i.e. didn't deadlock.