From nobody Sun May 5 03:37:21 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1523320665136249.13039237410658; Mon, 9 Apr 2018 17:37:45 -0700 (PDT) Received: from localhost ([::1]:51437 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f5hHu-0002dj-K1 for importer@patchew.org; Mon, 09 Apr 2018 20:37:30 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51603) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f5hGa-0001rb-TZ for qemu-devel@nongnu.org; Mon, 09 Apr 2018 20:36:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f5hGa-0001Se-3j for qemu-devel@nongnu.org; Mon, 09 Apr 2018 20:36:08 -0400 Received: from mail-pf0-x244.google.com ([2607:f8b0:400e:c00::244]:33381) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1f5hGZ-0001Rx-Iq for qemu-devel@nongnu.org; Mon, 09 Apr 2018 20:36:07 -0400 Received: by mail-pf0-x244.google.com with SMTP id f15so6788432pfn.0 for ; Mon, 09 Apr 2018 17:36:07 -0700 (PDT) Received: from cloudburst.twiddle.net ([2001:8000:10e0:a000:c673:a6b6:fdef:1933]) by smtp.gmail.com with ESMTPSA id t25sm2641012pfj.187.2018.04.09.17.36.03 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 09 Apr 2018 17:36:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=N+7+nWgYcsOGP93QMezBChGx/w9u6Hy2+v+BgiPrEkY=; b=MM6B/R1q/9talvuzXlWrbtRSW0QSvWCEBIUsvBLxsi6MxJzWLuqQq5qcC0F4r5Blzm 8pO7LAoDzDdYnLAg5gcpTPZUN4vMyUwwvmdLLj6O8kmPafE+rPW18cWmLqbvNbj1qyt8 YTc29MCLBXMP17sPtsaLt60NzJ6VrcQEPqioY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=N+7+nWgYcsOGP93QMezBChGx/w9u6Hy2+v+BgiPrEkY=; b=ptPDdiZqW5CCPLFe/0tSc40PfRdN5aEuOkc29EaulOq+a6b/mIkWwRswbKrIVyLi1p ZxyrOnCeoeVCp87uVlOgEVD0qcEtexp0Kz27Yx1cKXkVwOG2SpDDo1xS3gFjAeGbsCU0 MN4GpcYpnlIVAqy4l79J0yXMSMlJ1s6to7g0fh+JulfuAZ9KfhsRDJ1zQEUXm1SCKUBi lq21nIc17CnalwxVMXkQr/uYF3yMTftPHJWBM3pYnJGz5FyUssNBaw95+YmACtoiHz1u F3h+lxIRtRYu7vTv1Yx3N8/HVaNVdl0vOv+UqrSyeWU9BPjS/yRGFKqtSFFwpHN2IanL SEvg== X-Gm-Message-State: AElRT7G4LB0cox13Eeam0Y+f2YTPkBU1k3DbpW0SPGxm8tMWDwG3hg4m ITdSHnX3+aP7ORT5mlsYP0uSwmhENp4= X-Google-Smtp-Source: AIpwx4/jIJqa2CBq0MlcQcune/azVLz3CSq6W6uk8/1xq2WPyGmWdOV2AbptxxpPIvJVkWM/FGBYzA== X-Received: by 10.99.114.2 with SMTP id n2mr26868486pgc.274.1523320566268; Mon, 09 Apr 2018 17:36:06 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Tue, 10 Apr 2018 10:35:58 +1000 Message-Id: <20180410003558.2470-1-richard.henderson@linaro.org> X-Mailer: git-send-email 2.14.3 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400e:c00::244 Subject: [Qemu-devel] [PATCH for-2.12] tcg: Introduce tcg_set_insn_start_param X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, qemu-arm@nongnu.org, qemu-stable@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" The parameters for tcg_gen_insn_start are target_ulong, which may be split into two TCGArg parameters for storage in the opcode on 32-bit hosts. Fixes the ARM target and its direct use of tcg_set_insn_param, which would set the wrong argument in the 64-on-32 case. Cc: qemu-stable@nongnu.org Reported-by: alarson@ddci.com Signed-off-by: Richard Henderson --- Peter, I'm not sure what the reproducer is for this reported problem. I could boot my aa64 images both before and after this patch. Perhaps I would have needed to run an aa32 binary within the aa64 kernel? r~ --- target/arm/translate.h | 2 +- tcg/tcg.h | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/target/arm/translate.h b/target/arm/translate.h index c47febf99d..4428c98e2e 100644 --- a/target/arm/translate.h +++ b/target/arm/translate.h @@ -120,7 +120,7 @@ static inline void disas_set_insn_syndrome(DisasContext= *s, uint32_t syn) =20 /* We check and clear insn_start_idx to catch multiple updates. */ assert(s->insn_start !=3D NULL); - tcg_set_insn_param(s->insn_start, 2, syn); + tcg_set_insn_start_param(s->insn_start, 2, syn); s->insn_start =3D NULL; } =20 diff --git a/tcg/tcg.h b/tcg/tcg.h index 9e2d909a4a..30896ca304 100644 --- a/tcg/tcg.h +++ b/tcg/tcg.h @@ -825,6 +825,16 @@ static inline void tcg_set_insn_param(TCGOp *op, int a= rg, TCGArg v) op->args[arg] =3D v; } =20 +static inline void tcg_set_insn_start_param(TCGOp *op, int arg, target_ulo= ng v) +{ +#if TARGET_LONG_BITS <=3D TCG_TARGET_REG_BITS + tcg_set_insn_param(op, arg, v); +#else + tcg_set_insn_param(op, arg * 2, v); + tcg_set_insn_param(op, arg * 2 + 1, v >> 32); +#endif +} + /* The last op that was emitted. */ static inline TCGOp *tcg_last_op(void) { --=20 2.14.3