From patchwork Sat Sep 22 02:04:57 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 186067 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 03D632C0089 for ; Sat, 22 Sep 2012 12:58:08 +1000 (EST) Received: from localhost ([::1]:42227 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TFF6S-0006g1-Q3 for incoming@patchwork.ozlabs.org; Fri, 21 Sep 2012 22:05:56 -0400 Received: from eggs.gnu.org ([208.118.235.92]:57490) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TFF5r-0005CB-OM for qemu-devel@nongnu.org; Fri, 21 Sep 2012 22:05:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TFF5q-0000h1-B6 for qemu-devel@nongnu.org; Fri, 21 Sep 2012 22:05:19 -0400 Received: from mail-pb0-f45.google.com ([209.85.160.45]:64906) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TFF5q-0000d7-4e for qemu-devel@nongnu.org; Fri, 21 Sep 2012 22:05:18 -0400 Received: by mail-pb0-f45.google.com with SMTP id rp12so8850169pbb.4 for ; Fri, 21 Sep 2012 19:05:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references; bh=xonaI5DS1KTcPDHyMnTBxa/pc+c0yOijUW0F00hOerI=; b=mRI6FXxuGVk3ce5615cJBEZ2dsY5snGP4FQYNX8r0fjfazLADO5N3Y6R4o0xYfzZKl lJUw/ynOVvqOKB3S331GicYXzltf+63JweYVo3S1+FaD7/Ni0CfBqKRNvrsrvc+WXxgW 31njtfr9pU8PDY19wfyW1w0SYKlQh2Akl5p1bKCZU4LesbA65Uhgyd+TxTs6ySZNBx5F UP1AvthtvS3zSLGXnn+aoEIlFukwFFw6Cm3KEfa713od5yUFQBfXS6aIgtMKrHX3GCgW AcQiI0MvhNiWjr0H2hQ6XzzebEejGd2gqe/qnPiJPN4244OaiKxcc4bWi/fQXXKpHtSK dabQ== Received: by 10.66.79.166 with SMTP id k6mr17200787pax.44.1348279517829; Fri, 21 Sep 2012 19:05:17 -0700 (PDT) Received: from anchor.twiddle.home.com ([173.160.232.49]) by mx.google.com with ESMTPS id s4sm4956298paw.35.2012.09.21.19.05.16 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 21 Sep 2012 19:05:17 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Fri, 21 Sep 2012 19:04:57 -0700 Message-Id: <1348279507-3617-5-git-send-email-rth@twiddle.net> X-Mailer: git-send-email 1.7.11.4 In-Reply-To: <1348279507-3617-1-git-send-email-rth@twiddle.net> References: <1348279507-3617-1-git-send-email-rth@twiddle.net> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.85.160.45 Cc: Blue Swirl Subject: [Qemu-devel] [PATCH 04/14] tcg-sparc: Don't MAP_FIXED on top of the program X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org The address we pick in sparc64.ld is also 0x60000000, so doing a fixed map on top of that is guaranteed to blow up. Choosing 0x40000000 is exactly right for the max of code_gen_buffer_size set below. No need to ever use MAP_FIXED. While getting our desired address helps optimize the generated code, we won't fail if we don't get it. Signed-off-by: Richard Henderson --- exec.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/exec.c b/exec.c index f22e9e6..4510985 100644 --- a/exec.c +++ b/exec.c @@ -543,8 +543,7 @@ static void code_gen_alloc(unsigned long tb_size) code_gen_buffer_size = (800 * 1024 * 1024); #elif defined(__sparc_v9__) // Map the buffer below 2G, so we can use direct calls and branches - flags |= MAP_FIXED; - start = (void *) 0x60000000UL; + start = (void *) 0x40000000UL; if (code_gen_buffer_size > (512 * 1024 * 1024)) code_gen_buffer_size = (512 * 1024 * 1024); #elif defined(__arm__) @@ -584,8 +583,7 @@ static void code_gen_alloc(unsigned long tb_size) code_gen_buffer_size = (800 * 1024 * 1024); #elif defined(__sparc_v9__) // Map the buffer below 2G, so we can use direct calls and branches - flags |= MAP_FIXED; - addr = (void *) 0x60000000UL; + addr = (void *) 0x40000000UL; if (code_gen_buffer_size > (512 * 1024 * 1024)) { code_gen_buffer_size = (512 * 1024 * 1024); }