linux/arch/arc/kernel
Eugeniy Paltsev 4404926390 ARC: U-boot: check arguments paranoidly
commit a66f2e57bd upstream.

Handle U-boot arguments paranoidly:
 * don't allow to pass unknown tag.
 * try to use external device tree blob only if corresponding tag
   (TAG_DTB) is set.
 * don't check uboot_tag if kernel build with no ARC_UBOOT_SUPPORT.

NOTE:
If U-boot args are invalid we skip them and try to use embedded device
tree blob. We can't panic on invalid U-boot args as we really pass
invalid args due to bug in U-boot code.
This happens if we don't provide external DTB to U-boot and
don't set 'bootargs' U-boot environment variable (which is default
case at least for HSDK board) In that case we will pass
{r0 = 1 (bootargs in r2); r1 = 0; r2 = 0;} to linux which is invalid.

While I'm at it refactor U-boot arguments handling code.

Tested-by: Corentin LABBE <clabbe@baylibre.com>
Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
[bwh: Backported to 3.16: adjust context]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
History 2019-05-02 21:41:57 +01:00
..
.gitignore ARC: Add some .gitignore entries 2013-08-26 09:40:24 +05:30
arc_hostlink.c ARC: Hostlink Pseudo-Driver for Metaware Debugger 2013-02-15 23:16:10 +05:30
arcksyms.c ARC: Build system: Makefiles, Kconfig, Linker script 2013-02-11 20:00:25 +05:30
asm-offsets.c ARC: pt_regs update #5: Use real ECR for pt_regs->event vs. synth values 2013-06-26 14:04:48 +05:30
clk.c ARC: fix typo with clock speed 2013-05-07 13:43:54 +05:30
ctx_sw.c ARC: [SMP] Fix build failures for large NR_CPUS 2013-11-06 10:41:46 +05:30
ctx_sw_asm.S ARC: Fix build breakage for !CONFIG_ARC_DW2_UNWIND 2014-06-26 10:14:02 +05:30
devtree.c ARC: fix build warning in devtree 2014-06-23 11:50:26 +05:30
disasm.c ARC port updates for Linux 3.10 (part 1) 2013-05-09 14:36:27 -07:00
entry.S ARC: Re-enable MMU upon Machine Check exception 2017-11-26 13:50:29 +00:00
fpu.c ARC: Process-creation/scheduling/idle-loop 2013-02-11 20:00:38 +05:30
head.S ARC: U-boot: check arguments paranoidly 2019-05-02 21:41:57 +01:00
irq.c ARC: [SMP] ISS SMP extension bitrot 2014-05-05 14:22:12 +05:30
kgdb.c arc: kgdb: add default implementation for kgdb_roundup_cpus() 2013-11-06 10:41:41 +05:30
kprobes.c Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial 2013-11-15 16:47:22 -08:00
Makefile ARC: Add perf support for ARC700 cores 2013-11-12 09:45:38 +05:30
module.c ARC: Fix coding style issues 2013-04-09 12:21:14 +05:30
perf_event.c ARC: [perf] Fix a few thinkos 2013-11-28 15:49:59 +05:30
process.c ARC: clone syscall to setp r25 as thread pointer 2018-12-16 22:09:36 +00:00
ptrace.c ARC: Implement ptrace(PTRACE_GET_THREAD_AREA) 2014-06-26 10:14:08 +05:30
reset.c arc: export symbol for pm_power_off in reset.c 2013-11-06 10:41:44 +05:30
setup.c ARC: U-boot: check arguments paranoidly 2019-05-02 21:41:57 +01:00
signal.c arc: Use get_signal() signal_setup_done() 2019-05-02 21:41:41 +01:00
smp.c ARC: [SMP] Fix IPI IRQ registration 2014-06-26 11:58:25 +05:30
stacktrace.c arc: unwind: warn only once if DW2_UNWIND is disabled 2016-08-22 22:38:22 +01:00
sys.c ARC: ABIv3: fork/vfork wrappers not needed in "no-legacy-syscall" ABI 2013-03-11 19:01:10 +05:30
time.c ARC: arc_local_timer_setup() need not pass own cpu id 2014-06-03 13:26:52 +05:30
traps.c ARC: Reduce #ifdef'ery for unaligned access emulation 2013-11-06 10:41:39 +05:30
troubleshoot.c ARC: show_regs: lockdep: avoid page allocator... 2019-05-02 21:41:24 +01:00
unaligned.c ARC: [arcompact] brown paper bag bug in unaligned access delay slot fixup 2017-03-16 02:27:10 +00:00
unwind.c ARC: dw2 unwind: Ignore CIE version !=1 gracefully instead of bailing 2016-01-25 10:43:41 +00:00
vmlinux.lds.S ARC: optimize kernel bss clearing in early boot code 2014-06-26 10:14:05 +05:30