diff options
author | Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com> | 2019-03-05 18:46:26 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2019-03-06 00:07:18 -0500 |
commit | 0cbe3e26abe0cfe7effb67f620a77d46cce628b2 (patch) | |
tree | 66c7245bed4833b455a9763daf5f1286646bd94e /fs/proc | |
parent | 8bb4e7a2ee26c05a94ae6cb0aec2f82a3523cf35 (diff) |
mm: update ptep_modify_prot_start/commit to take vm_area_struct as arg
Patch series "NestMMU pte upgrade workaround for mprotect", v5.
We can upgrade pte access (R -> RW transition) via mprotect. We need to
make sure we follow the recommended pte update sequence as outlined in
commit bd5050e38aec ("powerpc/mm/radix: Change pte relax sequence to
handle nest MMU hang") for such updates. This patch series does that.
This patch (of 5):
Some architectures may want to call flush_tlb_range from these helpers.
Link: http://lkml.kernel.org/r/20190116085035.29729-2-aneesh.kumar@linux.ibm.com
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com>
Cc: Nicholas Piggin <npiggin@gmail.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/proc')
-rw-r--r-- | fs/proc/task_mmu.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c index 85b0ef890b28..9c2ef731dd5f 100644 --- a/fs/proc/task_mmu.c +++ b/fs/proc/task_mmu.c | |||
@@ -948,10 +948,10 @@ static inline void clear_soft_dirty(struct vm_area_struct *vma, | |||
948 | pte_t ptent = *pte; | 948 | pte_t ptent = *pte; |
949 | 949 | ||
950 | if (pte_present(ptent)) { | 950 | if (pte_present(ptent)) { |
951 | ptent = ptep_modify_prot_start(vma->vm_mm, addr, pte); | 951 | ptent = ptep_modify_prot_start(vma, addr, pte); |
952 | ptent = pte_wrprotect(ptent); | 952 | ptent = pte_wrprotect(ptent); |
953 | ptent = pte_clear_soft_dirty(ptent); | 953 | ptent = pte_clear_soft_dirty(ptent); |
954 | ptep_modify_prot_commit(vma->vm_mm, addr, pte, ptent); | 954 | ptep_modify_prot_commit(vma, addr, pte, ptent); |
955 | } else if (is_swap_pte(ptent)) { | 955 | } else if (is_swap_pte(ptent)) { |
956 | ptent = pte_swp_clear_soft_dirty(ptent); | 956 | ptent = pte_swp_clear_soft_dirty(ptent); |
957 | set_pte_at(vma->vm_mm, addr, pte, ptent); | 957 | set_pte_at(vma->vm_mm, addr, pte, ptent); |