linux_dsm_epyc7002/arch
Sebastian Andrzej Siewior f77084d963 x86/mm/pat: Disable preemption around __flush_tlb_all()
The WARN_ON_ONCE(__read_cr3() != build_cr3()) in switch_mm_irqs_off()
triggers every once in a while during a snapshotted system upgrade.

The warning triggers since commit decab0888e ("x86/mm: Remove
preempt_disable/enable() from __native_flush_tlb()"). The callchain is:

  get_page_from_freelist() -> post_alloc_hook() -> __kernel_map_pages()

with CONFIG_DEBUG_PAGEALLOC enabled.

Disable preemption during CR3 reset / __flush_tlb_all() and add a comment
why preemption has to be disabled so it won't be removed accidentaly.

Add another preemptible() check in __flush_tlb_all() to catch callers with
enabled preemption when PGE is enabled, because PGE enabled does not
trigger the warning in __native_flush_tlb(). Suggested by Andy Lutomirski.

Fixes: decab0888e ("x86/mm: Remove preempt_disable/enable() from __native_flush_tlb()")
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Dave Hansen <dave.hansen@linux.intel.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: stable@vger.kernel.org
Link: https://lkml.kernel.org/r/20181017103432.zgv46nlu3hc7k4rq@linutronix.de
2018-10-29 19:04:31 +01:00
..
alpha alpha: switch to NO_BOOTMEM 2018-10-26 16:25:20 -07:00
arc Devicetree updates for 4.20: 2018-10-26 12:09:58 -07:00
arm Merge branch 'akpm' (patches from Andrew) 2018-10-26 19:33:41 -07:00
arm64 Merge branch 'akpm' (patches from Andrew) 2018-10-26 19:33:41 -07:00
c6x Devicetree updates for 4.20: 2018-10-26 12:09:58 -07:00
h8300 Devicetree updates for 4.20: 2018-10-26 12:09:58 -07:00
hexagon hexagon: switch to NO_BOOTMEM 2018-10-26 16:25:20 -07:00
ia64 mm: make memmap_init a proper function 2018-10-26 16:26:35 -07:00
m68k powerpc updates for 4.20 2018-10-26 14:36:21 -07:00
microblaze Devicetree updates for 4.20: 2018-10-26 12:09:58 -07:00
mips Merge branch 'akpm' (patches from Andrew) 2018-10-26 19:33:41 -07:00
nds32 Devicetree updates for 4.20: 2018-10-26 12:09:58 -07:00
nios2 Merge branch 'akpm' (patches from Andrew) 2018-10-26 19:33:41 -07:00
openrisc Devicetree updates for 4.20: 2018-10-26 12:09:58 -07:00
parisc hugetlb: introduce generic version of huge_ptep_get 2018-10-26 16:26:34 -07:00
powerpc Merge branch 'akpm' (patches from Andrew) 2018-10-26 19:33:41 -07:00
riscv RISC-V Patches for the 4.20 Merge Window, Part 1 2018-10-25 18:01:29 -07:00
s390 sched: loadavg: consolidate LOAD_INT, LOAD_FRAC, CALC_LOAD 2018-10-26 16:26:32 -07:00
sh Merge branch 'akpm' (patches from Andrew) 2018-10-26 19:33:41 -07:00
sparc Merge branch 'akpm' (patches from Andrew) 2018-10-26 19:33:41 -07:00
um um: switch to NO_BOOTMEM 2018-10-26 16:25:20 -07:00
unicore32 unicore32: switch to NO_BOOTMEM 2018-10-26 16:25:20 -07:00
x86 x86/mm/pat: Disable preemption around __flush_tlb_all() 2018-10-29 19:04:31 +01:00
xtensa Merge branch 'akpm' (patches from Andrew) 2018-10-26 19:33:41 -07:00
.gitignore
Kconfig jump_label: Implement generic support for relative references 2018-09-27 17:56:47 +02:00