On Tue, Feb 20, 2018 at 10:14:39PM +0000, Maciej W. Rozycki wrote: > On Mon, 19 Feb 2018, James Hogan wrote: > > > > KEXEC assume kernel align to PAGE_SIZE, and 64KB is the largest > > > PAGE_SIZE. > > > > Please expand, maybe referring to sanity_check_segment_list() which does > > the actual check. Maybe something like this: > > > > 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. > > But why does it have to be hardcoded? Shouldn't it be inherited from > the image being loaded? I'm missing bits of context here, but that > would be either CONFIG_PAGE_SIZE_* settings or the ELF program header's > `p_align' value, depending on how this code operates. Wasting say 60kB > of memory on smaller systems due to excessive alignment might not be a > good idea. I presume there's nothing to stop a kernel with 64KB pages (and hence requiring 64KB alignment of load sections) loading a new kernel with 4KB pages (which is the one we're looking at). Cheers James
Attachment:
signature.asc
Description: Digital signature