[Skiboot] [PATCH] external/mambo: 4 byte align chained CPIOs

Dan Horák dan at danny.cz
Fri Nov 27 18:49:02 AEDT 2020


On Thu, 26 Nov 2020 13:01:51 +1100
Michael Neuling <mikey at neuling.org> wrote:

> Linux requires chained CPIOs to be 4 byte aligned otherwise they are
> ignored. This aligns them.
> 
> Signed-off-by: Michael Neuling <mikey at neuling.org>
> ---
>  external/mambo/skiboot.tcl | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)

LGTM

Reviewed-by: Dan Horák <dan at danny.cz>


		Dan

> 
> diff --git a/external/mambo/skiboot.tcl b/external/mambo/skiboot.tcl
> index 76d29f6e9080..3a8e19406f29 100644
> --- a/external/mambo/skiboot.tcl
> +++ b/external/mambo/skiboot.tcl
> @@ -274,13 +274,14 @@ if { [info exists env(SKIBOOT_INITRD)] } {
>  	    set cpio_size [file size $cpio_file]
>  	    mysim mcm 0 memory fread $cpio_end $cpio_size $cpio_file
>  	    set cpio_end [expr $cpio_end + $cpio_size]
> +	    # Linux requires cpios are 4 byte aligned
> +	    set cpio_end [expr $cpio_end + 3 & 0xfffffffffffffffc]
>      }
>  
>      mysim of addprop $chosen_node int "linux,initrd-start" $cpio_start
>      mysim of addprop $chosen_node int "linux,initrd-end"   $cpio_end
>  }
>  
> -
>  # Map persistent memory disks
>  proc pmem_node_add { root start size } {
>      set start_hex [format %x $start]
> -- 
> 2.28.0
> 
> _______________________________________________
> Skiboot mailing list
> Skiboot at lists.ozlabs.org
> https://lists.ozlabs.org/listinfo/skiboot


More information about the Skiboot mailing list