From patchwork Mon Sep 14 08:36:50 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amit Daniel Kachhap X-Patchwork-Id: 11773271 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E672D14F6 for ; Mon, 14 Sep 2020 08:38:35 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 912B121548 for ; Mon, 14 Sep 2020 08:38:35 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="w02+LXYR" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 912B121548 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:MIME-Version:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Owner; bh=OIDOcTIV1cYW48g9dLKA75ibYbR8pVO/KECsu8Mt3EM=; b=w02+LXYRTcVkfbALiwpWg0AkT/ B+Zx7tjTN1O6qqd7roRlRwoEzY6zdPaioTYsJWTgBnG7MC7QuSANYwaxDfa+4HzuFVTxJBJEW7tgK dBYDaGOZV5lOnnX9gg3fm7zakqFiZEi2ss5tDB/7s8tJPZnUgO0TjkqGEG3ewnv5XhT5lh3Lq9Dvh XkeVjczax9TWqp6OkSs4f14dLtKDnGIrWT06Os5cGjACp+ANKkMwQGFWCR9tGvzYq08WsgtJCcmie 5BM0rpamYaQZH4rHbzeXd8cHG8LVUcsycUol7jwc7mxEIwuQsWBf61v3k7wO4ZS6Dp1D7/7Y5x1tu q+jbse3A==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kHjz7-0004TR-1f; Mon, 14 Sep 2020 08:37:13 +0000 Received: from foss.arm.com ([217.140.110.172]) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kHjz4-0004Sq-0t for linux-arm-kernel@lists.infradead.org; Mon, 14 Sep 2020 08:37:11 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 7E4BE1045; Mon, 14 Sep 2020 01:37:08 -0700 (PDT) Received: from a077416.blr.arm.com (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 58E173F718; Mon, 14 Sep 2020 01:37:05 -0700 (PDT) From: Amit Daniel Kachhap To: linux-arm-kernel@lists.infradead.org Subject: [PATCH v8 0/6] arm64: add Armv8.3 pointer authentication enhancements Date: Mon, 14 Sep 2020 14:06:50 +0530 Message-Id: <20200914083656.21428-1-amit.kachhap@arm.com> X-Mailer: git-send-email 2.17.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200914_043710_156067_3247D407 X-CRM114-Status: GOOD ( 14.04 ) X-Spam-Score: -2.3 (--) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-2.3 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [217.140.110.172 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , Suzuki K Poulose , Catalin Marinas , Mark Brown , James Morse , Amit Daniel Kachhap , Vincenzo Frascino , Will Deacon , Dave Martin MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org These patch series adds support for Armv8.3 pointer authentication enhanced features mandatory for Armv8.6 and optional for Armv8.3. These features are, * Enhanced PAC generation algorithm (ARMv8.3-pauth2). * Generate fault when authenticate instruction fails (ARMV8.3-FPAC). More details can be found here [1]. Changes since v7 [2]: * Cleaned-up trivial checks as pointed by Catalin. Changes since v6 [3]: * Clubbed Ptrauth combined branch instructions as suggested by Will. Changes since v5 [4]: * Few Comments modified as suggested by Dave and Suzuki. * Added Reviewed-by's. Changes since v4 [5]: * New patch "arm64: kprobe: add checks for ARMv8.3-PAuth combined instructions". This fixes uprobe crash with ARMv8.3-PAuth combined instructions. * New patch "arm64: traps: Allow force_signal_inject to pass esr error code". This is preparatory patch for ARMV8.3-FPAC fault exception handling. * Removed caching of bootcpu address authentication cpufeature levels in static variables. This was suggested by Dave and Suzuki. * Use existing force_signal_inject function to invoke ptrauth fault signal as suggested by Dave. * Commit log changes. Changes since v3 [6]: * Added a new patch "arm64: kprobe: clarify the comment of steppable hint instructions" as suggested in the last iteration. * Removed the ptrauth fault handler from el0 compat handler as pointed by Dave. * Mentioned the new feature name clearly as ARMV8.3-FPAC and ARMv8.3-pauth2 as per ARMv8-A reference manual. * Commit logs cleanup. Changes since v2 [7]: * Dropped the patch "arm64: cpufeature: Fix the handler for address authentication" * Added new matching function for address authentication as generic matching function has_cpuid_feature is specific for LOWER_SAFE features. This was suggested by Suzuki [3]. * Disabled probe of Authenticate ptrauth instructions as per Mark Brown's merged changes of whitelisting of hint instructions. This series is based on kernel version v5.9-rc5. Regards, Amit [1]: https://community.arm.com/developer/ip-products/processors/b/processors-ip-blog/posts/arm-architecture-developments-armv8-6-a [2]: http://lists.infradead.org/pipermail/linux-arm-kernel/2020-September/599573.html [3]: http://lists.infradead.org/pipermail/linux-arm-kernel/2020-September/598163.html [4]: https://lore.kernel.org/linux-arm-kernel/1597734671-23407-1-git-send-email-amit.kachhap@arm.com/ [5]: http://lists.infradead.org/pipermail/linux-arm-kernel/2020-July/584393.html [6]: https://lore.kernel.org/linux-arm-kernel/1592457029-18547-1-git-send-email-amit.kachhap@arm.com/ [7]: http://lists.infradead.org/pipermail/linux-arm-kernel/2020-April/723751.html Amit Daniel Kachhap (6): arm64: kprobe: add checks for ARMv8.3-PAuth combined instructions arm64: traps: Allow force_signal_inject to pass esr error code arm64: ptrauth: Introduce Armv8.3 pointer authentication enhancements arm64: cpufeature: Modify address authentication cpufeature to exact arm64: kprobe: disable probe of fault prone ptrauth instruction arm64: kprobe: clarify the comment of steppable hint instructions arch/arm64/include/asm/esr.h | 4 ++- arch/arm64/include/asm/exception.h | 1 + arch/arm64/include/asm/insn.h | 4 +++ arch/arm64/include/asm/sysreg.h | 24 +++++++++----- arch/arm64/include/asm/traps.h | 2 +- arch/arm64/kernel/cpufeature.c | 44 ++++++++++++++++++++------ arch/arm64/kernel/entry-common.c | 21 ++++++++++++ arch/arm64/kernel/fpsimd.c | 4 +-- arch/arm64/kernel/insn.c | 11 +++---- arch/arm64/kernel/probes/decode-insn.c | 9 ++++-- arch/arm64/kernel/traps.c | 26 +++++++++++---- 11 files changed, 112 insertions(+), 38 deletions(-)