[Skiboot] [PATCH 2/2] external/mambo: Error out if kernel is too large

Michael Neuling mikey at neuling.org
Tue Mar 26 07:58:09 AEDT 2019


On Mon, 2019-03-25 at 15:29 +1100, Russell Currey wrote:
> If you're trying to boot a gigantic kernel in mambo (which you can
> reproduce by building a kernel with CONFIG_MODULES=n) you'll get
> misleading errors like:
> 
> WARNING: 0: (0): [0:0]: Invalid/unsupported instr 0x00000000[INVALID]
> WARNING: 0: (0):  PC(EA): 0x0000000030000010 PC(RA):0x0000000030000010 MSR:
> 0x9000000000000000 LR: 0x0000000000000000
> WARNING: 0: (0):  numInstructions = 0
> WARNING: 1: (1): [0:0]: Invalid/unsupported instr 0x00000000[INVALID]
> WARNING: 1: (1):  PC(EA): 0x0000000000000E40 PC(RA):0x0000000000000E40 MSR:
> 0x9000000000000000 LR: 0x0000000000000000
> WARNING: 1: (1):  numInstructions = 1
> WARNING: 1: (1): Interrupt to 0x0000000000000E40 from 0x0000000000000E40
> INFO: 1: (2): ** Execution stopped: Continuous Interrupt, Instruction caused
> exception,  **
> 
> So add an error to skiboot.tcl to warn the user before this happens.
> Making PAYLOAD_ADDR further back is one way to do this but if there's a
> less gross way to generally work around this very niche problem, I can
> suggest that instead.

I think this works!

> Signed-off-by: Russell Currey <ruscur at russell.cc>

Acked-by: Michael Neuling <mikey at neuling.org>


> ---
>  external/mambo/skiboot.tcl | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/external/mambo/skiboot.tcl b/external/mambo/skiboot.tcl
> index 096f1c34..7a939bfb 100644
> --- a/external/mambo/skiboot.tcl
> +++ b/external/mambo/skiboot.tcl
> @@ -552,6 +552,10 @@ mysim memory fread $mconf(boot_load) $boot_size
> $mconf(boot_image)
>  set payload_size [file size $mconf(payload)]
>  mysim memory fread $mconf(payload_addr) $payload_size $mconf(payload)
>  
> +if { $payload_size > [expr $mconf(boot_load) - $mconf(payload_addr)] } {
> +	
> +}
> +
>  # Flatten it
>  epapr::of2dtb mysim $mconf(epapr_dt_addr)
>  



More information about the Skiboot mailing list