Received: by 2002:a05:6358:700f:b0:131:369:b2a3 with SMTP id 15csp1386192rwo; Wed, 2 Aug 2023 13:13:08 -0700 (PDT) X-Google-Smtp-Source: APBJJlGjkpBmQ6Qcv85A1ehH7k1LvjlivWHoRhftlfaFGLZGfVsvR1LY5nopJzgRriRBwVkQXckI X-Received: by 2002:a17:902:e543:b0:1bb:8725:f537 with SMTP id n3-20020a170902e54300b001bb8725f537mr17980490plf.66.1691007188417; Wed, 02 Aug 2023 13:13:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691007188; cv=none; d=google.com; s=arc-20160816; b=W4cRS8uvau8U8LNGTH7pYFO7m4e1BzYzmsbi1NpZys8/YkdMYNPbqg0dZhNgnMcVPD Cu3hur9ZG8GQCoRt6orIaUXHw+PYwYzuVYcdCpUVDyFp0r/JieB2Cq6t/spE23vN0c+7 XMALEXNpHU+VQ5XrXO2G3hCDMoBJ4t5sLF1BURNgkC8ucVARez3IaYq7knjiEC7nsPyE QiqmRJkt1U69Bn2tl0HB7dJxVWWPwxUNNFgTqyqEBOcMwkIcGkNBiw/V1x9QCn/JLoJU 95MJJey6rjbdWzBZT/dmz90p3pHmbSRwzJqUrWREaHyRRPN98pv378seqeg9UN1Hm9jT MS3A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:subject:cc:to:from:date:references:in-reply-to :message-id:mime-version:user-agent:feedback-id:dkim-signature :dkim-signature; bh=SmMQ6kJN4Wc3hcGgVxP+bMiAcMtZCScse6Dh72DQZNY=; fh=yxR1lBqxKJbFZUNdibrOYLrUCrsGsxcmLnNDMN1N0MQ=; b=SM3Gi594twzOLznCImXB8ApExPXz8YJcoPdWzSiTGTW8fClHt5S0CgmbUOuDnlFGqL KqBmJdo8VNSuz43v1ZuNwU2xWOxtY9S7UkOEA97YLTMF1Bx9fsXKZO4NP5KVk4MrubnT 8zloipO8v9n2HsENvfBBm1+CADBTOckMqos5AppqV2I51FCXEJMZfrHS3KMAA2PP4Jol MZwuVj8ZuSx40mP14Hm12nfULJqF3JrB0+vstxuF3n8rqgGEtCfbRX83BPnrfNtGqqyQ iEvR/C6oSO/boBl1bWa+Ful+DerRZ2AHhZd2Y4YYVM5bHDqbpoW9+e9vJvAxO21/ndRF SEUA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@arndb.de header.s=fm2 header.b=RS2lZDrq; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=xi6gI5pR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h17-20020a170902f2d100b001b86dfad851si10004267plc.253.2023.08.02.13.12.55; Wed, 02 Aug 2023 13:13:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@arndb.de header.s=fm2 header.b=RS2lZDrq; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=xi6gI5pR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232704AbjHBSSj (ORCPT + 99 others); Wed, 2 Aug 2023 14:18:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33852 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232364AbjHBSSd (ORCPT ); Wed, 2 Aug 2023 14:18:33 -0400 Received: from wout1-smtp.messagingengine.com (wout1-smtp.messagingengine.com [64.147.123.24]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7B5832103; Wed, 2 Aug 2023 11:18:27 -0700 (PDT) Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailout.west.internal (Postfix) with ESMTP id 498BF3200754; Wed, 2 Aug 2023 14:18:23 -0400 (EDT) Received: from imap51 ([10.202.2.101]) by compute6.internal (MEProxy); Wed, 02 Aug 2023 14:18:24 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arndb.de; h=cc :cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm2; t=1691000302; x=1691086702; bh=Sm MQ6kJN4Wc3hcGgVxP+bMiAcMtZCScse6Dh72DQZNY=; b=RS2lZDrqYqL/YCzd28 LQCEyYTBpZ9AsOx0epUPG7MNbrjDFXtbn2z9kisIrwzEFRddS8DfdcM4pINxZ//S 5OZE92Kstnns7ub7HeGv0fpTJBX8OtBSFKJpxGDUGHF8XRBobYAx/rMNGnyCjym7 YMESHJFdKICPLHtuv6ikqbcVe3W7vyxG+OaoTho+CZi9nYIvCwjRJdKhf57NElLn jPBvbA2kRk8Sx+ttZ0omoSfqXeXMjP/gBLwz+9y5dTYLnxLIhGtXkGiqnOpt9v5m 43bdfIu9/HZyez1rthW6GvPxKTxX20wVPxAZiNEZjpSFXabaFM6wVQdH0mFK2RUy vAKw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; t=1691000302; x=1691086702; bh=SmMQ6kJN4Wc3h cGgVxP+bMiAcMtZCScse6Dh72DQZNY=; b=xi6gI5pRORVFWj2yXsvH8AwNVpnA9 A5a1Fyq0dj4s0Io3/eZsSzAY4OFS64wWHck4CM0gPb81+pJadaLf00nsSoPmHJGI yqdSVZAjgY8ehq3RhWDC8UYbVMzAjmVMcHBwywcIOa99Qy8QIUW+xbMGwUSFU/Hs FsKW2jX4AqemuoL3171ZDDO0JyfwO5hM/zB1YSrSGeShaHj08n4uujRORratQFhl PdYVWLxvY+XY+sg3MZG5ljs1mFykrJFTKazhDfBDkPHOoXt9PCcCQyRrdFxl5fzU UzHNPG8eosDSYySxkWrL7sJIGGLzV7IY67xLvNFuQEpYFlAws4/AKP5Bw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedrkedtgddvjecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefofgggkfgjfhffhffvvefutgesthdtredtreertdenucfhrhhomhepfdetrhhn ugcuuegvrhhgmhgrnhhnfdcuoegrrhhnugesrghrnhgusgdruggvqeenucggtffrrghtth gvrhhnpeffheeugeetiefhgeethfejgfdtuefggeejleehjeeutefhfeeggefhkedtkeet ffenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrrh hnugesrghrnhgusgdruggv X-ME-Proxy: Feedback-ID: i56a14606:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id 9F7D1B60089; Wed, 2 Aug 2023 14:18:21 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.9.0-alpha0-624-g7714e4406d-fm-20230801.001-g7714e440 Mime-Version: 1.0 Message-Id: In-Reply-To: References: <20230801-bitwise-v1-1-799bec468dc4@google.com> <20230802161553.GA2108867@dev-arch.thelio-3990X> Date: Wed, 02 Aug 2023 20:17:32 +0200 From: "Arnd Bergmann" To: "Linus Torvalds" , "Nathan Chancellor" , "Michael Ellerman" , "Will Deacon" , "Catalin Marinas" Cc: "Nick Desaulniers" , "Tom Rix" , Linux-Arch , linux-kernel@vger.kernel.org, llvm@lists.linux.dev, linuxppc-dev Subject: Re: [PATCH] word-at-a-time: use the same return type for has_zero regardless of endianness Content-Type: text/plain X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Aug 2, 2023, at 19:37, Linus Torvalds wrote: > On Wed, 2 Aug 2023 at 09:16, Nathan Chancellor wrote: >> >> We see this warning with ARCH=arm64 defconfig + CONFIG_CPU_BIG_ENDIAN=y. > > Oh Christ. I didn't even realize that arm64 allowed a BE config. > > The config option goes back to 2013 - are there actually BE user space > implementations around? At least NXP's Layerscape and Huawei's SoCs ended up in big-endian appliances, running legacy software ported from mips or powerpc. I agree this was a mistake, but that wasn't nearly as obvious ten years ago when there were still new BE-only sparc, mips and powerpc put on the market -- that really only ended in 2017. > People, why do we do that? That's positively crazy. BE is dead and > should be relegated to legacy platforms. There are no advantages to > being different just for the sake of being different - any "security > by obscurity" argument would be far outweighed by the inconvenience to > actual users. > > Yes, yes, I know the aarch64 architecture technically allows BE > implementations - and apparently you can even do it by exception > level, which I had to look up. But do any actually exist? > > Does the kernel even work right in BE mode? It's really easy to miss > some endianness check when all the actual hardware and use is LE, and > when (for example) instruction encoding and IO is then always LE > anyway. This was always only done for compatibility with non-portable software when companies with large custom network stacks argued that it was cheaper to build the entire open source software to big-endian than port their own product to little-endian. ;-) We (Linaro) used to test all toolchain and kernel releases in big-endian mode as member companies had customers that asked for it, but that stopped a while ago as those legacy software stacks either got more portable or got replaced over time. Many Arm systems won't boot BE kernels any more because UEFI firmware only supports LE, or because of driver bugs. Virtual machines are still likely to work fine though. I'm fairly sure that all Arm Cortex and Neoverse cores still\ support BE mode in all exception levels, OTOH at least Apple's custom CPUs do not implement it at all. Arnd