ARM: permit stack trace dumping for any tasks

Both implementations of function unwind_frame() now checks stack boundaries:
frame-pointer based since commit 3abb6671a9c04479c4bd026798a05f857393b7e2
("ARM: 7913/1: fix framepointer check in unwind_frame"),
unwind-table based since a51345770e519552e749ff457a2a9f83171a67b5
("ARM: 7987/1: ARM : unwinder : Prevent data abort due to stack overflow").

Now it's safe to dump stack traces for any task, not only for current.
If task is running we could get garbage but kernel will not explode.
Actually, get_wchan() uses this code-path for ages without any problems:
it calls unwind_frame() after racy check "task->state != TASK_RUNNING".

This patch enables CONFIG_STACKTRACE dumper for non-current tasks,
it's exposed into userspace via /proc/$PID/stack

Signed-off-by: Konstantin Khlebnikov <k.khlebnikov@samsung.com>
Cc: Anurag Aggarwal <a.anurag@samsung.com>
Cc: Dave Martin <Dave.Martin@arm.com>
ARM: LPAE: rework TTBR0/TTBR1 split

This patch removes enabling TTBRx split from __v7_setup (v7_ttb_setup)
and postpones it till cpu_init() which is called in init_mm context after
leaving idmap. Also it disables split in setup_mm_for_reboot() before
switching mm to idmap. Idmap and split are never enabled at the same time.

Callback keystone_smp_secondary_initmem no longer required, all this setup
is done in cpu_init which is called right before smp_ops.smp_secondary_init.

Signed-off-by: Konstantin Khlebnikov <k.khlebnikov@samsung.com>
ARM: enable TTBR0/TTBR1 split in short mode

This feature was partially implemented long time ago. All cpus load
swapper_pg_dir into TTBR1 since commit d427958a46af24f75d0017c45eadd172273bbf33
("ARM: 6942/1: mm: make TTBR1 always point to swapper_pg_dir on ARMv6/7").
But split is not enabled in TTBCR.

This patch enables TTBRx split for 2Gb/2Gb and 1Gb/3Gb vm split combinations.
Area covered by TTBR0 must be power of two, thus 3Gb/1Gb mode is unsupported.

Signed-off-by: Konstantin Khlebnikov <k.khlebnikov@samsung.com>
ARM: reduce size of page table directory for short mode

Virtual memory above PAGE_OFFSET is controlled by TTBR1 which always
points to swapper_pg_dir. Size of the rest pgd tables might be reduced.
Of course idmap_pgd is special too, we need full 16k table for it.

This patch saves 8k per process for 2G/2G split (12k for 1G/3G split)
and kills source of frequent order-2 allocations.

Signed-off-by: Konstantin Khlebnikov <k.khlebnikov@samsung.com>
ARM: fix 32-bit phys_addr_t overflow in sanity_check_meminfo

vmalloc_limit easily overflows in case of 1G/3G split.
For example, if PHYS_OFFSET=0x80000000 and PAGE_OFFSET=0x40000000 then
vmalloc_limit have to be 0x1_2F800000.

Signed-off-by: Konstantin Khlebnikov <k.khlebnikov@samsung.com>
ARM: use long-calls and move modules into vmalloc area

Usually modules are loaded into small area prior to the kernel
text because they are linked with the kernel using short calls.
Compile-time instrumentations like GCOV or KASAN bloat code a lot.
As a result huge modules no longer fit into reserved area.

This patch adds option CONFIG_MODULES_USE_VMALLOC which lifts
limitation on amount of loaded modules. It builds modules using
GCC option -mlong-calls and loads modules into vmalloc area.

In few places exported symbols are called from inline assembly.
This patch adds macro for such these sites: __asmbl and __asmbl_clobber.
Call turns into single 'bl' or sequence 'movw; movt; blx' depending on
context and state of config option. Short-calls are used inside kernel.

Currently this option isn't compatible with CONFIG_FUNCTION_TRACER.
Compiler emits short calls to profiling function even with -mlong-calls.
This is a bug in GCC, but ftrace anyway cannot patch such prologues.

Signed-off-by: Konstantin Khlebnikov <k.khlebnikov@samsung.com>