Commit c2c896be authored by Arseny Solokha's avatar Arseny Solokha Committed by Michael Ellerman

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: default avatarArseny Solokha <asolokha@kb.kras.ru>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
parent 7f43e71e
......@@ -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();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment