Re: KVM swapping with mmu notifiers

Avi Kivity
2008-01-21T12:53:05Z

Andrea Arcangeli wrote:
> On Sun, Jan 20, 2008 at 05:16:03PM +0200, Avi Kivity wrote:
>
>> Yes, it's supposed to work (we can't prevent userspace from doing it).
>>
>
> Hmm, I think we already prevent it, so I don't think I need to update
> my swap code until the below is removed.
>
> /* Check for overlaps */
> r = -EEXIST;
> for (i = 0; i < KVM_MEMORY_SLOTS; ++i) {
> struct kvm_memory_slot *s = &kvm->memslots[i];
>
> if (s == memslot)
> continue;
> if (!((base_gfn + npages <= s->base_gfn) ||
> (base_gfn >= s->base_gfn + s->npages)))
> goto out_free;
> }
>

Right.

We will have to eventually remove it (to support aliases on non-x86),
but no hurry now.

--
error compiling committee.c: too many arguments to function