Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp3535683yba; Mon, 29 Apr 2019 04:16:28 -0700 (PDT) X-Google-Smtp-Source: APXvYqwBeN1IEsta2TvJoo0RLqCnKRgRrw/PalIgrUKy1n+9Q0lx28es3eRww3L+i61062c3U2ev X-Received: by 2002:a65:5181:: with SMTP id h1mr36909805pgq.167.1556536587893; Mon, 29 Apr 2019 04:16:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556536587; cv=none; d=google.com; s=arc-20160816; b=nx9puZBUGRg5Qb/z+gUwOs7lH+PFtLyccSun12argU4IZQPOsomrQ6ouV+zx9P3737 PcEuBVjUxedN5JwI/rMoMaX2UhpVOzhUA9j6nTPTqQk4CzPjtM5/NT8dtuKhsE2Pe5zF uQlwAm/kugcKYLXOfKM/INv0h1xR/2YQKgUrIFAkVSUf2DfZceNIeZxUMQ/Fgl6AFP0f wvGJHRPpkzl2+a72UXdu9YRBYPhGkna5TxpSma5V6s2Xbqe3Xjc4LyBg7k2It1ctZ1+E YGu/lkkIYbJyqEumwgQefPozC+m0nJo7h8CAgyTMgA10VvdGSAIQTt2t904fwmt0DHrH 6qYw== 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=x28FrJjCiQBqslkV+zQDusUSdhRwlePNuGMIarDkv/M=; b=h4PnHq86xCMSiWCkSSrmC0Df2FVVaE9EQd+yQ8vtsRrou6x5bdYnxVPedzMQTp/TKL U+SLUmxOiPGBq4tZQ9xaYEYcWA9NvYk8/m+nuecxdt4NIxdGN/7mfoP/ffO28Uh7PYaC pQtAfH180yyUVfqhbbvD/+fkQHHljHgl8YkUlV7W6ymGZx1Lbo6JiQiwE8ApyolYunPm XBgoStXJ0SdiZiNXW+nzXBcZIQ5CCTG4IQ2R7jEaLMScKIarI5CPmNN5QMH5pUcAZ2qu jxhDKllho02FhjzusL90e6CLwVJDZ82cg+ISvXMovH/ganT+1fIbguUR63l8Pw6EBNuW 16tw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c11si32063121pga.462.2019.04.29.04.16.11; Mon, 29 Apr 2019 04:16:27 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727927AbfD2LNu (ORCPT + 99 others); Mon, 29 Apr 2019 07:13:50 -0400 Received: from mail-qk1-f196.google.com ([209.85.222.196]:38514 "EHLO mail-qk1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727819AbfD2LNu (ORCPT ); Mon, 29 Apr 2019 07:13:50 -0400 Received: by mail-qk1-f196.google.com with SMTP id g141so1301153qke.5; Mon, 29 Apr 2019 04:13:49 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=x28FrJjCiQBqslkV+zQDusUSdhRwlePNuGMIarDkv/M=; b=KjFCx3f8TeZtNxQPZkuirjnLjg6sgQ4GVdqWeB9Xb4jgwKvXSwejAP8d0Ve9GxJHqy +5zh/Y7cF5oUq3nm6ZcwLXIC1tAWVlykQA2GLEdezucoGIj0geG9CvfkbqMgPh4WRGkB uXwCoY3pcUah5nME6m8J7dvCxkdCojs1mzQPkcPGYem2VvoHn2su0X3rz5R/lzWzKnUL yXcVmDp1piq2OBXcX8xaChlcOEocEh8ATEOSa9jIlnoOoPRZ/NGhIIAm26MzWCSADvCW JvmVnbOOln+DqXgO2KOlzR988WAySKsCXKIQVEoWGols5OPUb1raZu6rT6VQiBWOzdem N/qA== X-Gm-Message-State: APjAAAVNs2GkOcAT/YHJfEBavVm/Jo/KZ+v9uod842lvrlyP+gnVQ0Zo kFmj60FFngIU5bWU8msY8Vwyhi+caBrciDp0xi8= X-Received: by 2002:a37:c402:: with SMTP id d2mr34106774qki.291.1556536429180; Mon, 29 Apr 2019 04:13:49 -0700 (PDT) MIME-Version: 1.0 References: <20190427153222.GA9613@jerusalem> <20190427202150.GB9613@jerusalem> In-Reply-To: From: Arnd Bergmann Date: Mon, 29 Apr 2019 13:13:32 +0200 Message-ID: Subject: Re: endianness swapped To: Geert Uytterhoeven Cc: Greg Ungerer , Angelo Dureghello , Logan Gunthorpe , Thomas Gleixner , Kate Stewart , Philippe Ombredanne , Greg KH , "Linux/m68k" , Linux-Arch , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Apr 29, 2019 at 10:44 AM Geert Uytterhoeven wrote: > On Sun, Apr 28, 2019 at 3:59 PM Greg Ungerer wrote: > > On 28/4/19 7:21 pm, Arnd Bergmann wrote: > > > On Sun, Apr 28, 2019 at 10:46 AM Geert Uytterhoeven > > > wrote: > > >> > > >> Orthogonal to how Coldfire's read[wl]() should be fixed, I find it a bit > > >> questionable to swap data twice on big endian architectures. > > > > > > I would expect that the compiler is capable of detecting a double > > > swap and optimize it out. Even if it can't, there are not that many > > > instances of io{read,write}{16,32}be in the kernel, so the increase > > > in kernel image size from a double swap should be limited to a > > > few extra instructions, and the runtime overhead should be > > > negligible compared to the bus access. > > Probably the overhead is not negligible on old m68k... Maybe the I/O devices are faster than I expected then. I was guessing that there is still a factor of 100x or more between going to an on-chip bus and single byterev register-to-register instruction. I did notice that __arch_swab32() is an inline assembly, so the compiler has no way of eliminating the double swap, but setting CONFIG_ARCH_USE_BUILTIN_BSWAP makes it do the right thing. Arnd