qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] [PATCH 14/15] postcopy: Check for userfault+hugepage featur


From: Dr. David Alan Gilbert (git)
Subject: [Qemu-devel] [PATCH 14/15] postcopy: Check for userfault+hugepage feature
Date: Fri, 6 Jan 2017 18:28:22 +0000

From: "Dr. David Alan Gilbert" <address@hidden>

We need extra Linux kernel support (~4.9) to support userfaults
on hugetlbfs; check for them.

Signed-off-by: Dr. David Alan Gilbert <address@hidden>
---
 migration/postcopy-ram.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/migration/postcopy-ram.c b/migration/postcopy-ram.c
index 6b30b43..d12dd7f 100644
--- a/migration/postcopy-ram.c
+++ b/migration/postcopy-ram.c
@@ -81,6 +81,17 @@ static bool ufd_version_check(int ufd)
         return false;
     }
 
+    if (getpagesize() != ram_pagesize_summary()) {
+        bool have_hp = false; 
+        /* We've got a huge page */
+#ifdef UFFD_FEATURE_MISSING_HUGETLBFS
+        have_hp = api_struct.features & UFFD_FEATURE_MISSING_HUGETLBFS;
+#endif
+        if (!have_hp) {
+            error_report("Userfault on this host does not support huge pages");
+            return false;
+        }
+    }
     return true;
 }
 
-- 
2.9.3




reply via email to

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