Received: by 2002:a25:23cc:0:0:0:0:0 with SMTP id j195csp1686350ybj; Wed, 6 May 2020 03:27:01 -0700 (PDT) X-Google-Smtp-Source: APiQypIZ3bjCwmXyeq6RYVhr4viyq00QZQ/hxwCKFtnrPQcvdVCMVofmwJHpeDSeC5WIKv8VBBEW X-Received: by 2002:aa7:d892:: with SMTP id u18mr6247571edq.156.1588760821233; Wed, 06 May 2020 03:27:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588760821; cv=none; d=google.com; s=arc-20160816; b=aItXUmSiZieR23hrRJ2Y6MdytDUYG9TjOuXjbKLGdndxj3OH/moC6wY7VL33SW6GXj GOuC95Afe9dWgY2gZ3stJH+P1UxhSJIS8O3I/lr5u26PKTewYCMNLp0Ut7mc2vZQvZjH 749f7c6lFJBAUhlFPEUjpvhnWIxN5wNDE2jZXUum68xKxZIuSmu3q0CrPlzNPqbw5Ezq TCiF8gHRQwqSlp8G6fwB4it24OQenwjg6HI0f4CVY43OzTOSnFqkbKKtzOvLrQTtEtSE irQ8g0LRs3Z3xlCE58WxPgYbTSXYgtM1Ki9kl7Y1dROd7nGjnypJ2DwGR7AKSi8tDi8b 5RIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version; bh=SbIWR3SErpHRrKzfxuoJeMiKhIiouyJcOJIG4Y8Ut5g=; b=pWgdzO8ZWbHYCBrt83PKPoI0HQeeSJe43Iv9NcWkGxDV5jAuzxq5MoKtRactGI2w3k vZzVYOZpoKj3Z8RmMu7/Q5rUoTkyzq7acgZQzZ4JoWqw/oG7PbasUQ6KElASwttMP8M/ KW1EhRRsmkTmn7X2XAHNbjF0/W/SuaQ6zHui0rviWVGIk953Lq/vrNVreTm/vBrlYFrz DIlqBHBwPq4zYKUIz5q/2gXPgRX9rqo4e/wxuoNJ5i4zNc0CdLyeGpyDQQ2buIcSh/h5 wwJo5Arm1SeoBAlWi32lX9Vlt0f2Dw2IIYAXVtTHBAEdhTLrJt3FvcSbQtiyv/7cCzT8 J9Zw== 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 v3si80315edi.195.2020.05.06.03.26.37; Wed, 06 May 2020 03:27:01 -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 S1729041AbgEFKXS (ORCPT + 99 others); Wed, 6 May 2020 06:23:18 -0400 Received: from mout.kundenserver.de ([212.227.126.134]:33855 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726354AbgEFKXR (ORCPT ); Wed, 6 May 2020 06:23:17 -0400 Received: from mail-qt1-f177.google.com ([209.85.160.177]) by mrelayeu.kundenserver.de (mreue012 [212.227.15.129]) with ESMTPSA (Nemesis) id 1MmQUL-1ioS942yyv-00iVlS for ; Wed, 06 May 2020 12:23:15 +0200 Received: by mail-qt1-f177.google.com with SMTP id l18so989997qtp.0 for ; Wed, 06 May 2020 03:23:15 -0700 (PDT) X-Gm-Message-State: AGi0PuaB37Yem6/VamAStebf1HvcWugXdLjovtCd5IS1ZpPYW8bRIwWd KflbCHboLNbfCE1MAkFhobnA2mnXDhJoZXyIM6E= X-Received: by 2002:ac8:2bce:: with SMTP id n14mr7247646qtn.18.1588760594548; Wed, 06 May 2020 03:23:14 -0700 (PDT) MIME-Version: 1.0 References: <20200505141257.707945-1-arnd@arndb.de> <20200505142556.GF82823@C02TD0UTHF1T.local> <20200505194243.5bfc6ec6@blackhole> <20200506034523.GA564255@ubuntu-s3-xlarge-x86> In-Reply-To: <20200506034523.GA564255@ubuntu-s3-xlarge-x86> From: Arnd Bergmann Date: Wed, 6 May 2020 12:22:58 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] arm64: disable patchable function entry on big-endian clang builds To: Nathan Chancellor Cc: Torsten Duwe , Mark Rutland , 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 , "linux-kernel@vger.kernel.org" , clang-built-linux , Fangrui Song Content-Type: text/plain; charset="UTF-8" X-Provags-ID: V03:K1:DBFf79e2HDVCGSZUDxn6IOV+QVQgJN237vSxdArlmWB/yLex+bT 08rNvKMzsQ7YjLFyl9Ur2d5xMp+FC53rDJc63JWEJksvJCTr6rac8pJUiscDjJXPU26sG8i 5A7O0VCYYncf/tjPU7TnYu76rpD+wrT5pJsyEUtl1sEUm8SqH7cjbffabHwBBCM7pKKlvVm e11DFT1jpY2vSDMa5I6SQ== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:OhvwMSvbUOU=:vN8iUfWiF5Y0isCPVpvWO5 imYw2ndSZzRjFfzlfutk1iyybPyICSIQWBuj0QW9C0eMd1QujCzAWp+vIXzdnOppGaBtfPYib ajvbn3d1R9TpKGFr/nQV6Z3f90B/2yC5Gq8A0HL52BPo2Ek2Vg0RfT2Qi1lNCTcC+Xy1yJVT6 mIYKYANaEUTolPfGWKQfRMxPclZyKBnNGd8oUEbu37Q8JPg/izw2r8gZVChEwHwr7SR0MeFHq UiJvGTWoaWqYn2LgaSyBoj8cWSJ295jTzeEvHdnFp1NOuORQPObgu7IKRnHPSUIfu/MYfxKPT AEXigwnseWF5GSWqEWbwPs2+xR0Wx1QfCXUdBVPqw+jaBae3NNGn5E8Vaj/V8i+PD1UyBb+oY gJKOCwuTMKPKKijo9p27p4YN+n+wueNrObnEHD6kbWfssNW+4MiGaRk+jXzbBNnVOKTegkh7t NM2/JUNEJ1WXCjmCsIAcMNCRDtbi91Lbbr0HHibaTGOfXqA6EvqKjyoLmWiYihQGZqjRvEBnE N8tRwhsQ414pbdQMauUxFTvmc9OoDOLVp5d3fBb4rvtlcEUsx7dkDjOO3GdwaLzsZ18cDP6x6 1EIU5qD87flryNu98opMpV2zyM1522afAtZNX5dTt52ycrUXW5UtwFmZSTrZYQbBFRp2fbbVV dMHh/x0Lz1j7SgN3z+kMXb69KAQmdZNvB6CRvSlw/2DnoxRYWtKYQbBFY0s6NlOe1vyMRHwlL LigKoKJUBi/ONT9Rh6Sx3MZ9YYk8YnBrMFMhD3JKYZwlNU4iZFNuitUSuP7hwv5SBI1Dw0nyB U+56mYwxowe2ceo8ZdM0ceO2vSQTx/33IZuLm5UFRwAtiHfVgg= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. 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? 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