All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC] MIPS: Align vmlinuz load address to a page boundary
@ 2018-06-10 18:20 Fredrik Noring
  2018-06-12 18:19 ` Fredrik Noring
  2018-07-02 13:11 ` Ralf Baechle
  0 siblings, 2 replies; 4+ messages in thread
From: Fredrik Noring @ 2018-06-10 18:20 UTC (permalink / raw)
  To: linux-mips; +Cc: Maciej W. Rozycki

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);
 

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-07-02 18:25 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-06-10 18:20 [RFC] MIPS: Align vmlinuz load address to a page boundary Fredrik Noring
2018-06-12 18:19 ` Fredrik Noring
2018-07-02 13:11 ` Ralf Baechle
2018-07-02 18:24   ` Fredrik Noring

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.