From patchwork Fri Apr 16 18:59:41 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 422578 Delivered-To: patch@linaro.org Received: by 2002:a02:6a6f:0:0:0:0:0 with SMTP id m47csp656701jaf; Fri, 16 Apr 2021 12:16:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyu2douqh2lIvoFfhkqpdocMtGnfi0qG9KBIbTnmySj/bgEVriF7aPktsS+m+5VZB9+9FVO X-Received: by 2002:a92:cd8a:: with SMTP id r10mr8383701ilb.282.1618600578138; Fri, 16 Apr 2021 12:16:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618600578; cv=none; d=google.com; s=arc-20160816; b=e5YsxepBTlvO60O/TFDkXW5v5ib1RVLE7UrwtYCX4J66NWLdFMhX8FsaYk3hbUh/uI Xujbci5WyJWZrkV+alKke1MZgEZ5zMlNmP19DkNiBVyV/9ky3FBdLhZUF3GR6hZcQiCl Y0Fp2UhIzFPGGjtusfsuCt+/pcKCooTRY4tICax391M3kuG58W+B/xVRznmeCvk/Os7W CKtm5Ts8+uBE6aqVU03BG2mLvlFAq3MH+po3CfcIk8003dV6Kz+PUJ1yDm0M5Xlyt1Nc HzYsWlcMz5kTgG60Qj3NBcJFtEW+VKr3+qhayLUU/JCsb1dY6tAzwnva2p7bxUVZqy+W N5Hw== 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:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=+FqQpeZX2hPehb5y76ZqDzt7hc+HNgslVIaYOGp2C88=; b=hpWtR5wLYkWsKXxF87UdXJhJzRi8tBJkGCz0C8AAqE7MLz3nNVyLTrNIBNIQ8CkrHD VJO15PNgF3E9gOczFkGhfkGKqrWR4c81SRVgPtcq1nqoOLvFPOyDw+rK1k3XtUit/oDD zLF4Hxkhjxm9rKWbpHqYUwsMQt930lWSgJh4GjBVDTutZ4BnfrXPZO2cltlNiQgglrPw QSh0OuEbfbjAS5lTZ2fjxjxOPYJUR78a2KA9iL4VcJOOrkO+bpc7YE+fiFexKX9F3gU1 ib/1BUYPUWhGbECg2lpMFej9cG64EVmFX35oGFEWcbBZuJwv/CvsejqKl88Q5KeaMiLV F9ZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=VYMlRlb9; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 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. [209.51.188.17]) by mx.google.com with ESMTPS id h10si6420317ilo.148.2021.04.16.12.16.18 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 16 Apr 2021 12:16:18 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=VYMlRlb9; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 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]:49644 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lXTwv-00061c-I3 for patch@linaro.org; Fri, 16 Apr 2021 15:16:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50282) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lXThi-0003hW-Ar for qemu-devel@nongnu.org; Fri, 16 Apr 2021 15:00:34 -0400 Received: from mail-pf1-x431.google.com ([2607:f8b0:4864:20::431]:46758) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lXThR-0004KF-Rl for qemu-devel@nongnu.org; Fri, 16 Apr 2021 15:00:33 -0400 Received: by mail-pf1-x431.google.com with SMTP id d124so18912077pfa.13 for ; Fri, 16 Apr 2021 12:00:12 -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:in-reply-to:references :mime-version:content-transfer-encoding; bh=+FqQpeZX2hPehb5y76ZqDzt7hc+HNgslVIaYOGp2C88=; b=VYMlRlb9R+lOpaDUhAl9oTRyFpcqb9ok7Ddxa7eEr4DRVjxjskH/dA7evgvGytDWml 6D6F2WqNSjK6MDxh6jIkXdncxg3SbI+/UUCEq2Gwa85Cmm3bTQ3Il6MdVTutLrH6xQHO OU2VhmO0ef5/DWehCPF8VDkAHbhpDloKt95iSebHL4L+IHPqywdmLEV76PbM1ZRn/Sf5 YAW8e5mzmr1xaaBAFirmwMKGBM8AAOoQnxEz8pyB/ZY3o6RoYOGmS5dfg1BWsgF3PYWr ydTo49zGEsY3Xp6/XKsEGRl0vguR0eAuVzoA3Slspb6/Er9TU0AZ65nexFp+tF54frm6 ByrA== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=+FqQpeZX2hPehb5y76ZqDzt7hc+HNgslVIaYOGp2C88=; b=qNvmc/qzAyJwxSsBTWhh92laRvJfJnVwf+SHcO2+oZli5Xxne5C+UcEauhkKuBpqmz x0Mk5vxbhjzg3q2Qzu9GFAVX2KQ9u4t2AxfsI2RX2dbixRhdSRmObtyubJhMghiMN2Nv UNHq6DC6PfGUfyjcSrooHItllSxq8CQBGdG2lXJpyiXRTByIr+8V2XSM/xKTJXdLjNmy uUQlWbSqMpIZSynbxRRZGeYmdJhyZEvAz71Ab3GZrNxO5/jLvj/ac4jRFfjTGTCi4ipF jsb78jcooW7g4dmzS6hF9hZk1NxRY/Ns3zsuO+2K/xw8l+jfFwsITRc/779fsFJcyE7E Jyxw== X-Gm-Message-State: AOAM530NMAywUX54GcRauO+/cZVSHieZP7D+/Dpv0AMncknLKjwLHhxH 1Q+nnrYgG/iwT+sNwG7Mm/11qMd+5kwTOA== X-Received: by 2002:a63:f715:: with SMTP id x21mr440994pgh.399.1618599612108; Fri, 16 Apr 2021 12:00:12 -0700 (PDT) Received: from localhost.localdomain ([71.212.131.83]) by smtp.gmail.com with ESMTPSA id d7sm1988337pfv.197.2021.04.16.12.00.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Apr 2021 12:00:11 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v4 12/30] target/arm: Fix SCTLR_B test for TCGv_i64 load/store Date: Fri, 16 Apr 2021 11:59:41 -0700 Message-Id: <20210416185959.1520974-13-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210416185959.1520974-1-richard.henderson@linaro.org> References: <20210416185959.1520974-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::431; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x431.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , qemu-arm@nongnu.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Just because operating on a TCGv_i64 temporary does not mean that we're performing a 64-bit operation. Restrict the frobbing to actual 64-bit operations. This bug is not currently visible because all current users of these two functions always pass MO_64. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- target/arm/translate.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.25.1 diff --git a/target/arm/translate.c b/target/arm/translate.c index 91a19bc4f4..52b9ca502e 100644 --- a/target/arm/translate.c +++ b/target/arm/translate.c @@ -982,7 +982,7 @@ static void gen_aa32_ld_i64(DisasContext *s, TCGv_i64 val, TCGv_i32 a32, tcg_gen_qemu_ld_i64(val, addr, index, opc); /* Not needed for user-mode BE32, where we use MO_BE instead. */ - if (!IS_USER_ONLY && s->sctlr_b) { + if (!IS_USER_ONLY && s->sctlr_b && (opc & MO_SIZE) == MO_64) { tcg_gen_rotri_i64(val, val, 32); } @@ -1001,7 +1001,7 @@ static void gen_aa32_st_i64(DisasContext *s, TCGv_i64 val, TCGv_i32 a32, TCGv addr = gen_aa32_addr(s, a32, opc); /* Not needed for user-mode BE32, where we use MO_BE instead. */ - if (!IS_USER_ONLY && s->sctlr_b) { + if (!IS_USER_ONLY && s->sctlr_b && (opc & MO_SIZE) == MO_64) { TCGv_i64 tmp = tcg_temp_new_i64(); tcg_gen_rotri_i64(tmp, val, 32); tcg_gen_qemu_st_i64(tmp, addr, index, opc);