From patchwork Sat Mar 11 18:30:16 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Helge Deller X-Patchwork-Id: 9618959 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 6CE06604CC for ; Sat, 11 Mar 2017 18:30:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 649742872B for ; Sat, 11 Mar 2017 18:30:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5897F28734; Sat, 11 Mar 2017 18:30:53 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id D00F12872B for ; Sat, 11 Mar 2017 18:30:52 +0000 (UTC) Received: from localhost ([::1]:44339 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cmln1-0005E1-M5 for patchwork-qemu-devel@patchwork.kernel.org; Sat, 11 Mar 2017 13:30:51 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39805) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cmlmn-0005Cp-F7 for qemu-devel@nongnu.org; Sat, 11 Mar 2017 13:30:38 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cmlmj-0003VS-HN for qemu-devel@nongnu.org; Sat, 11 Mar 2017 13:30:37 -0500 Received: from mout.gmx.net ([212.227.17.22]:65443) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cmlmj-0003UB-79 for qemu-devel@nongnu.org; Sat, 11 Mar 2017 13:30:33 -0500 Received: from ls3530.fritz.box ([193.159.24.20]) by mail.gmx.com (mrgmx101 [212.227.17.168]) with ESMTPSA (Nemesis) id 0MH4Os-1d0ZHF1MKA-00DnvX; Sat, 11 Mar 2017 19:30:19 +0100 Date: Sat, 11 Mar 2017 19:30:16 +0100 From: Helge Deller To: qemu-devel@nongnu.org, Riku Voipio Message-ID: <20170311183016.GA20514@ls3530.fritz.box> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.7.1 (2016-10-04) X-Provags-ID: V03:K0:7G0AmaHFJNKqSdFw5HP03Opl1NFy1x7xaqxPiG13p7s9T7uUf5I gR5O4Z3xGohGalMVUw48F/vymyIOuKZ9Jcpt2tHwnaNtyUJFV2EvnP934GRlsoc4K1syrJ9 zDd3jsiyL7lnzSdHcPxlPxiQhJSMjAVIoTCyWKZCSoAyT26gN5RLuuikd/9YLcwwEEqCOFj kKmtnf66EM1i0xHzwWGnw== X-UI-Out-Filterresults: notjunk:1; V01:K0:3a1JQgZSh9Q=:oZLHQQbgSTjMZB78QqjOX2 Nkf/OJDBGscwN2NDChyFjzUeRraHo8VFP6WCbL6Q+tvUOZv5WWOXvaUKOrK5dsJzM15NkjmPK RTQiW+fWGIoybB/Bfg6icVOZLEx2to0SU65yl5qC7P7JBdOM8TCizUm1tYjvCQTxRhyfMtNva kvW2p6JHO8yXtGntMxDikvOMOBZ+bzbMpQZjsvGqaCoh9EAfaeIg1lVr2EK2QUwgeWAzJley4 wTsZgTmeGRwNqFumzEQJH12tC9OxkcQ6T+dx7bDZm4shAjI1UKYCX+wfiYhMBnL9lhdgg/6ay +HWylugbXVpo2Zqp0Fu3APVHXMz0nB8RvLqVeF4kaVS3TcPb33PltOPBnPKfvEZbVxCpQJflD vOBnhZVvsUU5X6sariDCgszxFXY1Oft+Bwfa/GV8TQtbzUrDbYfZH3Yab3f2lzlxsj9mUuyhr s9AJH7/8fwntIUZXo6si8pDXt1gGB4fnYPSNSz/YcDTUdFyRvsvSEPKP39kW6FXIcEqyZ2Mmw 0ajk5pJjmwE5npOsJevlehsNLGyAYqV1+gD2IGVZg2LkCCiqSqmAfm3uigvE7WvT93cvroKxj oXd7snRqxe0TR4aIIN9F85tAMgvmYA4TpzgzdcNlFEBYxZpcpeX2GrC/wj69gGnqH8+NP1h1D 2vU2Iz4VCcWnQpCP2LAIpN5uyBbldwAQrPWd84vk52HJKD4f3ZJcWPT6c5DSxefoOdq3kcuPw +lcXSM+xliJbiTr2ejt950JrR/aBc1YlOYEleL4BpB3/qYOGTkJMa8sqShk= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 212.227.17.22 Subject: [Qemu-devel] [PATCH] linux-user: Add TARGET_MAP_STACK and TARGET_MAP_HUGETLB for all remaining architectures 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: Richard Henderson Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Add the missing defines and for TARGET_MAP_STACK and TARGET_MAP_HUGETLB for alpha, mips, ppc and x86, and fix the mmap_flags translation table to translate those flags between host and target architecture. Signed-off-by: Helge Deller diff --git a/linux-user/syscall.c b/linux-user/syscall.c index cec8428..03ed370 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -5875,6 +5875,8 @@ static bitmask_transtbl mmap_flags_tbl[] = { { TARGET_MAP_LOCKED, TARGET_MAP_LOCKED, MAP_LOCKED, MAP_LOCKED }, { TARGET_MAP_NORESERVE, TARGET_MAP_NORESERVE, MAP_NORESERVE, MAP_NORESERVE }, + { TARGET_MAP_STACK, TARGET_MAP_STACK, MAP_STACK, MAP_STACK }, + { TARGET_MAP_HUGETLB, TARGET_MAP_HUGETLB, MAP_HUGETLB, MAP_HUGETLB }, { 0, 0, 0, 0 } }; diff --git a/linux-user/syscall_defs.h b/linux-user/syscall_defs.h index f356189..a516d77 100644 --- a/linux-user/syscall_defs.h +++ b/linux-user/syscall_defs.h @@ -1346,6 +1346,8 @@ struct target_winsize { #define TARGET_MAP_NORESERVE 0x0400 /* don't check for reservations */ #define TARGET_MAP_POPULATE 0x10000 /* populate (prefault) pagetables */ #define TARGET_MAP_NONBLOCK 0x20000 /* do not block on IO */ +#define TARGET_MAP_STACK 0x40000 /* give out an address that is best suited for process/thread stacks */ +#define TARGET_MAP_HUGETLB 0x80000 /* create a huge page mapping */ #elif defined(TARGET_PPC) #define TARGET_MAP_FIXED 0x10 /* Interpret addr exactly */ #define TARGET_MAP_ANONYMOUS 0x20 /* don't use a file */ @@ -1356,6 +1358,8 @@ struct target_winsize { #define TARGET_MAP_NORESERVE 0x0040 /* don't check for reservations */ #define TARGET_MAP_POPULATE 0x8000 /* populate (prefault) pagetables */ #define TARGET_MAP_NONBLOCK 0x10000 /* do not block on IO */ +#define TARGET_MAP_STACK 0x20000 /* give out an address that is best suited for process/thread stacks */ +#define TARGET_MAP_HUGETLB 0x40000 /* create a huge page mapping */ #elif defined(TARGET_ALPHA) #define TARGET_MAP_ANONYMOUS 0x10 /* don't use a file */ #define TARGET_MAP_FIXED 0x100 /* Interpret addr exactly */ @@ -1366,6 +1370,8 @@ struct target_winsize { #define TARGET_MAP_NORESERVE 0x10000 /* no check for reservations */ #define TARGET_MAP_POPULATE 0x20000 /* pop (prefault) pagetables */ #define TARGET_MAP_NONBLOCK 0x40000 /* do not block on IO */ +#define TARGET_MAP_STACK 0x80000 /* give out an address that is best suited for process/thread stacks */ +#define TARGET_MAP_HUGETLB 0x100000 /* create a huge page mapping */ #elif defined(TARGET_HPPA) #define TARGET_MAP_ANONYMOUS 0x10 /* don't use a file */ #define TARGET_MAP_FIXED 0x04 /* Interpret addr exactly */ @@ -1388,6 +1394,8 @@ struct target_winsize { #define TARGET_MAP_NORESERVE 0x4000 /* don't check for reservations */ #define TARGET_MAP_POPULATE 0x8000 /* populate (prefault) pagetables */ #define TARGET_MAP_NONBLOCK 0x10000 /* do not block on IO */ +#define TARGET_MAP_STACK 0x20000 /* give out an address that is best suited for process/thread stacks */ +#define TARGET_MAP_HUGETLB 0x40000 /* create a huge page mapping */ #define TARGET_MAP_UNINITIALIZED 0x4000000 /* for anonymous mmap, memory could be uninitialized */ #endif