selftests/vDSO: Add riscv getcpu & gettimeofday test
authorGuo Ren <guoren@kernel.org>
Thu, 3 Nov 2022 08:04:51 +0000 (04:04 -0400)
committerShuah Khan <skhan@linuxfoundation.org>
Thu, 3 Nov 2022 09:28:01 +0000 (03:28 -0600)
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>
tools/testing/selftests/vDSO/vdso_test_getcpu.c
tools/testing/selftests/vDSO/vdso_test_gettimeofday.c

index fc25ede..1df5d05 100644 (file)
 #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;
index 8ccc73e..e411f28 100644 (file)
@@ -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";