Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp720769pxb; Sat, 6 Mar 2021 15:03:01 -0800 (PST) X-Google-Smtp-Source: ABdhPJwNEc7mZy/7KaU2f5sC9OE9NrZptfLlqgnWkDiFe3gTOpYYXndH8Yi59lhuldk5xVX0f48J X-Received: by 2002:a17:906:16ca:: with SMTP id t10mr8586372ejd.85.1615071781511; Sat, 06 Mar 2021 15:03:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615071781; cv=none; d=google.com; s=arc-20160816; b=xZgLyhMQ8X9qygdwht8qtTS+JCwt5DAvT84ahxglqDaUdnIjwiZqrTLjcf19RSv63K 9JOXJRBn8qNm7A/d444DjjEmx20I6Zw1R4/763MNRCDRe+WlzfTeU0o4Yq918vwCxVTs zrbs2mvBAwzAppY8si9uIS53nFMtOB8fTNg/vPX44VNbzn4YYC/zKrCYwP9lJ8FcD70q bBQJ+1vKwpEgl2xgoKD1PkzLxck8MKGPXZdZEmWo+Gu/r/B1p596iciRUcjKfRenfwyZ +kJixkt6hgMa0uceRIEapoyl/xBnPNF3+y49WEEWggo1cKxXreUrqAOOvOmbYsOwL2TA uT9w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=8nHCZptQjHnM4lCQczhqy6s2D5/E3xQC48J1FoZ6Oio=; b=rCSsHjOvQP9iBF+N6z3cm17iE68xqCd0MYebD82znthG/jk1K6/gFg5NdIerUJm9B+ Y0IQQiWixVnt5AGADZNH5+NgZ3Ndlr/49afL5sIGmCNGn99G+rAnwxmT9PB79+YCdUbs DNEHMUhTRsnYmqdWOfz5V2M+GqtWuS1Lu6IBvUF6HGcyUOu26zB6ZcQ3806B2rvlAQzm nxmDyaW9wXuxYXmSne1CwGZJKLs0XK5Wpq32pZIh98qjNhE7xmgEsnIEfzPWEG5qvRif Bt4CqkQG3Zr9tc4c0ekVmznhpLJSqnMrs1r17n2l/opLuw94cB0q7MK4idvDmJX+T05a WKtQ== 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 f21si4128439edy.337.2021.03.06.15.01.53; Sat, 06 Mar 2021 15:03:01 -0800 (PST) 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 S229818AbhCFW7m (ORCPT + 99 others); Sat, 6 Mar 2021 17:59:42 -0500 Received: from elvis.franken.de ([193.175.24.41]:50538 "EHLO elvis.franken.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229733AbhCFW7R (ORCPT ); Sat, 6 Mar 2021 17:59:17 -0500 Received: from uucp (helo=alpha) by elvis.franken.de with local-bsmtp (Exim 3.36 #1) id 1lIftD-0000w8-00; Sat, 06 Mar 2021 23:59:15 +0100 Received: by alpha.franken.de (Postfix, from userid 1000) id A115EC114C; Sat, 6 Mar 2021 23:58:55 +0100 (CET) Date: Sat, 6 Mar 2021 23:58:55 +0100 From: Thomas Bogendoerfer To: Rob Herring Cc: Paul Cercueil , od@zcrc.me, "open list:MIPS" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH] MIPS: boot/compressed: Copy DTB to aligned address Message-ID: <20210306225855.GA3574@alpha.franken.de> References: <20210303193305.924384-1-paul@crapouillou.net> <20210306084513.GA5453@alpha.franken.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Mar 06, 2021 at 02:35:21PM -0700, Rob Herring wrote: > On Sat, Mar 6, 2021 at 1:45 AM Thomas Bogendoerfer > wrote: > > > > On Wed, Mar 03, 2021 at 02:37:55PM -0600, Rob Herring wrote: > > > On Wed, Mar 3, 2021 at 1:33 PM Paul Cercueil wrote: > > > > > > > > Since 5.12-rc1, the Device Tree blob must now be properly aligned. > > > > > > I had checked the other built-in cases as microblaze broke too, but > > > missed some of the many ways MIPS can have a dtb. Appended and > > > built-in DTBs were supposed to be temporary. :( > > > > and a fdt can also be provided by firmware. And according to spec > > there is no aligmnet requirement. So this whole change will break > > then. What was the reason for the whole churn ? > > There was a long discussion on devicetree-compiler list a few months > ago. In summary, a while back libfdt switched to accessors from raw > pointer accesses to avoid any possible unaligned accesses (is MIPS > always okay with unaligned accesses?). no, it will trap unaligned accesses, that's the reason for Paul's problem. > This was determined to be a > performance regression and an overkill as the DT structure itself > should always be naturally aligned if the dtb is 64-bit aligned. I > think 32-bit aligned has some possible misaligned accesses. the access macros are using *(unsigned long long *), which isn't even nice for 32bit CPUs... > As part of this, a dtb alignment check was added. So worst case, we > could disable that if need be. yeah, or override fdt32/64_to_cpu, if I understood the code correctly. Thomas. -- Crap can work. Given enough thrust pigs will fly, but it's not necessarily a good idea. [ RFC1925, 2.3 ]