aboutsummaryrefslogtreecommitdiffstats
path: root/mm/hmm.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2019-08-06 19:05:47 +0300
committerJason Gunthorpe <jgg@mellanox.com>2019-08-07 14:58:06 -0300
commit309f9a4f5e1a233d5df2101b9394ee689d9e463f (patch)
treec0847f8ec2e351fcb1e1d4d6eb0e63f4e6ece197 /mm/hmm.c
parentmm/hmm: remove the mask variable in hmm_vma_walk_hugetlb_entry (diff)
downloadlinux-dev-309f9a4f5e1a233d5df2101b9394ee689d9e463f.tar.xz
linux-dev-309f9a4f5e1a233d5df2101b9394ee689d9e463f.zip
mm/hmm: don't abuse pte_index() in hmm_vma_handle_pmd
pte_index is an internal arch helper in various architectures, without consistent semantics. Open code that calculation of a PMD index based on the virtual address instead. Link: https://lore.kernel.org/r/20190806160554.14046-10-hch@lst.de Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Jason Gunthorpe <jgg@mellanox.com> Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Diffstat (limited to 'mm/hmm.c')
-rw-r--r--mm/hmm.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/mm/hmm.c b/mm/hmm.c
index 4807f4b16736..8d56a4342624 100644
--- a/mm/hmm.c
+++ b/mm/hmm.c
@@ -486,7 +486,7 @@ static int hmm_vma_handle_pmd(struct mm_walk *walk,
if (pmd_protnone(pmd) || fault || write_fault)
return hmm_vma_walk_hole_(addr, end, fault, write_fault, walk);
- pfn = pmd_pfn(pmd) + pte_index(addr);
+ pfn = pmd_pfn(pmd) + ((addr & ~PMD_MASK) >> PAGE_SHIFT);
for (i = 0; addr < end; addr += PAGE_SIZE, i++, pfn++) {
if (pmd_devmap(pmd)) {
hmm_vma_walk->pgmap = get_dev_pagemap(pfn,