Re: [PATCH RFC 4/6] KVM: x86: acknowledgment mechanism for async pf page ready notifications

From: Andy Lutomirski
Date: Wed Apr 29 2020 - 20:45:31 EST


On Wed, Apr 29, 2020 at 10:40 AM Paolo Bonzini <pbonzini@xxxxxxxxxx> wrote:
>
> On 29/04/20 19:28, Andy Lutomirski wrote:
> > This seems functional, but I'm wondering if it could a bit simpler and
> > more efficient if the data structure was a normal descriptor ring with
> > the same number slots as whatever the maximum number of waiting pages
> > is. Then there would never need to be any notification from the guest
> > back to the host, since there would always be room for a notification.
>
> No, it would be much more complicated code for a slow path which is
> already order of magnitudes slower than a vmexit. It would also use
> much more memory.

Fair enough.

>
> > It might be even better if a single unified data structure was used
> > for both notifications.
>
> That's a very bad idea since one is synchronous and one is asynchronous.
> Part of the proposal we agreed upon was to keep "page not ready"
> synchronous while making "page ready" an interrupt. The data structure
> for "page not ready" will be #VE.
>

#VE on SVM will be interesting, to say the least, and I think that a
solution that is VMX specific doesn't make much sense. #VE also has
unpleasant issues involving the contexts in which it can occur. You
will have quite a hard time convincing me to ack the addition of a #VE
entry handler for this. I think a brand new vector is the right
solution.