kvm: qemu: mark guest mapping as MADV_DONTFORK
When qemu fork's (ssh migration, qemu-nbd, slirp), the guest memory
mapping becomes shared and write-protected by parent and child, until
execve switches to a new mm.
get_user_pages with force=1 parameter will break COW during this window,
leaving stale shadow mappings that point to the previously shared page.
Fix this by madvising the range as MADV_DONTFORK, if mmu notifiers are
disabled.
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Avi Kivity <avi@qumranet.com>