From: Helge Deller <deller@gmx.de>
To: qemu-devel@nongnu.org, Riku Voipio <riku.voipio@iki.fi>
Cc: Richard Henderson <rth@twiddle.net>
Subject: [Qemu-devel] [PATCH] linux-user: Add TARGET_MAP_STACK and TARGET_MAP_HUGETLB for all remaining architectures
Date: Sat, 11 Mar 2017 19:30:16 +0100 [thread overview]
Message-ID: <20170311183016.GA20514@ls3530.fritz.box> (raw)
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 <deller@gmx.de>
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
next reply other threads:[~2017-03-11 18:30 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-11 18:30 Helge Deller [this message]
2017-03-11 18:33 ` [Qemu-devel] [PATCH] linux-user: Add TARGET_MAP_STACK and TARGET_MAP_HUGETLB for all remaining architectures no-reply
2017-03-11 21:53 ` Richard Henderson
2017-03-13 14:09 ` Helge Deller
2017-03-13 20:52 ` Richard Henderson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170311183016.GA20514@ls3530.fritz.box \
--to=deller@gmx.de \
--cc=qemu-devel@nongnu.org \
--cc=riku.voipio@iki.fi \
--cc=rth@twiddle.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).