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=-5.2 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,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham 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 95319C28CBC for ; Wed, 6 May 2020 13:04:55 +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 6528520752 for ; Wed, 6 May 2020 13:04:55 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="jkC88AG9" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6528520752 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-Type: Content-Transfer-Encoding:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date:Message-ID:From: References:To:Subject:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=AQspeWbtuWOOh9MuEavGl+qh1TGWFxG5fqOOQcAJA/o=; b=jkC88AG9GRBvAZvrWB6Gj9JSd MgV8VF/+OlMiEqjSYtDElG3OXPSInJr2KQ5Rx+WnehAb/iOJyhJdu7MO05TY/0FfOXDc5pM4B9v93 Fd5+ZzQO88DKWL6ds5Rre2DFClfOZWh46/jzebwL02gaWHWVVCLUi6EzvUSH0PZCm3PwgRXj39MC+ teYm+g/GcUcowQOY5gJjYAJv5uYyYbiByKKp6zqHBkxkW5iU7/HHHa8QNeA7/9lEarBAyhOUIlOl8 sZGMo4+guKAUfWfGVsOfYp7ukWeyUu67GpnwtvMgHi54XLxexFI3tFDtRZR3GZBLJxXxyqmd0Fq2W k64Kyknrg==; 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 1jWJjG-0008JR-Al; Wed, 06 May 2020 13:04:50 +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 1jWJjD-0008IM-7x; Wed, 06 May 2020 13:04:48 +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 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 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-Language: en-US X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200506_060447_322757_41BD931A 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 , Catalin Marinas , Bhupesh Sharma , kexec@lists.infradead.org, linux-kernel@vger.kernel.org, James Morse , Vincenzo Frascino , linux-arm-kernel@lists.infradead.org Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.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 > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel