OpenCloudOS-Kernel/tools/testing/selftests/vm
Aneesh Kumar K.V f39c58008d selftest/vm: fix map_fixed_noreplace test failure
On the latest RHEL the test fails due to executable mapped at 256MB
address

     # ./map_fixed_noreplace
    mmap() @ 0x10000000-0x10050000 p=0xffffffffffffffff result=File exists
    10000000-10010000 r-xp 00000000 fd:04 34905657                           /root/rpmbuild/BUILD/kernel-5.14.0-56.el9/linux-5.14.0-56.el9.ppc64le/tools/testing/selftests/vm/map_fixed_noreplace
    10010000-10020000 r--p 00000000 fd:04 34905657                           /root/rpmbuild/BUILD/kernel-5.14.0-56.el9/linux-5.14.0-56.el9.ppc64le/tools/testing/selftests/vm/map_fixed_noreplace
    10020000-10030000 rw-p 00010000 fd:04 34905657                           /root/rpmbuild/BUILD/kernel-5.14.0-56.el9/linux-5.14.0-56.el9.ppc64le/tools/testing/selftests/vm/map_fixed_noreplace
    10029b90000-10029bc0000 rw-p 00000000 00:00 0                            [heap]
    7fffbb510000-7fffbb750000 r-xp 00000000 fd:04 24534                      /usr/lib64/libc.so.6
    7fffbb750000-7fffbb760000 r--p 00230000 fd:04 24534                      /usr/lib64/libc.so.6
    7fffbb760000-7fffbb770000 rw-p 00240000 fd:04 24534                      /usr/lib64/libc.so.6
    7fffbb780000-7fffbb7a0000 r--p 00000000 00:00 0                          [vvar]
    7fffbb7a0000-7fffbb7b0000 r-xp 00000000 00:00 0                          [vdso]
    7fffbb7b0000-7fffbb800000 r-xp 00000000 fd:04 24514                      /usr/lib64/ld64.so.2
    7fffbb800000-7fffbb810000 r--p 00040000 fd:04 24514                      /usr/lib64/ld64.so.2
    7fffbb810000-7fffbb820000 rw-p 00050000 fd:04 24514                      /usr/lib64/ld64.so.2
    7fffd93f0000-7fffd9420000 rw-p 00000000 00:00 0                          [stack]
    Error: couldn't map the space we need for the test

Fix this by finding a free address using mmap instead of hardcoding
BASE_ADDRESS.

Link: https://lkml.kernel.org/r/20220217083417.373823-1-aneesh.kumar@linux.ibm.com
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Jann Horn <jannh@google.com>
Cc: Shuah Khan <shuah@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2022-02-26 09:51:17 -08:00
..
.gitignore mm, hugepages: add hugetlb vma mremap() test 2021-11-06 13:30:39 -07:00
Makefile mm, hugepages: add hugetlb vma mremap() test 2021-11-06 13:30:39 -07:00
charge_reserved_hugetlb.sh selftests/vm: make charge_reserved_hugetlb.sh work with existing cgroup setting 2022-01-15 16:30:30 +02:00
check_config.sh selftests/vm: hmm-tests: remove the libhugetlbfs dependency 2020-12-15 12:13:38 -08:00
compaction_test.c selftests/vm: 8x compaction_test speedup 2020-10-13 18:38:34 -07:00
config mm/gup_benchmark: rename to mm/gup_test 2020-12-15 12:13:38 -08:00
gup_test.c mm/gup_benchmark: support threading 2021-06-29 10:53:48 -07:00
hmm-tests.c mm/hmm.c: allow VM_MIXEDMAP to work with hmm_range_fault 2022-01-15 16:30:31 +02:00
hugepage-mmap.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
hugepage-mremap.c mm, hugepages: make memory size variable in hugepage-mremap selftest 2022-01-15 16:30:29 +02:00
hugepage-shm.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
hugetlb_reparenting_test.sh selftests/vm: make charge_reserved_hugetlb.sh work with existing cgroup setting 2022-01-15 16:30:30 +02:00
khugepaged.c khugepaged: selftests: remove debug_cow 2021-06-30 20:47:26 -07:00
ksm_tests.c selftests: vm: add KSM huge pages merging time test 2021-11-06 13:30:41 -07:00
madv_populate.c selftests/vm: make MADV_POPULATE_(READ|WRITE) use in-tree headers 2021-11-06 13:30:42 -07:00
map_fixed_noreplace.c selftest/vm: fix map_fixed_noreplace test failure 2022-02-26 09:51:17 -08:00
map_hugetlb.c selftests/vm: fix display of page size in map_hugetlb 2020-09-19 13:13:39 -07:00
map_populate.c tools/testing/selftests/vm/: add MAP_POPULATE test 2018-08-22 10:52:45 -07:00
memfd_secret.c secretmem: test: add basic selftest for memfd_secret(2) 2021-07-08 11:48:21 -07:00
mlock-random-test.c selftests: Fix spelling mistake "cann't" -> "cannot" 2021-09-03 09:58:13 -07:00
mlock2-tests.c selftests: vm: drop dependencies on page flags from mlock2 tests 2020-04-02 09:35:31 -07:00
mlock2.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
mremap_dontunmap.c selftests: add a MREMAP_DONTUNMAP selftest for shmem 2021-04-30 11:20:39 -07:00
mremap_test.c selftests/vm: remove ARRAY_SIZE define from individual tests 2021-12-10 17:51:25 -07:00
on-fault-limit.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
pkey-helpers.h selftests/vm: remove ARRAY_SIZE define from individual tests 2021-12-10 17:51:25 -07:00
pkey-powerpc.h selftests: vm: pkeys: use the correct page size on powerpc 2020-06-04 19:06:27 -07:00
pkey-x86.h selftests/vm/pkeys: exercise x86 XSAVE init state 2021-07-01 11:06:06 -07:00
protection_keys.c selftests/vm/pkeys: exercise x86 XSAVE init state 2021-07-01 11:06:06 -07:00
run_vmtests.sh mm, hugepages: make memory size variable in hugepage-mremap selftest 2022-01-15 16:30:29 +02:00
split_huge_page_test.c tools/testing/selftests/vm/split_huge_page_test.c: fix application of sizeof to pointer 2021-10-28 17:18:55 -07:00
test_hmm.sh mm/hmm/test: add selftests for HMM 2020-05-19 16:48:31 -03:00
test_vmalloc.sh vm/test_vmalloc.sh: adapt for updated driver interface 2021-04-30 11:20:40 -07:00
thuge-gen.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
transhuge-stress.c selftests/vm/transhuge-stress: fix ram size thinko 2021-11-06 13:30:41 -07:00
userfaultfd.c kselftest/vm: revert "tools/testing/selftests/vm/userfaultfd.c: use swap() to make code cleaner" 2022-02-04 09:25:05 -08:00
va_128TBswitch.c selftests/vm: remove ARRAY_SIZE define from individual tests 2021-12-10 17:51:25 -07:00
virtual_address_range.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 191 2019-05-30 11:29:21 -07:00
write_hugetlb_memory.sh selftests/vm: make charge_reserved_hugetlb.sh work with existing cgroup setting 2022-01-15 16:30:30 +02:00
write_to_hugetlbfs.c selftests/vm/write_to_hugetlbfs.c: fix unused variable warning 2020-05-23 10:26:31 -07:00