From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53524) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1chKc4-00015H-Gl for qemu-devel@nongnu.org; Fri, 24 Feb 2017 13:29:05 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1chKc3-00083z-LC for qemu-devel@nongnu.org; Fri, 24 Feb 2017 13:29:04 -0500 Received: from mx1.redhat.com ([209.132.183.28]:50498) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1chKc3-00083M-F5 for qemu-devel@nongnu.org; Fri, 24 Feb 2017 13:29:03 -0500 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 9BCDA80484 for ; Fri, 24 Feb 2017 18:29:03 +0000 (UTC) From: "Dr. David Alan Gilbert (git)" Date: Fri, 24 Feb 2017 18:28:40 +0000 Message-Id: <20170224182844.32452-13-dgilbert@redhat.com> In-Reply-To: <20170224182844.32452-1-dgilbert@redhat.com> References: <20170224182844.32452-1-dgilbert@redhat.com> Subject: [Qemu-devel] [PATCH v3 12/16] postcopy: Allow hugepages List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org, quintela@redhat.com, lvivier@redhat.com Cc: aarcange@redhat.com From: "Dr. David Alan Gilbert" Allow huge pages in postcopy. Signed-off-by: Dr. David Alan Gilbert Reviewed-by: Juan Quintela Reviewed-by: Laurent Vivier --- migration/postcopy-ram.c | 25 +------------------------ 1 file changed, 1 insertion(+), 24 deletions(-) diff --git a/migration/postcopy-ram.c b/migration/postcopy-ram.c index 03cbd6e..6b30b43 100644 --- a/migration/postcopy-ram.c +++ b/migration/postcopy-ram.c @@ -85,24 +85,6 @@ 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. @@ -122,12 +104,6 @@ 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__, @@ -139,6 +115,7 @@ bool postcopy_ram_supported_by_host(void) if (!ufd_version_check(ufd)) { goto out; } + /* TODO: Only allow huge pages if the kernel supports it */ /* * userfault and mlock don't go together; we'll put it back later if -- 2.9.3