From patchwork Thu Mar 7 17:04:26 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 159904 Delivered-To: patch@linaro.org Received: by 2002:a02:5cc1:0:0:0:0:0 with SMTP id w62csp7685431jad; Thu, 7 Mar 2019 09:19:23 -0800 (PST) X-Google-Smtp-Source: APXvYqytYYpOz76s3aCN5vsYJdYTN4VVqnLAAwYZSwHRtVfeqaGrV04ausLHn1NiScub3db8LAxO X-Received: by 2002:a25:4056:: with SMTP id n83mr12615284yba.105.1551979163845; Thu, 07 Mar 2019 09:19:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551979163; cv=none; d=google.com; s=arc-20160816; b=WmiKreTNJTLv74Gns9+eOoB7IW2el7xTcOjjHsVGMIYLMSXIMSBp5pD75dG4HtEQKp v/L9EF5eiAQTQxDB8TIpNFAp9n2hgka2+J+rUZ7ZN1sclp6T2Ie589kDtlLhEPbWsk1r DDoN/pOqt8powE/jpdDntYCWgbsmFPkegOQcwSC5kl95ZzKrfLyx3DIBbRwciV5Crofd F/jT2TX/qbocFAcgWUGlS/N4q3sfZgqmQNIeKnkSCaQQRpyHHakx4LSbO4hbtU0kQ/RM p9VI1vYpuwY5tPQX5jzqaVQ7RXj/lK5votyO805zfhQGy9gKcPUc7LZpG6A6sE4Le7Fn QBRw== 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:subject:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=F8FPG9SENuqhdf6hDTRz0uq8wwt3hGfwP2PIDIambNs=; b=bn6MLR43e8MLowCHli/3/bjTMLJOsy78AARE3TmBLqStCbSYIs+cICc6fR8jKMH1ym fetoDdU1ZVnpg/WhWCbu9ExJM9K1lUkjZdxjCXa+Oix3okH/2EpEaZf6LagAYXUbbEvk xz2tiB7uUfkwM4Sl5zouJmufTCN1teVhuRnoS6mnp2xbeeawoqDZ2fsikcMJ3wHdgHiB NVzfjrpt7jH0r1L5BjwOgA97tINRTkePLs02nDlmgNTW6IVOx8eAY8cX8n/pGh8HbynN RMkziWhega/ZakV8ixl2XBUzFXia/5QfOpM+lYrUpJvBguGT1pN39J2Gq0Qp/N2k4pV8 9GcQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=kgnnDqsR; 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 f5si3037389ywc.356.2019.03.07.09.19.23 for (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 07 Mar 2019 09:19:23 -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=kgnnDqsR; 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 ([127.0.0.1]:55805 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h1wfz-0001Km-Bj for patch@linaro.org; Thu, 07 Mar 2019 12:19:23 -0500 Received: from eggs.gnu.org ([209.51.188.92]:58911) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h1wSD-0006Pr-Qe for qemu-devel@nongnu.org; Thu, 07 Mar 2019 12:05:10 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h1wSA-0004kc-Mu for qemu-devel@nongnu.org; Thu, 07 Mar 2019 12:05:07 -0500 Received: from mail-pf1-x441.google.com ([2607:f8b0:4864:20::441]:40279) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h1wS7-0004Q3-S6 for qemu-devel@nongnu.org; Thu, 07 Mar 2019 12:05:04 -0500 Received: by mail-pf1-x441.google.com with SMTP id h1so11900004pfo.7 for ; Thu, 07 Mar 2019 09:04:53 -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; bh=F8FPG9SENuqhdf6hDTRz0uq8wwt3hGfwP2PIDIambNs=; b=kgnnDqsRgSFsARANhHJJQsdYQalL/U6v/W0u38hJ29pHOYrDbW4wmcoJmih4YUyUIi MbXokHPkpBANFmCZvzq02KOLpOSghmsBOz+nYNEvWzolyzKlE0HoZGOYbcT+jvBy8L9l W57HO0N/BcgEW/oT9qCxp7EiH8MWXqZzH/uc0bZCpYkzYVpx2Fy/90BQvs/wRN41F4jM 2ze0JR6kx1PDI6J1lWtE15Kgd7KQRDIMm+TwejLAiMFXkbihdKZsNv2oTWTU6iH4GNL9 lfGPXFaiMmlSaQr5IwpgGog7kCOKzkiDbyiK27HBwUkW8URsGjP6204MJC3FK6WgWB06 z19Q== 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=F8FPG9SENuqhdf6hDTRz0uq8wwt3hGfwP2PIDIambNs=; b=tMkUu3/l0wnp/IUaa+CQ7l3gXsRhccDPKDEMXMXOUQIByBt31eddIQf9PMc9EIWaLx o8lsdIrFMwF5bxy1cyxDubziB/j6tWfmh2LonCW/NsmHK8RpjkBzZtQKQFdDivzRYLVX W+GrNOmvYAtD7ySuY2L29ZRSweu4FSBzzsZ86GfXRgzfF5gqGR01SU2McfWDcwTXriVv uwVXVi4p6VzJHB/6FYXh4OJfinsoBOBcPgVo1/lVel/tsKS9FCNWvDoU4DezhVS3a9Pw JwhOUUuQvZM4rYw4qZc2QUmA5wDvlb8qJqtsgmB7tEnhijEMeGyWLZ71fZSkAVBW6Xak cI7A== X-Gm-Message-State: APjAAAX3WoNYFku3PHYLG9JdMeXTKoGOIG+lq8+PbF/Vs2CXqC0eBRTK wQt4wdD+IZ0Xj7nyaUMlEehLBd/+A9Y= X-Received: by 2002:a17:902:1008:: with SMTP id b8mr13492182pla.120.1551978292614; Thu, 07 Mar 2019 09:04:52 -0800 (PST) Received: from cloudburst.twiddle.net (97-113-188-82.tukw.qwest.net. [97.113.188.82]) by smtp.gmail.com with ESMTPSA id r82sm10040562pfa.161.2019.03.07.09.04.51 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 07 Mar 2019 09:04:51 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Date: Thu, 7 Mar 2019 09:04:26 -0800 Message-Id: <20190307170440.3113-9-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.2 In-Reply-To: <20190307170440.3113-1-richard.henderson@linaro.org> References: <20190307170440.3113-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::441 Subject: [Qemu-devel] [PATCH v4 08/22] target/arm: Implement the GMI instruction X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.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.2 diff --git a/target/arm/helper-a64.h b/target/arm/helper-a64.h index 6ad23bf9ee..3b78e19279 100644 --- a/target/arm/helper-a64.h +++ b/target/arm/helper-a64.h @@ -108,3 +108,4 @@ DEF_HELPER_FLAGS_3(mte_check2, 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 7aca5b074f..e60c6f48eb 100644 --- a/target/arm/mte_helper.c +++ b/target/arm/mte_helper.c @@ -220,3 +220,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 181692cd1b..e756985982 100644 --- a/target/arm/translate-a64.c +++ b/target/arm/translate-a64.c @@ -5316,6 +5316,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;