From patchwork Fri Dec 7 10:36:30 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 1009345 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="EUcDoANT"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 43B8S806Hfz9s55 for ; Fri, 7 Dec 2018 21:52:24 +1100 (AEDT) Received: from localhost ([::1]:45330 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gVDk5-00014Y-Bt for incoming@patchwork.ozlabs.org; Fri, 07 Dec 2018 05:52:21 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59359) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gVDVW-00007P-5a for qemu-devel@nongnu.org; Fri, 07 Dec 2018 05:37:18 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gVDVT-00083Y-3E for qemu-devel@nongnu.org; Fri, 07 Dec 2018 05:37:18 -0500 Received: from mail-ot1-x344.google.com ([2607:f8b0:4864:20::344]:36579) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gVDVS-00082D-Si for qemu-devel@nongnu.org; Fri, 07 Dec 2018 05:37:14 -0500 Received: by mail-ot1-x344.google.com with SMTP id k98so3366346otk.3 for ; Fri, 07 Dec 2018 02:37:13 -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=EUcDoANTxOlK54eUhc+sTv+udh2nYitot4t9Etf7IQRueIYEFNRns8PX2UUNpsZWQd a7fdAdEj1bS1SvNWNd/yD6ZGH/7EWW/QXM0jcgRZoWUg9bnlkW5ojHFj5jZ8jGRS6004 jcYM2wX4tEHhMUXMKeZGioE11DwTDIRrKx4p8= 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=s7pNrEtWeCd04ilC536sMXObVzgKgEAGoxSH4TgW6EQCVLcdbE7aGXBxQJUEE38LpE F2Ud6XiVvB1zacmyWM7V57fRnBsReBfEfFBAolr0lr+sPEXlu+DYUfusdK0IgmtucLqu VRhalyQ6QJuHEAxubILAWHxi6jv3LrS+bLy4YCqWOx6sDkihIWK8zip+XjdWbey2kdQJ YMRkc4YO7X5pwZzcfNCGnAtG/jt5HinoiBOBozWD4yOKkkfB1q3OquBvhkcGBct4wofA 4DmtaJp/yQxM+StrapM1+B9H9vDEt9al4gfNl1hXzZwAlMQMa9c5H8Dn/FI5L2cnBAjP cRvA== X-Gm-Message-State: AA+aEWYscz4iF7WKKytIZ2oZ/rF8KPLry3cB0pecYBaiq3YGkEtS0veN lws1yjqhHkD+d32DwuWgu2hlLeisPSI= X-Google-Smtp-Source: AFSGD/UsWJ9VjdronisMkiUAymQ+oou5CIpvd46JC/1Q4jK3oVQFTjjbqTUUMrPe1K7kKY4aAnG6zQ== X-Received: by 2002:a9d:a2e:: with SMTP id 43mr1006720otg.8.1544179032363; Fri, 07 Dec 2018 02:37:12 -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.37.11 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 07 Dec 2018 02:37:11 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Date: Fri, 7 Dec 2018 04:36:30 -0600 Message-Id: <20181207103631.28193-26-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::344 Subject: [Qemu-devel] [PATCH 25/26] 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, ramana.radhakrishnan@arm.com Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.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(+) 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 */