Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp884171imu; Fri, 11 Jan 2019 10:44:56 -0800 (PST) X-Google-Smtp-Source: ALg8bN4EIIe4EH9AAdKzhSXLWrDdVogQxt6TVuGWtojsZMQAhOnp5a5o46rDWxGZPZcnBKNjltMt X-Received: by 2002:a63:4a4d:: with SMTP id j13mr12359689pgl.127.1547232296644; Fri, 11 Jan 2019 10:44:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547232296; cv=none; d=google.com; s=arc-20160816; b=j1QsMLv08WB67YGdzqujI0TLo94tJWESN5ovwhT9CNEYtlJk/RpgnAOsHicBNLcWQP qo+9L1W5Cy+IY2gpNJ+DeAe5imlGs0VHkH/JSrm4DSxombK+LEZ2Tz/xt1yPqoiM2gfv PLYFrW+ZRdYGOIh3rBo3yjzvHBZ8eCjvEZwL0LSkO/AhJZxJBP8i2eOVfzBnEAl+KRyy R3rabrvGwQsLdQlnvAi4dAF2DRdmoUGe6x1y+8EaHzTY681xQj6sknEogJrF8dvI5FC+ 9toSj+EG9zGrKDzzFtr25ZmqVqAJh2cmrwe/jcya1n0RgoqCOw0wAa29AhdQnrjxZ0ka +gpg== 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=7955OUwj0QmTGXTuWUkXcD/Fb363ITbPB7rgR7i1G44=; b=O99aCldSR6X6DhAeMgqC2ouvybL2DYl48807qW3YIUupht7b3F5WEMkS/QRJ2+P3NI ab7eATK2c+KhoYqAiboPNzcohDK6c9et4JPmHXz2BnMYyeOlDc0+RLvSoj+3fyGP8LBE TCZ0jTevtOon3WIJCQu0QYFGsEp3jxn4wEBz7syaZ/3mE75pTYZfnGAovUrqe4VZRyP3 NMKNKZUz7Rk+kFipo/KY8mU6EMip7ChYBIqxtZUVDNRKQqAPWrDBj1Pn57gKVuqYtFwS 23rOsL2fYI91JGbkpuDTxRkkLxIdBQ1HtV7EW/SxDnFIK6zl2q9AUbuhfrOOxeTYMKXf HaYg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=PE8v9uH0; 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 w32si4602556pga.337.2019.01.11.10.44.37; Fri, 11 Jan 2019 10:44:56 -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=PE8v9uH0; 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 S1732278AbfAKOUO (ORCPT + 99 others); Fri, 11 Jan 2019 09:20:14 -0500 Received: from mail.kernel.org ([198.145.29.99]:37748 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388058AbfAKOUK (ORCPT ); Fri, 11 Jan 2019 09:20:10 -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 4ED0021783; Fri, 11 Jan 2019 14:20:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1547216409; bh=kkdj8d8yBG8D3tBb1OT1vQuyebtJOUHCG62epiYF2xs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PE8v9uH0j7RGAKby+NnQ5DAw8NifYuL7iEExw6j/fPMLZdJjH55/HiAaHnvEz8hdj hbyrNs1xhvrJ+2Vfsq12y+L/xh93GinVimzZPF+ya9y46ZKiviIXiuschIFRABKJZG lLcGW4yMZP/KwhIWifqY6UkpeIUOO//tzrRIP9+U= 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.4 52/88] MIPS: Align kernel load address to 64KB Date: Fri, 11 Jan 2019 15:08:21 +0100 Message-Id: <20190111131053.742377687@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190111131045.137499039@linuxfoundation.org> References: <20190111131045.137499039@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.4-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);