From patchwork Thu Feb 16 14:22:24 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 728714 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3vPJnp5Wp3z9s8T for ; Fri, 17 Feb 2017 01:44:14 +1100 (AEDT) Received: from localhost ([::1]:47089 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ceNI4-0006SD-5z for incoming@patchwork.ozlabs.org; Thu, 16 Feb 2017 09:44:12 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48568) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ceMxU-0002fG-3r for qemu-devel@nongnu.org; Thu, 16 Feb 2017 09:22:57 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ceMxQ-0002Mp-Ti for qemu-devel@nongnu.org; Thu, 16 Feb 2017 09:22:56 -0500 Received: from mout.kundenserver.de ([217.72.192.75]:64456) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ceMxQ-0002M3-Ff for qemu-devel@nongnu.org; Thu, 16 Feb 2017 09:22:52 -0500 Received: from localhost.localdomain ([78.238.229.36]) by mrelayeu.kundenserver.de (mreue101 [212.227.15.183]) with ESMTPSA (Nemesis) id 0Lo0CW-1cBcmM2Ip6-00fwUy; Thu, 16 Feb 2017 15:22:38 +0100 From: Laurent Vivier To: qemu-devel@nongnu.org Date: Thu, 16 Feb 2017 15:22:24 +0100 Message-Id: <20170216142227.27448-12-laurent@vivier.eu> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170216142227.27448-1-laurent@vivier.eu> References: <20170216142227.27448-1-laurent@vivier.eu> MIME-Version: 1.0 X-Provags-ID: V03:K0:c9OXB3oXzuq0MCzqa6HCV1+3rkGT9NTOpJGr9FotrftdJs7XdZt 0Oij5NKA8AjpVFg9GfbMGsH5tvzQvZUj/Wpn7+62ieuHIun12tXLGxsIus4LukreMC6F3Sg Wb5lXCO5aAiqoI2A+S4j4Pn61Np/5aB8g9j4ay+7k2Z8gH4J08wSYCNF7oquQk3NfqCw8d1 LoqK/Q1AXkCbqitPTPQQA== X-UI-Out-Filterresults: notjunk:1; V01:K0:rqXf4ZctgXQ=:uK9kQWEe78/iJ0Vg11Mj2K 7dLJs6FXTnTPrniisy3KW6glmqtirEhzJBsQ7SDhwcxs1skOVWuvtsny+xrKiXWxkvkZIMBPv siVp3WcRwiJu3B1UqRwu8Z8yONVUJpER9ccd7PV/KcQQuWG7BXuPmx9Qc3KcW2qvELIfb5p6i N9oJ908fbJMwUbhKdsq9a7zRhX/f+u2nLM2jy+3gq/7Svi78eERrNg1GlyGyOBM5xS/pje4KZ KN2naBaLb+RKzmYO3/8OZuqCBP72NX5LFZZrN+2+cdEmwb1AKLi5AnBtIW69aLzKGcgvK4+tw Y7MnZuQKGAAhr/7pSzSAyrYgEIcxhs7yjeOFnFYzlIgQXqmc0kCY5MWwtCoAhP8wDUgh/TFZj ZLMj1eTWexK4UPzW98xIE93ZNpMSPYCSt+++FLBXVNQjrYQQSOu+gmi31Ly/5msvk8QbsLnBA iAsqKLLzdbV1uDV2sEcXii10QYDX7m37rkM2n+ESy+3z3qXYSpRCnXuVp9CZeyT/YMW/2dwEE hoHCGy5bCp5B9OuKxpKxNE6PK1aYJkP9JKSdx5yH2/RgDM6WRkr68Ch9aPldb5M3PbeU5UwWW J4c1yURz0Y7VNJVCoGllUcHGeXEmp3B9D2buFe6sqFeqz/Q7aJVTLizvYaYAHge3VmIaj1+n3 FnvxISsBz5bt1pJrG7fzR7SE7H1rZyaF1URvmsJol+N7pgmxmckgFs6kE++/gIre7WIOsFcwl BJYnROA+XE1VLf3b X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 217.72.192.75 Subject: [Qemu-devel] [PULL 11/14] linux-user: fix tcg/mmap test X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Pranith Kumar , Riku Voipio , Laurent Vivier Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Marc-André Lureau tests/tcg/mmap test fails with values other than default target page size. When creating a map beyond EOF, extra anonymous pages are added up to the target page boundary. Currently, this operation is performed only when qemu_real_host_page_size < TARGET_PAGE_SIZE, but it should be performed if the configured page size (qemu -p) is larger than qemu_real_host_page_size too. Signed-off-by: Marc-André Lureau [pranith: dropped checkpatch changes] Signed-off-by: Pranith Kumar Reviewed-by: Alex Bennée Reviewed-by: Laurent Vivier Message-Id: <20170119151533.29328-2-bobby.prani@gmail.com> Signed-off-by: Laurent Vivier --- linux-user/mmap.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/linux-user/mmap.c b/linux-user/mmap.c index 4ed9cad..4888f53 100644 --- a/linux-user/mmap.c +++ b/linux-user/mmap.c @@ -426,9 +426,9 @@ abi_long target_mmap(abi_ulong start, abi_ulong len, int prot, may need to truncate file maps at EOF and add extra anonymous pages up to the targets page boundary. */ - if ((qemu_real_host_page_size < TARGET_PAGE_SIZE) - && !(flags & MAP_ANONYMOUS)) { - struct stat sb; + if ((qemu_real_host_page_size < qemu_host_page_size) && + !(flags & MAP_ANONYMOUS)) { + struct stat sb; if (fstat (fd, &sb) == -1) goto fail;