From patchwork Thu Jul 5 11:32:27 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 9833 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 AEFD123E1B for ; Thu, 5 Jul 2012 11:32:31 +0000 (UTC) Received: from mail-yx0-f180.google.com (mail-yx0-f180.google.com [209.85.213.180]) by fiordland.canonical.com (Postfix) with ESMTP id 6A21BA182AF for ; Thu, 5 Jul 2012 11:32:31 +0000 (UTC) Received: by yenq6 with SMTP id q6so7836652yen.11 for ; Thu, 05 Jul 2012 04:32:30 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:from:to:cc :subject:date:message-id:x-mailer:x-gm-message-state; bh=FvFW0w3bFzKAXkT5qYOTLzWE71CGjZeXnXpFqTkLTdk=; b=k27kVonlFzb1VbLuY6EGF3slLEeqbuEpBGayIhQX0Dmr6RUf7Y2ifkeP5L5iMnJpnO es/D08FHsE8gqErfx6vU+tXWknaddZ28Sb/9Ck6Ta9MZJojW290TOVYWZ7QD/hO6GAwJ +Mgit7ln4I5qfEq70V/casHV5OE/E0YwwHispL5XotDcVDQYixGCWuhgGj/SW/85SjAW EPZZApV4DYjRcVjPwXRXR27JvUKaPmcw5LJpK9iTju90+pX2Ljxro6Shz2XGCYpsmryd dGZ2fl+Q5unttiQn2QkVnoyoxUu+kNFUstw7u5ttjaQ1qOQcc8NiSb0jg7nwMJfZQ1rE dxzQ== Received: by 10.50.163.99 with SMTP id yh3mr13607962igb.53.1341487950697; Thu, 05 Jul 2012 04:32:30 -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.231.24.148 with SMTP id v20csp64140ibb; Thu, 5 Jul 2012 04:32:29 -0700 (PDT) Received: by 10.180.94.4 with SMTP id cy4mr41332197wib.2.1341487949109; Thu, 05 Jul 2012 04:32:29 -0700 (PDT) Received: from mnementh.archaic.org.uk (mnementh.archaic.org.uk. [81.2.115.146]) by mx.google.com with ESMTPS id cs8si43436698wib.23.2012.07.05.04.32.28 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 05 Jul 2012 04:32:29 -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 1SmkIN-0005fP-2K; Thu, 05 Jul 2012 12:32:27 +0100 From: Peter Maydell To: qemu-devel@nongnu.org Cc: patches@linaro.org Subject: [PATCH] target-arm: Fix TCG temp handling in 64 bit cp writes Date: Thu, 5 Jul 2012 12:32:27 +0100 Message-Id: <1341487947-21760-1-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.2.5 X-Gm-Message-State: ALoCoQl+y0qAIqDy2evsEYjsJ/klcx2+El02UpsLt49Bl2W6+IYEFK9YjcmWuYh9AClF0jeRsa9S Fix errors in the TCG temp handling in the 64 bit coprocessor write path: we were reusing a 32 bit temp after it had been freed by store_reg(), and failing to free a 64 bit temp. This bug has no visible effect at this point because there aren't any non-NOP 64 bit registers yet; it needs to be fixed as a prerequisite for the 64 bit registers in LPAE support. Signed-off-by: Peter Maydell --- I didn't notice this with my earlier LPAE testing because (a) I wasn't testing with an --enable-debug build and (b) it only caused an actual problem when passing more than 512MB of RAM to the LPAE guest... target-arm/translate.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/target-arm/translate.c b/target-arm/translate.c index a2a0ecd..64d7cfd 100644 --- a/target-arm/translate.c +++ b/target-arm/translate.c @@ -6263,7 +6263,9 @@ static int disas_coproc_insn(CPUARMState * env, DisasContext *s, uint32_t insn) tcg_gen_trunc_i64_i32(tmp, tmp64); store_reg(s, rt, tmp); tcg_gen_shri_i64(tmp64, tmp64, 32); + tmp = tcg_temp_new_i32(); tcg_gen_trunc_i64_i32(tmp, tmp64); + tcg_temp_free_i64(tmp64); store_reg(s, rt2, tmp); } else { TCGv tmp;