From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.6 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 87D65C433E0 for ; Fri, 5 Feb 2021 11:13:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3A0A964F9F for ; Fri, 5 Feb 2021 11:13:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232012AbhBELMV (ORCPT ); Fri, 5 Feb 2021 06:12:21 -0500 Received: from foss.arm.com ([217.140.110.172]:55996 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230073AbhBELJp (ORCPT ); Fri, 5 Feb 2021 06:09:45 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 85037D6E; Fri, 5 Feb 2021 03:08:59 -0800 (PST) Received: from [10.37.8.15] (unknown [10.37.8.15]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 54CB33F73B; Fri, 5 Feb 2021 03:08:58 -0800 (PST) Subject: Re: [PATCH] selftests/vDSO: fix ABI selftest on riscv To: Palmer Dabbelt , tklauser@distanz.ch, shuah@kernel.org Cc: Paul Walmsley , aou@eecs.berkeley.edu, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org References: From: Vincenzo Frascino Message-ID: <019fcafc-09b5-a13c-a83f-d6a0b1eb3224@arm.com> Date: Fri, 5 Feb 2021 11:12:59 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2/5/21 7:06 AM, Palmer Dabbelt wrote: > 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 >> --- >>  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 > Acked-by: Palmer Dabbelt > Acked-by: Vincenzo Frascino > 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! -- Regards, Vincenzo