From patchwork Mon Feb 11 23:52:42 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 158041 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp3203616jaa; Mon, 11 Feb 2019 16:00:31 -0800 (PST) X-Google-Smtp-Source: AHgI3IZmGNoAWg4WeYOZ0Shf0bHIzFxI9+ub8UYsxEEz1XUHrArAIHWFskbrAn6cvZ6nYfuQMSsx X-Received: by 2002:a25:6754:: with SMTP id b81mr620213ybc.425.1549929631183; Mon, 11 Feb 2019 16:00:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549929631; cv=none; d=google.com; s=arc-20160816; b=zoSrcBsBrsnsMhacllY+8d/lNCnimpwaZACBjejKnvEmXEUh6B8SbB1pJqMDzvYZef V6UyKGjh18UQz1LtxtztANNxDkg3tftPBNHvuFhYeDf634gSCJ9onWGlWogUqLs1hJqa xmnEhHRCiLRAZlgR7813BoK0ks2SAnbhEcpmmhk2pf/SIbKMtxly/7xzhENAUtkvVH1E BdfrLl+bTKCZ6OMf/n+qZsnncwo62MbSp55d5OCeW7O02pYfDYdCK3DbXj4vci9e0CBz VMrkpmP3xPvMRQoKroCFOEhrSx1cIjbXlSw9HYcsX5Qff5xs7KSFEUVTsIExI25DTNpp vXTg== 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=Kmm2As5QErToKnAZtTaLla6p1MaYpNIuxtZbUjkLWnk=; b=Ch/L9CLMY/GGydRiqz+mYK9c+v+E35i77g+y9IblRtwXscLEDhpnV/iXhOZfe+1x2X Qbijo/spq+rq7Qar0GwgnWk3ayWoMGPT+GWx5FcNDGBatHxpQPfCdZpUxpG08KWvgnKj 8CR5B1gjPXMa+11L+RXMkpt42UeQZRiQzvPCZiHfxX6YEkGqfilgDC7cyGC01Hmz28yi N4dx1t1NWIJd5obFKQtLYkJenXScYXtrp//aBIx79VFsTTujwf/caZXRPIz/q6ytA5MD iGLh/B2eIesVfUXuzhKVa/HBjdqGJis2IQfte1qwnjSXeqk5ChJKCJx4XHdUlKnHlmik IwsQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=ZidENpA9; 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 e185si7053597ywd.55.2019.02.11.16.00.31 for (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 11 Feb 2019 16:00:31 -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=ZidENpA9; 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]:58248 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gtLV0-0002UV-LG for patch@linaro.org; Mon, 11 Feb 2019 19:00:30 -0500 Received: from eggs.gnu.org ([209.51.188.92]:38157) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gtLOG-0005R2-Vv for qemu-devel@nongnu.org; Mon, 11 Feb 2019 18:53:34 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gtLOE-0004aE-HN for qemu-devel@nongnu.org; Mon, 11 Feb 2019 18:53:32 -0500 Received: from mail-pf1-x442.google.com ([2607:f8b0:4864:20::442]:42473) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gtLOC-0004Rt-BZ for qemu-devel@nongnu.org; Mon, 11 Feb 2019 18:53:30 -0500 Received: by mail-pf1-x442.google.com with SMTP id n74so324893pfi.9 for ; Mon, 11 Feb 2019 15:53:18 -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=Kmm2As5QErToKnAZtTaLla6p1MaYpNIuxtZbUjkLWnk=; b=ZidENpA9kruZ1RJGavkWK31F/Eg5o76ygIgs2GCuthV9RcMZzRHvvudtoQH2lH3k8H /NQmssmo1tQiGNZN8wjRuwmgAjuSKE7ZiUCabC8sS570yynDdhEtYYea4wA+Zr9Q8Dqm BR6EDxMTgaOk/blh+pMzB+g0VOBj69U0mrSVGzGASDnaRktbi/Ng1GIIHGqqnQFJtvRL DSvqaB9QPHsjFuEerBpfAOOX74Opmge+55vortcJ6Tql1zOtN9ImnczvfbyYr3+S0wkX 6P74WCXumzqxn3hpzFGIvSGHxeFdDqmrJHC3bV+HgBCPJa0gkyiiG3nwTSZiGpINtHUb Wygw== 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=Kmm2As5QErToKnAZtTaLla6p1MaYpNIuxtZbUjkLWnk=; b=KaqNgiM+yTztifDt11ye543bqVYKiA7K76+PtDy16KY988w7IKohfCDLkDBEt7JDCp Wey9c6Hbc3Ysg+puAvXamvJ0SNDHBMU3h8AREaa6ob45bXlC8aTn6AFFN4GNDqTpmibr cDGLtxrI/0XBtBWM4prQVMGZ5IRDZqLpUB71iXXqHAsnF4uuiLSsZJxiRxYnc55Q+zeo H70DRKBRdpSazGM7VO3zSAoo2xTb53lfBmrVnueFd0StcCTbNDEjWv5ipM9TgPlb71+G NVQufVwlhOJ0l5j29Cq8wv89iua+yXJMz2+rPZbdiKwtsR5aEGTScx5LQjL7kp6JAOVu DK2Q== X-Gm-Message-State: AHQUAuZYt8YMxFwHIFvFBQ1kiKf2nWeIf5xHmrJ125M4roju9gY2ntHU HuRAQDsza8tqJ5DjjRfz17HcWPcb/40= X-Received: by 2002:a62:47d9:: with SMTP id p86mr881857pfi.95.1549929197217; Mon, 11 Feb 2019 15:53:17 -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 c4sm11861031pgq.85.2019.02.11.15.53.16 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 11 Feb 2019 15:53:16 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Date: Mon, 11 Feb 2019 15:52:42 -0800 Message-Id: <20190211235258.542-13-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.2 In-Reply-To: <20190211235258.542-1-richard.henderson@linaro.org> References: <20190211235258.542-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Received-From: 2607:f8b0:4864:20::442 Subject: [Qemu-devel] [PATCH v3 12/28] 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, 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.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 8e322bd6a0..791bcc3b66 100644 --- a/target/arm/translate-a64.c +++ b/target/arm/translate-a64.c @@ -5165,6 +5165,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;