linux/arch/arm64
David Hildenbrand 70ffdb9393 mm/fault, arch: Use pagefault_disable() to check for disabled pagefaults in the handler
Introduce faulthandler_disabled() and use it to check for irq context and
disabled pagefaults (via pagefault_disable()) in the pagefault handlers.

Please note that we keep the in_atomic() checks in place - to detect
whether in irq context (in which case preemption is always properly
disabled).

In contrast, preempt_disable() should never be used to disable pagefaults.
With !CONFIG_PREEMPT_COUNT, preempt_disable() doesn't modify the preempt
counter, and therefore the result of in_atomic() differs.
We validate that condition by using might_fault() checks when calling
might_sleep().

Therefore, add a comment to faulthandler_disabled(), describing why this
is needed.

faulthandler_disabled() and pagefault_disable() are defined in
linux/uaccess.h, so let's properly add that include to all relevant files.

This patch is based on a patch from Thomas Gleixner.

Reviewed-and-tested-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: David Hildenbrand <dahi@linux.vnet.ibm.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: David.Laight@ACULAB.COM
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: airlied@linux.ie
Cc: akpm@linux-foundation.org
Cc: benh@kernel.crashing.org
Cc: bigeasy@linutronix.de
Cc: borntraeger@de.ibm.com
Cc: daniel.vetter@intel.com
Cc: heiko.carstens@de.ibm.com
Cc: herbert@gondor.apana.org.au
Cc: hocko@suse.cz
Cc: hughd@google.com
Cc: mst@redhat.com
Cc: paulus@samba.org
Cc: ralf@linux-mips.org
Cc: schwidefsky@de.ibm.com
Cc: yang.shi@windriver.com
Link: http://lkml.kernel.org/r/1431359540-32227-7-git-send-email-dahi@linux.vnet.ibm.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
2015-05-19 08:39:15 +02:00
..
boot ARM64: juno: add sp810 support and fix sp804 clock frequency 2015-05-12 16:39:28 +02:00
configs ARM: SoC 64-bit changes for v4.1 2015-04-22 09:23:58 -07:00
crypto Merge git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6 2015-05-11 11:05:13 -07:00
include arm64: add missing data types in smp_load_acquire/smp_store_release 2015-04-27 11:39:04 +01:00
kernel arm64: perf: fix memory leak when probing PMU PPIs 2015-05-12 16:50:21 +01:00
kvm arm64 updates for 4.1: 2015-04-16 13:58:29 -05:00
lib arm64: __clear_user: handle exceptions on strb 2014-11-13 15:21:26 +00:00
mm mm/fault, arch: Use pagefault_disable() to check for disabled pagefaults in the handler 2015-05-19 08:39:15 +02:00
net arm64: bpf: fix signedness bug in loading 64-bit immediate 2015-05-08 16:15:07 +01:00
xen arm: xen: implement multicall hypercall support. 2014-04-24 13:09:46 +01:00
Kconfig ARM64: Enable CONFIG_GENERIC_IRQ_SHOW_LEVEL 2015-04-27 11:39:05 +01:00
Kconfig.debug coresight: moving to new "hwtracing" directory 2015-04-03 16:17:04 +02:00
Makefile arm64: Adjust EFI libstub object include logic 2015-03-17 16:59:47 +00:00