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=-8.2 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=unavailable 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 4B35CC2D0E5 for ; Fri, 27 Mar 2020 12:55:31 +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 12781206F2 for ; Fri, 27 Mar 2020 12:55:31 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="BP0OKtU0" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 12781206F2 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=ExKZfZpoqpqeSh9DrbI4wp8UPSyzhJT3IUsmtFi0l50=; b=BP0OKtU0iAYukX evh6lmAn/zJJvJa4lgHEH02uGeP1RDL3aBAwKhP+8w+RCjBacGXGwWLmwTMII8IvwITPagERUPyE4 cUDEgHVAF2PdbMUKAskWbeOj8m+pFWbHJAIpjqs2iYga5qvOKh8n49vgUfRtpbL8+891H1MoOhVWY I2PIUgSOHgGt7giDPDayuV+Rfx5NjyEviAUKcOT2iFZ/6JkpqWDTClgOwHtmWBt+paU6MIiKwTzFL S4DhAQnn+s9o/vjyCPsQAQ3GinZAhwF1c9On0EqORsH4QQrj9c+/25EkkkRuGJuUdg5RQanQUfcKb az8VRB5PI/Lll08d1A9A==; 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 1jHoWI-0004yT-Eb; Fri, 27 Mar 2020 12:55:30 +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 1jHoWE-0004xl-TY for linux-arm-kernel@lists.infradead.org; Fri, 27 Mar 2020 12:55:28 +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 06E1C7FA; Fri, 27 Mar 2020 05:55:26 -0700 (PDT) Received: from mbp (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 2B2AF3F71F; Fri, 27 Mar 2020 05:55:25 -0700 (PDT) Date: Fri, 27 Mar 2020 12:55:22 +0000 From: Catalin Marinas To: Amit Daniel Kachhap Subject: Re: [PATCH 2/2] arm64: Kconfig: ptrauth: Add binutils version check to fix mismatch Message-ID: <20200327125522.GB18117@mbp> References: <1585236720-21819-1-git-send-email-amit.kachhap@arm.com> <1585236720-21819-2-git-send-email-amit.kachhap@arm.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1585236720-21819-2-git-send-email-amit.kachhap@arm.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200327_055527_001067_AAB4B723 X-CRM114-Status: GOOD ( 18.39 ) 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: Vincenzo Frascino , Will Deacon , linux-kernel@vger.kernel.org, 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 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) -- Catalin _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel