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_2 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 2E186C47254 for ; Tue, 5 May 2020 17:43:21 +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 D67B1206FA for ; Tue, 5 May 2020 17:43:20 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="OAVrYzwx" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D67B1206FA Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=lst.de 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:MIME-Version:References:In-Reply-To: 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=wItEUC5ZcdUzcV17eUU7o08L5x1OsHOCyHE2mCko8aA=; b=OAVrYzwxL8ofqf SC8n0OuuqxquguLPA37haBwEpeC4Y5IABLJEVOTmKnsALDeHWdwL0p6g6ucv5a5bVTxsegEWLLzuB gKk6tjPYcfbRZnTOGVjqRjxXt/VjUQ+hVCNpUBt+Z93HNykAJ4dn3bzbO2HLQIQODG85JjmQ5UPpN p2T+4IUGThzWOd20FFJ68fkPAm5k5OM/L8cjKhuAmn8Zz7wUU1d2hCv/xwvh9pK9hrVizvdOFQDMz 3SvCi77ERdk7pdBBJuntxgdDlwFoJwuiLTlcW0tVzRCt62axRaJCzqxNNOfct4ZlrfgpDVwYOgcBh bkt3WdkhUEIj3wqr6Llg==; 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 1jW1bE-0004CI-H4; Tue, 05 May 2020 17:43:20 +0000 Received: from verein.lst.de ([213.95.11.211]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jW1bB-0004Ae-Fb for linux-arm-kernel@lists.infradead.org; Tue, 05 May 2020 17:43:19 +0000 Received: by verein.lst.de (Postfix, from userid 107) id 51CB368C65; Tue, 5 May 2020 19:43:13 +0200 (CEST) Received: from blackhole (p5B0D8880.dip0.t-ipconnect.de [91.13.136.128]) by verein.lst.de (Postfix) with ESMTPSA id 4B6E268BFE; Tue, 5 May 2020 19:42:48 +0200 (CEST) Date: Tue, 5 May 2020 19:42:43 +0200 From: Torsten Duwe To: Mark Rutland Subject: Re: [PATCH] arm64: disable patchable function entry on big-endian clang builds Message-ID: <20200505194243.5bfc6ec6@blackhole> In-Reply-To: <20200505142556.GF82823@C02TD0UTHF1T.local> References: <20200505141257.707945-1-arnd@arndb.de> <20200505142556.GF82823@C02TD0UTHF1T.local> Organization: LST e.V. X-Mailer: Claws Mail 3.17.5 (GTK+ 2.24.32; x86_64-suse-linux-gnu) MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200505_104317_818583_CB9E6EFA X-CRM114-Status: GOOD ( 22.13 ) 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: Marc Zyngier , Ionela Voinescu , Julien Thierry , Arnd Bergmann , Ard Biesheuvel , Catalin Marinas , Torsten Duwe , Steve Capper , linux-kernel@vger.kernel.org, Kristina Martsenko , AKASHI Takahiro , Alexandre Ghiti , clang-built-linux@googlegroups.com, Josh Poimboeuf , Amit Daniel Kachhap , Andrew Morton , Will Deacon , Ard Biesheuvel , linux-arm-kernel@lists.infradead.org, Kees Cook 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 Hi Arnd, Mark and others, this may not be worth arguing but I'm currently fighting excessive workarounds in another area and so this triggers me, so I have to make a remark ;-) On Tue, 5 May 2020 15:25:56 +0100 Mark Rutland wrote: > On Tue, May 05, 2020 at 04:12:36PM +0200, Arnd Bergmann wrote: > > Clang only supports the patchable_function_entry attribute on > > little-endian arm64 builds, but not on big-endian: > > > > include/linux/kasan-checks.h:16:8: error: unknown attribute > > 'patchable_function_entry' ignored [-Werror,-Wunknown-attributes] > > > > Disable that configuration with another dependency. Unfortunately > > the existing check is not enough, as $(cc-option) at this point does > > not pass the -mbig-endian flag. > > Well that's unfortunate. :( > > Do we know if this is deliberate and/or likely to change in future? > This practically rules out a BE distro kernel with things like PAC, > which isn't ideal. But still better than cumulating workarounds. If clang's flags aren't orthogonal then that's a bug in clang. If I get a vote here I'm against it. > > Fixes: 3b23e4991fb6 ("arm64: implement ftrace with regs") > > Signed-off-by: Arnd Bergmann > > This looks fine for now, and we can add a version check in future, so: ^^^^^^^^^^^^^^^^^^^ see what I mean? And in the end another line of code you'll never again get rid of. I suggest to get a quote from clang folks first about their schedule and regarded importance of patchable-function-entries on BE, and leave it as is: broken on certain clang configurations. It's not the kernel's fault. > Acked-by: Mark Rutland > > Mark. > > > --- > > arch/arm64/Kconfig | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig > > index 4b256fa6db7a..a33d6402b934 100644 > > --- a/arch/arm64/Kconfig > > +++ b/arch/arm64/Kconfig > > @@ -151,7 +151,7 @@ config ARM64 > > select HAVE_DMA_CONTIGUOUS > > select HAVE_DYNAMIC_FTRACE > > select HAVE_DYNAMIC_FTRACE_WITH_REGS \ > > - if $(cc-option,-fies on y=2) > > + if $(cc-option,-fpatchable-function-entry=2) && > > !(CC_IS_CLANG && CPU_BIG_ENDIAN) select > > HAVE_EFFICIENT_UNALIGNED_ACCESS select HAVE_FAST_GUP > > select HAVE_FTRACE_MCOUNT_RECORD > > -- > > 2.26.0 > > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel