From patchwork Thu Mar 12 19:42:11 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 184528 Delivered-To: patch@linaro.org Received: by 2002:a92:1f12:0:0:0:0:0 with SMTP id i18csp961836ile; Thu, 12 Mar 2020 12:54:59 -0700 (PDT) X-Google-Smtp-Source: ADFU+vvJasnDa3cvlmtsGx0TCvAHxOiadGcyEDgs+Txis30JZyJRzQK1RnRZlU1XiLrCcnpV0vPn X-Received: by 2002:a37:6e42:: with SMTP id j63mr9461611qkc.400.1584042899354; Thu, 12 Mar 2020 12:54:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584042899; cv=none; d=google.com; s=arc-20160816; b=o931jMRVVzqXJnziG7earACTMJvpxAWaDwdjkW4n7khGCnX+3is8iN3kkp19jNGMhy ZNzXZmEZx1d/xBpRTFOBuF7GwJY70JFTiXg9vkKzD+tnCgyM//fy++BRTHndcNCGjU5k 7ZY6uJmoxpWTouam01a18WE86gGvveJZKr5zTQpskpKofg/k0aIOAOxxn7YzaN/RjOx1 gOiGdfoIjxhN2VNgs1GZiPgtE2u7R33XdVUApKiaWmah/FBEN1tq5BjsgfNU/AcpzOWQ 9wjQHHtKw5655ejOzvrijnIyGYJQEcpk37MQWoRryNL73dohMKUoWM0o0wvc5+XuWIKf z4kQ== 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=6fjfG7LN06yH+pNuquMUhvUVJ8pyrVs4uGZznYaGBxE=; b=di0Qd38B1shSpysf+cfPbCBe6NQqp9Hi45RreE+WaA+xmuuUsVWtNYsF4Qd79N/gKx S9fK3vZQLZjMBNsGPAHS64OnhPj88cUU/DJIx9pL9i19f6NMoHhfg+XYkNylqov5lTE9 KOry7BatiP+h8uFCJv224dEFXhk4Gg1oYrebjKRgTE64MVOk92EIon64ZljYU32Z1Bf2 /mG4soo6dv5Tujy6CuLb/r1N/8ZqMtqM3fAL5g4MRGPhr+iJzF4PLDqTGFJQbqSa4nh6 dqorg95k/pVPiPIgQ9ipkn7LvApvpGzi1nE1xB6NlZ1Mg9s5BVUZCEEzN8CzMpi+DExq KaRQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=w7WAjdqm; 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=pass (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 n2si2560276qtl.131.2020.03.12.12.54.59 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 12 Mar 2020 12:54:59 -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=pass header.i=@linaro.org header.s=google header.b=w7WAjdqm; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:49590 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jCTv0-0000In-QO for patch@linaro.org; Thu, 12 Mar 2020 15:54:58 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45874) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jCTjZ-0006VR-Dn for qemu-devel@nongnu.org; Thu, 12 Mar 2020 15:43:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jCTjY-0002Lb-7g for qemu-devel@nongnu.org; Thu, 12 Mar 2020 15:43:09 -0400 Received: from mail-pg1-x543.google.com ([2607:f8b0:4864:20::543]:45930) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jCTjY-0002L1-1e for qemu-devel@nongnu.org; Thu, 12 Mar 2020 15:43:08 -0400 Received: by mail-pg1-x543.google.com with SMTP id m15so3556049pgv.12 for ; Thu, 12 Mar 2020 12:43: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:in-reply-to:references :mime-version:content-transfer-encoding; bh=6fjfG7LN06yH+pNuquMUhvUVJ8pyrVs4uGZznYaGBxE=; b=w7WAjdqm2IUPa54aUDMzrWvOUWnadKKNZ8zE/Wu55e9dow8az+53kEZml1xoogi3aK wdIA9mkwxqtHeN891u8Ilqqk2zevxXmKyXYLCTS3jfbPuR73/qcs4D8umBD7IR3jF47t tvIoKNiXsK7SWqpAS7RStxJLcYJD8gzCzPZJTd/Mjct9Nchz3FPtjzpquOzwqUNCGnrG MHjNE52OjeBKr8LVG3O+VapEURoY99G3PeKTsRtii1qDtEuBrmTJq3UAE9//7HNXNxv9 PG87InYvMWZreqbISqdex9pTokXRnorqDcbP7UEzukpsgQhX558jUb4C8pmWVMpdFlqj 1i+Q== 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=6fjfG7LN06yH+pNuquMUhvUVJ8pyrVs4uGZznYaGBxE=; b=GEQnCN+2QNjT7CWbcaSaOLInvAVBgIvE01CjWN0d4SEoiIxfEPEzbA7y+AkUv4zE9j f/e2KbqDSoc2addNigKe3v50YldpehZNBoqtCQUNRpWQYnGVX1wOn/Jh3GLtpmilwQ7N pw/lk02EvMha2CEtzKlK/C3IWdNkJbCOSOOyWmscshtKJM7N9XTrErKb5wCdWrEP7yKP lmr81J66VGoqMtd/z2mBXVBKMdDH3iDyHv1GJQIbtcopJ1iM+ZPy5kQGLMBcrK5FCewi MA2HQ9k+CQa94NoNaH42MTbzp6S2c+xz5K4VTsR65QrjolU2rAMXPgBoqq1TwwotO5K7 KUsA== X-Gm-Message-State: ANhLgQ0R5ArrPl8Vt8nnKSUDDSAydz+7+eQhEIY/Y7ES6q8IXfyAi0/a b1srW4OFIRsvUJXciiPtYA4gEKLJeOk= X-Received: by 2002:a62:7c82:: with SMTP id x124mr1497509pfc.280.1584042186745; Thu, 12 Mar 2020 12:43:06 -0700 (PDT) Received: from localhost.localdomain (97-126-123-70.tukw.qwest.net. [97.126.123.70]) by smtp.gmail.com with ESMTPSA id g69sm6824842pje.34.2020.03.12.12.43.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Mar 2020 12:43:06 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v6 34/42] target/arm: Handle TBI for sve scalar + int memory ops Date: Thu, 12 Mar 2020 12:42:11 -0700 Message-Id: <20200312194219.24406-35-richard.henderson@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200312194219.24406-1-richard.henderson@linaro.org> References: <20200312194219.24406-1-richard.henderson@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::543 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, alex.bennee@linaro.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" We still need to handle tbi for user-only when mte is inactive. Signed-off-by: Richard Henderson --- target/arm/translate-a64.h | 1 + target/arm/translate-a64.c | 2 +- target/arm/translate-sve.c | 6 ++++-- 3 files changed, 6 insertions(+), 3 deletions(-) -- 2.20.1 diff --git a/target/arm/translate-a64.h b/target/arm/translate-a64.h index 452b4764d0..65c0280498 100644 --- a/target/arm/translate-a64.h +++ b/target/arm/translate-a64.h @@ -40,6 +40,7 @@ TCGv_ptr get_fpstatus_ptr(bool); bool logic_imm_decode_wmask(uint64_t *result, unsigned int immn, unsigned int imms, unsigned int immr); bool sve_access_check(DisasContext *s); +TCGv_i64 clean_data_tbi(DisasContext *s, TCGv_i64 addr); TCGv_i64 gen_mte_check1(DisasContext *s, TCGv_i64 addr, bool is_write, bool tag_checked, int log2_size); TCGv_i64 gen_mte_checkN(DisasContext *s, TCGv_i64 addr, bool is_write, diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c index d86c13a32d..1314b200e0 100644 --- a/target/arm/translate-a64.c +++ b/target/arm/translate-a64.c @@ -232,7 +232,7 @@ static void gen_a64_set_pc(DisasContext *s, TCGv_i64 src) * of the write-back address. */ -static TCGv_i64 clean_data_tbi(DisasContext *s, TCGv_i64 addr) +TCGv_i64 clean_data_tbi(DisasContext *s, TCGv_i64 addr) { TCGv_i64 clean = new_tmp_a64(s); #ifdef CONFIG_USER_ONLY diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c index 5b399bb005..ce67b79b02 100644 --- a/target/arm/translate-sve.c +++ b/target/arm/translate-sve.c @@ -4554,9 +4554,8 @@ static void do_mem_zpa(DisasContext *s, int zt, int pg, TCGv_i64 addr, * For e.g. LD4, there are not enough arguments to pass all 4 * registers as pointers, so encode the regno into the data field. * For consistency, do this even for LD1. - * TODO: mte_n check here while callers are updated. */ - if (mte_n && s->mte_active[0]) { + if (s->mte_active[0]) { int msz = dtype_msz(dtype); desc = FIELD_DP32(desc, MTEDESC, MIDX, get_mem_index(s)); @@ -4566,7 +4565,10 @@ static void do_mem_zpa(DisasContext *s, int zt, int pg, TCGv_i64 addr, desc = FIELD_DP32(desc, MTEDESC, ESIZE, 1 << msz); desc = FIELD_DP32(desc, MTEDESC, TSIZE, mte_n << msz); desc <<= SVE_MTEDESC_SHIFT; + } else { + addr = clean_data_tbi(s, addr); } + desc = simd_desc(vsz, vsz, zt | desc); t_desc = tcg_const_i32(desc); t_pg = tcg_temp_new_ptr();