Received: by 2002:a25:23cc:0:0:0:0:0 with SMTP id j195csp1826480ybj; Wed, 6 May 2020 06:09:32 -0700 (PDT) X-Google-Smtp-Source: APiQypJ6l1/kqPRN2kYkx5dotH3AgAhtH7ZyhsCx0VIvjJjemkg7huW2vWL34X355TdQ7u4m/dP/ X-Received: by 2002:a50:dac4:: with SMTP id s4mr628502edj.277.1588770572526; Wed, 06 May 2020 06:09:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588770572; cv=none; d=google.com; s=arc-20160816; b=cI4BpE7hf9Eqq1+V44mHdqTrX6d89UPyfn0cPQMQSz1U46JcEtNAMXxYGh2yu9svDQ 6pAC4ureFGprChcCOI7vYNnKcSnmWSXQT+0/r98Omea0iIF64JYk7k5rIIdHPx50u2Xi woAUybgnfmMpmyZxwbVWwq648XKXwnID9a7CNgAqvgj0e+b5dEfEd4mNHfxeIb3RvZBO u9ZYZzD+j8gPKuwpHEx6+VaT1Zr8Bea10Yuie72LeKfFJlqet3bSTav9WxWKYX9GPPPK TBl4BHTmvQa0SHKo7UZ1rHIFxmF70uNLZXp7W5WZqv0Lq8QtbBCrhieRq9X9hLr+JE6u v71g== 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=6XiyHZV4bfU3Ql+/aBdHCRx56nXyQ3GCNW7Qnkx9qlQ=; b=pH0eCCPvYRl3BPLs0GkjEeCEvGHyCPfZABBeqnvHXSflFATdL0MIEdt9HdAQFHwfGr k7gLMKuZoyUXV4zH7j8CZfk1pYo4Ip4U/RyXY9hzvTDGgdGdjAKKH8dc/pPhMfysanEo PJMYiA9Sx+3zUqOSFD4eR28MFrseRuOBhumkLH6jFuJll8GF1TVv92Dbpxik7ANIpRIW zVFmjfnokP5e52uEtKTzEe2XMz7l9trAfS+RgOs+jzWwXAvL10KQVPuhTMKiWkuRiUd+ cxdVjS7Uh/zn9ollCRnUqgr0gOEivebC5Nh1iCX1dkE/RSp3uhB5FmX17+unkVUBPQvP mRlA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z2si1045664edx.317.2020.05.06.06.09.05; Wed, 06 May 2020 06:09:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728592AbgEFNEr (ORCPT + 99 others); Wed, 6 May 2020 09:04:47 -0400 Received: from foss.arm.com ([217.140.110.172]:36264 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728045AbgEFNEr (ORCPT ); Wed, 6 May 2020 09:04:47 -0400 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 63B95D6E; Wed, 6 May 2020 06:04:46 -0700 (PDT) Received: from [10.57.31.214] (unknown [10.57.31.214]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 64E833F68F; Wed, 6 May 2020 06:04:43 -0700 (PDT) Subject: Re: [PATCH v2 1/2] arm64/crash_core: Export KERNELPACMASK in vmcoreinfo To: Will Deacon Cc: linux-arm-kernel@lists.infradead.org, kexec@lists.infradead.org, linux-kernel@vger.kernel.org, Catalin Marinas , Bhupesh Sharma , Vincenzo Frascino , James Morse , Mark Rutland References: <1587968702-19996-1-git-send-email-amit.kachhap@arm.com> <20200504171741.GD1833@willie-the-truck> <20200506123112.GF8043@willie-the-truck> From: Amit Kachhap Message-ID: <590176f0-802b-f71a-0c1e-00283808e1d8@arm.com> Date: Wed, 6 May 2020 18:34:20 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <20200506123112.GF8043@willie-the-truck> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On 5/6/20 6:01 PM, Will Deacon wrote: > On Wed, May 06, 2020 at 05:32:56PM +0530, Amit Kachhap wrote: >> On 5/4/20 10:47 PM, Will Deacon wrote: >>> On Mon, Apr 27, 2020 at 11:55:01AM +0530, Amit Daniel Kachhap wrote: >>>> diff --git a/arch/arm64/include/asm/compiler.h b/arch/arm64/include/asm/compiler.h >>>> index eece20d..32d5900 100644 >>>> --- a/arch/arm64/include/asm/compiler.h >>>> +++ b/arch/arm64/include/asm/compiler.h >>>> @@ -19,6 +19,9 @@ >>>> #define __builtin_return_address(val) \ >>>> (void *)(ptrauth_clear_pac((unsigned long)__builtin_return_address(val))) >>>> +#else /* !CONFIG_ARM64_PTR_AUTH */ >>>> +#define ptrauth_user_pac_mask() 0ULL >>>> +#define ptrauth_kernel_pac_mask() 0ULL >>> >>> This doesn't look quite right to me, since you still have to take into >>> account the case where CONFIG_ARM64_PTR_AUTH=y but the feature is not >>> available at runtime: >> >> Yes agree with you here. However the config gaurd is saving some extra >> computation for __builtin_return_address. There are some compiler >> support being added in __builtin_extract_return_address to mask the PAC. >> Hopefully that will improve this code. In the meantime let it be like this. > > Does the extra computation matter? Isn't it just a couple of instructions? ok sure. I will push v3 as you suggested. Thanks, Amit > > Will >