qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] linux-user: Add TARGET_MAP_STACK and TARGET_MAP_HUGETLB for all remaining architectures
@ 2017-03-11 18:30 Helge Deller
  2017-03-11 18:33 ` no-reply
  2017-03-11 21:53 ` Richard Henderson
  0 siblings, 2 replies; 5+ messages in thread
From: Helge Deller @ 2017-03-11 18:30 UTC (permalink / raw)
  To: qemu-devel, Riku Voipio; +Cc: Richard Henderson

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
 

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-03-13 20:52 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-03-11 18:30 [Qemu-devel] [PATCH] linux-user: Add TARGET_MAP_STACK and TARGET_MAP_HUGETLB for all remaining architectures Helge Deller
2017-03-11 18:33 ` no-reply
2017-03-11 21:53 ` Richard Henderson
2017-03-13 14:09   ` Helge Deller
2017-03-13 20:52     ` Richard Henderson

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).