Re: [RFC] KVM: mm: fd-based approach for supporting KVM guest private memory

From: Andy Lutomirski
Date: Fri Aug 27 2021 - 14:24:47 EST




On Thu, Aug 26, 2021, at 2:26 PM, David Hildenbrand wrote:
> On 26.08.21 19:05, Andy Lutomirski wrote:

> > Oof. That's quite a requirement. What's the point of the VMA once all
> > this is done?
>
> You can keep using things like mbind(), madvise(), ... and the GUP code
> with a special flag might mostly just do what you want. You won't have
> to reinvent too many wheels on the page fault logic side at least.
>

You can keep calling the functions. The implementations working is a different story: you can't just unmap (pte_numa-style or otherwise) a private guest page to quiesce it, move it with memcpy(), and then fault it back in.

In any event, adding fd-based NUMA APIs would be quite nice. Look at the numactl command.