From patchwork Fri Jan 18 14:57:28 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 155954 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp3365227jaa; Fri, 18 Jan 2019 07:10:59 -0800 (PST) X-Google-Smtp-Source: ALg8bN6gnTAeQJdbT+aF0qixBXWb6ERkqBwoxrS8pui2rvY5ETVAbr69T8cRpevF0tY/ygYO9KwS X-Received: by 2002:a1c:c707:: with SMTP id x7mr15687128wmf.120.1547824259367; Fri, 18 Jan 2019 07:10:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547824259; cv=none; d=google.com; s=arc-20160816; b=uBL/GG/wy0FUWts3bhnpiJdWcFCmOpfmdILdS0dGdBPV94dO7IQYCjO1poeTazxC1w olp8S8ck5U0CJZcrLuXE4N11ehqgs3NaJRfEe1pmdRgun2/Mei5bEjXxCGXMNVyt7jiz 43uuJtOTjSDe6o46Vdn7dPxfj4ev9dpRJ/iMKqSX/a4Z8uei/gS3UNIkp/y+BQQPrUV9 KZqERvFWEtkwjKVkdaz2n9B7bcm956LiG8TuRNJtkWL5OvoI9lVhC21NxJIPyhO+SmgC gLkT4dvlTc346olxCv8rhYVVnIu+Po1myGznlCakJahIiB0kH6QEZM6X2kuuOh68krAY d/6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=ifHsDnqc8Sb01hMkj6/Yv/R/LrojCD4CM+l9BtlkRxQ=; b=uxThlemwqsAtGmnzeyLagCQLzCqKHhdD4yVOiFxxJC00dNr5XUEvMK4nhYDsiVl0g3 Gqk6Q2NpWBT2IA7vBqFmYpaW5cVhlOEo3CJuSCD0XI5fGG63k+guYiZg5Ho5rQHWXhr4 RKdKfGiFULIHRGDXl1rOMFDND91o1Buh5ANaEUyKpvvyFlD2vDNGbyKMgMnCRqpvddpj T22AfnBxi7iK7gc0yxpjILw0tQGgnhmi58O5Ioctwlm4P5bTyH+w9y2tjoI6bbjn8euB A3TnkvvjCUn0TPJ+vUVPkWbgs/MyH7fTvhFuU54SdCxmzV57JifhMZBposKXy/NuL0/b 0N/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=ASvH1L01; 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 y13si30437661wrr.124.2019.01.18.07.10.59 for (version=TLS1 cipher=AES128-SHA bits=128/128); Fri, 18 Jan 2019 07:10:59 -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=ASvH1L01; 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]:41140 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gkVnO-0003dJ-5L for patch@linaro.org; Fri, 18 Jan 2019 10:10:58 -0500 Received: from eggs.gnu.org ([209.51.188.92]:43001) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gkVbU-0002lp-Ao for qemu-devel@nongnu.org; Fri, 18 Jan 2019 09:58:45 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gkVbS-0007MP-JK for qemu-devel@nongnu.org; Fri, 18 Jan 2019 09:58:40 -0500 Received: from mail-wr1-x435.google.com ([2a00:1450:4864:20::435]:43674) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gkVbS-0007BH-9r for qemu-devel@nongnu.org; Fri, 18 Jan 2019 09:58:38 -0500 Received: by mail-wr1-x435.google.com with SMTP id r10so15380558wrs.10 for ; Fri, 18 Jan 2019 06:58:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=ifHsDnqc8Sb01hMkj6/Yv/R/LrojCD4CM+l9BtlkRxQ=; b=ASvH1L01EghttU2G8Y91WbQ7ymxAIZ38rDrDliAUx5l/3leurNmJM0Hx2xq2/PhTiY OakZn/0e/6Cxu77ds+5HUB++PsVEQcWJHx45bJrUVOAngsojF2eAEXYpbQVYdkgV2FCx A/llwOlUme1XKjcrQMVl47smUu+GRDO+9cm9A= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ifHsDnqc8Sb01hMkj6/Yv/R/LrojCD4CM+l9BtlkRxQ=; b=pmgjLRzqL+HOOSoE1jH+KqJnn1Oc3Wmt8m/uZ8sT3pHCPkvCOagK8cO8vd8BcWX7GH i2M297XPdx1nltkCL6UHvxJ22v/+qQ/kYfSBzR9BY8qSAhOQCLyUNRYsc2AR1zYIA/3h c+tiDs537TXYadElMijZmZFtRq3639dbbeR7Kwv4ZpsSi5BcmQeEo677zKfGgCTVi4AP DmNI1yvnZn0rhhgURaR2x98Art4PQYe5orEKm55VWjMGtEDUzpronOlWB+7+lsuWMW5R ilsLoL7dEkSUyid9wEhhOS5FQs7m3HBDeU0BYMtVP7el0RrIaEJmrYGzArOxgHxc6Jug JtMw== X-Gm-Message-State: AJcUukfKh0pu5eT+2GluGocfBTxhJdSuE4Cedhbs2KnMEcqeAnH2vK9d HUh86bMpQuFnmperNyE8Z9LuxZx/kQZYNQ== X-Received: by 2002:adf:a50c:: with SMTP id i12mr16211720wrb.220.1547823500913; Fri, 18 Jan 2019 06:58:20 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id e27sm92094561wra.67.2019.01.18.06.58.19 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 18 Jan 2019 06:58:20 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Date: Fri, 18 Jan 2019 14:57:28 +0000 Message-Id: <20190118145805.6852-13-peter.maydell@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190118145805.6852-1-peter.maydell@linaro.org> References: <20190118145805.6852-1-peter.maydell@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::435 Subject: [Qemu-devel] [PULL 12/49] 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: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Richard Henderson Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson Message-id: 20190108223129.5570-9-richard.henderson@linaro.org Signed-off-by: Peter Maydell --- target/arm/translate-a64.c | 146 +++++++++++++++++++++++++++++++++++++ 1 file changed, 146 insertions(+) -- 2.20.1 diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c index dac61a3c3a5..8a8408c1b7d 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; }