diff options
author | Russell Currey <ruscur@russell.cc> | 2019-03-25 15:29:29 +1100 |
---|---|---|
committer | Stewart Smith <stewart@linux.ibm.com> | 2019-03-28 15:24:12 +1100 |
commit | edf7e841ff9d7ff1aef5518317319936fa362f11 (patch) | |
tree | 66d5fc319b5d3eb00e7026b6962567540b3788a7 /external | |
parent | 8d8a9ca30453bc92977409966e6006f8c18f4be5 (diff) | |
download | skiboot-edf7e841ff9d7ff1aef5518317319936fa362f11.zip skiboot-edf7e841ff9d7ff1aef5518317319936fa362f11.tar.gz skiboot-edf7e841ff9d7ff1aef5518317319936fa362f11.tar.bz2 |
external/mambo: Error out if kernel is too large
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.
Signed-off-by: Russell Currey <ruscur@russell.cc>
Acked-by: Michael Neuling <mikey@neuling.org>
Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
Diffstat (limited to 'external')
-rw-r--r-- | external/mambo/skiboot.tcl | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/external/mambo/skiboot.tcl b/external/mambo/skiboot.tcl index 096f1c3..7a939bf 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)] } { + error "vmlinux is too large, consider adjusting PAYLOAD_ADDR" +} + # Flatten it epapr::of2dtb mysim $mconf(epapr_dt_addr) |