aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/tools/testing/selftests/vDSO
diff options
context:
space:
mode:
authorGuo Ren <guoren@kernel.org>2022-11-03 04:04:51 -0400
committerShuah Khan <skhan@linuxfoundation.org>2022-11-03 03:28:01 -0600
commitd942f231afc037490538cea67bb0c667e6d12214 (patch)
tree355b720708bd73bd0932f9148fbb6345c8bcd2be /tools/testing/selftests/vDSO
parentDocumentation: amd-pstate: Add tbench and gitsource test introduction (diff)
downloadwireguard-linux-d942f231afc037490538cea67bb0c667e6d12214.tar.xz
wireguard-linux-d942f231afc037490538cea67bb0c667e6d12214.zip
selftests/vDSO: Add riscv getcpu & gettimeofday test
Enable vDSO getcpu & gettimeofday test for riscv. But only riscv64 supports __vdso_gettimeofday and riscv32 is under development. VERSION { LINUX_4.15 { global: __vdso_rt_sigreturn; __vdso_gettimeofday; __vdso_clock_gettime; __vdso_clock_getres; __vdso_getcpu; __vdso_flush_icache; local: *; }; } Co-developed-by: haocheng.zy <haocheng.zy@linux.alibaba.com> Signed-off-by: haocheng.zy <haocheng.zy@linux.alibaba.com> Suggested-by: Mao Han <han_mao@linux.alibaba.com> Reviewed-by: Shuah Khan <skhan@linuxfoundation.org> Signed-off-by: Guo Ren <guoren@linux.alibaba.com> Signed-off-by: Guo Ren <guoren@kernel.org> Cc: Paul Walmsley <paul.walmsley@sifive.com> Cc: Palmer Dabbelt <palmer@dabbelt.com> Cc: Elliott Hughes <enh@google.com> Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
Diffstat (limited to 'tools/testing/selftests/vDSO')
-rw-r--r--tools/testing/selftests/vDSO/vdso_test_getcpu.c4
-rw-r--r--tools/testing/selftests/vDSO/vdso_test_gettimeofday.c3
2 files changed, 7 insertions, 0 deletions
diff --git a/tools/testing/selftests/vDSO/vdso_test_getcpu.c b/tools/testing/selftests/vDSO/vdso_test_getcpu.c
index fc25ede131b8..1df5d057d79f 100644
--- a/tools/testing/selftests/vDSO/vdso_test_getcpu.c
+++ b/tools/testing/selftests/vDSO/vdso_test_getcpu.c
@@ -14,7 +14,11 @@
#include "../kselftest.h"
#include "parse_vdso.h"
+#if defined(__riscv)
+const char *version = "LINUX_4.15";
+#else
const char *version = "LINUX_2.6";
+#endif
const char *name = "__vdso_getcpu";
struct getcpu_cache;
diff --git a/tools/testing/selftests/vDSO/vdso_test_gettimeofday.c b/tools/testing/selftests/vDSO/vdso_test_gettimeofday.c
index 8ccc73ed8240..e411f287a426 100644
--- a/tools/testing/selftests/vDSO/vdso_test_gettimeofday.c
+++ b/tools/testing/selftests/vDSO/vdso_test_gettimeofday.c
@@ -27,6 +27,9 @@
#if defined(__aarch64__)
const char *version = "LINUX_2.6.39";
const char *name = "__kernel_gettimeofday";
+#elif defined(__riscv)
+const char *version = "LINUX_4.15";
+const char *name = "__vdso_gettimeofday";
#else
const char *version = "LINUX_2.6";
const char *name = "__vdso_gettimeofday";