KVM: Disable manual dirty log when dirty ring enabled
commita81a592698c5cf3d84486b00c84b7979dfa0a3da
authorPeter Xu <peterx@redhat.com>
Thu, 6 May 2021 16:05:48 +0000 (6 12:05 -0400)
committerPaolo Bonzini <pbonzini@redhat.com>
Wed, 26 May 2021 12:49:46 +0000 (26 14:49 +0200)
treedd43f42826f474eb69096c9309234939961b95e0
parent2ea5cb0a47c9dbf78235de30a0d5846a4ab6d995
KVM: Disable manual dirty log when dirty ring enabled

KVM_CAP_MANUAL_DIRTY_LOG_PROTECT2 is for KVM_CLEAR_DIRTY_LOG, which is only
useful for KVM_GET_DIRTY_LOG.  Skip enabling it for kvm dirty ring.

More importantly, KVM_DIRTY_LOG_INITIALLY_SET will not wr-protect all the pages
initially, which is against how kvm dirty ring is used - there's no way for kvm
dirty ring to re-protect a page before it's notified as being written first
with a GFN entry in the ring!  So when KVM_DIRTY_LOG_INITIALLY_SET is enabled
with dirty ring, we'll see silent data loss after migration.

Signed-off-by: Peter Xu <peterx@redhat.com>
Message-Id: <20210506160549.130416-10-peterx@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
accel/kvm/kvm-all.c