Linux MIPS Architecture development
 help / color / mirror / Atom feed
From: Fredrik Noring <noring@nocrew.org>
To: linux-mips@linux-mips.org
Cc: "Maciej W. Rozycki" <macro@mips.com>
Subject: [RFC] MIPS: Align vmlinuz load address to a page boundary
Date: Sun, 10 Jun 2018 20:20:58 +0200	[thread overview]
Message-ID: <20180610182056.GA15738@localhost.localdomain> (raw)

Hi,

The kexec system call seems to require that the vmlinuz loading address is
aligned to a page boundary. 4096 bytes is a fairly common page size, but
perhaps not the only possibility? Does kexec require additional alignments?

Fredrik

Signed-off-by: Fredrik Noring <noring@nocrew.org>

--- a/arch/mips/boot/compressed/calc_vmlinuz_load_addr.c
+++ b/arch/mips/boot/compressed/calc_vmlinuz_load_addr.c
@@ -44,12 +44,8 @@ int main(int argc, char *argv[])
 	vmlinux_size = (uint64_t)sb.st_size;
 	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).
-	 */
-
-	vmlinuz_load_addr += (16 - vmlinux_size % 16);
+	/* The kexec system call requires page alignment. */
+	vmlinuz_load_addr += (4096 - vmlinux_size % 4096);
 
 	printf("0x%llx\n", vmlinuz_load_addr);
 

             reply	other threads:[~2018-06-10 18:21 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-10 18:20 Fredrik Noring [this message]
2018-06-12 18:19 ` [RFC] MIPS: Align vmlinuz load address to a page boundary Fredrik Noring
2018-07-02 13:11 ` Ralf Baechle
2018-07-02 18:24   ` Fredrik Noring

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180610182056.GA15738@localhost.localdomain \
    --to=noring@nocrew.org \
    --cc=linux-mips@linux-mips.org \
    --cc=macro@mips.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox