Received: from [140.186.70.92] (port=48283 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OMUFF-0004HN-4X for qemu-devel@nongnu.org; Wed, 09 Jun 2010 18:59:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OMUFC-0001dT-KS for qemu-devel@nongnu.org; Wed, 09 Jun 2010 18:59:35 -0400 Received: from hall.aurel32.net ([88.191.82.174]:56230) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OMUFC-0001dI-G7 for qemu-devel@nongnu.org; Wed, 09 Jun 2010 18:59:34 -0400 Date: Thu, 10 Jun 2010 00:59:32 +0200 From: Aurelien Jarno Subject: Re: [Qemu-devel] [PATCH 06/35] tcg-s390: Allocate the code_gen_buffer near the main program. Message-ID: <20100609225932.GJ3008@ohm.aurel32.net> References: <1275678883-7082-1-git-send-email-rth@twiddle.net> <1275678883-7082-7-git-send-email-rth@twiddle.net> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: <1275678883-7082-7-git-send-email-rth@twiddle.net> List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Richard Henderson Cc: qemu-devel@nongnu.org, agraf@suse.de On Fri, Jun 04, 2010 at 12:14:14PM -0700, Richard Henderson wrote: > This allows the use of direct calls to the helpers, > and a direct branch back to the epilogue. > > Signed-off-by: Richard Henderson > --- > exec.c | 7 +++++++ > 1 files changed, 7 insertions(+), 0 deletions(-) > > diff --git a/exec.c b/exec.c > index bb3dcad..7bbfe60 100644 > --- a/exec.c > +++ b/exec.c > @@ -519,6 +519,13 @@ static void code_gen_alloc(unsigned long tb_size) > start = (void *) 0x01000000UL; > if (code_gen_buffer_size > 16 * 1024 * 1024) > code_gen_buffer_size = 16 * 1024 * 1024; > +#elif defined(__s390x__) > + /* Map the buffer so that we can use direct calls and branches. */ > + /* We have a +- 4GB range on the branches; leave some slop. */ > + if (code_gen_buffer_size > (3ul * 1024 * 1024 * 1024)) { > + code_gen_buffer_size = 3ul * 1024 * 1024 * 1024; > + } > + start = (void *)0x90000000UL; Is there any reason for this address? > #endif > code_gen_buffer = mmap(start, code_gen_buffer_size, > PROT_WRITE | PROT_READ | PROT_EXEC, > -- > 1.7.0.1 > > > -- Aurelien Jarno GPG: 1024D/F1BCDB73 aurelien@aurel32.net http://www.aurel32.net