From patchwork Wed Jun 22 14:16:32 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 2166 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 133BC23F18 for ; Wed, 22 Jun 2011 14:16:38 +0000 (UTC) Received: from mail-vx0-f180.google.com (mail-vx0-f180.google.com [209.85.220.180]) by fiordland.canonical.com (Postfix) with ESMTP id A1CE9A182E9 for ; Wed, 22 Jun 2011 14:16:37 +0000 (UTC) Received: by vxd7 with SMTP id 7so916054vxd.11 for ; Wed, 22 Jun 2011 07:16:37 -0700 (PDT) Received: by 10.52.175.197 with SMTP id cc5mr1001189vdc.287.1308752197085; Wed, 22 Jun 2011 07:16:37 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.52.183.130 with SMTP id em2cs139238vdc; Wed, 22 Jun 2011 07:16:36 -0700 (PDT) Received: by 10.227.164.129 with SMTP id e1mr809898wby.67.1308752195687; Wed, 22 Jun 2011 07:16:35 -0700 (PDT) Received: from mnementh.archaic.org.uk (mnementh.archaic.org.uk [81.2.115.146]) by mx.google.com with ESMTPS id n11si1506681wbh.138.2011.06.22.07.16.34 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 22 Jun 2011 07:16:34 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of pm215@archaic.org.uk designates 81.2.115.146 as permitted sender) client-ip=81.2.115.146; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of pm215@archaic.org.uk designates 81.2.115.146 as permitted sender) smtp.mail=pm215@archaic.org.uk Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.72) (envelope-from ) id 1QZOEK-0004eK-CA; Wed, 22 Jun 2011 15:16:32 +0100 From: Peter Maydell To: qemu-devel@nongnu.org Cc: patches@linaro.org Subject: [PATCH] exec-all.h: Make MAX_OP_PER_INSTR large enough for target-arm's uses Date: Wed, 22 Jun 2011 15:16:32 +0100 Message-Id: <1308752192-17849-1-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.2.5 The target-arm frontend's worst-case TCG ops per instr is 194 (and in general many of the "load multiple registers" ARM instructions generate more than 100 TCG ops). Raise MAX_OP_PER_INSTR accordingly to avoid possible buffer overruns. Since it doesn't make any sense for the "64 bit guest on 32 bit host" case to have a smaller limit than the normal case, we collapse the two cases back into each other again. (This increase costs us about 14K in extra static buffer space and 21K of extra margin at the end of a 32MB codegen buffer.) Signed-off-by: Peter Maydell --- You might recall the patchset which moves the Neon load/store multiple instructions to helper functions, and which turns out to slow them down rather a lot. This is the other approach, which is just to raise the limit so that the existing implementations don't risk buffer overruns. The extra memory costs are tiny IMHO. (The Neon instructions are the worst offenders but the VFP load/store multiple insns also breach the previous limit. I think we should consider an implementation of an instruction that's been basically the same since VFP support was added to QEMU in 2005 to be an acceptable one, and make sure our buffer sizes cope with it :-)) exec-all.h | 6 +----- 1 files changed, 1 insertions(+), 5 deletions(-) diff --git a/exec-all.h b/exec-all.h index 2a13a95..ef5f5b6 100644 --- a/exec-all.h +++ b/exec-all.h @@ -43,11 +43,7 @@ typedef ram_addr_t tb_page_addr_t; typedef struct TranslationBlock TranslationBlock; /* XXX: make safe guess about sizes */ -#if (HOST_LONG_BITS == 32) && (TARGET_LONG_BITS == 64) -#define MAX_OP_PER_INSTR 128 -#else -#define MAX_OP_PER_INSTR 96 -#endif +#define MAX_OP_PER_INSTR 208 #if HOST_LONG_BITS == 32 #define MAX_OPC_PARAM_PER_ARG 2