qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [RFC PATCH 1/4] migration/postcopy-ram: check pagefault fla


From: Christian Pinto
Subject: [Qemu-devel] [RFC PATCH 1/4] migration/postcopy-ram: check pagefault flags in userfaultfd thread
Date: Thu, 9 Mar 2017 12:34:34 +0100

The UFFD_PAGEFAULT_FLAG_WP should be set every time the page fault is due to a
write to a write-protected page. Flag should be checked at every time
to be sure the page fault is due to a write into WP area.

Signed-off-by: Christian Pinto <address@hidden>
Signed-off-by: Baptiste Reynal <address@hidden>
---
 migration/postcopy-ram.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/migration/postcopy-ram.c b/migration/postcopy-ram.c
index ea70bd5d16..9c45f1059f 100644
--- a/migration/postcopy-ram.c
+++ b/migration/postcopy-ram.c
@@ -534,7 +534,12 @@ static void *postcopy_ram_fault_thread(void *opaque)
                 migrate_send_rp_req_pages(mis, NULL,
                                           rb_offset, hostpagesize);
             }
-        } else { /* UFFDIO_REGISTER_MODE_WP */
+        } else if (msg.arg.pagefault.flags &
+                    UFFD_PAGEFAULT_FLAG_WP) { /* UFFDIO_REGISTER_MODE_WP */
+            /*
+             * msg.arg.pagefault.flags &UFFD_PAGEFAULT_FLAG_WP expected to
+             * be set in case of pagefault due to write protected page
+             * */
             MigrationState *ms = container_of(us, MigrationState,
                                               userfault_state);
             ret = ram_save_queue_pages(ms, qemu_ram_get_idstr(rb), rb_offset,
-- 
2.11.0




reply via email to

[Prev in Thread] Current Thread [Next in Thread]