From patchwork Fri Apr 16 18:59:43 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 422584 Delivered-To: patch@linaro.org Received: by 2002:a02:6a6f:0:0:0:0:0 with SMTP id m47csp659391jaf; Fri, 16 Apr 2021 12:20:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxruetZZEjymreX1ObkUFcs98z12bncDzXk1HAkqVcBLmVTwFKyEX0MP4Hx2qp6aNddRYW1 X-Received: by 2002:a92:5204:: with SMTP id g4mr8361049ilb.84.1618600840782; Fri, 16 Apr 2021 12:20:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618600840; cv=none; d=google.com; s=arc-20160816; b=BG4EGuLjUxAQB/rmNAr9RdpwhOfHss9KL+lKY7wrsnqakdOX8Ajpiums/PdyVp9HIm wKvsSWXS0l/w0VQQhcZcl4I5sKtSuYxnxkdYErf/SrwdIEgnBegbzWHQkktPmK6AVbya +f8CxIMNq27mWz3vRak0xlYhaq4JOcqDrUdaQmC4p6HK3D3yMw0tVoc/TTziXT3oYuxr Iki7ZIE2dUyHgbJ9HVWG2p7lVA3rtlP2OwNhMQ9djfBkLxLMMXAAnAYcfrkNtcfREDcg zGpApKYTwbmdTYUePETaGowmWqiUGWOtLC81LrJi1dNh0d/bONfQxhYcotP3xZsViUYa O2yQ== 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=DHk5nVHWEzvUPbJqkpxdTXVHC+WlIvNKPTV6ov5dVNQ=; b=aVcFTmDCtcyDhqpNUs5UUp8387bNvjbZgUov7qotE8SSUHxrfPaelryxjpE8QsfScR LDjYauBhtHvbJ6Y3TMloju6eHRr4xjheWUPPOU7N5GnE3y7miCJlJte/gWwUdJKhmhjb mGxFj60W3kqF0U3EW7+2qst+IY+VLVn9DFwy7hf3qyQHTS+cJcvVeExa0i09KW7gsY6I OPqoeJfV1dJ+KAKg2E9dq1J6wy1cCfjjufvPEm5o9Ll8+Xj2tY/yIqkIFkwu4Bo+xHf8 w0JjfQXddjHJdyEsp1/emkAr3u/yYIiUCys+B8De1/snSP+9H5xm7xKDOIJkHJGSpClS GbLw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=tVFp49xi; 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 q3si5008574ios.60.2021.04.16.12.20.40 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 16 Apr 2021 12:20:40 -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=tVFp49xi; 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]:40268 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lXU1A-0005X6-6l for patch@linaro.org; Fri, 16 Apr 2021 15:20:40 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50384) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lXThm-0003qY-6R for qemu-devel@nongnu.org; Fri, 16 Apr 2021 15:00:38 -0400 Received: from mail-pg1-x533.google.com ([2607:f8b0:4864:20::533]:38806) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lXThS-0004LI-PE for qemu-devel@nongnu.org; Fri, 16 Apr 2021 15:00:37 -0400 Received: by mail-pg1-x533.google.com with SMTP id w10so19823024pgh.5 for ; Fri, 16 Apr 2021 12:00:15 -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=DHk5nVHWEzvUPbJqkpxdTXVHC+WlIvNKPTV6ov5dVNQ=; b=tVFp49xi/mYyOMV0Pgrbax8MhuVM3A8UD6UCyYg07pTfJmNGXHUmJp7K6j5P41x5NK 18vL3YVnVj3M7/HEA8ZWcLMYXBVQrxA8tNhMwIjfboX9hZQcmwPxYzR3uzobjAuU8y97 Bl2MvIZiyPV53SCMB1ojjCrKrkXirQcuo0/UHHd68Kuox6fPJO9L+blkRbzohjO9cKur ZA99/WDcrViuxWt4oFI/lE2CWPfhUU1veuAvFEu3MH6CaScxu+38X0rjY10yvaz5WLhT agCBjVY9ESfxPbBtFf9X3hvin6rcGBtrzhvGfeX5nL3w1afqe6S4I+2MmUYRo35yuzj7 5ldg== 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=DHk5nVHWEzvUPbJqkpxdTXVHC+WlIvNKPTV6ov5dVNQ=; b=sTExbzrbrWGwNVKVB8sKgj1lMfEpQTNs0gRMhCwfzIjwmio1fHMoE8ACh8Xm901siJ 9/tQ076M0qMMo7Db/m5jX7+Oq2d/M8NQ6kKzxCoh0TIF4TfusCoTbbvp9PhzPHIVB+AY XPM6n/sWOV8sQVDQ8Ln1pmVNAOuudUmtEzcJ4uVehPTbSctGzuYY1bwmj+15ZeTAdcIV KWLhkLC7y1FbI8XYiQtc+n0cBuv1CVVd8NIn5NSXaY7plkHTDBrLt6xpby/0bOFiDvsE Mi2YFE0f2hZ1vhIG/lqYkFPQAquHJuFQQVrdSHWKUMM0MM48MoFLi+SlSfffQfh9buE2 ADmg== X-Gm-Message-State: AOAM531+tOOOrrxHPAmA7KmF1xYP26sKAOi+3s0PvvNVo0M86gTpy/Wn 7Qm5Awsu4zHMaaBVX/v+QOH3NgWHPswqxA== X-Received: by 2002:a63:1a48:: with SMTP id a8mr469017pgm.81.1618599614010; Fri, 16 Apr 2021 12:00:14 -0700 (PDT) Received: from localhost.localdomain ([71.212.131.83]) by smtp.gmail.com with ESMTPSA id d7sm1988337pfv.197.2021.04.16.12.00.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Apr 2021 12:00:13 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v4 14/30] target/arm: Enforce word alignment for LDRD/STRD Date: Fri, 16 Apr 2021 11:59:43 -0700 Message-Id: <20210416185959.1520974-15-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::533; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x533.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 , 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 7472e98f09..63c665fb4e 100644 --- a/target/arm/translate.c +++ b/target/arm/translate.c @@ -6512,13 +6512,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. */ @@ -6541,13 +6541,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); @@ -6649,13 +6649,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. */ @@ -6688,13 +6688,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);