[coreboot] Linux 4.7 kernel payload with coreboot 4.4

Paul Menzel paulepanter at users.sourceforge.net
Wed Aug 10 23:23:41 CEST 2016


Dear Trammell,


Welcome to coreboot.


Am Mittwoch, den 10.08.2016, 07:03 -0600 schrieb Trammell Hudson:
> The Linux 4.7 kernel payload crashes early in the boot process 
> with CoreBoot 4.4.  I traced it to these instructions that are
> finding a safe spot to decompress the rest of the kernel and
> patched around it with a hard coded location:
> 
> diff -u --recursive /home/hudson/build/clean/linux-4.7/arch/x86/boot/compressed/head_64.S ./linux-4.7/arch/x86/boot/compressed/head_64.S
> --- /home/hudson/build/clean/linux-4.7/arch/x86/boot/compressed/head_64.S	2016-07-24 15:23:50.000000000 -0400
> +++ ./linux-4.7/arch/x86/boot/compressed/head_64.S	2016-08-05 12:07:11.399854225 -0400
> @@ -340,9 +357,15 @@
>  1:
>  
>  	/* Target address to relocate to for decompression */
> +#if 0
>  	movl	BP_init_size(%rsi), %ebx
>  	subl	$_end, %ebx
>  	addq	%rbp, %rbx
> +#else
> +	// coreboot does not populate the init_size boot param?
> +	// fake it with a hard coded value
> +	movl    $0x97b000, %ebx
> +#endif
>  
>  	/* Set up the stack */
>  	leaq	boot_stack_end(%rbx), %rsp
> 
> It seems that the Linux kernel bzImage is supposed to set this value,
> rather than coreboot, so my comment is likely incorrect.
> 
> Dumping linux-4.7/arch/x86/boot/header.o, it looks like init_siez
> is supposed to be 0xcf5000, so I wonder if %rsi is pointing to the
> wrong location.
> 
> In 4.6.4 the computed address was hardcoded:
> 
>         movl    $LOAD_PHYSICAL_ADDR, %ebx
>         /* Target address to relocate to for decompression */
>         addl    $z_extract_offset, %ebx
> 
>   3e:   bb 00 00 00 01          mov    $0x1000000,%ebx
>   43:   81 c3 00 00 00 00       add    $0x0,%ebx

I have no idea, but could it be related to KASRL (Kernel Address Space
Layout Randomization)?


Thanks,

Paul


PS: Please note, that officially coreboot is spelled all lowercase (see
your email subject). (Depending on your localization(?) you might want
to start it with a capital letter, but please never CamelCase.)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: This is a digitally signed message part
URL: <http://www.coreboot.org/pipermail/coreboot/attachments/20160810/20926d90/attachment.asc>


More information about the coreboot mailing list