From patchwork Fri Dec 7 10:36:10 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 153109 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp335203ljp; Fri, 7 Dec 2018 02:37:17 -0800 (PST) X-Google-Smtp-Source: AFSGD/WoFVXpYWu0x4+ke8+6S7hTpa6KvO3YUitUd4VgW7WQB+QJqImABEJdaPjjkv6aP8bAMfZ/ X-Received: by 2002:ac8:6b18:: with SMTP id w24mr1460569qts.144.1544179036949; Fri, 07 Dec 2018 02:37:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544179036; cv=none; d=google.com; s=arc-20160816; b=zfnbs345PUd8aeTtM4MfxA9U5Z+JcctJOmpPiE8cPQ8pQN19dPohIxvG+8KTvr1rBZ 06WaE1llkfX6A05S7Gm1yDTXUq2mYXh6/NlShTX2OVLNdP5f0X6aoWwejOa8m9l8vD09 tG32GqMON97lyxqwtdZKqTFn068B/pomrB84EQz7vT99AhlZ30hvYTMl2uLUTC/df01Y D+TQSR4ahJc2VDeJ5R/SNOB0A+T3Ghr4ZeRFdiZImNgEAZKzHAJgKTWvbkqLIS3T7MoS L3rjghl6zbIqkQvXu3A8S9qCo8jslqsmxIsL/btI8gmC1ACj3uWxImX73kK36rA4EgGA Ng0w== 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=BBGH46DSzj6YIrBp1pSAJv0X2g3wgK77Rkp3YAo8k6I=; b=DMP9DfnUgIMSZm+NzPnub0TEjs5wdo8Fwn/QZ9bAiPjyTpj/LN1Kkyp5snilGFKz0r 00SOY2CiDyfJIaZizBeCMulIeeUu1ZuIDkDxQRdfBjvRBsWjMG7occsdMTb7S+cqvHzd oO0OMqUSMEAh7KrdA23S2mcTILvAdXXHt+qHenk1MuQ5HNd5GUmMfR5PEcVGwEoCiRoj XgvXvYPyjx1h7SaZyg/I/4WABi8KO4Rb2yDK8zBtB+fb0XprWDyK8L/GcE17y+wDdkgi N3xLAjxgPEGICv6tS8KNMw2nuHYbWTJSFawfESsT/qYYgFOItTAA5CL5kD5+g8pMvHgg ig8w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=gjSQqh82; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 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. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id 63si784321qkr.108.2018.12.07.02.37.16 for (version=TLS1 cipher=AES128-SHA bits=128/128); Fri, 07 Dec 2018 02:37:16 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=gjSQqh82; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 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 ([::1]:45251 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gVDVU-000836-Cg for patch@linaro.org; Fri, 07 Dec 2018 05:37:16 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59050) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gVDUz-000802-ME for qemu-devel@nongnu.org; Fri, 07 Dec 2018 05:36:46 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gVDUy-0007KT-OO for qemu-devel@nongnu.org; Fri, 07 Dec 2018 05:36:45 -0500 Received: from mail-oi1-x241.google.com ([2607:f8b0:4864:20::241]:45291) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gVDUy-0007I5-FP for qemu-devel@nongnu.org; Fri, 07 Dec 2018 05:36:44 -0500 Received: by mail-oi1-x241.google.com with SMTP id y1so1218143oie.12 for ; Fri, 07 Dec 2018 02:36:44 -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=BBGH46DSzj6YIrBp1pSAJv0X2g3wgK77Rkp3YAo8k6I=; b=gjSQqh82xRUUx27Sw7M3eUZfBYbMNtfsuqzwmCBZ/1daWZxrhnWzcVJqJWxMFDsDr9 UCa96TyDacYx9MJrByfmDQ2fKEWeNYfoDaz0FMnuKeYMVxFbo98ER4J8yc8eVj9hpLEF jN/ogFCi3g+TA70MZrmPmyqyDKHO6Mi9gMm48= 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=BBGH46DSzj6YIrBp1pSAJv0X2g3wgK77Rkp3YAo8k6I=; b=tT4atfceP0tDncF1J/+UDFbcaPyXqYbhvt1czaY9x/dka34iB2Y+rXNR0bzORr4uiI HuhVkcVAYtTkB/BOqv9cQrsLfTlzJquuauy/+OaRbkl3LndU96Rv7ztFwvjNVtaJWSId 8u0hKOrViZ4R3uMcx+M/636KSkRF/sI4aHZQG67ouOGoxw3nZ5/eAGQEfrhVJldPJtLH 9VHEvp4396IwSuUXQHEDVKPUgn7Sr9ajX6v7afuZZPZLn1vWPtVgb25Do43vvhXAapSY PSaVlJZ9fKxu6Js/AeImFG2s2jRROh08GxVYJKfGvQ42qIHSLVA1RvAfAXPtbkBOjMfK hzYg== X-Gm-Message-State: AA+aEWZKSYlJ+9312BT1d63D5oaMcOuABQ+81bhDAHOXJVCSJ4dSedkk SfN6mTdCoz/wHE9HUfijypKRujL54xY= X-Received: by 2002:aca:6155:: with SMTP id v82mr952901oib.259.1544179003477; Fri, 07 Dec 2018 02:36:43 -0800 (PST) Received: from cloudburst.twiddle.net (172.189-204-159.bestel.com.mx. [189.204.159.172]) by smtp.gmail.com with ESMTPSA id c19sm2037594otl.16.2018.12.07.02.36.42 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 07 Dec 2018 02:36:42 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Date: Fri, 7 Dec 2018 04:36:10 -0600 Message-Id: <20181207103631.28193-6-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.2 In-Reply-To: <20181207103631.28193-1-richard.henderson@linaro.org> References: <20181207103631.28193-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::241 Subject: [Qemu-devel] [PATCH 05/26] 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, ramana.radhakrishnan@arm.com Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Richard Henderson --- 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 7c1cc1ce8e..0df344f9e8 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 000: /* NOP */ + break; + case 003: /* WFI */ s->base.is_jmp = DISAS_WFI; - return; + break; + case 001: /* 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 002: /* WFE */ if (!(tb_cflags(s->base.tb) & CF_PARALLEL)) { s->base.is_jmp = DISAS_WFE; } - return; - case 4: /* SEV */ - case 5: /* SEVL */ + break; + case 004: /* SEV */ + case 005: /* SEVL */ /* we treat all as NOP at least for now */ - return; + break; + case 007: /* XPACLRI */ + if (s->pauth_active) { + gen_helper_xpaci(cpu_X[30], cpu_env, cpu_X[30]); + } + break; + case 010: /* PACIA1716 */ + if (s->pauth_active) { + gen_helper_pacia(cpu_X[17], cpu_env, cpu_X[17], cpu_X[16]); + } + break; + case 012: /* PACIB1716 */ + if (s->pauth_active) { + gen_helper_pacib(cpu_X[17], cpu_env, cpu_X[17], cpu_X[16]); + } + break; + case 014: /* AUTIA1716 */ + if (s->pauth_active) { + gen_helper_autia(cpu_X[17], cpu_env, cpu_X[17], cpu_X[16]); + } + break; + case 016: /* AUTIB1716 */ + if (s->pauth_active) { + gen_helper_autib(cpu_X[17], cpu_env, cpu_X[17], cpu_X[16]); + } + break; + case 030: /* PACIAZ */ + if (s->pauth_active) { + gen_helper_pacia(cpu_X[30], cpu_env, cpu_X[30], + new_tmp_a64_zero(s)); + } + break; + case 031: /* PACIASP */ + if (s->pauth_active) { + gen_helper_pacia(cpu_X[30], cpu_env, cpu_X[30], cpu_X[31]); + } + break; + case 032: /* PACIBZ */ + if (s->pauth_active) { + gen_helper_pacib(cpu_X[30], cpu_env, cpu_X[30], + new_tmp_a64_zero(s)); + } + break; + case 033: /* PACIBSP */ + if (s->pauth_active) { + gen_helper_pacib(cpu_X[30], cpu_env, cpu_X[30], cpu_X[31]); + } + break; + case 034: /* AUTIAZ */ + if (s->pauth_active) { + gen_helper_autia(cpu_X[30], cpu_env, cpu_X[30], + new_tmp_a64_zero(s)); + } + break; + case 035: /* AUTIASP */ + if (s->pauth_active) { + gen_helper_autia(cpu_X[30], cpu_env, cpu_X[30], cpu_X[31]); + } + break; + case 036: /* AUTIBZ */ + if (s->pauth_active) { + gen_helper_autib(cpu_X[30], cpu_env, cpu_X[30], + new_tmp_a64_zero(s)); + } + break; + case 037: /* 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; } }