[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v8 46/54] postcopy: Check order of received target p
From: |
Dr. David Alan Gilbert (git) |
Subject: |
[Qemu-devel] [PATCH v8 46/54] postcopy: Check order of received target pages |
Date: |
Tue, 29 Sep 2015 09:38:10 +0100 |
From: "Dr. David Alan Gilbert" <address@hidden>
Ensure that target pages received within a host page are in order.
This shouldn't trigger, but in the cases where the sender goes
wrong and sends stuff out of order it produces a corruption that's
really nasty to debug.
Signed-off-by: Dr. David Alan Gilbert <address@hidden>
---
migration/ram.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/migration/ram.c b/migration/ram.c
index d6437be..8b1570d 100644
--- a/migration/ram.c
+++ b/migration/ram.c
@@ -2212,6 +2212,7 @@ static int ram_load(QEMUFile *f, void *opaque, int
version_id)
void *postcopy_host_page = NULL;
bool postcopy_place_needed = false;
bool matching_page_sizes = qemu_host_page_size == TARGET_PAGE_SIZE;
+ void *last_host = NULL;
seq_iter++;
@@ -2264,6 +2265,14 @@ static int ram_load(QEMUFile *f, void *opaque, int
version_id)
/* If all TP are zero then we can optimise the place */
if (!((uintptr_t)host & ~qemu_host_page_mask)) {
all_zero = true;
+ } else {
+ /* not the 1st TP within the HP */
+ if (host != (last_host + TARGET_PAGE_SIZE)) {
+ error_report("Non-sequential target page %p/%p\n",
+ host, last_host);
+ ret = -EINVAL;
+ break;
+ }
}
/*
@@ -2274,6 +2283,7 @@ static int ram_load(QEMUFile *f, void *opaque, int
version_id)
~qemu_host_page_mask) == 0;
postcopy_place_source = postcopy_host_page;
}
+ last_host = host;
}
switch (flags & ~RAM_SAVE_FLAG_CONTINUE) {
--
2.5.0
- Re: [Qemu-devel] [PATCH v8 42/54] Postcopy: Use helpers to map pages during migration, (continued)
- [Qemu-devel] [PATCH v8 43/54] Don't sync dirty bitmaps in postcopy, Dr. David Alan Gilbert (git), 2015/10/01
- [Qemu-devel] [PATCH v8 41/54] postcopy_ram.c: place_page and helpers, Dr. David Alan Gilbert (git), 2015/10/01
- [Qemu-devel] [PATCH v8 44/54] Don't iterate on precopy-only devices during postcopy, Dr. David Alan Gilbert (git), 2015/10/01
- [Qemu-devel] [PATCH v8 45/54] Host page!=target page: Cleanup bitmaps, Dr. David Alan Gilbert (git), 2015/10/01
- [Qemu-devel] [PATCH v8 46/54] postcopy: Check order of received target pages,
Dr. David Alan Gilbert (git) <=
- [Qemu-devel] [PATCH v8 47/54] Round up RAMBlock sizes to host page sizes, Dr. David Alan Gilbert (git), 2015/10/01
- [Qemu-devel] [PATCH v8 48/54] Postcopy; Handle userfault requests, Dr. David Alan Gilbert (git), 2015/10/01
- [Qemu-devel] [PATCH v8 50/54] postcopy: Wire up loadvm_postcopy_handle_ commands, Dr. David Alan Gilbert (git), 2015/10/01
- [Qemu-devel] [PATCH v8 49/54] Start up a postcopy/listener thread ready for incoming page data, Dr. David Alan Gilbert (git), 2015/10/01
- [Qemu-devel] [PATCH v8 51/54] Postcopy: Mark nohugepage before discard, Dr. David Alan Gilbert (git), 2015/10/01
- [Qemu-devel] [PATCH v8 52/54] End of migration for postcopy, Dr. David Alan Gilbert (git), 2015/10/01
- [Qemu-devel] [PATCH v8 53/54] Disable mlock around incoming postcopy, Dr. David Alan Gilbert (git), 2015/10/01