From patchwork Fri Jun 26 03:31:34 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 191799 Delivered-To: patch@linaro.org Received: by 2002:a92:d244:0:0:0:0:0 with SMTP id v4csp114654ilg; Thu, 25 Jun 2020 20:57:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx7UDHI8aAql970fxMl0mqdOp7vf8FZVuBg9dEZftdZy0ENx7jhVlnuD1rqpBN5aUEkcwsu X-Received: by 2002:a25:cd83:: with SMTP id d125mr1775789ybf.38.1593143872851; Thu, 25 Jun 2020 20:57:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593143872; cv=none; d=google.com; s=arc-20160816; b=Mhv3aBMEAW8CXVzEbBX4cFil9PqkEaVq1MJOuBa2QHFi+NJmeJqIseAoG2KP8+/u/w dl+RgOJazFu4SVxkdxI5ZD/bJ3F2vA1YnaErQnHdY/I525FxSbSjWmOpYBR45z+IxX6Q CDPEHQ0RFWHljvdjnOdt/RwxSv9JcLiVZDRd9FGjrjxUwRZ6U38oeHsOCMjps++XdC55 8rBgl1+zg350qs3sq5iUXsccIUNRTtgcn6Nv3G9vK76eAnktpMaaZiXGaEfDqgzbUqZi OgDDyVXPc7ugArrpnID58FpQSQu4Je2ZHHATkF1gIyifTtuRI4I0b6lVjWbPU4yCluHv KWGg== 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=73dckcvlkTiMvsVB7ETeQRaRlxizQr/3gWMqHjU/tSo=; b=IeA9mk8vb0JnyCE219C5eYwt1eoUjrSs8QF4ta3ZGKggBEhB7RQzl789tG0q2GM9Aq UNg/UW3cfI0UkbZl228raey58VdEKfIjCH/k70NeRXWTLxdsKpW837aGsfgkV2YfDxyc wasI0BZBBA7tzbWGxayeAc82BD6LctSENkt7ub5ImDrPeBua/kUZuGx2VCN9HZqX3B5i XZ90FN8bG55YjErMzmJ2gG2JOPnPWIJ3tFZ5Feq103U8oyGwkFwck6Fv8yehIIyNYS9B 7QY74ADdS6YH7NuNC58f4HvY4ByC2JMI6KmOv6uKocqfK4v2d+JLHSVjsFEimboorMKD 5ZSg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=W8Qbi1wL; 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 s2si22066196ybe.216.2020.06.25.20.57.52 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 25 Jun 2020 20:57:52 -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=W8Qbi1wL; 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]:49694 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jofUu-0002cv-Cm for patch@linaro.org; Thu, 25 Jun 2020 23:57:52 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42782) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jof6U-00014l-CQ for qemu-devel@nongnu.org; Thu, 25 Jun 2020 23:32:38 -0400 Received: from mail-pf1-x442.google.com ([2607:f8b0:4864:20::442]:35496) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jof6S-00024J-OK for qemu-devel@nongnu.org; Thu, 25 Jun 2020 23:32:38 -0400 Received: by mail-pf1-x442.google.com with SMTP id h185so4065826pfg.2 for ; Thu, 25 Jun 2020 20:32:36 -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=73dckcvlkTiMvsVB7ETeQRaRlxizQr/3gWMqHjU/tSo=; b=W8Qbi1wLW52QmqrXSHjYeU1TMlq5oXRauaNOtuTZIeOkuhO6/Ge0hMowIOeQDC/mAO SSXW9OKf0KPJIat3Pa7uC0nQRt9lBTQBGSOFM/wNOLZYpWZECLgp0H0EKpCp9w+p5TZe N0+exm6aeLNYnsMss0/VF58f6NUU353fvdnx0Mg2iTTNuwmPf9hysBOQCHN/8GmRU3Ui fj9IU02MXpW2XFNzrrtq7qGdXLroCt104CKfgUyLvWAW+Ggi/Z7ME/4sueTsg1xhvv0j q39hIt4IZHJ757A+zBH7Alh8AdOvTHTjvt6OP058xJB0fzsUyTdZ2O5lOOul5TPCsllW NgAQ== 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=73dckcvlkTiMvsVB7ETeQRaRlxizQr/3gWMqHjU/tSo=; b=ZP0dVDuBn6N3RjbxEsa8Xx4KDw3SS7doPC4LnZFw6OgOUM55dafIOCgY7P32KJWbGB WQwEJGdwJilpZTY0O1l2XVTnngkb5X3l2EdB3bsbOOUzyTwwXdteaUYrdKdvAVkbLh31 pKVZQeUhzwer+LjUsnp3/lraSOM4C988P1thpRm8lQGlSOPG1Ei8U6iymFlJyWctxqqt AYVe96JT0zQaLQE7tL/3fPQ0udysi7u/89U8CBNdlTYjs520CVCMrS1yPbwqCY0sYhZd q43Lshy2yvC/ZzaQiPPJ37R4ym1PmV7TVCBe2UuML496RLsYal/0pcc/jjnI+b9ZL37n l8RA== X-Gm-Message-State: AOAM533xWkVZFDgMgj3pLuvUhDON9yU5SXk37cstZ9NFzbmKHzlcZEez fBDr/9mz9xnWYZo/AbfEWpTpFjT0PbQ= X-Received: by 2002:aa7:85da:: with SMTP id z26mr819894pfn.13.1593142355015; Thu, 25 Jun 2020 20:32:35 -0700 (PDT) Received: from localhost.localdomain (174-21-143-238.tukw.qwest.net. [174.21.143.238]) by smtp.gmail.com with ESMTPSA id y27sm1605256pgc.56.2020.06.25.20.32.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jun 2020 20:32:34 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v9 36/46] target/arm: Handle TBI for sve scalar + int memory ops Date: Thu, 25 Jun 2020 20:31:34 -0700 Message-Id: <20200626033144.790098-37-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200626033144.790098-1-richard.henderson@linaro.org> References: <20200626033144.790098-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::442; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x442.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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=_AUTOLEARN 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, david.spickett@linaro.org, steplong@quicinc.com 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. Reviewed-by: Peter Maydell 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.25.1 diff --git a/target/arm/translate-a64.h b/target/arm/translate-a64.h index 781c441399..49e4865918 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 7a3774bfda..e46c4a49e0 100644 --- a/target/arm/translate-a64.c +++ b/target/arm/translate-a64.c @@ -215,7 +215,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 e4fbe48493..04eda9a126 100644 --- a/target/arm/translate-sve.c +++ b/target/arm/translate-sve.c @@ -4587,9 +4587,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)); @@ -4599,7 +4598,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();