From: David Hildenbrand <[email protected]>

Let's make sure to not merge when different memory regions are involved.
Unlikely, but theoretically possible.

Acked-by: Stefan Berger <[email protected]>
Reviewed-by: Peter Xu <[email protected]>
Cc: Marc-André Lureau <[email protected]>
Cc: Paolo Bonzini <[email protected]>
Cc: "Michael S. Tsirkin" <[email protected]>
Cc: Eduardo Habkost <[email protected]>
Cc: Alex Williamson <[email protected]>
Cc: Dr. David Alan Gilbert <[email protected]>
Cc: Igor Mammedov <[email protected]>
Cc: Claudio Fontana <[email protected]>
Cc: Thomas Huth <[email protected]>
Cc: "Alex Bennée" <[email protected]>
Cc: Peter Xu <[email protected]>
Cc: Laurent Vivier <[email protected]>
Cc: Stefan Berger <[email protected]>
Signed-off-by: David Hildenbrand <[email protected]>
Message-Id: <[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
---
 softmmu/memory_mapping.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/softmmu/memory_mapping.c b/softmmu/memory_mapping.c
index e7af276546..d401ca7e31 100644
--- a/softmmu/memory_mapping.c
+++ b/softmmu/memory_mapping.c
@@ -229,7 +229,8 @@ static void guest_phys_blocks_region_add(MemoryListener 
*listener,
 
         /* we want continuity in both guest-physical and host-virtual memory */
         if (predecessor->target_end < target_start ||
-            predecessor->host_addr + predecessor_size != host_addr) {
+            predecessor->host_addr + predecessor_size != host_addr ||
+            predecessor->mr != section->mr) {
             predecessor = NULL;
         }
     }
-- 
2.31.1



Reply via email to