[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 12/15] migration/postcopy: Explicitly disallow huge p
From: |
Juan Quintela |
Subject: |
[Qemu-devel] [PULL 12/15] migration/postcopy: Explicitly disallow huge pages |
Date: |
Fri, 14 Oct 2016 17:28:20 +0200 |
From: "Dr. David Alan Gilbert" <address@hidden>
At the moment postcopy will fail as soon as qemu tries to register
userfault on the RAMBlock pages that are backed by hugepages.
However, the kernel is going to get userfault support for hugepage
at some point, and we've not got the rest of the QEMU code to support
it yet, so fail neatly with an error like:
Postcopy doesn't support hugetlbfs yet (/objects/mem1)
Signed-off-by: Dr. David Alan Gilbert <address@hidden>
Reviewed-by: Juan Quintela <address@hidden>
Signed-off-by: Juan Quintela <address@hidden>
---
migration/postcopy-ram.c | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)
diff --git a/migration/postcopy-ram.c b/migration/postcopy-ram.c
index 9b04778..a40dddb 100644
--- a/migration/postcopy-ram.c
+++ b/migration/postcopy-ram.c
@@ -85,6 +85,24 @@ static bool ufd_version_check(int ufd)
}
/*
+ * Check for things that postcopy won't support; returns 0 if the block
+ * is fine.
+ */
+static int check_range(const char *block_name, void *host_addr,
+ ram_addr_t offset, ram_addr_t length, void *opaque)
+{
+ RAMBlock *rb = qemu_ram_block_by_name(block_name);
+
+ if (qemu_ram_pagesize(rb) > getpagesize()) {
+ error_report("Postcopy doesn't support large page sizes yet (%s)",
+ block_name);
+ return -E2BIG;
+ }
+
+ return 0;
+}
+
+/*
* Note: This has the side effect of munlock'ing all of RAM, that's
* normally fine since if the postcopy succeeds it gets turned back on at the
* end.
@@ -104,6 +122,12 @@ bool postcopy_ram_supported_by_host(void)
goto out;
}
+ /* Check for anything about the RAMBlocks we don't support */
+ if (qemu_ram_foreach_block(check_range, NULL)) {
+ /* check_range will have printed its own error */
+ goto out;
+ }
+
ufd = syscall(__NR_userfaultfd, O_CLOEXEC);
if (ufd == -1) {
error_report("%s: userfaultfd not available: %s", __func__,
--
2.7.4
- [Qemu-devel] [PULL 04/15] migration: Make failed migration load set file error, (continued)
- [Qemu-devel] [PULL 04/15] migration: Make failed migration load set file error, Juan Quintela, 2016/10/14
- [Qemu-devel] [PULL 08/15] migrate: Use boxed qapi for migrate-set-parameters, Juan Quintela, 2016/10/14
- [Qemu-devel] [PULL 07/15] migrate: Share common MigrationParameters struct, Juan Quintela, 2016/10/14
- [Qemu-devel] [PULL 09/15] migrate: Fix bounds check for migration parameters in migration.c, Juan Quintela, 2016/10/14
- [Qemu-devel] [PULL 05/15] migration/rdma: Don't flag an error when we've been told about one, Juan Quintela, 2016/10/14
- [Qemu-devel] [PULL 10/15] Postcopy vs xbzrle: Don't send xbzrle pages once in postcopy [for 2.8], Juan Quintela, 2016/10/14
- [Qemu-devel] [PULL 06/15] migrate: Fix cpu-throttle-increment regression in HMP, Juan Quintela, 2016/10/14
- [Qemu-devel] [PULL 11/15] RAMBlocks: Store page size, Juan Quintela, 2016/10/14
- [Qemu-devel] [PULL 13/15] migration: Fix seg with missing port, Juan Quintela, 2016/10/14
- [Qemu-devel] [PULL 14/15] migrate: move max-bandwidth and downtime-limit to migrate_set_parameter, Juan Quintela, 2016/10/14
- [Qemu-devel] [PULL 12/15] migration/postcopy: Explicitly disallow huge pages,
Juan Quintela <=
- [Qemu-devel] [PULL 15/15] docs/xbzrle: correction, Juan Quintela, 2016/10/14
- Re: [Qemu-devel] [PULL 00/15] Migration v2, Peter Maydell, 2016/10/17