From patchwork Tue Jan 8 22:31:06 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 155015 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp35627jaa; Tue, 8 Jan 2019 14:38:12 -0800 (PST) X-Google-Smtp-Source: ALg8bN5vM1uzSyGqxpNDLCMxONhAJPfPLb1EjPnkwyvYL8tYzfSwa+ZBPXHgFdchy8eo5a8fg+Iz X-Received: by 2002:adf:fbc8:: with SMTP id d8mr2763642wrs.318.1546987092753; Tue, 08 Jan 2019 14:38:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546987092; cv=none; d=google.com; s=arc-20160816; b=bm1JoDo4cCnhytbNaG2+UM7x2PBEfCyN/fDTtJas2//F4vtiuXpMAZM2Na+56ycl+s nR9EwNeu2EKk4WmsScOvp+7jKs/ZaeKPYh5oxO9I0Amxxh5IKpzOUEFRKjhP1l24qXuZ 3JbhRsVIspXI8rLPcPPgd53pZVfoLtKubof326R0pyVW6WXTnLj84Vjp5ANOZOxydXJ9 dQQWir1JqH+avFKPbG07ysxrvYMUa75yMNuiQkDnlzd5xIPEV8iR8Xduywje5yed8gSc 2DPB+VAJPRzNZmMmt6LaosctEPPXglSy1QIS5zmKlq93BYtqqGLDrJTV64bZ4ypXCkLL vuAw== 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=RPDBYEPnq8VUHD21sOkgc4lwKfdr/8rUEWyrTjwmWuI=; b=obbTFi2d/14dqVDBfhfJBApiQ9uda6BHpriSmNXj5R0iCQKbAi9kpTxfY8mLmiqyvP Sb8F24wlzIDGQFM7u1IEnXXMvGoW7dZVlFPEOMj0fGWZvlTJ7lE5Wbd11Er0T7kNHhih WbR0/F5jNot/EpJrOT3A5WGMlq3zz6Mi1LIEOIuBub6DORgtlOR2RE9TxFixkwVpulUr fNKUYuVYl9x0PU+m5A4C4Ej6V/KKehexpRtBSr5Sg74kprrkK5Swbk0BcChrA5FJ1lTT OIidHo/NW+KMJ21TIB7nNhQiGjE5KFGpIs2uCcXO1xbd28Wjq4EtHAxwo5++Q8/Sj3sX oCGA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=gRNKnM+y; 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 m2si40661869wrg.33.2019.01.08.14.38.12 for (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 08 Jan 2019 14:38:12 -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=gRNKnM+y; 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]:40898 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gh00h-0004VN-Hn for patch@linaro.org; Tue, 08 Jan 2019 17:38:11 -0500 Received: from eggs.gnu.org ([209.51.188.92]:52576) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ggzuh-0008EK-MJ for qemu-devel@nongnu.org; Tue, 08 Jan 2019 17:32:01 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ggzug-0004Sr-Ny for qemu-devel@nongnu.org; Tue, 08 Jan 2019 17:31:59 -0500 Received: from mail-pg1-x541.google.com ([2607:f8b0:4864:20::541]:44810) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ggzug-0004SL-GO for qemu-devel@nongnu.org; Tue, 08 Jan 2019 17:31:58 -0500 Received: by mail-pg1-x541.google.com with SMTP id t13so2345852pgr.11 for ; Tue, 08 Jan 2019 14:31:58 -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=RPDBYEPnq8VUHD21sOkgc4lwKfdr/8rUEWyrTjwmWuI=; b=gRNKnM+yk5lZJmN3sGTtEujymeq4rwAZgF4LnmUHWCYU8gblwAIM4cbcxnDkGzjucG AqSylImxzb26mXxRsARL7mo/lrTjvEQeIx9hCZQaQSJ5s9jpQZl35oA4/2p5xaW/5bQN 1l5P6Ea06bSpM7I8v8n9LeJ4M/l2HB3WjwEzQ= 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=RPDBYEPnq8VUHD21sOkgc4lwKfdr/8rUEWyrTjwmWuI=; b=exyo1VgR79KpR8H8m3oQkF2E3tj1FryTvlWISltPOhNxrwIagRuphRCs8AiczzSS6s xuHqyM+LXI/oE+v9uepoIdvMnWoDNSI1+WzXrRcbGQ9zbBGBmyRvq1i6SUdnNBGFvYG3 IVhaf2QFiv0nPEnnSndrbigOUHfhehuBeKjzcSEXira5nYsVifArBsUugsLG0Oi8DpXx c1+aOqYJBSHUsxdYnyDZOquoE9aeVfgHrXDYyTlZBSiiQnzI/jfWwBLUY5BPQen6iLnV jAf3Io7SXMRh2DfsJ27Se7GpNFA/AWBmDF37coJUbZnVSlJR1OvFgB2ZVSqhqZzfflKx 5Fyw== X-Gm-Message-State: AJcUukf85AoVABf4i8L7sD8MdN/I4Mvfb8qqlXNA25VVFnncYif/JeyY GT5moUsNBN759HXzJJ6TXkkfykg6WiU= X-Received: by 2002:a63:d34a:: with SMTP id u10mr3181879pgi.301.1546986717065; Tue, 08 Jan 2019 14:31:57 -0800 (PST) Received: from cloudburst.lan (2001-44b8-2176-c800-8cc6-2630-7d99-5ef1.static.ipv6.internode.on.net. [2001:44b8:2176:c800:8cc6:2630:7d99:5ef1]) by smtp.gmail.com with ESMTPSA id w128sm100686177pfw.79.2019.01.08.14.31.54 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 08 Jan 2019 14:31:56 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Date: Wed, 9 Jan 2019 08:31:06 +1000 Message-Id: <20190108223129.5570-9-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.2 In-Reply-To: <20190108223129.5570-1-richard.henderson@linaro.org> References: <20190108223129.5570-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::541 Subject: [Qemu-devel] [PATCH v3 08/31] target/arm: Decode PAuth within disas_data_proc_1src 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/translate-a64.c | 146 +++++++++++++++++++++++++++++++++++++ 1 file changed, 146 insertions(+) -- 2.17.2 diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c index dac61a3c3a..8a8408c1b7 100644 --- a/target/arm/translate-a64.c +++ b/target/arm/translate-a64.c @@ -4564,6 +4564,7 @@ static void handle_rev16(DisasContext *s, unsigned int sf, static void disas_data_proc_1src(DisasContext *s, uint32_t insn) { unsigned int sf, opcode, opcode2, rn, rd; + TCGv_i64 tcg_rd; if (extract32(insn, 29, 1)) { unallocated_encoding(s); @@ -4602,7 +4603,152 @@ static void disas_data_proc_1src(DisasContext *s, uint32_t insn) case MAP(1, 0x00, 0x05): handle_cls(s, sf, rn, rd); break; + case MAP(1, 0x01, 0x00): /* PACIA */ + if (s->pauth_active) { + tcg_rd = cpu_reg(s, rd); + gen_helper_pacia(tcg_rd, cpu_env, tcg_rd, cpu_reg_sp(s, rn)); + } else if (!dc_isar_feature(aa64_pauth, s)) { + goto do_unallocated; + } + break; + case MAP(1, 0x01, 0x01): /* PACIB */ + if (s->pauth_active) { + tcg_rd = cpu_reg(s, rd); + gen_helper_pacib(tcg_rd, cpu_env, tcg_rd, cpu_reg_sp(s, rn)); + } else if (!dc_isar_feature(aa64_pauth, s)) { + goto do_unallocated; + } + break; + case MAP(1, 0x01, 0x02): /* PACDA */ + if (s->pauth_active) { + tcg_rd = cpu_reg(s, rd); + gen_helper_pacda(tcg_rd, cpu_env, tcg_rd, cpu_reg_sp(s, rn)); + } else if (!dc_isar_feature(aa64_pauth, s)) { + goto do_unallocated; + } + break; + case MAP(1, 0x01, 0x03): /* PACDB */ + if (s->pauth_active) { + tcg_rd = cpu_reg(s, rd); + gen_helper_pacdb(tcg_rd, cpu_env, tcg_rd, cpu_reg_sp(s, rn)); + } else if (!dc_isar_feature(aa64_pauth, s)) { + goto do_unallocated; + } + break; + case MAP(1, 0x01, 0x04): /* AUTIA */ + if (s->pauth_active) { + tcg_rd = cpu_reg(s, rd); + gen_helper_autia(tcg_rd, cpu_env, tcg_rd, cpu_reg_sp(s, rn)); + } else if (!dc_isar_feature(aa64_pauth, s)) { + goto do_unallocated; + } + break; + case MAP(1, 0x01, 0x05): /* AUTIB */ + if (s->pauth_active) { + tcg_rd = cpu_reg(s, rd); + gen_helper_autib(tcg_rd, cpu_env, tcg_rd, cpu_reg_sp(s, rn)); + } else if (!dc_isar_feature(aa64_pauth, s)) { + goto do_unallocated; + } + break; + case MAP(1, 0x01, 0x06): /* AUTDA */ + if (s->pauth_active) { + tcg_rd = cpu_reg(s, rd); + gen_helper_autda(tcg_rd, cpu_env, tcg_rd, cpu_reg_sp(s, rn)); + } else if (!dc_isar_feature(aa64_pauth, s)) { + goto do_unallocated; + } + break; + case MAP(1, 0x01, 0x07): /* AUTDB */ + if (s->pauth_active) { + tcg_rd = cpu_reg(s, rd); + gen_helper_autdb(tcg_rd, cpu_env, tcg_rd, cpu_reg_sp(s, rn)); + } else if (!dc_isar_feature(aa64_pauth, s)) { + goto do_unallocated; + } + break; + case MAP(1, 0x01, 0x08): /* PACIZA */ + if (!dc_isar_feature(aa64_pauth, s) || rn != 31) { + goto do_unallocated; + } else if (s->pauth_active) { + tcg_rd = cpu_reg(s, rd); + gen_helper_pacia(tcg_rd, cpu_env, tcg_rd, new_tmp_a64_zero(s)); + } + break; + case MAP(1, 0x01, 0x09): /* PACIZB */ + if (!dc_isar_feature(aa64_pauth, s) || rn != 31) { + goto do_unallocated; + } else if (s->pauth_active) { + tcg_rd = cpu_reg(s, rd); + gen_helper_pacib(tcg_rd, cpu_env, tcg_rd, new_tmp_a64_zero(s)); + } + break; + case MAP(1, 0x01, 0x0a): /* PACDZA */ + if (!dc_isar_feature(aa64_pauth, s) || rn != 31) { + goto do_unallocated; + } else if (s->pauth_active) { + tcg_rd = cpu_reg(s, rd); + gen_helper_pacda(tcg_rd, cpu_env, tcg_rd, new_tmp_a64_zero(s)); + } + break; + case MAP(1, 0x01, 0x0b): /* PACDZB */ + if (!dc_isar_feature(aa64_pauth, s) || rn != 31) { + goto do_unallocated; + } else if (s->pauth_active) { + tcg_rd = cpu_reg(s, rd); + gen_helper_pacdb(tcg_rd, cpu_env, tcg_rd, new_tmp_a64_zero(s)); + } + break; + case MAP(1, 0x01, 0x0c): /* AUTIZA */ + if (!dc_isar_feature(aa64_pauth, s) || rn != 31) { + goto do_unallocated; + } else if (s->pauth_active) { + tcg_rd = cpu_reg(s, rd); + gen_helper_autia(tcg_rd, cpu_env, tcg_rd, new_tmp_a64_zero(s)); + } + break; + case MAP(1, 0x01, 0x0d): /* AUTIZB */ + if (!dc_isar_feature(aa64_pauth, s) || rn != 31) { + goto do_unallocated; + } else if (s->pauth_active) { + tcg_rd = cpu_reg(s, rd); + gen_helper_autib(tcg_rd, cpu_env, tcg_rd, new_tmp_a64_zero(s)); + } + break; + case MAP(1, 0x01, 0x0e): /* AUTDZA */ + if (!dc_isar_feature(aa64_pauth, s) || rn != 31) { + goto do_unallocated; + } else if (s->pauth_active) { + tcg_rd = cpu_reg(s, rd); + gen_helper_autda(tcg_rd, cpu_env, tcg_rd, new_tmp_a64_zero(s)); + } + break; + case MAP(1, 0x01, 0x0f): /* AUTDZB */ + if (!dc_isar_feature(aa64_pauth, s) || rn != 31) { + goto do_unallocated; + } else if (s->pauth_active) { + tcg_rd = cpu_reg(s, rd); + gen_helper_autdb(tcg_rd, cpu_env, tcg_rd, new_tmp_a64_zero(s)); + } + break; + case MAP(1, 0x01, 0x10): /* XPACI */ + if (!dc_isar_feature(aa64_pauth, s) || rn != 31) { + goto do_unallocated; + } else if (s->pauth_active) { + tcg_rd = cpu_reg(s, rd); + gen_helper_xpaci(tcg_rd, cpu_env, tcg_rd); + } + break; + case MAP(1, 0x01, 0x11): /* XPACD */ + if (!dc_isar_feature(aa64_pauth, s) || rn != 31) { + goto do_unallocated; + } else if (s->pauth_active) { + tcg_rd = cpu_reg(s, rd); + gen_helper_xpacd(tcg_rd, cpu_env, tcg_rd); + } + break; default: + do_unallocated: unallocated_encoding(s); break; }