From patchwork Wed Nov 2 08:15:31 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guo Ren X-Patchwork-Id: 13027796 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 95FDEC4332F for ; Wed, 2 Nov 2022 08:15:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229700AbiKBIPq (ORCPT ); Wed, 2 Nov 2022 04:15:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50654 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229485AbiKBIPo (ORCPT ); Wed, 2 Nov 2022 04:15:44 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7053B1F9D4; Wed, 2 Nov 2022 01:15:43 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 0D41961856; Wed, 2 Nov 2022 08:15:43 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9ADCEC433C1; Wed, 2 Nov 2022 08:15:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1667376942; bh=UxH40MzWMTgfzw2DpcmVuLk/WjWfLctWt4uq1vUp0i0=; h=From:To:Cc:Subject:Date:From; b=or6LzbYCHRbrao7fc8U/fz26mg1WS1im9d2FT2tbZCHMqTHPdBJS8v1KR65ucRjai qxf5Mwqwjg3JE6Y3ZU6cPwDevAAN8Cz3PtxSYRjoZpLpWHTLzuhMr3JE932rS7Tjxc s+6iC8znsYc8mF+z2PN8L22RM8o9HJiVmU+Sr0ODZKql2zSpEXd02z4paci1D+5dUf WFyuen5Pg/RHPJHiFSk64ob5eELxSXQ9VRu6aNEzJ1+cu5M5F+kwbyM/DpNMxXNYZl nMlszKcCisBqW2Rjrf2SKMzKVC020+UY0YAx2wdkdzMEkmyQXOTB4TS2TlHgbJHmPM X3eOpS1BqUkDA== From: guoren@kernel.org To: arnd@arndb.de, guoren@kernel.org, shuah@kernel.org Cc: linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, linux-kselftest@vger.kernel.org, "haocheng . zy" , Mao Han , Guo Ren , Paul Walmsley , Palmer Dabbelt , Elliott Hughes Subject: [PATCH] selftests/vDSO: Add riscv getcpu & gettimeofday test Date: Wed, 2 Nov 2022 04:15:31 -0400 Message-Id: <20221102081531.882149-1-guoren@kernel.org> X-Mailer: git-send-email 2.36.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org From: Guo Ren 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 Signed-off-by: haocheng.zy Suggested-by: Mao Han Signed-off-by: Guo Ren Signed-off-by: Guo Ren Cc: Paul Walmsley Cc: Palmer Dabbelt Cc: Elliott Hughes Reviewed-by: Shuah Khan --- tools/testing/selftests/vDSO/vdso_test_getcpu.c | 5 +++++ tools/testing/selftests/vDSO/vdso_test_gettimeofday.c | 3 +++ 2 files changed, 8 insertions(+) diff --git a/tools/testing/selftests/vDSO/vdso_test_getcpu.c b/tools/testing/selftests/vDSO/vdso_test_getcpu.c index fc25ede131b8..1e474f406a87 100644 --- a/tools/testing/selftests/vDSO/vdso_test_getcpu.c +++ b/tools/testing/selftests/vDSO/vdso_test_getcpu.c @@ -14,8 +14,13 @@ #include "../kselftest.h" #include "parse_vdso.h" +#if defined(__riscv) +const char *version = "LINUX_4.15"; +const char *name = "__vdso_getcpu"; +#else const char *version = "LINUX_2.6"; const char *name = "__vdso_getcpu"; +#endif struct getcpu_cache; typedef long (*getcpu_t)(unsigned int *, unsigned int *, 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";