From patchwork Fri Dec 14 05:24:09 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 153754 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp1676871ljp; Thu, 13 Dec 2018 21:34:25 -0800 (PST) X-Google-Smtp-Source: AFSGD/Wgy9Txk4IurLms2OcgBVLyRcMBp5ixDwDhxkaAll3NzXOEAWdzUm4n0Gr2lU02ysmYdc8K X-Received: by 2002:a37:9c57:: with SMTP id f84mr1387117qke.176.1544765665404; Thu, 13 Dec 2018 21:34:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544765665; cv=none; d=google.com; s=arc-20160816; b=nPm5gL4zIBa29/Inql9hRwd3XgmbTrfTWzODzs6YivGqmc6lvfAGbYNQfHRFIQ1/sb 0pSloz8s487aHzErhfnDiLUCobCvIFPcfgLdJHm1LNqn+2y+XxzagXeYXUEzxvCJPLls QM2Ba/rtMMdZ+dd5rxL5m/Pbzt1OtkH6iAgt8Yn610JOpOWw9EoZHMHlkozljBZwt+RN mBvV828cFq88qUARRwQ+nD7OvKof7Sg/JSVBgfecJsKrNKe8jXuqMsWStUO8lp4Hx0P7 NckmSX2d+dCZU2Ca2Q48iezl41/3xxizMaYePOXeN6/m2YWq2MDe2VtBmsx5bmCwsaDd tMsg== 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=5lV189kkOB6fne0CCcwUJT1P8TEOV3BpZfvcoTnPXCM=; b=cKfPmeBACjvXiKs8ZaJxJe8MyqmbC6LOp6iMyOL7Cxt7L2GXYOcMU+oY4MW6ki3nrO R6AZbnzvqD18NpIlSFNgBrokuytI/EWRZl3lkro2IS9hCGeqVGmy7w54cdqzcLWTARa0 eR5SmLtBtEFH37Tz9e7Z4EpEFlZzoQUz4ueytGQZK12h6VnCRGiw7bIdVyXqk0pQlHP1 T49eYkCCqEln0Iellx8+qRJpC5faalvb9Za+GOf+5UUnSRGEthStc0akc2QleYlFpdpi hKKIyaHgDMj6UidQd1yI7u2YIruo7/cn1TpJfOTm35CfOoPi3b4HLMblsLp1KytoeaMJ 2MDg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=fWyx79si; 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 n189si77534qkc.170.2018.12.13.21.34.25 for (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 13 Dec 2018 21:34:25 -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=fWyx79si; 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]:59480 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gXg7E-0004sI-Qa for patch@linaro.org; Fri, 14 Dec 2018 00:34:24 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55880) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gXfxu-0004md-64 for qemu-devel@nongnu.org; Fri, 14 Dec 2018 00:24:47 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gXfxs-0005Vv-EO for qemu-devel@nongnu.org; Fri, 14 Dec 2018 00:24:46 -0500 Received: from mail-ot1-x343.google.com ([2607:f8b0:4864:20::343]:41376) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gXfxs-0005VX-3P for qemu-devel@nongnu.org; Fri, 14 Dec 2018 00:24:44 -0500 Received: by mail-ot1-x343.google.com with SMTP id u16so4301790otk.8 for ; Thu, 13 Dec 2018 21:24:43 -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=5lV189kkOB6fne0CCcwUJT1P8TEOV3BpZfvcoTnPXCM=; b=fWyx79siYq7SkTSY1cduGbtIBdUNb8ZV09FhBtSnn2jKNJI7qdHtwKWnLgmd89FksO dHU8q6XmRI4feugX8OMGQn5ke0XNxdI+dylJevJKX/+KwL0EwIDnWy0w6uoEUJwQsfbR 0ciadTxqWcO6DM4816+G6cawhucVVtWeRDSVQ= 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=5lV189kkOB6fne0CCcwUJT1P8TEOV3BpZfvcoTnPXCM=; b=I0+1aiWvLfxAUoZ2TlPE6ZrYDXFQjM3MjVYmnU8E4Gwk3KD7b0GSsRLUMkT6jQDjOe 0CoLAuAo82XqN1vEvIsel4evWyL2wy8AnD/zqgObhicDh6SkdvS03WXPj3tqylDpJIsA FxFL6oTSLiLlHUXREhPj6q5XdZGxH/tgH7JNVNouhrxQsNMghnkTMUnNo6j2gtW6xQtc Uxxp8yVLcxWT0XSf/pms7phGrwxjlkxp2OziVIZaowNKNezNvLFX7B/OwmeR+eHdfm8N ONE5WYD1VyOQx8oxIPD63MPEE9A7H+bGwToBj9m+2JDVRRWkWxg9URp+YqZ2gc1kjHqf CuZw== X-Gm-Message-State: AA+aEWbwcKFwMO4Nu3dNJ5ny0V+iuk3rxymN5eNXigQ+dc1u4olSiC0T eLWVG4V1e3nBIYwho8wGeE6vnJIlbL0+hA== X-Received: by 2002:a9d:5183:: with SMTP id y3mr1068847otg.5.1544765082302; Thu, 13 Dec 2018 21:24:42 -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.41 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 13 Dec 2018 21:24:41 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Date: Thu, 13 Dec 2018 23:24:09 -0600 Message-Id: <20181214052410.11863-27-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 26/27] target/arm: Enable PAuth for user-only, part 2 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" FIXME: We should have an attribute that controls the EL1 enable bits. We may not always want to turn on pointer authentication with -cpu max. Signed-off-by: Richard Henderson --- target/arm/cpu.c | 6 ++++++ 1 file changed, 6 insertions(+) -- 2.17.2 Reviewed-by: Peter Maydell diff --git a/target/arm/cpu.c b/target/arm/cpu.c index 0b185f8d30..bc2c9eb551 100644 --- a/target/arm/cpu.c +++ b/target/arm/cpu.c @@ -162,6 +162,12 @@ static void arm_cpu_reset(CPUState *s) env->pstate = PSTATE_MODE_EL0t; /* Userspace expects access to DC ZVA, CTL_EL0 and the cache ops */ env->cp15.sctlr_el[1] |= SCTLR_UCT | SCTLR_UCI | SCTLR_DZE; + /* Enable all PAC keys. */ + env->cp15.sctlr_el[1] |= SCTLR_EnIA | SCTLR_EnIB; + env->cp15.sctlr_el[1] |= SCTLR_EnDA | SCTLR_EnDB; + /* Enable all PAC instructions */ + env->cp15.hcr_el2 |= HCR_API; + env->cp15.scr_el3 |= SCR_API; /* and to the FP/Neon instructions */ env->cp15.cpacr_el1 = deposit64(env->cp15.cpacr_el1, 20, 2, 3); /* and to the SVE instructions */