* [PATCH] sparc64: Fix mapping of 64k pages with MAP_FIXED
@ 2017-05-15 23:28 ` Nitin Gupta
0 siblings, 0 replies; 4+ messages in thread
From: Nitin Gupta @ 2017-05-15 23:28 UTC (permalink / raw)
To: David S. Miller; +Cc: Nitin Gupta, David S. Miller, sparclinux, linux-kernel
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
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH] sparc64: Fix mapping of 64k pages with MAP_FIXED
@ 2017-05-15 23:28 ` Nitin Gupta
0 siblings, 0 replies; 4+ messages in thread
From: Nitin Gupta @ 2017-05-15 23:28 UTC (permalink / raw)
To: David S. Miller; +Cc: Nitin Gupta, sparclinux, linux-kernel
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
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] sparc64: Fix mapping of 64k pages with MAP_FIXED
2017-05-15 23:28 ` Nitin Gupta
@ 2017-05-17 19:08 ` David Miller
-1 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2017-05-17 19:08 UTC (permalink / raw)
To: nitin.m.gupta; +Cc: sparclinux, linux-kernel
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.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] sparc64: Fix mapping of 64k pages with MAP_FIXED
@ 2017-05-17 19:08 ` David Miller
0 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2017-05-17 19:08 UTC (permalink / raw)
To: nitin.m.gupta; +Cc: sparclinux, linux-kernel
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.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2017-05-17 19:09 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-15 23:28 [PATCH] sparc64: Fix mapping of 64k pages with MAP_FIXED Nitin Gupta
2017-05-15 23:28 ` Nitin Gupta
2017-05-17 19:08 ` David Miller
2017-05-17 19:08 ` David Miller
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.