Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp2354758ybb; Mon, 30 Mar 2020 04:44:41 -0700 (PDT) X-Google-Smtp-Source: ADFU+vsMwvfQWa3OQlkKz3R7l5LXZZ0Lj4OCC3LlflVHZerVGVLEPMqdwVY3/WdLFd4IbTM90P/l X-Received: by 2002:a05:6808:6cb:: with SMTP id m11mr2946773oih.130.1585568681740; Mon, 30 Mar 2020 04:44:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585568681; cv=none; d=google.com; s=arc-20160816; b=oMU3V6zo6LEWSfVO3YBMJzD5RAahER67b6HocSk6N2k7VVbgBVVh8Lc2vNXFE7sXBq tyIvKsOR6fTJSANRw+tV45CJPSZ88rTGoE0nMHsdx0wLOGr8fssIMRFJzUi+OB97WbrJ tLtVnAwM1da4z1j/zdBUPQpiYyWl0KmODtmkAdP3K1ZNPKdeV2PF3WQ308lsN8WdiRFc wltR3hupFVbt9lAM8wgOyVVfMCvE6f2A4vpBT/PhraqM3j/JaFkFDI3RKuvZNrojMErS jOopXc61sE2TlmdWzSC3jq4G4MLALnczXF1E55X0gNtlSLjSWWDiLbV2rmkYh9SAqac+ 7APw== 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=hVa8JA/RYyLlcM8Ek9EvxQ06OhwsCecYtJ3jW7MdzJ8=; b=kRI6rjSP6jz8kqMERxU0MztcSD5YExaH25za6S7nYOMhzBZqUh+IndVfyMh8UWPdvH 1XtntcrBZl+0Y4wtmrvNN01QZopGjQfy2iK6yb038iMvVRuU9NeDmGSkCUQc98P8X6Bb Hr778ogwUfcA79UkG1FXJxW3w19de0aRIMcw4zYnH7PqsNVKCQ6o3Gsr5VFYmIZTn8vb Tbo6sbJiJsWuItWFTAZsInWAc1dvk9MbXI3/GAaFtJ6LiVxoPHtBnlfYX6fU66Swr3DU u2QiDfs5OasBWQAVildWFbX4pqaqOzGkh26xqErnBwbRdc3FiUXDl9NF3q19VZIH7IXT ojEQ== 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 m7si4820429oim.179.2020.03.30.04.44.29; Mon, 30 Mar 2020 04:44:41 -0700 (PDT) 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 S1729759AbgC3Lnu (ORCPT + 99 others); Mon, 30 Mar 2020 07:43:50 -0400 Received: from foss.arm.com ([217.140.110.172]:51394 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729669AbgC3Lnu (ORCPT ); Mon, 30 Mar 2020 07:43:50 -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 E58C931B; Mon, 30 Mar 2020 04:43:49 -0700 (PDT) Received: from [10.57.27.249] (unknown [10.57.27.249]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 4CC943F52E; Mon, 30 Mar 2020 04:43:48 -0700 (PDT) Subject: Re: [PATCH 2/2] arm64: Kconfig: ptrauth: Add binutils version check to fix mismatch To: Catalin Marinas Cc: linux-arm-kernel@lists.infradead.org, Will Deacon , Vincenzo Frascino , linux-kernel@vger.kernel.org References: <1585236720-21819-1-git-send-email-amit.kachhap@arm.com> <1585236720-21819-2-git-send-email-amit.kachhap@arm.com> <20200327125522.GB18117@mbp> From: Amit Kachhap Message-ID: <497d96a1-0532-ca18-8eaa-79fbcfd0b87d@arm.com> Date: Mon, 30 Mar 2020 17:13:44 +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: <20200327125522.GB18117@mbp> 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 On 3/27/20 6:25 PM, Catalin Marinas wrote: > On Thu, Mar 26, 2020 at 09:02:00PM +0530, Amit Daniel Kachhap wrote: >> Recent addition of ARM64_PTR_AUTH exposed a mismatch issue with binutils. >> 9.1+ versions of gcc inserts a section note .note.gnu.property but this >> can be used properly by binutils version greater than 2.33.1. If older >> binutils are used then the following warnings are generated, >> >> aarch64-linux-ld: warning: arch/arm64/kernel/vdso/vgettimeofday.o: unsupported GNU_PROPERTY_TYPE (5) type: 0xc0000000 >> aarch64-linux-objdump: warning: arch/arm64/lib/csum.o: unsupported GNU_PROPERTY_TYPE (5) type: 0xc0000000 >> aarch64-linux-nm: warning: .tmp_vmlinux1: unsupported GNU_PROPERTY_TYPE (5) type: 0xc0000000 >> >> This patch enables ARM64_PTR_AUTH when gcc and binutils versions are >> compatible with each other. Older gcc which do not insert such section >> continue to work as before. >> >> This scenario may not occur with clang as a recent commit 3b446c7d27ddd06 >> ("arm64: Kconfig: verify binutils support for ARM64_PTR_AUTH") masks >> binutils version lesser then 2.34. >> >> Reported-by: kbuild test robot >> Suggested-by: Vincenzo Frascino >> Signed-off-by: Amit Daniel Kachhap >> --- >> arch/arm64/Kconfig | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig >> index e6712b6..73135da 100644 >> --- a/arch/arm64/Kconfig >> +++ b/arch/arm64/Kconfig >> @@ -1503,7 +1503,7 @@ config ARM64_PTR_AUTH >> default y >> depends on !KVM || ARM64_VHE >> depends on (CC_HAS_SIGN_RETURN_ADDRESS || CC_HAS_BRANCH_PROT_PAC_RET) && AS_HAS_PAC >> - depends on CC_IS_GCC || (CC_IS_CLANG && AS_HAS_CFI_NEGATE_RA_STATE) >> + depends on (CC_IS_GCC && (GCC_VERSION < 90100 || LD_VERSION >= 233010000)) || (CC_IS_CLANG && AS_HAS_CFI_NEGATE_RA_STATE) > > We should add some of the comments in the commit log to the Kconfig > entry. I would also split this in two (equivalent to CC_IS_ implies): > > depends on !CC_IS_GCC || GCC_VERSION < 90100 || LD_VERSION >= 233010000 > depends on !CC_IS_CLANG || AS_HAS_CFI_NEGATE_RA_STATE > > and add a comment above the gcc/ld version checking. > > (not entirely identical to the original if CC is neither of them but I > don't think we have this problem) Re-posted v2 as per the suggestions. Thanks, Amit >