[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 45/57] postcopy: Check order of received target pages
From: |
Juan Quintela |
Subject: |
[Qemu-devel] [PULL 45/57] postcopy: Check order of received target pages |
Date: |
Tue, 10 Nov 2015 15:25:34 +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>
Reviewed-by: Juan Quintela <address@hidden>
Signed-off-by: Juan Quintela <address@hidden>
---
migration/ram.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/migration/ram.c b/migration/ram.c
index af5f369..8bf0841 100644
--- a/migration/ram.c
+++ b/migration/ram.c
@@ -2097,6 +2097,7 @@ static int ram_load_postcopy(QEMUFile *f)
MigrationIncomingState *mis = migration_incoming_get_current();
/* Temporary page that is later 'placed' */
void *postcopy_host_page = postcopy_get_tmp_page(mis);
+ void *last_host = NULL;
while (!ret && !(flags & RAM_SAVE_FLAG_EOS)) {
ram_addr_t addr;
@@ -2133,8 +2134,17 @@ static int ram_load_postcopy(QEMUFile *f)
/* 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;
+ }
}
+
/*
* If it's the last part of a host page then we place the host
* page
@@ -2143,6 +2153,7 @@ static int ram_load_postcopy(QEMUFile *f)
~qemu_host_page_mask) == 0;
place_source = postcopy_host_page;
}
+ last_host = host;
switch (flags & ~RAM_SAVE_FLAG_CONTINUE) {
case RAM_SAVE_FLAG_COMPRESS:
--
2.5.0
- Re: [Qemu-devel] [PULL 42/57] Page request: Consume pages off the post-copy queue, (continued)
- Re: [Qemu-devel] [PULL 42/57] Page request: Consume pages off the post-copy queue, Dr. David Alan Gilbert, 2015/11/12
- Re: [Qemu-devel] [PULL 42/57] Page request: Consume pages off the post-copy queue, Peter Maydell, 2015/11/12
- Re: [Qemu-devel] [PULL 42/57] Page request: Consume pages off the post-copy queue, Peter Maydell, 2015/11/12
- Re: [Qemu-devel] [PULL 42/57] Page request: Consume pages off the post-copy queue, Dr. David Alan Gilbert, 2015/11/12
- Re: [Qemu-devel] [PULL 42/57] Page request: Consume pages off the post-copy queue, Juan Quintela, 2015/11/12
- Re: [Qemu-devel] [PULL 42/57] Page request: Consume pages off the post-copy queue, Dr. David Alan Gilbert, 2015/11/12
- Re: [Qemu-devel] [PULL 42/57] Page request: Consume pages off the post-copy queue, Juan Quintela, 2015/11/12
- Re: [Qemu-devel] [PULL 42/57] Page request: Consume pages off the post-copy queue, Markus Armbruster, 2015/11/12
- Re: [Qemu-devel] [PULL 42/57] Page request: Consume pages off the post-copy queue, Andreas Färber, 2015/11/16
- [Qemu-devel] [PULL 43/57] postcopy_ram.c: place_page and helpers, Juan Quintela, 2015/11/10
- [Qemu-devel] [PULL 45/57] postcopy: Check order of received target pages,
Juan Quintela <=
- [Qemu-devel] [PULL 46/57] Don't sync dirty bitmaps in postcopy, Juan Quintela, 2015/11/10
- [Qemu-devel] [PULL 51/57] Start up a postcopy/listener thread ready for incoming page data, Juan Quintela, 2015/11/10
- [Qemu-devel] [PULL 50/57] Postcopy; Handle userfault requests, Juan Quintela, 2015/11/10
- [Qemu-devel] [PULL 49/57] Round up RAMBlock sizes to host page sizes, Juan Quintela, 2015/11/10
- [Qemu-devel] [PULL 52/57] postcopy: Wire up loadvm_postcopy_handle_ commands, Juan Quintela, 2015/11/10
- [Qemu-devel] [PULL 47/57] Don't iterate on precopy-only devices during postcopy, Juan Quintela, 2015/11/10
- [Qemu-devel] [PULL 48/57] Host page!=target page: Cleanup bitmaps, Juan Quintela, 2015/11/10
- [Qemu-devel] [PULL 55/57] Disable mlock around incoming postcopy, Juan Quintela, 2015/11/10
- [Qemu-devel] [PULL 54/57] End of migration for postcopy, Juan Quintela, 2015/11/10
- [Qemu-devel] [PULL 53/57] Postcopy: Mark nohugepage before discard, Juan Quintela, 2015/11/10