Revert "Revert "ARM: 7527/1: uaccess: explicitly check __user pointer when !CPU_USE_DOMAINS""

The security extension aka trustzone firmware had a bug in the old verizon release which is like the engineering release which causes reboot when a media is playing. I think qcom media goes into secure mode for security reason. verizon users need to update their freaking stuff before they complain something is broken.

Fuck verizon for making this a pain in the ass.

This reverts commit 38e1f74e6898f795b9943d7599fc5c96c13da7a0

Change-Id: If0df40b403546f53cf41642f406fe15cccda149e
cputime: Avoid multiplication overflow on utime scaling

We scale stime, utime values based on rtime (sum_exec_runtime
converted to jiffies). During scaling we multiple rtime * utime,
which seems to be fine, since both values are converted to u64,
but it's not.

Let assume HZ is 1000 - 1ms tick. Process consist of 64 threads,
run for 1 day, threads utilize 100% cpu on user space. Machine
has 64 cpus.

Process rtime = utime will be 64 * 24 * 60 * 60 * 1000 jiffies,
which is 0x149970000. Multiplication rtime * utime result is
0x1a855771100000000, which can not be covered in 64 bits.

Result of overflow is stall of utime values visible in user
space (prev_utime in kernel), even if application still consume
lot of CPU time.

A solution to solve this is to perform the multiplication on
stime instead of utime. It's easy to grow the utime value fast
with a CPU bound thread in userspace for example. Now we assume
that doing so with stime is much harder. In most cases a task
shouldn't ever spend much time in kernel space as it tends to
sleep waiting for jobs completion when they take long to
achieve. IO is the typical example of that.

Hence scaling the cputime by performing the multiplication on
stime instead of utime should considerably reduce the chances of
an overflow on most workloads.

This is largely inspired by a patch from Stanislaw Gruszka:
http://lkml.kernel.org/r/20130107113144.GA7544@redhat.com

Inspired-by: Stanislaw Gruszka <sgruszka@redhat.com>
Reported-by: Stanislaw Gruszka <sgruszka@redhat.com>
Acked-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Link: http://lkml.kernel.org/r/1359217182-25184-1-git-send-email-fweisbec@gmail.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>

Conflicts:

	kernel/sched/cputime.c

- adapted to core.c from linux kernel master

Signed-off-by: Luis Cruz <ljc2491@gmail.com>
sched: Lower chances of cputime scaling overflow
Adapted from: http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=d9a3c9823a2e6a543eb7807fb3d15d8233817ec5
Wouldn't let me cherry-pick it for some reason
Signed-off-by: Luis Cruz <ljc2491@gmail.com>
sched: Fix variable name misnomer, add comments

The min_vruntime variable actually stores the maximum value.
The added comment was taken from place_entity function.

Signed-off-by: Andrei Epure <epure.andrei@gmail.com>
Cc: peterz@infradead.org
Link: http://lkml.kernel.org/r/1363115544-1964-1-git-send-email-epure.andrei@gmail.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
sched/tracing: Allow tracing the preemption decision on wakeup

Thomas noted that we do the wakeup preemption check after the
wakeup trace point, this means the tracepoint cannot test/report
this decision; which is rather important for latency sensitive
workloads. Therefore move the tracepoint after doing the
preemption check.

Suggested-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Acked-by: Steven Rostedt <rostedt@goodmis.org>
Acked-by: Paul Turner <pjt@google.com>
Cc: Mike Galbraith <efault@gmx.de>
Link: http://lkml.kernel.org/r/1363254519.26965.9.camel@laptop
Signed-off-by: Ingo Molnar <mingo@kernel.org>
sched: Simplify can_migrate_task()

At this point tsk_cache_hot is always true, so no need to check it.

Signed-off-by: Zhang Hang <bob.zhanghang@huawei.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/51650107.9040606@huawei.com
[ Also remove unnecessary schedstat #ifdefs. ]
Signed-off-by: Ingo Molnar <mingo@kernel.org>
sched: Avoid cputime scaling overflow
from: http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/kernel/sched?id=55eaa7c1f511af5fb6ef808b5328804f4d4e5243
Signed-off-by: Luis Cruz <ljc2491@gmail.com>
sched: Do not account bogus utime
from: http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=772c808a252594692972773f6ee41c289b8e0b2a
Signed-off-by: Luis Cruz <ljc2491@gmail.com>
sched: Avoid prev->stime underflow
from: http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/kernel/sched?id=68aa8efcd1ab961e4684ef5af32f72a6ec1911de
Signed-off-by: Luis Cruz <ljc2491@gmail.com>
sched: fix build
- fix some defines
- add missing class
Signed-off-by: Luis Cruz <ljc2491@gmail.com>
Makefile: remove stupid wrapper to stop compilation if there is a warning. Good find @morfic.

Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>

Conflicts:

	Makefile