[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 2/2] kvm: clear dirty bitmaps from all overlapping memslots
From: |
Peter Xu |
Subject: |
Re: [PATCH 2/2] kvm: clear dirty bitmaps from all overlapping memslots |
Date: |
Fri, 20 Sep 2019 20:18:13 +0800 |
User-agent: |
Mutt/1.11.4 (2019-03-13) |
On Fri, Sep 20, 2019 at 12:21:22PM +0200, Paolo Bonzini wrote:
> Since the KVM dirty page reporting works on guest physical addresses,
> we need to clear all of the aliases when a page is migrated, or there
> is a risk of losing writes to the aliases that were not cleared.
The patch content looks perfect to me, though I just want to make sure
I understand the issue behind, and the commit message...
IMHO we've got two issues to cover for log_clear():
(1) memory region aliasing, hence multiple GPAs can point to the same
HVA/HPA so we need to clear the memslot dirty bits on all the
mapped GPAs, and,
(2) large log_clear() request which can cover more than one valid
kvm memslots. Note that in this case, the mem slots can really
be having different HVAs so imho it should be a different issue
comparing to (1)
The commit message says it's solving problem (1). However for what I
understand, we are actually doing well on issue (1) because in
memory_region_clear_dirty_bitmap() we iterate over all the flat views
so that we should have caught all the aliasing memory regions if there
are any. However this patch should perfectly fix problem (2). Am I
right?
Thanks,
--
Peter Xu