Skip to content

Commit 95c222a

Browse files
committed
mm/gup: detect huge pfnmap entries in gup-fast
jira LE-3557 Rebuild_History Non-Buildable kernel-5.14.0-570.26.1.el9_6 commit-author Peter Xu <[email protected]> commit ae3c99e Since gup-fast doesn't have the vma reference, teach it to detect such huge pfnmaps by checking the special bit for pmd/pud too, just like ptes. Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Peter Xu <[email protected]> Acked-by: David Hildenbrand <[email protected]> Reviewed-by: Jason Gunthorpe <[email protected]> Cc: Alexander Gordeev <[email protected]> Cc: Alex Williamson <[email protected]> Cc: Aneesh Kumar K.V <[email protected]> Cc: Borislav Petkov <[email protected]> Cc: Catalin Marinas <[email protected]> Cc: Christian Borntraeger <[email protected]> Cc: Dave Hansen <[email protected]> Cc: Gavin Shan <[email protected]> Cc: Gerald Schaefer <[email protected]> Cc: Heiko Carstens <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Matthew Wilcox <[email protected]> Cc: Niklas Schnelle <[email protected]> Cc: Paolo Bonzini <[email protected]> Cc: Ryan Roberts <[email protected]> Cc: Sean Christopherson <[email protected]> Cc: Sven Schnelle <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: Vasily Gorbik <[email protected]> Cc: Will Deacon <[email protected]> Cc: Zi Yan <[email protected]> Signed-off-by: Andrew Morton <[email protected]> (cherry picked from commit ae3c99e) Signed-off-by: Jonathan Maple <[email protected]>
1 parent f5dec21 commit 95c222a

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

mm/gup.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2903,6 +2903,9 @@ static int gup_huge_pmd(pmd_t orig, pmd_t *pmdp, unsigned long addr,
29032903
if (!pmd_access_permitted(orig, flags & FOLL_WRITE))
29042904
return 0;
29052905

2906+
if (pmd_special(orig))
2907+
return 0;
2908+
29062909
if (pmd_devmap(orig)) {
29072910
if (unlikely(flags & FOLL_LONGTERM))
29082911
return 0;
@@ -2947,6 +2950,9 @@ static int gup_huge_pud(pud_t orig, pud_t *pudp, unsigned long addr,
29472950
if (!pud_access_permitted(orig, flags & FOLL_WRITE))
29482951
return 0;
29492952

2953+
if (pud_special(orig))
2954+
return 0;
2955+
29502956
if (pud_devmap(orig)) {
29512957
if (unlikely(flags & FOLL_LONGTERM))
29522958
return 0;

0 commit comments

Comments
 (0)