mem/hugetlb: fix failure of hugemmap03: 1) In mmap's manual, The starting address for the new mapping is specified in addr. So, if mmap's argument "addr" is reachable, the mmap will creates a new mapping in the virtual address space of the call-ing process. The test hugemmap03 will test that a normal page cannot be mapped into a high memory region. This infers that "addr" should be higher for 64-bit mode. 2) The test use "-I2" option, and this not only causes TFAIL's loop, but also causes TPASS's loop. For TFAIL, loop is deserved, nor for TPASS. This patch fixed these problems. Signed-off-by: Liu Bo <liubo2009@cn.fujitsu.com>.
diff --git a/testcases/kernel/mem/hugetlb/hugemmap/hugemmap03.c b/testcases/kernel/mem/hugetlb/hugemmap/hugemmap03.c
index 892d24b..a07b9aa 100644
--- a/testcases/kernel/mem/hugetlb/hugemmap/hugemmap03.c
+++ b/testcases/kernel/mem/hugetlb/hugemmap/hugemmap03.c
@@ -55,7 +55,7 @@
#include "usctest.h"
#define PAGE_SIZE ((1UL) << 12) /* Normal page size */
-#define HIGH_ADDR (void *)(0x10000000000)
+#define HIGH_ADDR (void *)(0x1000000000000)
char* TEMPFILE="mmapfile";
@@ -130,6 +130,7 @@
continue;
} else {
tst_resm(TPASS, "Normal mmap() into high region failed correctly");
+ break;
}
close(fildes);