From nobody Fri Nov 7 02:35:44 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1544765758385451.3970325406626; Thu, 13 Dec 2018 21:35:58 -0800 (PST) Received: from localhost ([::1]:59491 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gXg8j-0005wL-7q for importer@patchew.org; Fri, 14 Dec 2018 00:35:57 -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) 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) 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-Google-Smtp-Source: AFSGD/WjTS9i5ZIPXRRzT9sQX80dYgQKUgaNVMyENbyC5PCc9tcpoCX3b5R8eT7A8wgnDzhcQUyiZg== X-Received: by 2002:a9d:5183:: with SMTP id y3mr1068847otg.5.1544765082302; Thu, 13 Dec 2018 21:24:42 -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+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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 Reviewed-by: Peter Maydell --- target/arm/cpu.c | 6 ++++++ 1 file changed, 6 insertions(+) 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 =3D PSTATE_MODE_EL0t; /* Userspace expects access to DC ZVA, CTL_EL0 and the cache ops */ env->cp15.sctlr_el[1] |=3D SCTLR_UCT | SCTLR_UCI | SCTLR_DZE; + /* Enable all PAC keys. */ + env->cp15.sctlr_el[1] |=3D SCTLR_EnIA | SCTLR_EnIB; + env->cp15.sctlr_el[1] |=3D SCTLR_EnDA | SCTLR_EnDB; + /* Enable all PAC instructions */ + env->cp15.hcr_el2 |=3D HCR_API; + env->cp15.scr_el3 |=3D SCR_API; /* and to the FP/Neon instructions */ env->cp15.cpacr_el1 =3D deposit64(env->cp15.cpacr_el1, 20, 2, 3); /* and to the SVE instructions */ --=20 2.17.2