mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-06 06:35:12 +00:00
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: dcd1912d21
("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>
This commit is contained in:
parent
b23afd3848
commit
b6c41cb050
1 changed files with 4 additions and 2 deletions
|
@ -24,9 +24,11 @@ static inline int is_hugepage_only_range(struct mm_struct *mm,
|
||||||
static inline int prepare_hugepage_range(struct file *file,
|
static inline int prepare_hugepage_range(struct file *file,
|
||||||
unsigned long addr, unsigned long len)
|
unsigned long addr, unsigned long len)
|
||||||
{
|
{
|
||||||
if (len & ~HPAGE_MASK)
|
struct hstate *h = hstate_file(file);
|
||||||
|
|
||||||
|
if (len & ~huge_page_mask(h))
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
if (addr & ~HPAGE_MASK)
|
if (addr & ~huge_page_mask(h))
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue