From patchwork Fri Oct 12 21:20:48 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 191223 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 D6C912C0093 for ; Sat, 13 Oct 2012 08:22:03 +1100 (EST) Received: from localhost ([::1]:52174 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TMmgE-00071o-0u for incoming@patchwork.ozlabs.org; Fri, 12 Oct 2012 17:22:02 -0400 Received: from eggs.gnu.org ([208.118.235.92]:52033) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TMmfF-0004Un-0M for qemu-devel@nongnu.org; Fri, 12 Oct 2012 17:21:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TMmfD-0002ez-Pe for qemu-devel@nongnu.org; Fri, 12 Oct 2012 17:21:00 -0400 Received: from mail-pb0-f45.google.com ([209.85.160.45]:52942) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TMmfD-0002dX-KG for qemu-devel@nongnu.org; Fri, 12 Oct 2012 17:20:59 -0400 Received: by mail-pb0-f45.google.com with SMTP id rp2so3204247pbb.4 for ; Fri, 12 Oct 2012 14:20:59 -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=UP4bm4HJVbAeMla0E+pqYM5vN4NOzkQw6K49dIZtosw=; b=zJC/gtT2MYj8gZ80BU3o7roOflrv2CvTdwSNlsPBWhQ/KXRTwcb9V/2J+e4RtgNL1A XyT6CZw1qHG0sFlg4p7uQR69peBFOl1LIgGVqCCJQixZCzcvJEcZxWWt+n9Oyirt6iGW sVSONnOtlPXl/WP4E0IIeqBpWi4Yu10qi1KhuIkhMmILDRO6a1K6iMh3VTfl9jai05Vb xxGv1/Jr2WEeeWBs3EuBCKEqvKogoWY9cgmQbX+vsA8hdUqsGF/rOfjD9xE9v1L6lDDc qPTfchAEnqvt601n3MtAnSVOf5oo/II2K5/3ecFK7OFnDIEoWLZZP6mfQ2wEIid3uGJ9 IzyQ== Received: by 10.68.221.166 with SMTP id qf6mr16965618pbc.54.1350076859210; Fri, 12 Oct 2012 14:20:59 -0700 (PDT) Received: from anchor.twiddle.home.com (50-194-63-110-static.hfc.comcastbusiness.net. [50.194.63.110]) by mx.google.com with ESMTPS id n7sm4879995pav.26.2012.10.12.14.20.58 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 12 Oct 2012 14:20:58 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Fri, 12 Oct 2012 14:20:48 -0700 Message-Id: <1350076850-7099-3-git-send-email-rth@twiddle.net> X-Mailer: git-send-email 1.7.11.7 In-Reply-To: <1350076850-7099-1-git-send-email-rth@twiddle.net> References: <1350076850-7099-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 2/4] exec: Don't make DEFAULT_CODE_GEN_BUFFER_SIZE too large 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 For ARM we cap the buffer size to 16MB. Do not allocate 32MB in that case. Signed-off-by: Richard Henderson --- exec.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/exec.c b/exec.c index db735dd..386cc08 100644 --- a/exec.c +++ b/exec.c @@ -529,7 +529,11 @@ bool memory_region_is_unassigned(MemoryRegion *mr) # define MAX_CODE_GEN_BUFFER_SIZE ((size_t)-1) #endif -#define DEFAULT_CODE_GEN_BUFFER_SIZE (32u * 1024 * 1024) +#define DEFAULT_CODE_GEN_BUFFER_SIZE_1 (32u * 1024 * 1024) + +#define DEFAULT_CODE_GEN_BUFFER_SIZE \ + (DEFAULT_CODE_GEN_BUFFER_SIZE_1 < MAX_CODE_GEN_BUFFER_SIZE \ + ? DEFAULT_CODE_GEN_BUFFER_SIZE_1 : MAX_CODE_GEN_BUFFER_SIZE) static inline size_t size_code_gen_buffer(size_t tb_size) {