Patch "parisc: Protect huge page pte changes with spinlocks" has been added to the 4.4-stable tree
Subsystems (2)
This is a note to let you know that I've just added the patch titled
parisc: Protect huge page pte changes with spinlocks
to the 4.4-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
parisc-protect-huge-page-pte-changes-with-spinlocks.patch
and it can be found in the queue-4.4 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.
Quoted 1 line
From
b0e551313ebde17764f3a5ed273df524d1e7e690Mon Sep 17 00:00:00 2001
From: Helge Deller <[email protected]>
Date: Thu, 26 Nov 2015 21:14:02 +0100
Subject: parisc: Protect huge page pte changes with spinlocks
From: Helge Deller <[email protected]>
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.
--- arch/parisc/include/asm/hugetlb.h | 20 ++---------- arch/parisc/mm/hugetlbpage.c | 60 ++++++++++++++++++++++++++++++-------- 2 files changed, 52 insertions(+), 28 deletions(-)
arch/parisc/include/asm/hugetlb.h +4 -16
@@ -54,24 +54,12 @@ static inline pte_t huge_pte_wrprotect(preturn pte_wrprotect (pte); } -static inline void huge_ptep_set_wrprotect (struct mm_struct *mm, -unsigned long addr,pte_t *ptep) -{ -pte_t old_pte = *ptep; -set_huge_pte_at (mm, addr, ptep,pte_wrprotect (old_pte)); -} +void huge_ptep_set_wrprotect (struct mm_struct *mm, +unsigned long addr,pte_t *ptep); -static inline int huge_ptep_set_access_flags (struct vm_area_struct *vma, +int huge_ptep_set_access_flags (struct vm_area_struct *vma,unsigned long addr,pte_t *ptep, -pte_t pte,int dirty) -{ -int changed = !pte_same (*ptep, pte); -if (changed) { -set_huge_pte_at (vma->vm_mm, addr, ptep, pte); -flush_tlb_page (vma, addr); - } -return changed; -} +pte_t pte,int dirty);static inline pte_t huge_ptep_get (pte_t *ptep) {
arch/parisc/mm/hugetlbpage.c +48 -12
95 lines not on this page · raw message
Patches currently in stable-queue which might be from [email protected] are
queue-4.4/parisc-protect-huge-page-pte-changes-with-spinlocks.patch queue-4.4/parisc-fix-__arch_si_preamble_size.patch