From patchwork Tue Apr 10 00:35:58 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 133052 Delivered-To: patch@linaro.org Received: by 10.46.84.29 with SMTP id i29csp764680ljb; Mon, 9 Apr 2018 17:38:01 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/P3+bSyip83KdrWpxXE3fDD+W3/x4jYoGKvYX/leckgsXt5XqUuo5Zu9jMd8RoVqSyLME8 X-Received: by 10.55.170.67 with SMTP id t64mr49694091qke.54.1523320680899; Mon, 09 Apr 2018 17:38:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523320680; cv=none; d=google.com; s=arc-20160816; b=O1zXrQEl4AfhCi++Mfof7sC4GkJbDdJ+vpRfVM6o6g7bNwKap9y9Q8ARTXN760LQDa 6zhtFrjRL1eEGtfUcNtjavfxyMk2KL5mZol9PHr/BXXy4Df9CwWwl66C4Srfrtql54AN WqnlP1kL1kjq8Vpf7GtyqN9x1/CbWdbGy4cD9en4he07m7k0/CPJA2Xs6JA+OA2bKV2p jGjBryo5Cj42zvnGiGZxS4hZoI0nWdF8gr7UvbNHyiTQKbZmyFVFdmxUGIYprm7y6rVD yPDQY2ldQKiNIpmYw36nRFfi27YaX5d2dIeHANaYN1vGB7Zypdrxol7R9IkCW0GrHI5n LurA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:message-id:date:to:from :dkim-signature:arc-authentication-results; bh=N+7+nWgYcsOGP93QMezBChGx/w9u6Hy2+v+BgiPrEkY=; b=YIUnNuOpRYNMKZRvRcbUp+/EDVGA/hvBI2jzJDqGDuxSMe+5UZi2ApmFVp8x0TEkSy YcZ8Rtwjt0nbJtPMJ4OcY4kgOvIhalzPn1Un0ltB5hXHaeBqoQtVZLrPYPgZclsHoD4b jzuoJt5juYgMOiSCMUkLb1kFUBi7c3TVfUasrjt1QLGaCsGM0RCjQ3OtPwz6/x2+ll7j 9rR16h9iaeVAcxxDZlfjC9i8LGIPR+LW174cAfAblfwpIZDI00Dq4KGmVosKzX8JRB46 5knICdev2xnD42lE9v2PiXPAU4YiuKsQTZb26ASPpKoiZ1yyfhgVs5XpBp9RSTq3dsU0 6hew== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=MM6B/R1q; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id c4si1750862qth.337.2018.04.09.17.38.00 for (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 09 Apr 2018 17:38:00 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=MM6B/R1q; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:51437 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f5hIO-0002dj-CS for patch@linaro.org; Mon, 09 Apr 2018 20:38:00 -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) 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-Received: by 10.99.114.2 with SMTP id n2mr26868486pgc.274.1523320566268; Mon, 09 Apr 2018 17:36:06 -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) 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+patch=linaro.org@nongnu.org Sender: "Qemu-devel" 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(-) -- 2.14.3 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) /* We check and clear insn_start_idx to catch multiple updates. */ assert(s->insn_start != NULL); - tcg_set_insn_param(s->insn_start, 2, syn); + tcg_set_insn_start_param(s->insn_start, 2, syn); s->insn_start = NULL; } 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 arg, TCGArg v) op->args[arg] = v; } +static inline void tcg_set_insn_start_param(TCGOp *op, int arg, target_ulong v) +{ +#if TARGET_LONG_BITS <= 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) {