Received: from eggs.gnu.org ([2001:4830:134:3::10]:51746) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1atOXn-0007MY-4y for qemu-devel@nongnu.org; Thu, 21 Apr 2016 20:01:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1atOXl-0007GY-4F for qemu-devel@nongnu.org; Thu, 21 Apr 2016 20:01:59 -0400 Received: from out2-smtp.messagingengine.com ([66.111.4.26]:58048) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1atOXl-0007GM-0k for qemu-devel@nongnu.org; Thu, 21 Apr 2016 20:01:57 -0400 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id 68AB621F1C for ; Thu, 21 Apr 2016 20:01:55 -0400 (EDT) From: "Emilio G. Cota" Date: Thu, 21 Apr 2016 20:01:54 -0400 Message-Id: <1461283314-2353-2-git-send-email-cota@braap.org> In-Reply-To: <1461283314-2353-1-git-send-email-cota@braap.org> References: <1461283314-2353-1-git-send-email-cota@braap.org> Subject: [Qemu-devel] [PATCH 2/2] translate-all: add missing munmap of the code_gen guard page for MIPS List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: QEMU Developers Cc: Paolo Bonzini , Peter Crosthwaite , Richard Henderson Signed-off-by: Emilio G. Cota --- translate-all.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/translate-all.c b/translate-all.c index e700399..bba9b62 100644 --- a/translate-all.c +++ b/translate-all.c @@ -668,39 +668,39 @@ static inline void *alloc_code_gen_buffer(void) buf = mmap((void *)start, size + qemu_real_host_page_size, PROT_NONE, flags, -1, 0); if (buf == MAP_FAILED) { return NULL; } #ifdef __mips__ if (cross_256mb(buf, size)) { /* Try again, with the original still mapped, to avoid re-acquiring that 256mb crossing. This time don't specify an address. */ size_t size2; void *buf2 = mmap(NULL, size + qemu_real_host_page_size, PROT_NONE, flags, -1, 0); switch (buf2 != MAP_FAILED) { case 1: if (!cross_256mb(buf2, size)) { /* Success! Use the new buffer. */ - munmap(buf, size); + munmap(buf, size + qemu_real_host_page_size); break; } /* Failure. Work with what we had. */ - munmap(buf2, size); + munmap(buf2, size + qemu_real_host_page_size); /* fallthru */ default: /* Split the original buffer. Free the smaller half. */ buf2 = split_cross_256mb(buf, size); size2 = tcg_ctx.code_gen_buffer_size; if (buf == buf2) { munmap(buf + size2 + qemu_real_host_page_size, size - size2); } else { munmap(buf, size - size2); } size = size2; break; } buf = buf2; } #endif -- 2.5.0