On 11/2/22 02:15, guoren@xxxxxxxxxx wrote:
From: Guo Ren <guoren@xxxxxxxxxx>
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@xxxxxxxxxxxxxxxxx>
Signed-off-by: haocheng.zy <haocheng.zy@xxxxxxxxxxxxxxxxx>
Suggested-by: Mao Han <han_mao@xxxxxxxxxxxxxxxxx>
Signed-off-by: Guo Ren <guoren@xxxxxxxxxxxxxxxxx>
Signed-off-by: Guo Ren <guoren@xxxxxxxxxx>
Cc: Paul Walmsley <paul.walmsley@xxxxxxxxxx>
Cc: Palmer Dabbelt <palmer@xxxxxxxxxxx>
Cc: Elliott Hughes <enh@xxxxxxxxxx>
---
tools/testing/selftests/vDSO/vdso_test_getcpu.c | 5 +++++
tools/testing/selftests/vDSO/vdso_test_gettimeofday.c | 3 +++
2 files changed, 8 insertions(+)
diff --git a/tools/testing/selftests/vDSO/vdso_test_getcpu.c b/tools/testing/selftests/vDSO/vdso_test_getcpu.c
index fc25ede131b8..1e474f406a87 100644
--- a/tools/testing/selftests/vDSO/vdso_test_getcpu.c
+++ b/tools/testing/selftests/vDSO/vdso_test_getcpu.c
@@ -14,8 +14,13 @@
#include "../kselftest.h"
#include "parse_vdso.h"
+#if defined(__riscv)
+const char *version = "LINUX_4.15";
+const char *name = "__vdso_getcpu";> +#else
const char *version = "LINUX_2.6";
const char *name = "__vdso_getcpu";
+#endif
name is same in both cases. Move it out of ifdef.
struct getcpu_cache;
typedef long (*getcpu_t)(unsigned int *, unsigned int *,
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";
Rest looks fine.
Reviewed-by: Shuah Khan <skhan@xxxxxxxxxxxxxxxxxxx>
thanks,
-- Shuah