Re: [RFC] MIPS: Align vmlinuz load address to a page boundary

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> 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?

Sorry for the brief description. The problem, more specifically, is
reported by kexec-tools/kexec/kexec.c:343:

	/* Verify base is pagesize aligned.
	 * Finding a way to cope with this problem
	 * is important but for now error so at least
	 * we are not surprised by the code doing the wrong
	 * thing.
	 */
	if (base & (pagesize -1)) {
		die("Base address: 0x%lx is not page aligned\n", base);
	}

https://git.kernel.org/pub/scm/utils/kernel/kexec/kexec-tools.git/tree/kexec/kexec.c?id=HEAD#n343

A more pressing issue at the moment though is that initramfs in vmlinuz is
ignored when booting. Is it supposed to work with a MIPS kernel?

Fredrik

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




[Index of Archives]     [Linux MIPS Home]     [LKML Archive]     [Linux ARM Kernel]     [Linux ARM]     [Linux]     [Git]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux