linux/tools/testing/selftests/vDSO
Tobias Klauser f405ac83fa selftests/vDSO: fix ABI selftest on riscv
Only older versions of the RISC-V GCC toolchain define __riscv__. Check
for __riscv as well, which is used by newer GCC toolchains. Also set
VDSO_32BIT based on __riscv_xlen.

Before (on riscv64):

$ ./vdso_test_abi
[vDSO kselftest] VDSO_VERSION: LINUX_4
Could not find __vdso_gettimeofday
Could not find __vdso_clock_gettime
Could not find __vdso_clock_getres
clock_id: CLOCK_REALTIME [PASS]
Could not find __vdso_clock_gettime
Could not find __vdso_clock_getres
clock_id: CLOCK_BOOTTIME [PASS]
Could not find __vdso_clock_gettime
Could not find __vdso_clock_getres
clock_id: CLOCK_TAI [PASS]
Could not find __vdso_clock_gettime
Could not find __vdso_clock_getres
clock_id: CLOCK_REALTIME_COARSE [PASS]
Could not find __vdso_clock_gettime
Could not find __vdso_clock_getres
clock_id: CLOCK_MONOTONIC [PASS]
Could not find __vdso_clock_gettime
Could not find __vdso_clock_getres
clock_id: CLOCK_MONOTONIC_RAW [PASS]
Could not find __vdso_clock_gettime
Could not find __vdso_clock_getres
clock_id: CLOCK_MONOTONIC_COARSE [PASS]
Could not find __vdso_time

After (on riscv32):

$ ./vdso_test_abi
[vDSO kselftest] VDSO_VERSION: LINUX_4.15
The time is 1612449376.015086
The time is 1612449376.18340784
The resolution is 0 1
clock_id: CLOCK_REALTIME [PASS]
The time is 774.842586182
The resolution is 0 1
clock_id: CLOCK_BOOTTIME [PASS]
The time is 1612449376.22536565
The resolution is 0 1
clock_id: CLOCK_TAI [PASS]
The time is 1612449376.20885172
The resolution is 0 4000000
clock_id: CLOCK_REALTIME_COARSE [PASS]
The time is 774.845491269
The resolution is 0 1
clock_id: CLOCK_MONOTONIC [PASS]
The time is 774.849534200
The resolution is 0 1
clock_id: CLOCK_MONOTONIC_RAW [PASS]
The time is 774.842139684
The resolution is 0 4000000
clock_id: CLOCK_MONOTONIC_COARSE [PASS]
Could not find __vdso_time

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Reviewed-by: Palmer Dabbelt <palmerdabbelt@google.com>
Acked-by: Palmer Dabbelt <palmerdabbelt@google.com>
Acked-by: Vincenzo Frascino <vincenzo.frascino@arm.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
2021-02-08 16:38:34 -07:00
..
.gitignore selftests/vDSO: add additional binaries to .gitignore 2021-01-04 09:25:44 -07:00
Makefile kselftest: Move test_vdso to the vDSO test suite 2020-10-27 17:58:33 -06:00
parse_vdso.c selftests: vdso: Use a header file to prototype parse_vdso API 2020-05-22 11:04:10 -06:00
parse_vdso.h selftests: vdso: Use a header file to prototype parse_vdso API 2020-05-22 11:04:10 -06:00
vdso_config.h selftests/vDSO: fix ABI selftest on riscv 2021-02-08 16:38:34 -07:00
vdso_standalone_test_x86.c selftests: vdso: Use a header file to prototype parse_vdso API 2020-05-22 11:04:10 -06:00
vdso_test_abi.c kselftest: Extend vDSO selftest 2020-10-27 17:57:08 -06:00
vdso_test_clock_getres.c kselftest: Extend vDSO selftest to clock_getres 2020-10-27 17:58:00 -06:00
vdso_test_correctness.c selftests/vDSO: fix -Wformat warning in vdso_test_correctness 2021-01-04 09:25:45 -07:00
vdso_test_getcpu.c selftests: vdso: Add a selftest for vDSO getcpu() 2020-05-22 11:05:07 -06:00
vdso_test_gettimeofday.c selftests: vdso: Use a header file to prototype parse_vdso API 2020-05-22 11:04:10 -06:00