From patchwork Fri Dec 14 05:23:48 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 153744 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp1672765ljp; Thu, 13 Dec 2018 21:27:26 -0800 (PST) X-Google-Smtp-Source: AFSGD/WdgZufKXGdqZW4Zh7aZ7oX+b/aa2pIKkzOX9z0RqU7vxQDtaNJUk2KcqvlSLwaITn8ykT6 X-Received: by 2002:aed:2946:: with SMTP id s64mr1440860qtd.383.1544765246225; Thu, 13 Dec 2018 21:27:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544765246; cv=none; d=google.com; s=arc-20160816; b=Il2mL4/2sGpiezuCc9B/4TLx3g1HjMHtcWpWV/loh7P6GPITayC4m/VyJxH4Yjx5yZ b2BU0+vNZoTPaR6sS/2RAm2Fys1Rvv9+7Vz/0f0T1U2AamwqzpHFi9Zi9oVf9zCTqnwZ aPlUsvqpjmAkJiDnCCjUlikdiTxgyzaVeTK1DJd3RmWSCcAKw0gf/9P8URFxgj0nvtIO l9+QrreWRcChSkQ9NlmyCZrpgueZtMyoHa1TX4fHSVc8euSuDJy9OjdNBQIT9/sRLlvm wY3cSDlrveNLBNXObr+JOlhv8Y85pj0eyU7EUWOlZ8t2iDpwdFI/QeLVPajH3dykBzAO +rbg== 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=SYOatYtJSpaTzS07nyWqPdpnsjKGS+KBxEp82O1v4wsvzusbTaxpIXCbn0EkxgAu0S EZKNMdsnaQGQvVP4V5pcUmkdpedJVDmcr0EgxOLigjO8ukFc6brS0Xc2NkxSlUvMgD5B BTftN2BI6viSS1mfEMKQYzwHAFwf8S/n5jfIqc8AyV7x2ldh7ZYKTQhDr8iledVxBCCl ip3FPQEsZ333LORbwfRzDXgPanUBKRFHaKb9H5z7GQM2coMsxfWbOnn0HrS3jWS5SFZF Y/bkyaoyQyTWAGIjA+j+cgydrbytZtLEiffG6noe1bsGFX6jTY8m55WFPxxZs9LJ2Q44 ggDw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=iU8sl2PZ; 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 t38si56678qth.297.2018.12.13.21.27.26 for (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 13 Dec 2018 21:27:26 -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=iU8sl2PZ; 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]:59441 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gXg0T-0005pl-JQ for patch@linaro.org; Fri, 14 Dec 2018 00:27:25 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55676) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gXfxY-0004PO-KT for qemu-devel@nongnu.org; Fri, 14 Dec 2018 00:24:27 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gXfxX-0005M9-ID for qemu-devel@nongnu.org; Fri, 14 Dec 2018 00:24:24 -0500 Received: from mail-ot1-x343.google.com ([2607:f8b0:4864:20::343]:35113) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gXfxX-0005Ke-C4 for qemu-devel@nongnu.org; Fri, 14 Dec 2018 00:24:23 -0500 Received: by mail-ot1-x343.google.com with SMTP id 81so4325841otj.2 for ; Thu, 13 Dec 2018 21:24:20 -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=iU8sl2PZQvTVZi6YZZWrN/zKniGNLds7pMmOobh2jXLINf6kQ8gVlAW6IV9Q9/RR+b 1BBOibdoDZzHeVd4V4geBv3AYnoxOReS5CRYhfkIAyEX/EC/Wvjr2+JeNds9wufW5EIB 5F5MQnWIZiMAAVWU3CB9kaJOrDs/L0e1f04d8= 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=dShlEE1zZ8qAN5CfQqk+vihymZPLS0l0uQtrxJa/aMkl3zyDvOC60q4XEtUOX/2j+9 h3j1ZIImymu8BnXuNTYdAYYCs22Kzpxd903ClsDGix5N1CbtwTSJCKh/FgPpS4CZo2MR tUDwgC1Xc/3qSTIMLa0ixEZvZAROaz7WX3ThpFaodDaFwQbniWCSpxcwKr3cpouYiOcb zQgtT37banPbieDDB1Q10i8wr2dvhCCfewC6KGf9j7jiosxLexk1oisWdnz0vdhnGhGp cflT979ihtDYYpE34HXdu+aCiBJT9GAkwp5jp5Kp+IInGvbYcAa/Gjue8g1rkqrZLOPR rC9w== X-Gm-Message-State: AA+aEWYdFry8DcGt74tedOWBXw7nySobnQvgF2QNf6Bffx4WYcM+RPCX MFAP+B96Sr6wi9QnaF0v6nwr8QbzGlvM/Q== X-Received: by 2002:a9d:6a81:: with SMTP id l1mr1220267otq.3.1544765059179; Thu, 13 Dec 2018 21:24:19 -0800 (PST) Received: from cloudburst.twiddle.net ([187.217.227.243]) by smtp.gmail.com with ESMTPSA id r1sm1845379oti.44.2018.12.13.21.24.17 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 13 Dec 2018 21:24:18 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Date: Thu, 13 Dec 2018 23:23:48 -0600 Message-Id: <20181214052410.11863-6-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.2 In-Reply-To: <20181214052410.11863-1-richard.henderson@linaro.org> References: <20181214052410.11863-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::343 Subject: [Qemu-devel] [PATCH v2 05/27] 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" Signed-off-by: Richard Henderson --- target/arm/translate-a64.c | 93 +++++++++++++++++++++++++++++++++----- 1 file changed, 81 insertions(+), 12 deletions(-) -- 2.17.2 Reviewed-by: Peter Maydell 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; } }