<div dir="ltr">Hi,<br><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Oct 10, 2015 at 2:46 PM, Li Wang <span dir="ltr"><<a href="mailto:liwang@redhat.com" target="_blank">liwang@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">the testcase 'hugemmap02' always failed on s390x as:<br>
----------<br>
hugemmap02 0 TINFO : set nr_hugepages to 128<br>
hugemmap02 1 TPASS : huge mmap succeeded (64-bit)<br>
./hugemmap02: relocation error: ./hugemmap02: symbol , version GLIBC_2.2 not defined in file libc.so.6 with link time reference<br>
----------<br>
<br>
the reason is that function<br>
"addr = mmap(LOW_ADDR, page_sz, PROT_READ,<br>
MAP_SHARED | MAP_FIXED, nfildes, 0);"<br>
expect to map in the virtual address from 0x80000000 to 0x80001000.<br>
<br>
but in the program we could obviously see the region has been used:<br>
---------<br>
# readelf -s hugemmap02 |grep 80001 -B 10<br>
<br>
120: 0000000080002c00 0 FUNC GLOBAL DEFAULT UND getgid@GLIBC_2.2 (4)<br>
<br>
Symbol table '.symtab' contains 406 entries:<br>
Num: Value Size Type Bind Vis Ndx Name<br>
0: 0000000000000000 0 NOTYPE LOCAL DEFAULT UND<br>
1: 0000000080000238 0 SECTION LOCAL DEFAULT 1<br>
2: 0000000080000248 0 SECTION LOCAL DEFAULT 2<br>
3: 0000000080000268 0 SECTION LOCAL DEFAULT 3<br>
4: 0000000080000290 0 SECTION LOCAL DEFAULT 4<br>
5: 0000000080000678 0 SECTION LOCAL DEFAULT 5<br>
6: 00000000800011d0 0 SECTION LOCAL DEFAULT 6<br>
7: 00000000800015f0 0 SECTION LOCAL DEFAULT 7<br>
8: 00000000800016e8 0 SECTION LOCAL DEFAULT 8<br>
9: 0000000080001768 0 SECTION LOCAL DEFAULT 9<br>
10: 00000000800017c8 0 SECTION LOCAL DEFAULT 10<br>
----------<br>
<br>
then I print the address during the program runing. it looks like as the guess:<br>
----------<br>
hugemmap02 0 TINFO : set nr_hugepages to 128<br>
program address:<br>
80000000-80012000 r-xp 00000000 fd:00 68124645 /mnt/tests/kernel/vm/hugepage/ltp-hugetlbfs/ltp-full-20150903/testcases/kernel/mem/hugetlb/hugemmap/hugemmap02<br>
80012000-80013000 r--p 00011000 fd:00 68124645 /mnt/tests/kernel/vm/hugepage/ltp-hugetlbfs/ltp-full-20150903/testcases/kernel/mem/hugetlb/hugemmap/hugemmap02<br>
...<br>
80014000-80017000 rw-p 00000000 00:00 0<br>
9cf72000-9cf93000 rw-p 00000000 00:00 0 [heap]<br>
3ffad56e000-3ffbd56e000 r--s 00000000 00:05 2677 /dev/zero<br>
3ffbd56e000-3ffcd56e000 r--s 00000000 00:05 2677 /dev/zero<br>
...<br>
рLhugemmap02 1 TPASS : huge mmap succeeded (64-bit)<br>
./hugemmap02: relocation error: ./hugemmap02: symbol , version GLIBC_2.2 not defined in file libc.so.6 with link time reference<br>
-----------<br>
<br>
So I draft this patch to shift 'LOW_ADDR' with an empty region on s390x.<br>
<br>
Signed-off-by: Li Wang <<a href="mailto:liwang@redhat.com">liwang@redhat.com</a>><br>
---<br>
testcases/kernel/mem/hugetlb/hugemmap/hugemmap02.c | 6 ++++++<br>
1 file changed, 6 insertions(+)<br>
<br>
diff --git a/testcases/kernel/mem/hugetlb/hugemmap/hugemmap02.c b/testcases/kernel/mem/hugetlb/hugemmap/hugemmap02.c<br>
index cfdcb3c..c5bb429 100644<br>
--- a/testcases/kernel/mem/hugetlb/hugemmap/hugemmap02.c<br>
+++ b/testcases/kernel/mem/hugetlb/hugemmap/hugemmap02.c<br>
@@ -56,8 +56,14 @@<br>
#include "safe_macros.h"<br>
#include "mem.h"<br>
<br>
+#if __s390__ || __s390x__<br>
+#define LOW_ADDR (void *)(0x90000000)<br>
+#define LOW_ADDR2 (void *)(0xa0000000)<br></blockquote><div><br></div><div>looks like the LOW_ADDR defined in limited is not a good idea, if the program can shift the region dynamically, that would be better.<br><br></div><div>so, please ignore this patch, I will format V2 to achieve the method.<br><br></div><div> <br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
+<br>
+#else<br>
#define LOW_ADDR (void *)(0x80000000)<br>
#define LOW_ADDR2 (void *)(0x90000000)<br>
+#endif<br>
<br>
static char TEMPFILE[MAXPATHLEN];<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
1.8.3.1<br>
<br>
<br>
--<br>
Mailing list info: <a href="http://lists.linux.it/listinfo/ltp" rel="noreferrer" target="_blank">http://lists.linux.it/listinfo/ltp</a><br>
</font></span></blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div>Regards,<br></div>Li Wang<br></div><div>Email: <a href="mailto:liwang@redhat.com" target="_blank">liwang@redhat.com</a><br></div></div></div></div></div></div>
</div></div>