Anyhow I'm quite sure that adding global MISSING handler for snapshotting
is too heavy and not really needed.
UFFDIO_ZEROCOPY installs a zero pfn and that should be all of it. There'll
definitely be overhead, but it may not be that huge as imagined. Live snapshot
is great in that we have point-in-time image of guest without stopping the
guest, so taking slightly longer time won't be a huge loss to us too.
Actually we can also think of other ways to work around it. One way is we can
pre-fault all guest pages before wr-protect. Note that we don't need to write
to the guest page because read would suffice, since uffd-wp would also work
with zero pfn. It's just that this workaround won't help on saving snapshot
disk space, but it seems working. It would be great if you have other
workarounds, maybe as you said UFFDIO_ZEROCOPY is not the only route.
Thanks,