From patchwork Tue Jan 8 22:31:04 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 155011 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp33131jaa; Tue, 8 Jan 2019 14:35:04 -0800 (PST) X-Google-Smtp-Source: ALg8bN59CtSZoHP00t4PoNZ9feHZB0gBCoJZpUe/bK3wWsqkDL3RSHd8fRDyr+1g/CLsSrdL36ej X-Received: by 2002:adf:c042:: with SMTP id c2mr2959827wrf.158.1546986904314; Tue, 08 Jan 2019 14:35:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546986904; cv=none; d=google.com; s=arc-20160816; b=r3ZXzL3bYkVgcpifRLJE1TjwCWz4DU3zlZcw7K94ONhjqyxi6zHjKMpNaZKAxscQBR 2zkyjNK3t+Kn2tcPnxi5nMKXI+UZkEsb+L7TgKGVXwmIJv1LTCkx3KYBF0ATG89Zv0MW hZGwtbXCwQPuVT8a3S2KHWr4VPD4KH/40BYFUuBeJNRCJmUEbqkhZLxM+ymCOCEdFfwu AGmDFe/BtG4t3RojJptrWmTf3DzUv9qomQO0UD8KFLg5y/s+sAV3QeKnRcXK1cznjhlF 7YxV8yTsVuoPiN8oauQYbFUildVFOvH6N9fHuTr2jtSHiHIM3ZCNss0bkOy64U61Xf3+ t4bQ== 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=1hpvolh3eiZvY+EUwSFoFURlL4sKnYluLlSrcZoczFI=; b=v9ZXfg/tvLHWopYACkdRHXrPLL4WjNRltwbYNloavAui+p/E2LtUlKFJs+dUtNiPYO UDW5bNQxsQKwwEPPXqhy/tEQN0ZpVD4f1k5Ilvcyo4M5tGCpOlLF0lPKRg3nolBW0laJ kE4oLSPjY+JL2C1u0QxStcQjQyfuhdAJliDRWO0ZCQz33oqbGHpppEA9gnaBRu/aaq9q W8ETEe6OvUsJIwPmgOGYGMvyBXwzlc2gWVmTNkT8pbejSITrV4wa5E5Df+l/D0klLOZo xa6QV4dAEeCZFsaKWUFK1ovSTXRBY1rMrSWS8nTLdhkvEW7nCv2cOMTz1YIbcQVngQKM mwnA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=CQIP4kJx; 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 186si7293795wmc.87.2019.01.08.14.35.04 for (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 08 Jan 2019 14:35:04 -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=CQIP4kJx; 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]:40067 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ggzxf-0001Pn-4f for patch@linaro.org; Tue, 08 Jan 2019 17:35:03 -0500 Received: from eggs.gnu.org ([209.51.188.92]:52523) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ggzub-00087Q-Lv for qemu-devel@nongnu.org; Tue, 08 Jan 2019 17:31:54 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ggzua-0004Lt-Nj for qemu-devel@nongnu.org; Tue, 08 Jan 2019 17:31:53 -0500 Received: from mail-pl1-x643.google.com ([2607:f8b0:4864:20::643]:37883) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ggzua-0004Kg-Hs for qemu-devel@nongnu.org; Tue, 08 Jan 2019 17:31:52 -0500 Received: by mail-pl1-x643.google.com with SMTP id b5so2568920plr.4 for ; Tue, 08 Jan 2019 14:31:52 -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=1hpvolh3eiZvY+EUwSFoFURlL4sKnYluLlSrcZoczFI=; b=CQIP4kJxBA5D7C+yzEnqU/uqEzFoP9NmNjvYy/wMQ/q0PVDtRH/i7gzE4ohseQcqL4 C/E/hh02eupUdrbgVzs0Ndwy9uS3yVqypZpKJ5gj6V0QR2qdTbRqctyNji2FYTCutq2W zqCfEW83nVdArH8+9jjOySiKU/UmGEDtudZ0U= 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=1hpvolh3eiZvY+EUwSFoFURlL4sKnYluLlSrcZoczFI=; b=IUf+Er07EhO923PxXkhADPigF9jV2YR6yQcmCfuRbXYkdDhaPrBUlAv1bWpedzSFx0 LkJYKf8G2VgzZUJLQqyy4mKUtl2rz1gBO/wiiWgXDaEz34aOJGI1o7EV+3qLg/SkBBq7 HlLfra/x7EqSrQD6rmskN3CWB+Sl95MizI8rJM1a+InCfpcswjSZLl3NqL1cns0t0RHH GgYYx5VCy7g5gA5wp38rRv5PzfhtmEcxm/7E7dWrKO5YgCXfBv83i/7/IXdctasBkOnv +1xLI+hUrIjoen8vUtiHsuZmx4rVCK8WO46E4Tr4hgrtgEnHqzQyZ8XsaFJvE1Mxzt2o lk5g== X-Gm-Message-State: AJcUukeE2QcWwPQd0mxaqlArZMv/U1IToXFOgaDM1o5Hpuc9ABXyJdPN cC6cyk0zP02jNX0prrfH9VDZphDQSsg= X-Received: by 2002:a17:902:ab92:: with SMTP id f18mr3426026plr.221.1546986711324; Tue, 08 Jan 2019 14:31:51 -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.49 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 08 Jan 2019 14:31:50 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Date: Wed, 9 Jan 2019 08:31:04 +1000 Message-Id: <20190108223129.5570-7-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::643 Subject: [Qemu-devel] [PATCH v3 06/31] target/arm: Decode PAuth within system hint space 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 --- v3: Use binary literals. --- target/arm/translate-a64.c | 93 +++++++++++++++++++++++++++++++++----- 1 file changed, 81 insertions(+), 12 deletions(-) -- 2.17.2 diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c index 37a57af715..b72aea3e97 100644 --- a/target/arm/translate-a64.c +++ b/target/arm/translate-a64.c @@ -1471,33 +1471,102 @@ static void handle_hint(DisasContext *s, uint32_t insn, } switch (selector) { - case 0: /* NOP */ - return; - case 3: /* WFI */ + case 0b00000: /* NOP */ + break; + case 0b00011: /* WFI */ s->base.is_jmp = DISAS_WFI; - return; + break; + case 0b00001: /* YIELD */ /* When running in MTTCG we don't generate jumps to the yield and * WFE helpers as it won't affect the scheduling of other vCPUs. * If we wanted to more completely model WFE/SEV so we don't busy * spin unnecessarily we would need to do something more involved. */ - case 1: /* YIELD */ if (!(tb_cflags(s->base.tb) & CF_PARALLEL)) { s->base.is_jmp = DISAS_YIELD; } - return; - case 2: /* WFE */ + break; + case 0b00010: /* WFE */ if (!(tb_cflags(s->base.tb) & CF_PARALLEL)) { s->base.is_jmp = DISAS_WFE; } - return; - case 4: /* SEV */ - case 5: /* SEVL */ + break; + case 0b00100: /* SEV */ + case 0b00101: /* SEVL */ /* we treat all as NOP at least for now */ - return; + break; + case 0b00111: /* XPACLRI */ + if (s->pauth_active) { + gen_helper_xpaci(cpu_X[30], cpu_env, cpu_X[30]); + } + break; + case 0b01000: /* PACIA1716 */ + if (s->pauth_active) { + gen_helper_pacia(cpu_X[17], cpu_env, cpu_X[17], cpu_X[16]); + } + break; + case 0b01010: /* PACIB1716 */ + if (s->pauth_active) { + gen_helper_pacib(cpu_X[17], cpu_env, cpu_X[17], cpu_X[16]); + } + break; + case 0b01100: /* AUTIA1716 */ + if (s->pauth_active) { + gen_helper_autia(cpu_X[17], cpu_env, cpu_X[17], cpu_X[16]); + } + break; + case 0b01110: /* AUTIB1716 */ + if (s->pauth_active) { + gen_helper_autib(cpu_X[17], cpu_env, cpu_X[17], cpu_X[16]); + } + break; + case 0b11000: /* PACIAZ */ + if (s->pauth_active) { + gen_helper_pacia(cpu_X[30], cpu_env, cpu_X[30], + new_tmp_a64_zero(s)); + } + break; + case 0b11001: /* PACIASP */ + if (s->pauth_active) { + gen_helper_pacia(cpu_X[30], cpu_env, cpu_X[30], cpu_X[31]); + } + break; + case 0b11010: /* PACIBZ */ + if (s->pauth_active) { + gen_helper_pacib(cpu_X[30], cpu_env, cpu_X[30], + new_tmp_a64_zero(s)); + } + break; + case 0b11011: /* PACIBSP */ + if (s->pauth_active) { + gen_helper_pacib(cpu_X[30], cpu_env, cpu_X[30], cpu_X[31]); + } + break; + case 0b11100: /* AUTIAZ */ + if (s->pauth_active) { + gen_helper_autia(cpu_X[30], cpu_env, cpu_X[30], + new_tmp_a64_zero(s)); + } + break; + case 0b11101: /* AUTIASP */ + if (s->pauth_active) { + gen_helper_autia(cpu_X[30], cpu_env, cpu_X[30], cpu_X[31]); + } + break; + case 0b11110: /* AUTIBZ */ + if (s->pauth_active) { + gen_helper_autib(cpu_X[30], cpu_env, cpu_X[30], + new_tmp_a64_zero(s)); + } + break; + case 0b11111: /* AUTIBSP */ + if (s->pauth_active) { + gen_helper_autib(cpu_X[30], cpu_env, cpu_X[30], cpu_X[31]); + } + break; default: /* default specified as NOP equivalent */ - return; + break; } }