1
0
Fork 0

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>
hifive-unleashed-5.1
Arseny Solokha 2015-02-04 13:18:02 +11:00 committed by Michael Ellerman
parent 7f43e71e8c
commit c2c896bee0
1 changed files with 5 additions and 1 deletions

View File

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