render / rpms / qemu

Forked from rpms/qemu 9 months ago
Clone

Blame 0083-tcg-sparc-Don-t-MAP_FIXED-on-top-of-the-program.patch

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