diff mbox series

[V2] selftests/vDSO: Add riscv getcpu & gettimeofday test

Message ID 20221103080451.1642500-1-guoren@kernel.org (mailing list archive)
State Handled Elsewhere
Headers show
Series [V2] selftests/vDSO: Add riscv getcpu & gettimeofday test | expand

Checks

Context Check Description
conchuod/cc_maintainers warning 2 maintainers not CCed: foo.bar@bar.com aou@eecs.berkeley.edu
conchuod/patch_count success Link
conchuod/cover_letter success Single patches do not need cover letters
conchuod/tree_selection success Guessed tree name to be for-next
conchuod/fixes_present success Fixes tag not required for -next series
conchuod/verify_signedoff success Signed-off-by tag matches author and committer
conchuod/kdoc success Errors and warnings before: 0 this patch: 0
conchuod/module_param success Was 0 now: 0
conchuod/build_rv32_defconfig fail Build and OK
conchuod/build_warn_rv64 fail Errors and warnings before: 1 this patch: 1
conchuod/dtb_warn_rv64 success Errors and warnings before: 0 this patch: 0
conchuod/header_inline success No static functions without inline keyword in header files
conchuod/checkpatch success total: 0 errors, 0 warnings, 0 checks, 20 lines checked
conchuod/source_inline success Was 0 now: 0
conchuod/build_rv64_nommu_k210_defconfig fail Build failed
conchuod/verify_fixes success No Fixes tag
conchuod/build_rv64_nommu_virt_defconfig fail Build failed

Commit Message

Guo Ren Nov. 3, 2022, 8:04 a.m. UTC
From: Guo Ren <guoren@kernel.org>

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>
---
 tools/testing/selftests/vDSO/vdso_test_getcpu.c       | 4 ++++
 tools/testing/selftests/vDSO/vdso_test_gettimeofday.c | 3 +++
 2 files changed, 7 insertions(+)

Comments

Palmer Dabbelt Dec. 2, 2022, 6:03 p.m. UTC | #1
On Thu, 03 Nov 2022 01:04:51 PDT (-0700), guoren@kernel.org wrote:
> From: Guo Ren <guoren@kernel.org>
>
> 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>
> ---
>  tools/testing/selftests/vDSO/vdso_test_getcpu.c       | 4 ++++
>  tools/testing/selftests/vDSO/vdso_test_gettimeofday.c | 3 +++
>  2 files changed, 7 insertions(+)
>
> 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";

Reviewed-by: Palmer Dabbelt <palmer@rivosinc.com>
Acked-by: Palmer Dabbelt <palmer@rivosinc.com>

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!
diff mbox series

Patch

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";