memory: Remove has_coalesced_range counter
commit264ef5a5c52c249ff51a16d141fc03df71714a13
authorPeter Xu <peterx@redhat.com>
Tue, 20 Aug 2019 14:13:26 +0000 (20 22:13 +0800)
committerPaolo Bonzini <pbonzini@redhat.com>
Wed, 21 Aug 2019 14:31:58 +0000 (21 16:31 +0200)
treea82c17a01f046fbf1cc7d7edd075dd6b4cd2cc23
parent23f1174aac4181f86bb7e13ca8bc2d4a0bdf1e5c
memory: Remove has_coalesced_range counter

The has_coalesced_range could potentially be problematic in that it
only works for additions of coalesced mmio ranges but not deletions.
The reason is that has_coalesced_range information can be lost when
the FlatView updates the topology again when the updated region is not
covering the coalesced regions. When that happens, due to
flatrange_equal() is not checking against has_coalesced_range, the new
FlatRange will be seen as the same one as the old and the new
instance (whose has_coalesced_range will be zero) will replace the old
instance (whose has_coalesced_range _could_ be non-zero).

The counter was originally used to make sure every FlatRange will only
notify once for coalesced_io_{add|del} memory listeners, because each
FlatRange can be used by multiple address spaces, so logically
speaking it could be called multiple times.  However we should not
limit that, because memory listeners should will only be registered
with specific address space rather than multiple address spaces.

So let's fix this up by simply removing the whole has_coalesced_range.

Fixes: 3ac7d43a6fbb5d4a3
Signed-off-by: Peter Xu <peterx@redhat.com>
Message-Id: <20190820141328.10009-3-peterx@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
memory.c