parisc: Protect huge page pte changes with spinlocks
authorHelge Deller <deller@gmx.de>
Thu, 26 Nov 2015 20:14:02 +0000 (21:14 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 17 Feb 2016 20:30:57 +0000 (12:30 -0800)
commit583097a3b2cef0bee535c8acc4189ceacb8bb6c6
treec603181ad125383b669b55e3242037fd6015ad2e
parenta623f87a72de35096a9eae7cc7764d0c9533c2e9
parisc: Protect huge page pte changes with spinlocks

commit b0e551313ebde17764f3a5ed273df524d1e7e690 upstream.

PA-RISC doesn't have atomic instructions to modify page table entries, so it
takes spinlock in the TLB handler and modifies the page table entry
non-atomically. If you modify the page table entry without the spinlock, you
may race with TLB handler on another CPU and your modification may be lost.
Protect against that with usage of purge_tlb_start() and purge_tlb_end() which
handles the TLB spinlock.

Signed-off-by: Helge Deller <deller@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/parisc/include/asm/hugetlb.h
arch/parisc/mm/hugetlbpage.c