From patchwork Mon Jan 11 19:00:57 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 360532 Delivered-To: patch@linaro.org Received: by 2002:a02:85a7:0:0:0:0:0 with SMTP id d36csp3137143jai; Mon, 11 Jan 2021 11:16:24 -0800 (PST) X-Google-Smtp-Source: ABdhPJyJxn5UkBnbV4eQIOsaJJ2BFwEHtRJKBGH7+OhF1IA9pe4/ahdJUcAIXwNH0qOFBvAcxhZp X-Received: by 2002:a25:bccf:: with SMTP id l15mr1844834ybm.272.1610392584293; Mon, 11 Jan 2021 11:16:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610392584; cv=none; d=google.com; s=arc-20160816; b=x5Ji8UNGtvSSZt37cIuJv/vRKJIdmgZTTouotNIoL8r2nOMHAWkVPUVX4Ot1kZqCFl 8zpqW7qGs1H4u8BOvAp8c8KXRaXJpwS/g7rRC0YqCxXwuotjG6setlxPozx3U7xuZ5ny V5V+qzzmzKgKEmR5AQVTSzCIRkuY1OGCV9Cv1riPY/U2szdK1wmfxa+9LUguG74rBVIb FQ1pNmkcnQj9DAiSTfo5/T2KN1KgAeUr2J4a9bvZuQkbL2tpOavReUsfDupI7K0E2dFK S037iv+iV8/dR9D8qlQ382cz2pjceuhCbQl7lPRLU/SWiiF2O8G0YWgeODRwne3loxKx UAXg== 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=GncTsfZkzDCi87UalR7JxGVcBAUvdECHyv5Jv99YvLY=; b=BhnvnaB7sRXT6CC4Vh/GrQbITpikoD18UnA8kByyV9PeP7S7oeBaX00x++8dTCzfNY 4yED678pPyhrUN7d9GvZQhlVG0gOgT1soweadGUr3AWiLXjk1zo0Q9B49SOfSHKIJauG h1YGfgMwWA60ivYqMlR2elKbPGDYiSY4yX0Vsoja8N8ENPqNHLx3hHb9SlTCNHC0mq6v ocz6Q/RHECOLh9i2OhGemeYFBWyKASZpe0SKId+9rcWQNTRAijVAvFZMK/FqPGCXZlrm IKGnYUA8XWm6rIPtyyn7saCubMpfq0BWPi0Sq/AdvCjzm/RnyfyhAozpFsisBaaXpsY1 oClA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="R5g+/ABQ"; 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 r144si736011ybc.16.2021.01.11.11.16.24 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 11 Jan 2021 11:16:24 -0800 (PST) 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="R5g+/ABQ"; 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]:49846 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kz2fv-00029t-Mx for patch@linaro.org; Mon, 11 Jan 2021 14:16:23 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:47378) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kz2Rx-0006AA-GC for qemu-devel@nongnu.org; Mon, 11 Jan 2021 14:01:57 -0500 Received: from mail-pj1-x1031.google.com ([2607:f8b0:4864:20::1031]:40446) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kz2Rj-0006SL-I9 for qemu-devel@nongnu.org; Mon, 11 Jan 2021 14:01:57 -0500 Received: by mail-pj1-x1031.google.com with SMTP id m5so95596pjv.5 for ; Mon, 11 Jan 2021 11:01:42 -0800 (PST) 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=GncTsfZkzDCi87UalR7JxGVcBAUvdECHyv5Jv99YvLY=; b=R5g+/ABQnTHfK++A9I+6jU7i7jfYIre2xc9V7BStNJh+WEYSjjKhp03MDvP79sZNch rqu/2NfadFqXwWkIC58dGrlzbDhsFjnPSDtd80V8TPfkJncxRp17HXHOuYw7zOmSUY58 QMXNiDnMIXZrKjpf+gdpXryvmGcDE0WU51DBZRyVKunN/0MQ9WyfCFhodwzoJtoPnFM9 S0CjFcFXZE0JmZINlIixG4EjZ5G+yZnNKniU1m1SdzTpWoePaoLI4K16XSk8bIIUi1Er fzhXoFpuh4TCyDaxJFhzlb97ye6Bw4/lfgLB5lpNVYmwxl/X99keHXIohG5hIuBGm73G /WjQ== 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=GncTsfZkzDCi87UalR7JxGVcBAUvdECHyv5Jv99YvLY=; b=qCaCAO576Xl0zbTmu/CfkYDgSpf8cM5tcqljgnOZOWEhsVSrAFdIJbxOdMj4u0F6c5 r7hmBh2Xg5iuYYrVkNWeY5R8omOVjuSpQTsuUsxg3bCVxnFv4joEFrpGUvoc6bb4ohJl HdypLzJFgR2emdSzHjvZGOlpMH+ffoPsctDMJRIy05rYOvMwbA0DXeJpMiz6aR25OE0v +/j4MkUZSchxve0JWfJrQqazQEeKJcrlCr9MxULjEXDc8LHVzYOoX5QoDWf1GZ4KpZdR 9s0mbcNOg13xMxL6O+41OgIrTLsewGMWiFUt7CWf3ks7WA2VqnjJZmDunY5bDch7aLRi +Lnw== X-Gm-Message-State: AOAM530mX+sZK9/FaQjrxTAPLGDXq/GJQjMp+n7EAY8aoeNzU6IfwM6w GE1p4rr6iwpn14qUqgmpPrg8x7W0FAzB5Q== X-Received: by 2002:a17:902:bf4a:b029:da:d0b8:6489 with SMTP id u10-20020a170902bf4ab02900dad0b86489mr720542pls.58.1610391700948; Mon, 11 Jan 2021 11:01:40 -0800 (PST) Received: from localhost.localdomain (rrcs-173-197-107-21.west.biz.rr.com. [173.197.107.21]) by smtp.gmail.com with ESMTPSA id n195sm350395pfd.169.2021.01.11.11.01.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Jan 2021 11:01:40 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v3 14/30] target/arm: Enforce word alignment for LDRD/STRD Date: Mon, 11 Jan 2021 09:00:57 -1000 Message-Id: <20210111190113.303726-15-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210111190113.303726-1-richard.henderson@linaro.org> References: <20210111190113.303726-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1031; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1031.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=unavailable 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@linaro.org, qemu-arm@nongnu.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Buglink: https://bugs.launchpad.net/qemu/+bug/1905356 Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- target/arm/translate.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) -- 2.25.1 diff --git a/target/arm/translate.c b/target/arm/translate.c index f75987dac4..9cc6a9f83d 100644 --- a/target/arm/translate.c +++ b/target/arm/translate.c @@ -6475,13 +6475,13 @@ static bool trans_LDRD_rr(DisasContext *s, arg_ldst_rr *a) addr = op_addr_rr_pre(s, a); tmp = tcg_temp_new_i32(); - gen_aa32_ld_i32(s, tmp, addr, mem_idx, MO_UL); + gen_aa32_ld_i32(s, tmp, addr, mem_idx, MO_UL | MO_ALIGN); store_reg(s, a->rt, tmp); tcg_gen_addi_i32(addr, addr, 4); tmp = tcg_temp_new_i32(); - gen_aa32_ld_i32(s, tmp, addr, mem_idx, MO_UL); + gen_aa32_ld_i32(s, tmp, addr, mem_idx, MO_UL | MO_ALIGN); store_reg(s, a->rt + 1, tmp); /* LDRD w/ base writeback is undefined if the registers overlap. */ @@ -6504,13 +6504,13 @@ static bool trans_STRD_rr(DisasContext *s, arg_ldst_rr *a) addr = op_addr_rr_pre(s, a); tmp = load_reg(s, a->rt); - gen_aa32_st_i32(s, tmp, addr, mem_idx, MO_UL); + gen_aa32_st_i32(s, tmp, addr, mem_idx, MO_UL | MO_ALIGN); tcg_temp_free_i32(tmp); tcg_gen_addi_i32(addr, addr, 4); tmp = load_reg(s, a->rt + 1); - gen_aa32_st_i32(s, tmp, addr, mem_idx, MO_UL); + gen_aa32_st_i32(s, tmp, addr, mem_idx, MO_UL | MO_ALIGN); tcg_temp_free_i32(tmp); op_addr_rr_post(s, a, addr, -4); @@ -6612,13 +6612,13 @@ static bool op_ldrd_ri(DisasContext *s, arg_ldst_ri *a, int rt2) addr = op_addr_ri_pre(s, a); tmp = tcg_temp_new_i32(); - gen_aa32_ld_i32(s, tmp, addr, mem_idx, MO_UL); + gen_aa32_ld_i32(s, tmp, addr, mem_idx, MO_UL | MO_ALIGN); store_reg(s, a->rt, tmp); tcg_gen_addi_i32(addr, addr, 4); tmp = tcg_temp_new_i32(); - gen_aa32_ld_i32(s, tmp, addr, mem_idx, MO_UL); + gen_aa32_ld_i32(s, tmp, addr, mem_idx, MO_UL | MO_ALIGN); store_reg(s, rt2, tmp); /* LDRD w/ base writeback is undefined if the registers overlap. */ @@ -6651,13 +6651,13 @@ static bool op_strd_ri(DisasContext *s, arg_ldst_ri *a, int rt2) addr = op_addr_ri_pre(s, a); tmp = load_reg(s, a->rt); - gen_aa32_st_i32(s, tmp, addr, mem_idx, MO_UL); + gen_aa32_st_i32(s, tmp, addr, mem_idx, MO_UL | MO_ALIGN); tcg_temp_free_i32(tmp); tcg_gen_addi_i32(addr, addr, 4); tmp = load_reg(s, rt2); - gen_aa32_st_i32(s, tmp, addr, mem_idx, MO_UL); + gen_aa32_st_i32(s, tmp, addr, mem_idx, MO_UL | MO_ALIGN); tcg_temp_free_i32(tmp); op_addr_ri_post(s, a, addr, -4);