Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1176541pxb; Thu, 4 Feb 2021 06:54:12 -0800 (PST) X-Google-Smtp-Source: ABdhPJwFK8u4bjj+JFEcPdm3Lp0SkUsoNg19hgUmweDZX44+PtFGYvsRui6JpLhtCD71yPyegbI9 X-Received: by 2002:a17:906:dbd0:: with SMTP id yc16mr5268092ejb.524.1612450451760; Thu, 04 Feb 2021 06:54:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612450451; cv=none; d=google.com; s=arc-20160816; b=P3SrE/T0a6DL9I7vGv0/G/oolR4xCbfL7bUaW0rgLKT8BRkMKUXXYwylNRmiSvwt8D uzCFEflQcYSCZ0HVwD3swalJgWS4nYil6DYinImCud9nRXXbKY6s1RlCEVxH/vrEtUwe NMCKy6iyLbU7dhxw6xtRVf+0XdJW1ME7SRMXbhmGF4VAop86JnGA60hNrULOKGcyg4b/ 2dQEZUpZhB3Nc8uCaYbdVRTgpdocq1gE3OVxNBrun800ybj6BX6HbFnSqpr6E1r47Y2D Y/0M8ODHWjPvc27XH4xP3nhrkDhaNRORqCZ8sXuPjh8fDC7jKtFrkJTeNK58Xj+PW5yX BSCw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from; bh=I2/iOUMYw7W1gcgKfifiHQmUUt7P803Vijotr9n+vNI=; b=D/+rTn1+K9T4duseTWUAMlhol8rPbnA3F+DZmqUWF1/+gXu++1K0zBNKXEPwvrWFgf N6Fp68LOceNXgfTyhGQhd3WUQmAYa90d1Deqy/pTVkajJovKCB5rFwZZflNQn/VLPihZ grMHXVdOAz6+7CKrEv4AcpGB6nk+u6sHiB3iObgZkkqaYBuaS+Upkjsb4V3GS/vgcwWr z1hKHVgb+kkYR3toeHppGb9USL6aqLjr8suq+6anHHBfxXdIOgJACEpm5ACBQnlCLVTJ R92ntYiIO8gxeAehbbhKF9KKvQWwGoUv0EpPCW69dis59nGhVI/ZxhSgThC2bC76RuMO 50+Q== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g1si3241908ejb.606.2021.02.04.06.53.46; Thu, 04 Feb 2021 06:54:11 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236828AbhBDOvw (ORCPT + 99 others); Thu, 4 Feb 2021 09:51:52 -0500 Received: from sym2.noone.org ([178.63.92.236]:51026 "EHLO sym2.noone.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236737AbhBDOvl (ORCPT ); Thu, 4 Feb 2021 09:51:41 -0500 Received: by sym2.noone.org (Postfix, from userid 1002) id 4DWhLW17lHzvjfp; Thu, 4 Feb 2021 15:50:42 +0100 (CET) From: Tobias Klauser To: Shuah Khan , Paul Walmsley , Palmer Dabbelt , Albert Ou Cc: Vincenzo Frascino , linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org Subject: [PATCH] selftests/vDSO: fix ABI selftest on riscv Date: Thu, 4 Feb 2021 15:50:42 +0100 Message-Id: <20210204145042.7345-1-tklauser@distanz.ch> X-Mailer: git-send-email 2.11.0 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 -- 2.30.0