kernel: mips: fix init crash/bootloop on 64-bit systems
The malta subtargets for mips64 and mips64el fail to start the init process
at boot, resulting in a boot loop. The issue was raised and analyzed within
FS#3277. Investigation suggested code near the [vdso] memory area of the
process was long jumping into a region inaccessible to the process, e.g.
init: - preinit -
init: Launched preinit instance, pid=522
do_page_fault(): sending SIGSEGV to init for invalid read access from
0000000000000360
epc =
0000000000000360 in init[
aaab42b000+4000]
ra =
000000fffee385e0 in
Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b
Rebooting in 1 seconds..
Note the low-memory read access and epc are the same. Upstream kernel 5.6
included a relevant patch and discussion:
*
d3f703c4359f ("mips: vdso: fix 'jalr t9' crash in vdso code")
Disassembly of the failing kernel's vdso.so confirmed presence of the
telltale long jumps, e.g.:
00000000000007c0 <__vdso_clock_getres@@LINUX_2.6>:
[...]
7dc:
0320f809 jalr t9
[...]
Restore booting mips64/mips64el malta by backporting the above commit:
* 310-v5.6-mips-vdso-fix-jalr-t9-crash-in-vdso-code.patch
Fixes: 54310a3aa02f ("malta: add kernel 5.4 config")
Fixes: FS#3277
Ref: https://bugs.openwrt.org/index.php?do=details&task_id=3277
Signed-off-by: Tony Ambardar <itugrok@yahoo.com>