selftests/vDSO: Add riscv getcpu & gettimeofday test
Subsystems (4)
PATCH v2 1/1 selftests/vDSO: Add riscv getcpu & gettimeofday test
From: Guo Ren <[email protected]>
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 <[email protected]>
Signed-off-by haocheng.zy <[email protected]>
Suggested-by Mao Han <[email protected]>
Reviewed-by Shuah Khan <[email protected]>
Signed-off-by Guo Ren <[email protected]>
Signed-off-by Guo Ren <[email protected]>
Cc Paul Walmsley <[email protected]>
Cc Palmer Dabbelt <[email protected]>
Cc Elliott Hughes <[email protected]>
--- tools/testing/selftests/vDSO/vdso_test_getcpu.c | 4 ++++ tools/testing/selftests/vDSO/vdso_test_gettimeofday.c | 3 +++ 2 files changed, 7 insertions(+)
tools/testing/selftests/vDSO/vdso_test_getcpu.c +4 -0
@@ -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 ;
tools/testing/selftests/vDSO/vdso_test_gettimeofday.c +3 -0
@@ -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" ;
Signature · 1 line
2.36.1
Quoted 54 lines · On Thu, 03 Nov 2022 01:04:51 PDT (-0700), [email protected] wrote:
From: Guo Ren <[email protected]>
Enable vDSO getcpu & gettimeofday test for riscv. But only riscv64 supports
__vdso_gettimeofdayand 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 <[email protected]>Signed-off-by haocheng.zy <[email protected]>Suggested-by Mao Han <[email protected]>Reviewed-by Shuah Khan <[email protected]>Signed-off-by Guo Ren <[email protected]>Signed-off-by Guo Ren <[email protected]>Cc Paul Walmsley <[email protected]>Cc Palmer Dabbelt <[email protected]>Cc Elliott Hughes <[email protected]>--- tools/testing/selftests/vDSO/vdso_test_getcpu.c | 4 ++++ tools/testing/selftests/vDSO/vdso_test_gettimeofday.c | 3 +++ 2 files changed, 7 insertions(+)tools/testing/selftests/vDSO/vdso_test_getcpu.c +4
-0@@ -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 ;tools/testing/selftests/vDSO/vdso_test_gettimeofday.c +0
-0
tools/testing/selftests/vDSO/vdso_test_gettimeofday.c line 35
Quoted 9 lines
tools/testing/selftests/vDSO/vdso_test_gettimeofday.c +3
-0@@ -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" ;
Reviewed-by Palmer Dabbelt <[email protected]>
Acked-by Palmer Dabbelt <[email protected]>
Looks like Shauh usually takes patches for this vdso selftest, but happy to take it through the RISC-V tree if that's easier. Either way's fine with me, I'm leaving it in patchwork for now as a reminder.
Thanks!