Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp4292899pxf; Tue, 16 Mar 2021 09:53:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzdqB0GM12ZkUs4puoc5QOwk9sk+okrZR4uY3m8Lx9Ikudk369wb/af7BV72D2MaSvIS9Ak X-Received: by 2002:aa7:de8b:: with SMTP id j11mr37247128edv.363.1615913639601; Tue, 16 Mar 2021 09:53:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615913639; cv=none; d=google.com; s=arc-20160816; b=rjTWeD0xYYiMkqXaw0Z8p52PMarKH5OKNEWgomayncFoSPtjDZ+SeVYCChFLhaBbnq FcqKJTfv7THvEuyFqK0JcXQlNXrGsmvFbehEswyymw6ybH5So/XQYABKlkRU/XsFuJeB Qi6ADJnB3hSMRAmFeLD9lEDscILbDK4KccvEbiqcztRVKKkoOi0BKHiBAaeSCA3eFIMY NxTxfBXUc5AGO35dZzovQfGCyIzlZ4+b050Ysisxc5RM39msTWBMiIODWdNGoCjmbvE3 tm1x5IfQYVAGrNg3rV7yx5f0RJtl05xZ8oJAev6M7v2Ky+vO+J8aCEuGvqglvJyZnYLt 1RCw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=5bpvrgoxQPCaF0emvcCJPq6EZKP/6rQYM8LRBb46q5A=; b=XdJpp2AF3cb/lmZTpq0Y1G9mRBa19VaM8QZRK+O5Yzzz1Mnj95ixIHzPSZduoXxTiU FncedyX15tkUKpc7OQOev/DUbPrkdLX0Fn2Af16mvAax8lV3OU4tErI6d0I82lOvGRiV BSlezkynVT6KDAA3AUcHxOD6bJAEDAQT0IZt8wP0g0tPUq/wlc6to/YSqZr9MFqw1IEp WvUG3WRfuP2p4XokN14czgLsd9NSRW1L0hR4/4buCoCyUbbQ9tXdNeFUZjJ9gQvAqGOP qdd2vBLbyPT6sMablqGdHddBXu1UXOZ4Ie5LkrjjQF+53c5qmPXX66hC57xYJzvGkMcT h7eA== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=crapouillou.net Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i13si13481162ejy.93.2021.03.16.09.53.36; Tue, 16 Mar 2021 09:53:59 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=crapouillou.net Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237261AbhCPPqD (ORCPT + 99 others); Tue, 16 Mar 2021 11:46:03 -0400 Received: from aposti.net ([89.234.176.197]:42038 "EHLO aposti.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229749AbhCPPpr (ORCPT ); Tue, 16 Mar 2021 11:45:47 -0400 From: Paul Cercueil To: Thomas Bogendoerfer Cc: od@zcrc.me, linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org, Paul Cercueil , =?UTF-8?q?Bj=C3=B8rn=20Mork?= Subject: [PATCH] MIPS: vmlinux.lds.S: Fix appended dtb not properly aligned Date: Tue, 16 Mar 2021 15:45:15 +0000 Message-Id: <20210316154515.171543-1-paul@crapouillou.net> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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(-) diff --git a/arch/mips/kernel/vmlinux.lds.S b/arch/mips/kernel/vmlinux.lds.S index 1234834cc4c4..1f98947fe715 100644 --- a/arch/mips/kernel/vmlinux.lds.S +++ b/arch/mips/kernel/vmlinux.lds.S @@ -176,7 +176,7 @@ SECTIONS .fill : { FILL(0); BYTE(0); - . = ALIGN(8); + STRUCT_ALIGN(); } __appended_dtb = .; /* leave space for appended DTB */ -- 2.30.2