Received: by 2002:a25:23cc:0:0:0:0:0 with SMTP id j195csp978548ybj; Tue, 5 May 2020 10:45:19 -0700 (PDT) X-Google-Smtp-Source: APiQypL59Vj18HjOWPCcLIK5gMLhy9mSWg11Nz5gC7fNPKWd6L1UFdsr7R2dbVwhhX1hqUzei4wb X-Received: by 2002:a50:f095:: with SMTP id v21mr3717650edl.103.1588700718819; Tue, 05 May 2020 10:45:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588700718; cv=none; d=google.com; s=arc-20160816; b=yEYAsmELqsINdsQZIF0a7D5Gn/3ez1bsktre9UfSdeBWCA+ncwBsTjATHQ9VDv2Ywr iUJVNe9gABFAYOfAjELRT2/RThQuoF985PxaqWNsrvcbdxdS9ohg+61sC0DBJv31ADnO jaqO4F9p4r1zTfhJ9JsXq3cntIa6CYcTrQQLDK7wj+rWF9IZLgUrnl3z7AcYiANTBPpO feRA7fUKg/AODU82jCQVYPo11sDwIaTO36YdJNVV0UTUJarjZy/WS36KkVXnPJhVsok4 9oZlZdC8XIDWOOehJ2cXqv9CNHGLkSHLQac45JrPqi7FTbb1QCYKqqJEkQiJ2PzyJOme tNnA== 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:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date; bh=9hER+xjeLTySbc0OMv+yqXPdSFAiL4DNxII6xXGHaWs=; b=WL1xAFO1YrK0pY62M3WgxUgxu0sQj57aJaJJTgcw5F5BCjT36s2epdfNf0dV9Qgf6X tOc5gbCRuonMjANlXGsNyAqtwmhogx9xJ14qVg4oKPAjvsrG0K8DkATVUvJfQ18z3aLG 0RjJmoPDO6BzLSrs+DbbjFIH2evgsSnKM/iprzxPuDJ42+vuA+5E+tQdlxtW6AD/935r XkfjrIQEEZP2m2YF9OIJDzvIOfGSETgDUVMbDIcvYBHXNVhvoPqXh/Xpp7ekTRQxpVzN jUFHYawN9DaAyRSSq8E9dyE5hQ9CRU5ApTc9RaN46o5MZSktiFIcNTKkMrGO4Qd6E9pA Eflg== 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 cy17si1727977edb.84.2020.05.05.10.44.56; Tue, 05 May 2020 10:45:18 -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 S1730408AbgEERnQ (ORCPT + 99 others); Tue, 5 May 2020 13:43:16 -0400 Received: from verein.lst.de ([213.95.11.211]:36572 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729315AbgEERnQ (ORCPT ); Tue, 5 May 2020 13:43:16 -0400 Received: by verein.lst.de (Postfix, from userid 107) id 3590468CEC; Tue, 5 May 2020 19:43:14 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on verein.lst.de X-Spam-Level: X-Spam-Status: No, score=-0.2 required=5.0 tests=ALL_TRUSTED,BAYES_50 autolearn=disabled version=3.3.1 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 Cc: Arnd Bergmann , Catalin Marinas , Will Deacon , Ard Biesheuvel , Amit Daniel Kachhap , Torsten Duwe , Ard Biesheuvel , AKASHI Takahiro , Josh Poimboeuf , Julien Thierry , Andrew Morton , Marc Zyngier , Kees Cook , Alexandre Ghiti , Kristina Martsenko , Ionela Voinescu , Steve Capper , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, clang-built-linux@googlegroups.com 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 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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 > >