All of lore.kernel.org
 help / color / mirror / Atom feed
From: Palmer Dabbelt <palmer@dabbelt.com>
To: tklauser@distanz.ch, shuah@kernel.org
Cc: Paul Walmsley <paul.walmsley@sifive.com>,
	aou@eecs.berkeley.edu, vincenzo.frascino@arm.com,
	linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-riscv@lists.infradead.org
Subject: Re: [PATCH] selftests/vDSO: fix ABI selftest on riscv
Date: Thu, 04 Feb 2021 23:06:37 -0800 (PST)	[thread overview]
Message-ID: <mhng-1ed0f9e8-84ec-4f2e-ac42-5a608726e2fe@palmerdabbelt-glaptop> (raw)
In-Reply-To: <20210204145042.7345-1-tklauser@distanz.ch>

On Thu, 04 Feb 2021 06:50:42 PST (-0800), tklauser@distanz.ch wrote:
> Only older versions of the RISC-V GCC toolchain define __riscv__. Check
> for __riscv as well, which is used by newer GCC toolchains. Also set
> VDSO_32BIT based on __riscv_xlen.
>
> Before (on riscv64):
>
> $ ./vdso_test_abi
> [vDSO kselftest] VDSO_VERSION: LINUX_4
> Could not find __vdso_gettimeofday
> Could not find __vdso_clock_gettime
> Could not find __vdso_clock_getres
> clock_id: CLOCK_REALTIME [PASS]
> Could not find __vdso_clock_gettime
> Could not find __vdso_clock_getres
> clock_id: CLOCK_BOOTTIME [PASS]
> Could not find __vdso_clock_gettime
> Could not find __vdso_clock_getres
> clock_id: CLOCK_TAI [PASS]
> Could not find __vdso_clock_gettime
> Could not find __vdso_clock_getres
> clock_id: CLOCK_REALTIME_COARSE [PASS]
> Could not find __vdso_clock_gettime
> Could not find __vdso_clock_getres
> clock_id: CLOCK_MONOTONIC [PASS]
> Could not find __vdso_clock_gettime
> Could not find __vdso_clock_getres
> clock_id: CLOCK_MONOTONIC_RAW [PASS]
> Could not find __vdso_clock_gettime
> Could not find __vdso_clock_getres
> clock_id: CLOCK_MONOTONIC_COARSE [PASS]
> Could not find __vdso_time
>
> After (on riscv32):
>
> $ ./vdso_test_abi
> [vDSO kselftest] VDSO_VERSION: LINUX_4.15
> The time is 1612449376.015086
> The time is 1612449376.18340784
> The resolution is 0 1
> clock_id: CLOCK_REALTIME [PASS]
> The time is 774.842586182
> The resolution is 0 1
> clock_id: CLOCK_BOOTTIME [PASS]
> The time is 1612449376.22536565
> The resolution is 0 1
> clock_id: CLOCK_TAI [PASS]
> The time is 1612449376.20885172
> The resolution is 0 4000000
> clock_id: CLOCK_REALTIME_COARSE [PASS]
> The time is 774.845491269
> The resolution is 0 1
> clock_id: CLOCK_MONOTONIC [PASS]
> The time is 774.849534200
> The resolution is 0 1
> clock_id: CLOCK_MONOTONIC_RAW [PASS]
> The time is 774.842139684
> The resolution is 0 4000000
> clock_id: CLOCK_MONOTONIC_COARSE [PASS]
> Could not find __vdso_time
>
> Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
> ---
>  tools/testing/selftests/vDSO/vdso_config.h | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/tools/testing/selftests/vDSO/vdso_config.h b/tools/testing/selftests/vDSO/vdso_config.h
> index 6a6fe8d4ff55..6188b16827d1 100644
> --- a/tools/testing/selftests/vDSO/vdso_config.h
> +++ b/tools/testing/selftests/vDSO/vdso_config.h
> @@ -47,10 +47,12 @@
>  #elif defined(__x86_64__)
>  #define VDSO_VERSION		0
>  #define VDSO_NAMES		1
> -#elif defined(__riscv__)
> +#elif defined(__riscv__) || defined(__riscv)
>  #define VDSO_VERSION		5
>  #define VDSO_NAMES		1
> +#if __riscv_xlen == 32
>  #define VDSO_32BIT		1
> +#endif
>  #else /* nds32 */
>  #define VDSO_VERSION		4
>  #define VDSO_NAMES		1

Reviewed-by: Palmer Dabbelt <palmerdabbelt@google.com>
Acked-by: Palmer Dabbelt <palmerdabbelt@google.com>

Not sure if you want this through the RISC-V tree, so I'm leaving it out for
now and assuming it'll go through a kselftest tree.

Thanks!

WARNING: multiple messages have this Message-ID (diff)
From: Palmer Dabbelt <palmer@dabbelt.com>
To: tklauser@distanz.ch, shuah@kernel.org
Cc: aou@eecs.berkeley.edu, linux-kernel@vger.kernel.org,
	linux-kselftest@vger.kernel.org,
	Paul Walmsley <paul.walmsley@sifive.com>,
	linux-riscv@lists.infradead.org, vincenzo.frascino@arm.com
Subject: Re: [PATCH] selftests/vDSO: fix ABI selftest on riscv
Date: Thu, 04 Feb 2021 23:06:37 -0800 (PST)	[thread overview]
Message-ID: <mhng-1ed0f9e8-84ec-4f2e-ac42-5a608726e2fe@palmerdabbelt-glaptop> (raw)
In-Reply-To: <20210204145042.7345-1-tklauser@distanz.ch>

On Thu, 04 Feb 2021 06:50:42 PST (-0800), tklauser@distanz.ch wrote:
> Only older versions of the RISC-V GCC toolchain define __riscv__. Check
> for __riscv as well, which is used by newer GCC toolchains. Also set
> VDSO_32BIT based on __riscv_xlen.
>
> Before (on riscv64):
>
> $ ./vdso_test_abi
> [vDSO kselftest] VDSO_VERSION: LINUX_4
> Could not find __vdso_gettimeofday
> Could not find __vdso_clock_gettime
> Could not find __vdso_clock_getres
> clock_id: CLOCK_REALTIME [PASS]
> Could not find __vdso_clock_gettime
> Could not find __vdso_clock_getres
> clock_id: CLOCK_BOOTTIME [PASS]
> Could not find __vdso_clock_gettime
> Could not find __vdso_clock_getres
> clock_id: CLOCK_TAI [PASS]
> Could not find __vdso_clock_gettime
> Could not find __vdso_clock_getres
> clock_id: CLOCK_REALTIME_COARSE [PASS]
> Could not find __vdso_clock_gettime
> Could not find __vdso_clock_getres
> clock_id: CLOCK_MONOTONIC [PASS]
> Could not find __vdso_clock_gettime
> Could not find __vdso_clock_getres
> clock_id: CLOCK_MONOTONIC_RAW [PASS]
> Could not find __vdso_clock_gettime
> Could not find __vdso_clock_getres
> clock_id: CLOCK_MONOTONIC_COARSE [PASS]
> Could not find __vdso_time
>
> After (on riscv32):
>
> $ ./vdso_test_abi
> [vDSO kselftest] VDSO_VERSION: LINUX_4.15
> The time is 1612449376.015086
> The time is 1612449376.18340784
> The resolution is 0 1
> clock_id: CLOCK_REALTIME [PASS]
> The time is 774.842586182
> The resolution is 0 1
> clock_id: CLOCK_BOOTTIME [PASS]
> The time is 1612449376.22536565
> The resolution is 0 1
> clock_id: CLOCK_TAI [PASS]
> The time is 1612449376.20885172
> The resolution is 0 4000000
> clock_id: CLOCK_REALTIME_COARSE [PASS]
> The time is 774.845491269
> The resolution is 0 1
> clock_id: CLOCK_MONOTONIC [PASS]
> The time is 774.849534200
> The resolution is 0 1
> clock_id: CLOCK_MONOTONIC_RAW [PASS]
> The time is 774.842139684
> The resolution is 0 4000000
> clock_id: CLOCK_MONOTONIC_COARSE [PASS]
> Could not find __vdso_time
>
> Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
> ---
>  tools/testing/selftests/vDSO/vdso_config.h | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/tools/testing/selftests/vDSO/vdso_config.h b/tools/testing/selftests/vDSO/vdso_config.h
> index 6a6fe8d4ff55..6188b16827d1 100644
> --- a/tools/testing/selftests/vDSO/vdso_config.h
> +++ b/tools/testing/selftests/vDSO/vdso_config.h
> @@ -47,10 +47,12 @@
>  #elif defined(__x86_64__)
>  #define VDSO_VERSION		0
>  #define VDSO_NAMES		1
> -#elif defined(__riscv__)
> +#elif defined(__riscv__) || defined(__riscv)
>  #define VDSO_VERSION		5
>  #define VDSO_NAMES		1
> +#if __riscv_xlen == 32
>  #define VDSO_32BIT		1
> +#endif
>  #else /* nds32 */
>  #define VDSO_VERSION		4
>  #define VDSO_NAMES		1

Reviewed-by: Palmer Dabbelt <palmerdabbelt@google.com>
Acked-by: Palmer Dabbelt <palmerdabbelt@google.com>

Not sure if you want this through the RISC-V tree, so I'm leaving it out for
now and assuming it'll go through a kselftest tree.

Thanks!

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

  reply	other threads:[~2021-02-05  7:08 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-04 14:50 [PATCH] selftests/vDSO: fix ABI selftest on riscv Tobias Klauser
2021-02-04 14:50 ` Tobias Klauser
2021-02-05  7:06 ` Palmer Dabbelt [this message]
2021-02-05  7:06   ` Palmer Dabbelt
2021-02-05  7:57   ` Tobias Klauser
2021-02-05  7:57     ` Tobias Klauser
2021-02-08 23:37     ` Shuah Khan
2021-02-08 23:37       ` Shuah Khan
2021-02-09  1:55       ` Palmer Dabbelt
2021-02-09  1:55         ` Palmer Dabbelt
2021-02-10  8:06       ` Tobias Klauser
2021-02-10  8:06         ` Tobias Klauser
2021-02-05 11:12   ` Vincenzo Frascino
2021-02-05 11:12     ` Vincenzo Frascino

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=mhng-1ed0f9e8-84ec-4f2e-ac42-5a608726e2fe@palmerdabbelt-glaptop \
    --to=palmer@dabbelt.com \
    --cc=aou@eecs.berkeley.edu \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=paul.walmsley@sifive.com \
    --cc=shuah@kernel.org \
    --cc=tklauser@distanz.ch \
    --cc=vincenzo.frascino@arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.