From patchwork Fri Oct 11 13:47:30 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 175954 Delivered-To: patch@linaro.org Received: by 2002:ac9:3c86:0:0:0:0:0 with SMTP id w6csp963472ocf; Fri, 11 Oct 2019 06:54:03 -0700 (PDT) X-Google-Smtp-Source: APXvYqzalHBpsHzriNABoKsS9mXQACRPT/ix9spZlccVXhybs7U2JypaBIdDS+NeXAUFgxC+kwzp X-Received: by 2002:ac8:368b:: with SMTP id a11mr16935144qtc.362.1570802043160; Fri, 11 Oct 2019 06:54:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570802043; cv=none; d=google.com; s=arc-20160816; b=u3oa9ob+7JvyCcQK5/g3TwEaADWcCC4+V6h6CihifWcHvcnS7kC7PparZQhb5utPbf O0QKVR79Y7DaxzxFvtEVx12t31a5wYMsD/4BNAicZi1zv3jj67lAqKYLz3DHewGaKD8s mwNhJHtBbEFzoADsS0gic2mcIeC6QF2nupNWxRl1OC7PNE433aXCPd9XJY1JCQWb1KRc aT5NmqHuOXxmyEnt8bceNeu1DI9mUw49FOIKJJbDqGSB17aOgZwVk4GC5jyQ5wjsjWtE bPA7aePJ3osCGdx+C6A421q2Jpd53UBUVcZYa8ottjZHiZ8BzlMn4cEcKtHdEyGUMcg6 kXNQ== 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:references:in-reply-to :message-id:date:subject:to:from:dkim-signature; bh=o8+XY/UcseGCyRDxlQOhrRq4L82DVUKd4GlR/wFLdGQ=; b=bzY1+UDerIUPoKDZ32n4caQOU7ygX/erj/g82BSS+z50EXwfxvDEBDvjyb2lluqRs6 7QgqQ0d3z46rYCDvPIHSHx06/9FX0SgF85VKUV3yzZ2OyT3DciYbSmrYrAOLSRt8HAgb OjIsqEZMUzb8waPBMEtUz4Oozu+AGpI8nT8X0UatU/zs17N7N1HdiR+QPhXNh/neSMqP /5/M/rSZTboOLt37eUMb2Cb8QitErpXmj+OgMxN1nBnMZ/Rjrj+uUZi1sAkQ0ia2Bgbs sVsRKPxoMTxr2sJCfsdWXvFDLRRz10nQIzzrOCc/HFjsUPCYTC9ik3w0/A5Q+WTGGMu+ T0zA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=XxMkP3cu; 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 c13si8446719qkl.46.2019.10.11.06.54.03 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 11 Oct 2019 06:54:03 -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=XxMkP3cu; 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]:50596 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iIvMo-0000I2-9g for patch@linaro.org; Fri, 11 Oct 2019 09:54:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38954) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iIvIz-0005Qr-Oy for qemu-devel@nongnu.org; Fri, 11 Oct 2019 09:50:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iIvIy-0003qA-NH for qemu-devel@nongnu.org; Fri, 11 Oct 2019 09:50:05 -0400 Received: from mail-yw1-xc41.google.com ([2607:f8b0:4864:20::c41]:38264) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iIvIy-0003pw-Jz for qemu-devel@nongnu.org; Fri, 11 Oct 2019 09:50:04 -0400 Received: by mail-yw1-xc41.google.com with SMTP id s6so3496237ywe.5 for ; Fri, 11 Oct 2019 06:50:04 -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; bh=o8+XY/UcseGCyRDxlQOhrRq4L82DVUKd4GlR/wFLdGQ=; b=XxMkP3cuC45PymTfi2IKBDZt8J4WXEa/gzYz/z/Au1ZuaM/U+Wh2+/Z6pXS41OU/Bu yWa539MQMIWZrGmU10sEDGYBRQ1KQ8l/vADphQ+MWVVeeEh0CJaUngIckbrX0HkJLI+p 0VhWb5Puue2V10/LNoEfVIjOhgIe38THpT51yu0iUH+saSuLZJsNT9hHC5AThQZP4sL8 Y8BNI5sPGcXAiFy2pQsjOrHoQAajSpaGoRYnJodvF2mIVval+f1rvyDfy7xZqStgE9/Q 4O5GzKPSepeAPP/MxobLIKi5vnAfLdSgOyM/tGQOFOVXiVt8ustM9ZHEfg9rMFwihxi4 Q/kQ== 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; bh=o8+XY/UcseGCyRDxlQOhrRq4L82DVUKd4GlR/wFLdGQ=; b=XAP9MF1bEVgnj0y/Xfn60uEflGWfYNuN31+K8cr+/dWCLFFg0dsdQGMwSJ+QAxGSdD ShBdvgNdTp4z/SqcYfS+OHuTGIXQYODh45xZj6E6G6AafLUKRD3YXcj9Wx0byj66tBxR Hptejj9Y5uZFiYIfFhjExS4GVSl8m2BnSeJwEwVAL5g6LfqI/HRORaRpow9B/VdmlQV8 y7NvsdAGipiIzdH9dkmkpfJyhodvRMrYdGObZrDR9iR3T/9PwkjMHsb3xnbT6ySTZLRd oJpvSCcGz2LrnLtdMULCL0nDXTI3AT5yL4Ae93Yh8luVHOHpK0xnEyDppd7g1zCdUhDp g4wg== X-Gm-Message-State: APjAAAVX7PoOeR5MMeD+/2rORX5ub+EPFsZFSzHQ7vRgr+d60PmXCGZG c6Fo9JYuk1A34+eLUbbToTELJdi4bC8= X-Received: by 2002:a81:c8c:: with SMTP id 134mr2583852ywm.205.1570801803665; Fri, 11 Oct 2019 06:50:03 -0700 (PDT) Received: from cloudburst.gateway.pace.com (67.216.151.25.pool.hargray.net. [67.216.151.25]) by smtp.gmail.com with ESMTPSA id f68sm2534000ywb.96.2019.10.11.06.49.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Oct 2019 06:50:03 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v5 08/22] target/arm: Implement the GMI instruction Date: Fri, 11 Oct 2019 09:47:30 -0400 Message-Id: <20191011134744.2477-9-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191011134744.2477-1-richard.henderson@linaro.org> References: <20191011134744.2477-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::c41 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" Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- target/arm/helper-a64.h | 1 + target/arm/mte_helper.c | 6 ++++++ target/arm/translate-a64.c | 6 ++++++ 3 files changed, 13 insertions(+) -- 2.17.1 diff --git a/target/arm/helper-a64.h b/target/arm/helper-a64.h index 268c114b79..31f848ca03 100644 --- a/target/arm/helper-a64.h +++ b/target/arm/helper-a64.h @@ -109,3 +109,4 @@ DEF_HELPER_FLAGS_3(mte_check3, TCG_CALL_NO_WG, i64, env, i64, i32) DEF_HELPER_FLAGS_3(irg, TCG_CALL_NO_RWG, i64, env, i64, i64) DEF_HELPER_FLAGS_4(addg, TCG_CALL_NO_RWG_SE, i64, env, i64, i32, i32) DEF_HELPER_FLAGS_4(subg, TCG_CALL_NO_RWG_SE, i64, env, i64, i32, i32) +DEF_HELPER_FLAGS_2(gmi, TCG_CALL_NO_RWG_SE, i64, i64, i64) diff --git a/target/arm/mte_helper.c b/target/arm/mte_helper.c index c3edc51bba..251dfff1e1 100644 --- a/target/arm/mte_helper.c +++ b/target/arm/mte_helper.c @@ -254,3 +254,9 @@ uint64_t HELPER(subg)(CPUARMState *env, uint64_t ptr, return address_with_allocation_tag(ptr - offset, rtag); } + +uint64_t HELPER(gmi)(uint64_t ptr, uint64_t mask) +{ + int tag = allocation_tag_from_addr(ptr); + return mask | (1ULL << tag); +} diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c index 26aee0c1c9..4184d65d97 100644 --- a/target/arm/translate-a64.c +++ b/target/arm/translate-a64.c @@ -5188,6 +5188,12 @@ static void disas_data_proc_2src(DisasContext *s, uint32_t insn) gen_helper_irg(cpu_reg_sp(s, rd), cpu_env, cpu_reg_sp(s, rn), cpu_reg(s, rm)); break; + case 5: /* GMI */ + if (sf == 0 || !dc_isar_feature(aa64_mte_insn_reg, s)) { + goto do_unallocated; + } + gen_helper_gmi(cpu_reg(s, rd), cpu_reg_sp(s, rn), cpu_reg(s, rm)); + break; case 8: /* LSLV */ handle_shift_reg(s, A64_SHIFT_TYPE_LSL, sf, rm, rn, rd); break;