[Cbe-oss-dev] [PATCH] powerpc: Introduce address space "slices"

Adam Litke agl at us.ibm.com
Wed Feb 21 06:45:35 EST 2007


Your patch drops the pgoff check that prepare_hugepage_range used to
check.  The misaligned_offset test in libhugetlbfs identified the
problem.  The following patch (applied on top of yours) makes the
problem go away.  I am not necessarily suggesting it's the correct
fix... just concisely describing the problem.
 
commit 95bcfa9c7b086de320cd9a1ff9c7281f7f16b15f
Author: Adam Litke <agl at us.ibm.com>
Date:   Tue Feb 20 11:44:46 2007 -0800

    Restore the pgoff check for prepare_hugepage_range()

diff --git a/arch/powerpc/mm/hugetlbpage.c b/arch/powerpc/mm/hugetlbpage.c
index cbb8c52..f38ab78 100644
--- a/arch/powerpc/mm/hugetlbpage.c
+++ b/arch/powerpc/mm/hugetlbpage.c
@@ -349,6 +349,9 @@ int prepare_hugepage_range(unsigned long addr, unsigned long len, pgoff_t pgoff)
 
 	printk("prepare_hugepage_range(addr=0x%lx, len=0x%lx\n", addr, len);
 
+	if (pgoff & (~HPAGE_MASK >> PAGE_SHIFT))
+		return -EINVAL;
+
 	/* This is only useful for MAP_FIXED so we turn it into that */
 	gua_addr = slice_get_unmapped_area(addr, len, MAP_FIXED,
 					   mmu_huge_psize, 1, 0);

-- 
Adam Litke - (agl at us.ibm.com)
IBM Linux Technology Center




More information about the cbe-oss-dev mailing list