5544c1b
From 59aadb4f5b15eff968ed00ad29816ac19bef507d Mon Sep 17 00:00:00 2001
5544c1b
From: Richard Henderson <rth@twiddle.net>
5544c1b
Date: Fri, 21 Sep 2012 10:40:48 -0700
5544c1b
Subject: [PATCH] tcg-sparc: Don't MAP_FIXED on top of the program
5544c1b
5544c1b
The address we pick in sparc64.ld is also 0x60000000, so doing a fixed map
5544c1b
on top of that is guaranteed to blow up.  Choosing 0x40000000 is exactly
5544c1b
right for the max of code_gen_buffer_size set below.
5544c1b
5544c1b
No need to ever use MAP_FIXED.  While getting our desired address helps
5544c1b
optimize the generated code, we won't fail if we don't get it.
5544c1b
5544c1b
Signed-off-by: Richard Henderson <rth@twiddle.net>
5544c1b
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
5544c1b
---
5544c1b
 exec.c | 6 ++----
5544c1b
 1 file changed, 2 insertions(+), 4 deletions(-)
5544c1b
5544c1b
diff --git a/exec.c b/exec.c
5544c1b
index 5834766..871a68a 100644
5544c1b
--- a/exec.c
5544c1b
+++ b/exec.c
5544c1b
@@ -543,8 +543,7 @@ static void code_gen_alloc(unsigned long tb_size)
5544c1b
             code_gen_buffer_size = (800 * 1024 * 1024);
5544c1b
 #elif defined(__sparc_v9__)
5544c1b
         // Map the buffer below 2G, so we can use direct calls and branches
5544c1b
-        flags |= MAP_FIXED;
5544c1b
-        start = (void *) 0x60000000UL;
5544c1b
+        start = (void *) 0x40000000UL;
5544c1b
         if (code_gen_buffer_size > (512 * 1024 * 1024))
5544c1b
             code_gen_buffer_size = (512 * 1024 * 1024);
5544c1b
 #elif defined(__arm__)
5544c1b
@@ -584,8 +583,7 @@ static void code_gen_alloc(unsigned long tb_size)
5544c1b
             code_gen_buffer_size = (800 * 1024 * 1024);
5544c1b
 #elif defined(__sparc_v9__)
5544c1b
         // Map the buffer below 2G, so we can use direct calls and branches
5544c1b
-        flags |= MAP_FIXED;
5544c1b
-        addr = (void *) 0x60000000UL;
5544c1b
+        addr = (void *) 0x40000000UL;
5544c1b
         if (code_gen_buffer_size > (512 * 1024 * 1024)) {
5544c1b
             code_gen_buffer_size = (512 * 1024 * 1024);
5544c1b
         }