]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
s390/pgtable: Use set_pmd_bit() to invalidate PMD entry
authorAlexander Gordeev <agordeev@linux.ibm.com>
Fri, 6 Mar 2026 16:16:31 +0000 (17:16 +0100)
committerVasily Gorbik <gor@linux.ibm.com>
Thu, 12 Mar 2026 23:07:47 +0000 (00:07 +0100)
Commit 3a5a8d343e1c ("mm: fix race between __split_huge_pmd_locked()
and GUP-fast") failed to follow the convention and used direct PMD
entry modification instead of set_pmd_bit().

Reviewed-by: Gerald Schaefer <gerald.schaefer@linux.ibm.com>
Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
Link: https://lore.kernel.org/r/a9248694a38cc898d3f0628f59b8abb57d56a416.1772812343.git.agordeev@linux.ibm.com
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
arch/s390/include/asm/pgtable.h

index 1c3c3be93be9c631f7ef5c9bffd77a6701b19238..04ec9fee64982214bd59803f8de300f7e0da5ae4 100644 (file)
@@ -1744,10 +1744,10 @@ static inline pmd_t pmdp_huge_clear_flush(struct vm_area_struct *vma,
 static inline pmd_t pmdp_invalidate(struct vm_area_struct *vma,
                                   unsigned long addr, pmd_t *pmdp)
 {
-       pmd_t pmd;
+       pmd_t pmd = *pmdp;
 
-       VM_WARN_ON_ONCE(!pmd_present(*pmdp));
-       pmd = __pmd(pmd_val(*pmdp) | _SEGMENT_ENTRY_INVALID);
+       VM_WARN_ON_ONCE(!pmd_present(pmd));
+       pmd = set_pmd_bit(pmd, __pgprot(_SEGMENT_ENTRY_INVALID));
        return pmdp_xchg_direct(vma->vm_mm, addr, pmdp, pmd);
 }