x86/mm: Remove preempt_disable/enable() from __native_flush_tlb()
The preempt_disable/enable() pair in __native_flush_tlb() was added in
5cf0791da5c1 ("x86/mm: Disable preemption during CR3 read+write")
... to protect the UP variant of flush_tlb_mm_range().
That preempt_disable/enable() pair should have been added to the UP variant
of flush_tlb_mm_range() instead.
The UP variant was removed with commit:
ce4a4e565f52 ("x86/mm: Remove the UP asm/tlbflush.h code, always use the (formerly) SMP code")
... but the preempt_disable/enable() pair stayed around.
The latest change to __native_flush_tlb() in commit:
6fd166aae78c ("x86/mm: Use/Fix PCID to optimize user/kernel switches")
... added an access to a per CPU variable outside the preempt disabled
regions, which makes no sense at all. __native_flush_tlb() must always
be called with at least preemption disabled.
Remove the preempt_disable/enable() pair and add a WARN_ON_ONCE() to catch
bad callers independent of the smp_processor_id() debugging.
Signed-off-by: Thomas Gleixner <firstname.lastname@example.org>
Cc: Andy Lutomirski <email@example.com>
Cc: Borislav Petkov <firstname.lastname@example.org>
Cc: Dave Hansen <email@example.com>
Cc: Dominik Brodowski <firstname.lastname@example.org>
Cc: Linus Torvalds <email@example.com>
Cc: Linus Torvalds <firstname.lastname@example.org>
Cc: Peter Zijlstra <email@example.com>
Signed-off-by: Ingo Molnar <firstname.lastname@example.org>
1 file changed