From patchwork Tue Mar 14 16:20:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Rutland X-Patchwork-Id: 13174719 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id DA092C6FD1C for ; Tue, 14 Mar 2023 16:21:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=VTc1JBbhrXKmveoX4/IlIzzGtLXCxOgVIKDIhNcyDGo=; b=UsuPt1fRktJ8v9 uS1gW8upKbAY4gTP1HxYHqmnWtB9bKUqDXthWZMt2NHLHQ9TsmD6LYC1MrHn1hMvMJCIaaajgPflp AeAhz4OpYLWatMim4xmL3nrHsM0Oh0RLyr7WuyDAVHgF/UuhBdLa49VtF+0v0QnmOevgjmIRXEr9Y bVJ4QUEj7JynUVYS+l04ZdMbezty/pFL4+WdoHdta9HGULr7zEyjVPBwVDBcLa6lostLUHW30kJyB S3EZUdoNP6rgVJQcYzGTSqioF6Dj0Vrm7SgWhLcRdCOOPKlcGR3bioOYJc+g8VQRdUoaAZ0Yhav6g oX9070ZBSc2+xM1XfYKg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pc7OY-00Anpi-39; Tue, 14 Mar 2023 16:21:02 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pc7OS-00Annt-0G for linux-arm-kernel@lists.infradead.org; Tue, 14 Mar 2023 16:21:01 +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 420924B3; Tue, 14 Mar 2023 09:21:39 -0700 (PDT) Received: from lakrids.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 963A93F67D; Tue, 14 Mar 2023 09:20:54 -0700 (PDT) From: Mark Rutland To: linux-arm-kernel@lists.infradead.org Cc: amit.kachhap@arm.com, catalin.marinas@arm.com, james.morse@arm.com, kristina.martsenko@arm.com, mark.rutland@arm.com, will@kernel.org Subject: [PATCH 3/3] arm64: move PAC masks to Date: Tue, 14 Mar 2023 16:20:44 +0000 Message-Id: <20230314162044.888747-4-mark.rutland@arm.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230314162044.888747-1-mark.rutland@arm.com> References: <20230314162044.888747-1-mark.rutland@arm.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230314_092059_734803_DF0A65B1 X-CRM114-Status: GOOD ( 11.25 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Now that we use XPACLRI to strip PACs within the kernel, the ptrauth_user_pac_mask() and ptrauth_kernel_pac_mask() definitions no longer need to live in . Move them to , and ensure that this header is included where they are used. Signed-off-by: Mark Rutland Cc: Amit Daniel Kachhap Cc: Catalin Marinas Cc: James Morse Cc: Kristina Martsenko Cc: Will Deacon --- arch/arm64/include/asm/compiler.h | 7 ------- arch/arm64/include/asm/pointer_auth.h | 7 +++++++ arch/arm64/kernel/crash_core.c | 1 + 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/arch/arm64/include/asm/compiler.h b/arch/arm64/include/asm/compiler.h index 2476914e59a1..849effbac125 100644 --- a/arch/arm64/include/asm/compiler.h +++ b/arch/arm64/include/asm/compiler.h @@ -8,13 +8,6 @@ #define ARM64_ASM_PREAMBLE #endif -/* - * The EL0/EL1 pointer bits used by a pointer authentication code. - * This is dependent on TBI0/TBI1 being enabled, or bits 63:56 would also apply. - */ -#define ptrauth_user_pac_mask() GENMASK_ULL(54, vabits_actual) -#define ptrauth_kernel_pac_mask() GENMASK_ULL(63, vabits_actual) - #define xpaclri(ptr) \ ({ \ register unsigned long __xpaclri_ptr asm("x30") = (ptr); \ diff --git a/arch/arm64/include/asm/pointer_auth.h b/arch/arm64/include/asm/pointer_auth.h index b0665db86aa6..d2e0306e65d3 100644 --- a/arch/arm64/include/asm/pointer_auth.h +++ b/arch/arm64/include/asm/pointer_auth.h @@ -10,6 +10,13 @@ #include #include +/* + * The EL0/EL1 pointer bits used by a pointer authentication code. + * This is dependent on TBI0/TBI1 being enabled, or bits 63:56 would also apply. + */ +#define ptrauth_user_pac_mask() GENMASK_ULL(54, vabits_actual) +#define ptrauth_kernel_pac_mask() GENMASK_ULL(63, vabits_actual) + #define PR_PAC_ENABLED_KEYS_MASK \ (PR_PAC_APIAKEY | PR_PAC_APIBKEY | PR_PAC_APDAKEY | PR_PAC_APDBKEY) diff --git a/arch/arm64/kernel/crash_core.c b/arch/arm64/kernel/crash_core.c index 2b65aae332ce..66cde752cd74 100644 --- a/arch/arm64/kernel/crash_core.c +++ b/arch/arm64/kernel/crash_core.c @@ -8,6 +8,7 @@ #include #include #include +#include static inline u64 get_tcr_el1_t1sz(void);