Received: by 2002:a25:23cc:0:0:0:0:0 with SMTP id j195csp1995260ybj; Wed, 6 May 2020 08:50:10 -0700 (PDT) X-Google-Smtp-Source: APiQypKRf3dAcblCF1TxNRo/DzGRii7fENINqpXDOWtnWwIyl8jyvMF1Fd3q6exeVgDJSFy2p1mD X-Received: by 2002:a17:906:f106:: with SMTP id gv6mr8169991ejb.271.1588780210753; Wed, 06 May 2020 08:50:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588780210; cv=none; d=google.com; s=arc-20160816; b=dW4eL9zqmrdCqYXfSP+ZTeCnGV1cmzL4wISm1oFpJ4CZ5dZ7OnZgWalNCgxtAaDQVn G8PmS1X4HZ9/LTLVVGvguGgIlGi8Tcn268xNDZyOxDGoDZAIIuvFK5y3lmVZ1c/vNx3o u345FqZt7VdYgYz6C/7i8Wha5jbq7y7sbSxeqLGVe2kX/UfVeNFIbRs1hr+hZaQCAYmq LQRyg92RImF5FARfI2k1ua3hueWNHhIapQN5CHD/ui/6NHMzsLa91oPcXNRJljko74RN o62MEFgp4jaaRyK2tVahVlfmz5ix/bQMjOz9lQ3ScO5MUmSr/jDTNPL5bCKR4QyBxqOT Bh3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=+AoWjl9qm/9ONcKycsC0yd4jPr3qRbLth7/5z1t+XVo=; b=HE5Y7fMaxSYZKDME3DE6Zxrp24mQCP+X89/N6yjg6KfDsIKpKZ4IXObmzaywYMODCT St5YjoMCAk2oWY+ZQScVA/o7auFzIvRK+ts/D8/G0eR16ArA/RgErMCb0AZfF2lC3rLT XSWYaq6x1OCsklPXutbjhxddPC3ltGJQZjpuao5OunPPZTUC4V6fzLSMQCQPjC+Yge0/ DNPNKUNciQm2pdz6RkIOFwJ6SqQ2bsWzxOcR6Wrf/m3lSYrb0g2Ndz7Ol0yR1hBtG0df aHUleLUJHDz4cf0gKWsyL6q/6Le75pG/dE9H0ORoVHsUz8gwqqc/Ooa5s7slap1HuGRT 1yYg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=TcJwiF9P; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x15si1304040edl.247.2020.05.06.08.49.46; Wed, 06 May 2020 08:50:10 -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; dkim=pass header.i=@google.com header.s=20161025 header.b=TcJwiF9P; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729503AbgEFPqD (ORCPT + 99 others); Wed, 6 May 2020 11:46:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33834 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729148AbgEFPqD (ORCPT ); Wed, 6 May 2020 11:46:03 -0400 Received: from mail-pj1-x1044.google.com (mail-pj1-x1044.google.com [IPv6:2607:f8b0:4864:20::1044]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 02C0EC061A0F for ; Wed, 6 May 2020 08:46:02 -0700 (PDT) Received: by mail-pj1-x1044.google.com with SMTP id a5so1091479pjh.2 for ; Wed, 06 May 2020 08:46:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=+AoWjl9qm/9ONcKycsC0yd4jPr3qRbLth7/5z1t+XVo=; b=TcJwiF9PZJ7weYuO7y5YljNF/n80dtvLxhRuBe3ZyDkIc/4wV5E/MZPhnlFGn9ocv4 YBYDfadH8szxYIYL+r6z3W09w6cEDJ31wp9dskHioIjVDyTmJnX8M552EwQya9gu/Bre y0h/R9JdLaMiA7vpQqitsz//Jlmpx24z9YOnUanV53vffwnQFN7feRX2i7F8P4idZ83n QzEmaQYeuFB5RrPn9Y1BdikXDWTZeODBAvMsoyXrEXkXMQZk4flzNsBdDU6Zx9DC68Kp BGrmdrPw7B4Tary1iOpPmeQTbFSYfQMLTiCvuZrXWGLHQ3mif0aEXth1jdbIkLMwVrKM 6kUg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=+AoWjl9qm/9ONcKycsC0yd4jPr3qRbLth7/5z1t+XVo=; b=ngdHrPPp+ys0Uz5hCtvYvVHFL9U7jQqx7vTb97nox1sYygxE4cUR6aW08JNPL4yQOn MFfCRz3CyQRpnG7q++PzHgFrnKVWBgDUjlFIDzvhXZzBL9QSXQB4SQ99hxMrnLAhNgg2 Xa6pjDlxBx5svpsfjPOnwGosC8do++AW9MQUgHYgYsZ53yvPNlzLyXDP1Hdb/7UJzCa9 wgDH0m3hSeU7UyxFvLz8jEkevMOtskDSuRAGodNG7sfi6lfqWE2trcKhQ6OoME+1CbBB wWjMiltLjRpzuGirGuwUK757w1hP3wlbpWbKNYHa30exhz9thUr0OQt+a7wUQn0G0i// 3Aqg== X-Gm-Message-State: AGi0PuawQy11RYIWLMPE+skvcS/sU/BDw4JIuJJs1A3f5uBTrL7Al38k WylvzcKYthHsNnaINv5Ru58scA== X-Received: by 2002:a17:90a:a888:: with SMTP id h8mr10608900pjq.174.1588779961070; Wed, 06 May 2020 08:46:01 -0700 (PDT) Received: from google.com ([2620:15c:2ce:0:9efe:9f1:9267:2b27]) by smtp.gmail.com with ESMTPSA id i18sm5217925pjx.33.2020.05.06.08.45.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 May 2020 08:46:00 -0700 (PDT) Date: Wed, 6 May 2020 08:45:56 -0700 From: Fangrui Song To: Nathan Chancellor , Ard Biesheuvel Cc: Arnd Bergmann , Torsten Duwe , Mark Rutland , Catalin Marinas , Will Deacon , 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 , "linux-kernel@vger.kernel.org" , clang-built-linux Subject: Re: [PATCH] arm64: disable patchable function entry on big-endian clang builds Message-ID: <20200506154556.5fsxzs3vbfwixggd@google.com> References: <20200505141257.707945-1-arnd@arndb.de> <20200505142556.GF82823@C02TD0UTHF1T.local> <20200505194243.5bfc6ec6@blackhole> <20200506034523.GA564255@ubuntu-s3-xlarge-x86> <20200506153156.GA1213645@ubuntu-s3-xlarge-x86> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <20200506153156.GA1213645@ubuntu-s3-xlarge-x86> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2020-05-06, Nathan Chancellor wrote: >On Wed, May 06, 2020 at 12:22:58PM +0200, Arnd Bergmann wrote: >> On Wed, May 6, 2020 at 5:45 AM Nathan Chancellor >> wrote: >> > On Tue, May 05, 2020 at 07:42:43PM +0200, Torsten Duwe wrote: >> > > 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: >> > > > This practically rules out a BE distro kernel with things like PAC, >> > > > which isn't ideal. >> > >> > To be fair, are there big endian AArch64 distros? >> > >> > https://wiki.debian.org/Arm64Port: "There is also a big-endian version >> > of the architecture/ABI: aarch64_be-linux-gnu but we're not supporting >> > that in Debian (so there is no corresponding Debian architecture name) >> > and hopefully will never have to. Nevertheless you might want to check >> > for this by way of completeness in upstream code." >> > >> > OpenSUSE and Fedora don't appear to have support for big endian. >> >> I don't think any of the binary distros ship big endian ARM64. There are >> a couple of users that tend to build everything from source using Yocto >> or similar embedded distros, but as far as I can tell this is getting less >> common over time as applications get ported to be compatible with >> big-endian, or get phased out and replaced by code running on regular >> little-endian systems. >> >> The users we see today are likely in telco, military or aerospace >> settings (While earth is mostly little-endian these days, space is >> definitely big-endian) that got ported from big-endian hardware, but >> often with a high degree of customization and long service life. > >Ah yes, that makes sense, thanks for the information and background. >Helps orient myself for the future. > >> My policy for Arm specific kernel code submissions is generally that >> it should be written so it can work on either big-endian or little-endian >> using the available abstractions (just like any architecture independent >> code), but I don't normally expect it to be tested on big endian. >> >> There are some important examples of code that just doesn't work >> on big-endian because it's far too hard, e.g. the UEFI runtime services. >> That is also ok, if anyone really needs it, they can do the work. >> >> > > 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. >> > >> > We can file an upstream PR (https://bugs.llvm.org) to talk about this >> > (although I've CC'd Fangrui) but you would rather the kernel fail to >> > work properly than prevent the user from being able to select that >> > option? Why even have the "select" or "depends on" keyword then? Created https://reviews.llvm.org/D79495 to allow the function attribute 'patchable_function_entry' on aarch64_be. I think -fpatchable-function-entry= just works. Note, LLD does not support aarch64_be (https://github.com/ClangBuiltLinux/linux/issues/380). >> I definitely want all randconfig kernels to build without warnings, >> and I agree with you that making it just fail at build time is not >> a good solution. >> >> > That said, I do think we should hold off on this patch until we hear >> > from the LLVM developers. >> >> +1 >> >> Arnd > >Glad we are on the same page. > >Cheers, >Nathan