Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3535680imu; Mon, 7 Jan 2019 05:15:08 -0800 (PST) X-Google-Smtp-Source: ALg8bN4rn5a6aNBkLzhwWtjrusoWla+r1S2NvFLRcT/rcvj65ssTpg5gmQB7Vjh6XetgCo7lZvRU X-Received: by 2002:a17:902:9006:: with SMTP id a6mr60450198plp.334.1546866908463; Mon, 07 Jan 2019 05:15:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546866908; cv=none; d=google.com; s=arc-20160816; b=O0TH+ppyWY0oQJqZkso0oMIziHeLv/D9JkjClmE4nYMeIf9IketJoO+nXnHaQCnEgw sd1EXgSNXs9ao7gA/nS+EryWa04hhP/B2+61z8KwvzRhigSLTqyPeDKYwwHhd2CT04/I YjfbeswNE+ef/YKNgIRfodAeP2bJ/VTy+Et0B4LjIdLxks0HZ0PrENJk6e/mSQtS6oT+ RbWCalM4bgnjqZwMUhajzFxoWc1OkLGHcDRlk6MIEQq9pcLeFu5WgD2npDYBbGOdZgim 7yHuCTMLd6XiPYLz6m40RpG9tnNbwIIE0C+ZbYhgWk4jKl3+VG+mEU/uUEjryXh9pkAX XzHQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=4xi5YF0QZpiACVL7iHccx+x3oPxrjxY20ZfHepl6B3k=; b=Hf1nHPxNPq78y7StZuQbBXmV1IDOQo0lufVMhFTpDWmyLYj1ftnrDF8pY9xMPXdJ+V yB4I99l3URKb9XMz+rB8u6d7vuGM5WRMKU4MOMbyNOkS2W0AcT9ArJ1qhUVEZlhbrUvU OBpm52smqPDt60MK//6aEoQGzasj9gIusBIH0lz7xj9Z/Q+0wTeHl1IbDQiQa2rqOpTQ YvAXaED3B9QH51V8DWeiiOQM/Rlmt/aJRsj+Jfa4ggUMI3tInhpwp4FZsnlkoTYViwZo kYnfVCD+fqla2JbjXOTtzCkpPzlsVnjMSeCVv2dP+gdnuBEbHpGDY4h0Ed+Gf5FQEm/H SWhg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="EI3dur/y"; 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 s80si39047421pfa.130.2019.01.07.05.14.53; Mon, 07 Jan 2019 05:15:08 -0800 (PST) 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; dkim=pass header.i=@kernel.org header.s=default header.b="EI3dur/y"; 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 S1731692AbfAGNNN (ORCPT + 99 others); Mon, 7 Jan 2019 08:13:13 -0500 Received: from mail.kernel.org ([198.145.29.99]:51470 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731095AbfAGNDy (ORCPT ); Mon, 7 Jan 2019 08:03:54 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id CEB77206BB; Mon, 7 Jan 2019 13:03:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1546866234; bh=+EmzAL1l8qQp15hV8/0v7nspHsKJYyEMm0FT3xRF9oM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=EI3dur/yjmg3KOc6e+hJjCmc/0MyGA7D1PaXdawtDltKio9L/6OtdPr8boAMZnrLC eum2MWt0mpMEzReHNsq17nZtAeV8oFAt+fEmQKJDuSPqRhTCEuQ1b5xoUzagWhWe0F RXFsfnXxXTwXhwmpG72xxnx4DIydT815BPfD7fmI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Huacai Chen , Paul Burton , Ralf Baechle , James Hogan , "Steven J . Hill" , linux-mips@linux-mips.org, Fuxin Zhang , Zhangjin Wu Subject: [PATCH 4.14 092/101] MIPS: Align kernel load address to 64KB Date: Mon, 7 Jan 2019 13:33:20 +0100 Message-Id: <20190107105337.877027496@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190107105330.372621917@linuxfoundation.org> References: <20190107105330.372621917@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Huacai Chen commit bec0de4cfad21bd284dbddee016ed1767a5d2823 upstream. KEXEC needs the new kernel's load address to be aligned on a page boundary (see sanity_check_segment_list()), but on MIPS the default vmlinuz load address is only explicitly aligned to 16 bytes. Since the largest PAGE_SIZE supported by MIPS kernels is 64KB, increase the alignment calculated by calc_vmlinuz_load_addr to 64KB. Signed-off-by: Huacai Chen Signed-off-by: Paul Burton Patchwork: https://patchwork.linux-mips.org/patch/21131/ Cc: Ralf Baechle Cc: James Hogan Cc: Steven J . Hill Cc: linux-mips@linux-mips.org Cc: Fuxin Zhang Cc: Zhangjin Wu Cc: # 2.6.36+ Signed-off-by: Greg Kroah-Hartman --- arch/mips/boot/compressed/calc_vmlinuz_load_addr.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) --- a/arch/mips/boot/compressed/calc_vmlinuz_load_addr.c +++ b/arch/mips/boot/compressed/calc_vmlinuz_load_addr.c @@ -13,6 +13,7 @@ #include #include #include +#include "../../../../include/linux/sizes.h" int main(int argc, char *argv[]) { @@ -45,11 +46,11 @@ int main(int argc, char *argv[]) vmlinuz_load_addr = vmlinux_load_addr + vmlinux_size; /* - * Align with 16 bytes: "greater than that used for any standard data - * types by a MIPS compiler." -- See MIPS Run Linux (Second Edition). + * Align with 64KB: KEXEC needs load sections to be aligned to PAGE_SIZE, + * which may be as large as 64KB depending on the kernel configuration. */ - vmlinuz_load_addr += (16 - vmlinux_size % 16); + vmlinuz_load_addr += (SZ_64K - vmlinux_size % SZ_64K); printf("0x%llx\n", vmlinuz_load_addr);