aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2014-04-25 13:21:12 -0400
committerDavid S. Miller <davem@davemloft.net>2014-05-04 01:32:37 -0400
commit04df419de34104d8818b8c5cffaa062fa36d20ea (patch)
tree35f20c565e3d6797ed9638e688e4e911251da011 /arch
parent51e5ef1bb7ab0e5fa7de4e802da5ab22fe35f0bf (diff)
sparc64: Fix bugs in get_user_pages_fast() wrt. THP.
The large PMD path needs to check _PAGE_VALID not _PAGE_PRESENT, to decide if it needs to bail and return 0. pmd_large() should therefore just check _PAGE_PMD_HUGE. Calls to gup_huge_pmd() are guarded with a check of pmd_large(), so we just need to add a valid bit check. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch')
-rw-r--r--arch/sparc/include/asm/pgtable_64.h2
-rw-r--r--arch/sparc/mm/gup.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/arch/sparc/include/asm/pgtable_64.h b/arch/sparc/include/asm/pgtable_64.h
index e3db4b8e689b..1f281030769c 100644
--- a/arch/sparc/include/asm/pgtable_64.h
+++ b/arch/sparc/include/asm/pgtable_64.h
@@ -633,7 +633,7 @@ static inline unsigned long pmd_large(pmd_t pmd)
633{ 633{
634 pte_t pte = __pte(pmd_val(pmd)); 634 pte_t pte = __pte(pmd_val(pmd));
635 635
636 return (pte_val(pte) & _PAGE_PMD_HUGE) && pte_present(pte); 636 return pte_val(pte) & _PAGE_PMD_HUGE;
637} 637}
638 638
639#ifdef CONFIG_TRANSPARENT_HUGEPAGE 639#ifdef CONFIG_TRANSPARENT_HUGEPAGE
diff --git a/arch/sparc/mm/gup.c b/arch/sparc/mm/gup.c
index c4d3da68b800..1aed0432c64b 100644
--- a/arch/sparc/mm/gup.c
+++ b/arch/sparc/mm/gup.c
@@ -73,7 +73,7 @@ static int gup_huge_pmd(pmd_t *pmdp, pmd_t pmd, unsigned long addr,
73 struct page *head, *page, *tail; 73 struct page *head, *page, *tail;
74 int refs; 74 int refs;
75 75
76 if (!pmd_large(pmd)) 76 if (!(pmd_val(pmd) & _PAGE_VALID))
77 return 0; 77 return 0;
78 78
79 if (write && !pmd_write(pmd)) 79 if (write && !pmd_write(pmd))