Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1856402pxb; Fri, 5 Feb 2021 03:15:56 -0800 (PST) X-Google-Smtp-Source: ABdhPJwmLdrB0KFgaVyBVpHn1xe8c977l9W7lsBzR7MD4bqBKkpcrNDgkUlyQATmztRZ+KNbnbAm X-Received: by 2002:a17:906:8410:: with SMTP id n16mr3628763ejx.551.1612523756062; Fri, 05 Feb 2021 03:15:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612523756; cv=none; d=google.com; s=arc-20160816; b=0ZhLIR+uYOWvwJRqZBhwAlAxiDvWbEpa7strtDlySSQbtDO12XntUyvRihFeZw5ABn ByOWw59wL7dDaBOsQq5K9jX62wOvEMifRc2wSwno2sQjlxPzAZfycUdDHYDzuQ0i9o61 t1LsMeYC2woV2XOwCMk3D14/6jm9eVdPaYwTnsGJItkWtjUzi3ON8WaGoDg/dZO4uvJN BRXw6akaFQLhW3q5NJZ/H0Tq2sT37G0abgszI0HI8yzwP7fRyzIHUxn1QXUw+7cakPg0 revYwwFWb18OKuay32VF8JAh/NXIrvj2H3CxAxHvAQ/1fU54abRmLEPulNsbaaHonMfI jG4Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=SwYaLVId7XJc3qxUgkOnVkRIYm0u2+JAFlMejLn2cZQ=; b=uRtiXCwtXml07AxM7g8TmD+VWRdtRUIclzexd9XfLdf25JFanuf4UMDcYH9UE+Dm0o 48LTgqgtYCuMHjiw9mPsciw0NsIzRW0bPASUxfPXv8gJCpLbs7TKAY/VT22WTS+3/GBE AlDjTr6uYYbqfM0gYkosWP2OWagQyKZ9mH+x+K/2JWk1QRJ36m2L3C5bDA9ctVhF2535 0JVII4rDj2ql8i58G28zloY6GKDVqFL/JAyPNp1s+gkpBChYLmnrTYT+/31zRhqyRlqb xImclCIntr66pXR9s9LUPsd5bZcvllHG8Xsl5oJnZSbeyhA9YvBGUGy6z8q2Al+MOhW4 mPmg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g6si5134818ejx.715.2021.02.05.03.15.29; Fri, 05 Feb 2021 03:15:56 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231359AbhBELMO (ORCPT + 99 others); Fri, 5 Feb 2021 06:12:14 -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