Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1642122 > unrolled thread

[PATCH] sparc64: Fix mapping of 64k pages with MAP_FIXED

Started byNitin Gupta <nitin.m.gupta@oracle.com>
First post2017-05-16 01:30 +0200
Last post2017-05-17 21:10 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] sparc64: Fix mapping of 64k pages with MAP_FIXED Nitin Gupta <nitin.m.gupta@oracle.com> - 2017-05-16 01:30 +0200
    Re: [PATCH] sparc64: Fix mapping of 64k pages with MAP_FIXED David Miller <davem@davemloft.net> - 2017-05-17 21:10 +0200

#1642122 — [PATCH] sparc64: Fix mapping of 64k pages with MAP_FIXED

FromNitin Gupta <nitin.m.gupta@oracle.com>
Date2017-05-16 01:30 +0200
Subject[PATCH] sparc64: Fix mapping of 64k pages with MAP_FIXED
Message-ID<tHxB8-6e6-11@gated-at.bofh.it>
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

Signed-off-by: Nitin Gupta <nitin.m.gupta@oracle.com>
---
 arch/sparc/include/asm/hugetlb.h | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/arch/sparc/include/asm/hugetlb.h b/arch/sparc/include/asm/hugetlb.h
index dcbf985..d1f837d 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;
 }
-- 
2.9.2

[toc] | [next] | [standalone]


#1643582

FromDavid Miller <davem@davemloft.net>
Date2017-05-17 21:10 +0200
Message-ID<tIcuC-764-15@gated-at.bofh.it>
In reply to#1642122
From: Nitin Gupta <nitin.m.gupta@oracle.com>
Date: Mon, 15 May 2017 16:28:17 -0700

> 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
> 
> Signed-off-by: Nitin Gupta <nitin.m.gupta@oracle.com>

Applied, but I had to add an appropriate "Fixes: " line, please
do this in the future, like so on the line right before the
first signoff or ack:

Fixes: dcd1912d21a0 ("sparc64: Add 64K page size support")

Thanks.

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web