summaryrefslogtreecommitdiffstats
path: root/arch/powerpc/mm
diff options
context:
space:
mode:
authorArseny Solokha <asolokha@kb.kras.ru>2015-02-04 03:18:02 +0100
committerMichael Ellerman <mpe@ellerman.id.au>2015-02-04 03:19:27 +0100
commitc2c896bee08e1461fc24f9bf7dd57e2c63f6db70 (patch)
tree35315d0675d8c56dd3b3861081c6653799375987 /arch/powerpc/mm
parentpowerpc/powernv: Add OPAL soft-poweroff routine (diff)
downloadlinux-c2c896bee08e1461fc24f9bf7dd57e2c63f6db70.tar.xz
linux-c2c896bee08e1461fc24f9bf7dd57e2c63f6db70.zip
powerpc/mm: Warn on flushing tlb page in kernel context
Function __flush_tlb_page() must only be called for user contexts, so put in extra hardening to warn on calling it for kernel context. Signed-off-by: Arseny Solokha <asolokha@kb.kras.ru> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'arch/powerpc/mm')
-rw-r--r--arch/powerpc/mm/tlb_nohash.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/arch/powerpc/mm/tlb_nohash.c b/arch/powerpc/mm/tlb_nohash.c
index ab0616b0e6c2..cbd3d069897f 100644
--- a/arch/powerpc/mm/tlb_nohash.c
+++ b/arch/powerpc/mm/tlb_nohash.c
@@ -284,7 +284,11 @@ void __flush_tlb_page(struct mm_struct *mm, unsigned long vmaddr,
struct cpumask *cpu_mask;
unsigned int pid;
- if (unlikely(!mm))
+ /*
+ * This function as well as __local_flush_tlb_page() must only be called
+ * for user contexts.
+ */
+ if (unlikely(WARN_ON(!mm)))
return;
preempt_disable();