Skip to content

Commit

Permalink
x86: warn if arch_flush_lazy_mmu_cpu is called in preemptible context
Browse files Browse the repository at this point in the history
Impact: Catch cases where lazy MMU state is active in a preemtible context

arch_flush_lazy_mmu_cpu() has been changed to disable preemption so
the checks in enter/leave will never trigger. Put the preemtible()
check into arch_flush_lazy_mmu_cpu() to catch such cases.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
  • Loading branch information
Thomas Gleixner committed Feb 12, 2009
1 parent d85cf93 commit 34b0900
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions arch/x86/kernel/paravirt.c
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,7 @@ void arch_flush_lazy_mmu_mode(void)
preempt_disable();

if (paravirt_get_lazy_mode() == PARAVIRT_LAZY_MMU) {
WARN_ON(preempt_count() == 1);
arch_leave_lazy_mmu_mode();
arch_enter_lazy_mmu_mode();
}
Expand All @@ -285,6 +286,7 @@ void arch_flush_lazy_cpu_mode(void)
preempt_disable();

if (paravirt_get_lazy_mode() == PARAVIRT_LAZY_CPU) {
WARN_ON(preempt_count() == 1);
arch_leave_lazy_cpu_mode();
arch_enter_lazy_cpu_mode();
}
Expand Down

0 comments on commit 34b0900

Please sign in to comment.