Re: [PATCH 4/6] kvm-userland.git mmu notifier compat

Avi Kivity
2008-07-29T12:49:10Z

Andrea Arcangeli wrote:
> This patch to kvm-userland.git allows to build the tree on older
> kernels without mmu notifiers.
>
> Unfortunately emulating mmu notifiers with kprobes was feasible only
> for do_wp_page because it has a special property where calling the
> spte invalidate before the pte invalidate is ok thanks to the
> guarantee of that pte being wprotect, not to tell about the start/end
> functions. So old kernels without mmu notifiers will have to keep the
> page pinned I'm afraid. So to remove the page pin in future patches in
> a backwards compatible way, we'll have to go with #ifdef MMU_NOTIFIER
> in kvm.git code I'm afraid and this should be all that's needed on the
> kvm-userland side. Adding all page pinning needed by old kernels
> through hack-module.awk sounds a bit extreme to me, even if it would
> result in cleaner kvm.git code... anyway I think the below patch will
> be still needed to build regardless how we decide to handle the future
> changes.
>
>

Applied; thanks. I think page pinning can be worked around by pinning
all pages on memslot registration (and unpinning on memslot removal);
this will slow down virtual machine startup, but is at least simple.

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