From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 35158C33CB1 for ; Fri, 17 Jan 2020 10:15:00 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id E52FC24653 for ; Fri, 17 Jan 2020 10:14:59 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="uBA+wqik" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E52FC24653 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+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=+T8/nfg/4HLu3++3Xvv2w25dX18bEDyqD9CEaIi059I=; b=uBA+wqikk6I8r5 VJoXQjAPt/L3t9nu2vIEWAGIAXCQ6HciSGxJoxJoZyzmV7D/HvslYcuY1M/NnIuchvni5kwzWmgG6 8CNUR0Wevr5P0JGxK1rz0jJqJEcjlVSZkEakO9zxyydenHIUsxiaiF93zy3IeZdxvMHFa+pT4kJgE bgM0Ze5L+YcruNSUmElKbMV1yT/ZaLqB2yxK4ShYBkqXsafivfacb1vMsG1CNKIzEZXtftKlL20l5 VNjo6JfHCzaUGufCwHGNF7jsnTX/TC44H07IavZp6Iy0Su1dNbc0B6qbW9p2e5RTplnzEiNC37hMA K0h9s1gWDnXqvPSY43xw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1isOeV-0000OH-V8; Fri, 17 Jan 2020 10:14:55 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1isOeE-0000Fb-Hb for linux-arm-kernel@lists.infradead.org; Fri, 17 Jan 2020 10:14:47 +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 CFA8E11D4; Fri, 17 Jan 2020 02:14:35 -0800 (PST) Received: from arrakis.emea.arm.com (arrakis.cambridge.arm.com [10.1.197.42]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 14F113F68E; Fri, 17 Jan 2020 02:14:33 -0800 (PST) Date: Fri, 17 Jan 2020 10:14:32 +0000 From: Catalin Marinas To: Amit Daniel Kachhap Subject: Re: [PATCH v3 09/16] arm64: mask PAC bits of __builtin_return_address Message-ID: <20200117101432.GA26090@arrakis.emea.arm.com> References: <1576486038-9899-1-git-send-email-amit.kachhap@arm.com> <1576486038-9899-10-git-send-email-amit.kachhap@arm.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1576486038-9899-10-git-send-email-amit.kachhap@arm.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200117_021438_623156_3FDFC948 X-CRM114-Status: GOOD ( 14.25 ) 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 , Kees Cook , Suzuki K Poulose , Ard Biesheuvel , Richard Henderson , Kristina Martsenko , James Morse , Ramana Radhakrishnan , Mark Brown , Vincenzo Frascino , Will Deacon , Dave Martin , linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, Dec 16, 2019 at 02:17:11PM +0530, Amit Daniel Kachhap wrote: > diff --git a/arch/arm64/include/asm/compiler.h b/arch/arm64/include/asm/compiler.h > new file mode 100644 > index 0000000..3cb06f9 > --- /dev/null > +++ b/arch/arm64/include/asm/compiler.h > @@ -0,0 +1,20 @@ > +/* SPDX-License-Identifier: GPL-2.0 */ > +#ifndef __ASM_COMPILER_H > +#define __ASM_COMPILER_H > + > +#if defined(CONFIG_ARM64_PTR_AUTH) > + > +/* > + * 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) That's the current behaviour but I guess we could extend the mask to 63 here without breaking anything since we don't expect instruction addresses to be tagged. I also think we should turn TCR_EL1.TBID0 on when we have PAC present (in a separate patch for both the mask change and the TCR_EL1 bit as this may be slightly more controversial, a theoretical ABI change). > +#define ptrauth_kernel_pac_mask() (GENMASK_ULL(63, 56) | GENMASK_ULL(54, VA_BITS)) I think the kernel mask should be GENMASK_ULL(63, vabits_actual), no need to skip bit 55 since it's 1 already. With regards to VA_BITS (a constant), I'm not sure that's correct. ARMv8.2-LVA (52-bit VA) is an optional feature and I don't think PAC in 8.3 mandates it. -- Catalin _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel