path: root/arch/parisc/include/asm
diff options
authorHelge Deller <>2015-11-26 21:14:02 +0100
committerHelge Deller <>2016-01-16 19:19:14 +0100
commitb0e551313ebde17764f3a5ed273df524d1e7e690 (patch)
tree99c1e58b4509ab2a5510ac9abde6bc9b606ccbca /arch/parisc/include/asm
parent2c2277dc8e18eac8a59cdd0c62ca15106ab6f857 (diff)
parisc: Protect huge page pte changes with spinlocks
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 <> Cc: # v4.4
Diffstat (limited to 'arch/parisc/include/asm')
1 files changed, 4 insertions, 16 deletions
diff --git a/arch/parisc/include/asm/hugetlb.h b/arch/parisc/include/asm/hugetlb.h
index 7d56a9ccb752..a65d888716c4 100644
--- a/arch/parisc/include/asm/hugetlb.h
+++ b/arch/parisc/include/asm/hugetlb.h
@@ -54,24 +54,12 @@ static inline pte_t huge_pte_wrprotect(pte_t pte)
return 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)