From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.2 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9D940C433DB for ; Tue, 16 Mar 2021 22:05:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7086E64F89 for ; Tue, 16 Mar 2021 22:05:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230263AbhCPWFV (ORCPT ); Tue, 16 Mar 2021 18:05:21 -0400 Received: from elvis.franken.de ([193.175.24.41]:35191 "EHLO elvis.franken.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230139AbhCPWEv (ORCPT ); Tue, 16 Mar 2021 18:04:51 -0400 Received: from uucp (helo=alpha) by elvis.franken.de with local-bsmtp (Exim 3.36 #1) id 1lMHo2-0005CW-00; Tue, 16 Mar 2021 23:04:50 +0100 Received: by alpha.franken.de (Postfix, from userid 1000) id 46743C093D; Tue, 16 Mar 2021 22:59:19 +0100 (CET) Date: Tue, 16 Mar 2021 22:59:19 +0100 From: Thomas Bogendoerfer To: Paul Cercueil Cc: od@zcrc.me, linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org, =?iso-8859-1?Q?Bj=F8rn?= Mork Subject: Re: [PATCH] MIPS: vmlinux.lds.S: Fix appended dtb not properly aligned Message-ID: <20210316215919.GA18538@alpha.franken.de> References: <20210316154515.171543-1-paul@crapouillou.net> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20210316154515.171543-1-paul@crapouillou.net> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Mar 16, 2021 at 03:45:15PM +0000, Paul Cercueil wrote: > Commit 6654111c893f ("MIPS: vmlinux.lds.S: align raw appended dtb to 8 > bytes") changed the alignment from STRUCT_ALIGNMENT bytes to 8 bytes. > > The commit's message makes it sound like it was actually done on > purpose, but this is not the case. The commit was written when raw > appended dtb were not aligned at all. The STRUCT_ALIGN() was added a few > days before, in commit 7a05293af39f ("MIPS: boot/compressed: Copy DTB to > aligned address"). The true purpose of the commit was not to align > specifically to 8 bytes, but to make sure that the generated vmlinux' > size was properly padded to the alignment required for DTBs. > > While the switch to 8-byte alignment worked for vmlinux-appended dtb > blobs, it broke vmlinuz-appended dtb blobs, as the decompress routine > moves the blob to a STRUCT_ALIGNMENT aligned address. > > Fix this by changing the raw appended dtb blob alignment from 8 bytes > back to STRUCT_ALIGNMENT bytes in vmlinux.lds.S. > > Fixes: 6654111c893f ("MIPS: vmlinux.lds.S: align raw appended dtb to 8 bytes") > Cc: Bjørn Mork > Signed-off-by: Paul Cercueil > --- > arch/mips/kernel/vmlinux.lds.S | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) applied to mips-fixes. Thomas. -- Crap can work. Given enough thrust pigs will fly, but it's not necessarily a good idea. [ RFC1925, 2.3 ]