summaryrefslogtreecommitdiffstats
path: root/arch/sparc
diff options
context:
space:
mode:
authorNitin Gupta <nitin.m.gupta@oracle.com>2017-05-16 01:28:17 +0200
committerDavid S. Miller <davem@davemloft.net>2017-05-17 21:07:01 +0200
commitb6c41cb050d5debc7e4eaa0a81cbdbad72588891 (patch)
treef1aa480e1fe3c3c41e610791c660c99a9bbeedb6 /arch/sparc
parentMerge tag 'pstore-v4.12-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git... (diff)
downloadlinux-b6c41cb050d5debc7e4eaa0a81cbdbad72588891.tar.xz
linux-b6c41cb050d5debc7e4eaa0a81cbdbad72588891.zip
sparc64: Fix mapping of 64k pages with MAP_FIXED
An incorrect huge page alignment check caused mmap failure for 64K pages when MAP_FIXED is used with address not aligned to HPAGE_SIZE. Orabug: 25885991 Fixes: dcd1912d21a0 ("sparc64: Add 64K page size support") Signed-off-by: Nitin Gupta <nitin.m.gupta@oracle.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sparc')
-rw-r--r--arch/sparc/include/asm/hugetlb.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/arch/sparc/include/asm/hugetlb.h b/arch/sparc/include/asm/hugetlb.h
index dcbf985ab243..d1f837dc77a4 100644
--- a/arch/sparc/include/asm/hugetlb.h
+++ b/arch/sparc/include/asm/hugetlb.h
@@ -24,9 +24,11 @@ static inline int is_hugepage_only_range(struct mm_struct *mm,
static inline int prepare_hugepage_range(struct file *file,
unsigned long addr, unsigned long len)
{
- if (len & ~HPAGE_MASK)
+ struct hstate *h = hstate_file(file);
+
+ if (len & ~huge_page_mask(h))
return -EINVAL;
- if (addr & ~HPAGE_MASK)
+ if (addr & ~huge_page_mask(h))
return -EINVAL;
return 0;
}