summaryrefslogtreecommitdiffstats
path: root/arch/sparc/mm/gup.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2013-09-26 13:45:15 -0700
committerDavid S. Miller <davem@davemloft.net>2013-11-13 12:33:08 -0800
commita7b9403f0e6d5f99139dca18be885819c8d380a1 (patch)
tree3e88ddc9250a1408eefc48a20a8fb445e19fcaa3 /arch/sparc/mm/gup.c
parent2b77933c28f5044629bb19e8045aae65b72b939d (diff)
downloadlinux-a7b9403f0e6d5f99139dca18be885819c8d380a1.tar.gz
linux-a7b9403f0e6d5f99139dca18be885819c8d380a1.tar.bz2
linux-a7b9403f0e6d5f99139dca18be885819c8d380a1.zip
sparc64: Encode huge PMDs using PTE encoding.
Now that we have 64-bits for PMDs we can stop using special encodings for the huge PMD values, and just put real PTEs in there. We allocate a _PAGE_PMD_HUGE bit to distinguish between plain PMDs and huge ones. It is the same for both 4U and 4V PTE layouts. We also use _PAGE_SPECIAL to indicate the splitting state, since a huge PMD cannot also be special. All of the PMD --> PTE translation code disappears, and most of the huge PMD bit modifications and tests just degenerate into the PTE operations. In particular USER_PGTABLE_CHECK_PMD_HUGE becomes trivial. As a side effect, normal PMDs don't shift the physical address around. This also speeds up the page table walks in the TLB miss paths since they don't have to do the shifts any more. Another non-trivial aspect is that pte_modify() has to be changed to preserve the _PAGE_PMD_HUGE bits as well as the page size field of the pte. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sparc/mm/gup.c')
-rw-r--r--arch/sparc/mm/gup.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/arch/sparc/mm/gup.c b/arch/sparc/mm/gup.c
index 01ee23dd724d..c4d3da68b800 100644
--- a/arch/sparc/mm/gup.c
+++ b/arch/sparc/mm/gup.c
@@ -71,13 +71,12 @@ static int gup_huge_pmd(pmd_t *pmdp, pmd_t pmd, unsigned long addr,
int *nr)
{
struct page *head, *page, *tail;
- u32 mask;
int refs;
- mask = PMD_HUGE_PRESENT;
- if (write)
- mask |= PMD_HUGE_WRITE;
- if ((pmd_val(pmd) & mask) != mask)
+ if (!pmd_large(pmd))
+ return 0;
+
+ if (write && !pmd_write(pmd))
return 0;
refs = 0;