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>
This commit is contained in:
Arseny Solokha 2015-02-04 13:18:02 +11:00 коммит произвёл Michael Ellerman
Родитель 7f43e71e8c
Коммит c2c896bee0
1 изменённых файлов: 5 добавлений и 1 удалений

Просмотреть файл

@ -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();