Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp7319745imu; Thu, 31 Jan 2019 08:21:45 -0800 (PST) X-Google-Smtp-Source: ALg8bN6Sr5pXAzDVLQoxihie0cwKgoF65000hTnyfeQipFl4BAroYqArfsf0fqJVYDJHhWPiG9Sq X-Received: by 2002:aa7:824f:: with SMTP id e15mr34639619pfn.192.1548951705080; Thu, 31 Jan 2019 08:21:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548951705; cv=none; d=google.com; s=arc-20160816; b=wCdsvA0TSSoQu2NBaYPfnxd/c89Fznp2DUzK2RuLe2EcUbk3LpCFI4ZXOXJrb7fXR3 /xu4yg71iAj+MMBO4Wb/lKDmX/lcrQovX5qpdYQcyXNzGkIpnuWfX5ErsCXXY6ppcf33 2TxnaE8EdIQAuEcdTxCpJr/pMs7cHvIroQ2/NrfH2AS1iT3uXllnZpyy7eHN6BCCK+1x 49WfpreGKFpP2rCzKbz147B0g71hiPp1wAMEB5N+z9KoT+2WlhC3yOuIa5Tc7Vhm/fW1 x0jsbHBE772kTJA+rBBo9lLvEeWC1hWn1Ghy5Ya1alXehcZHtcbQt1GDxNDtII2bORU8 vbOA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=T14LJx3kp5JGwWFIj4IvEL+Ozu2KiHASAjdNpGeRUjI=; b=tuvyVw0yDfRupAQvND2TBEn3vDg2csJV8Z3iChHOlF5XTtfz9hgyEkp97UXAfv3iXs UCK+ZNDEUz7Ez5mWT2Cb/3yAuXnM+8WvnhJ4IwmOuMSAD5dX980Y2TUK3GDbt+2mv6FB ym62a8IJKZUJ/S/yf78KjW/cZ/xxnmvZhKuv9ka2yAnmLLLpaNb1GA4wi05Jv8EtQpeG otMl1OCH7BnABX5a5T+ObSxl83m+Q8h35TqU49x9hrAXabBb6ljwwer56AIm6BWlb8Yh 0y7v9r9GOSFZceRJqwGCSlwv9hdzqCWiSWQH7Ta39sWQ2rVmO7oTshLo6ewjlagM5Odp BBKQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 206si4525643pga.240.2019.01.31.08.21.29; Thu, 31 Jan 2019 08:21:45 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388321AbfAaQUI (ORCPT + 99 others); Thu, 31 Jan 2019 11:20:08 -0500 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:47186 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731284AbfAaQUH (ORCPT ); Thu, 31 Jan 2019 11:20:07 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 54929EBD; Thu, 31 Jan 2019 08:20:07 -0800 (PST) Received: from [10.1.196.105] (eglon.cambridge.arm.com [10.1.196.105]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id AB2943F557; Thu, 31 Jan 2019 08:20:05 -0800 (PST) Subject: Re: [PATCH v5 1/5] arm64: Add utilities to save restore pointer authentication keys To: Amit Daniel Kachhap Cc: linux-arm-kernel@lists.infradead.org, Marc Zyngier , Catalin Marinas , Will Deacon , Kristina Martsenko , kvmarm@lists.cs.columbia.edu, Ramana Radhakrishnan , Dave Martin , linux-kernel@vger.kernel.org References: <1548658727-14271-1-git-send-email-amit.kachhap@arm.com> <1548658727-14271-2-git-send-email-amit.kachhap@arm.com> From: James Morse Message-ID: <88ccd568-f027-6cdf-b4f1-6709d76102c1@arm.com> Date: Thu, 31 Jan 2019 16:20:03 +0000 User-Agent: Mozilla/5.0 (X11; Linux aarch64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 In-Reply-To: <1548658727-14271-2-git-send-email-amit.kachhap@arm.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Amit, On 28/01/2019 06:58, Amit Daniel Kachhap wrote: > The keys can be switched either inside an assembly or such > functions which do not have pointer authentication checks, so a GCC > attribute is added to enable it. > > A function ptrauth_keys_store is added which is similar to existing > function ptrauth_keys_switch but saves the key values in memory. > This may be useful for save/restore scenarios when CPU changes > privilege levels, suspend/resume etc. > diff --git a/arch/arm64/include/asm/pointer_auth.h b/arch/arm64/include/asm/pointer_auth.h > index 15d4951..98441ce 100644 > --- a/arch/arm64/include/asm/pointer_auth.h > +++ b/arch/arm64/include/asm/pointer_auth.h > @@ -11,6 +11,13 @@ > > #ifdef CONFIG_ARM64_PTR_AUTH > /* > + * Compile the function without pointer authentication instructions. This > + * allows pointer authentication to be enabled/disabled within the function > + * (but leaves the function unprotected by pointer authentication). > + */ > +#define __no_ptrauth __attribute__((target("sign-return-address=none"))) The documentation[0] for this says 'none' is the default. Will this only take-effect once the kernel supports pointer-auth for the host? (Is this just documentation until then?) ('noptrauth' would fit with 'notrace' slightly better) Thanks, James [0] https://gcc.gnu.org/onlinedocs/gcc/AArch64-Function-Attributes.html#AArch64-Function-Attributes