From patchwork Thu Nov 3 08:04:51 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guo Ren X-Patchwork-Id: 13029673 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 599FCC43217 for ; Thu, 3 Nov 2022 08:05:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229771AbiKCIFL (ORCPT ); Thu, 3 Nov 2022 04:05:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53326 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229688AbiKCIFL (ORCPT ); Thu, 3 Nov 2022 04:05:11 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9C26C116C; Thu, 3 Nov 2022 01:05:06 -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 ams.source.kernel.org (Postfix) with ESMTPS id 5061CB82695; Thu, 3 Nov 2022 08:05:05 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 663D7C433C1; Thu, 3 Nov 2022 08:04:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1667462704; bh=0H/9grb2h1ZdT4tEjfsYpds+m01aFKc77P1+gyy/5Kc=; h=From:To:Cc:Subject:Date:From; b=S61gmKRQeL/qIkrXM6DcGZ60Mxme4miDWVTrAJLek6OczOIhvnd3ew4OSq5qsaaL6 QCFj8EkymGXHCVM61erCNj1zxqL5YMlqVvPStNdgVP83D9/7ZK56YCYt/U4BjP2BSS u3zyHDqNoR9v3t3j3Fu7WRK74jq05iIa7w0y61otsQCG88GQeofE5K2WqATIXiA7uh L9dsUv/FkjxM3VGXui2WiADK5oC9wGa0auHfjlsgw4a6isUYRaf0fXtvFbEOwn+U1C 1ktyawcdNc1bXSFZIqfhUE+iDE1XG7Xaiwd+DpQrXJ0AUfhrVkCR2DX5jyH6zdB5YK fuQs6j5P68noQ== From: guoren@kernel.org To: arnd@arndb.de, guoren@kernel.org, shuah@kernel.org, skhan@linuxfoundation.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 V2] selftests/vDSO: Add riscv getcpu & gettimeofday test Date: Thu, 3 Nov 2022 04:04:51 -0400 Message-Id: <20221103080451.1642500-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 Reviewed-by: Shuah Khan Signed-off-by: Guo Ren Signed-off-by: Guo Ren Cc: Paul Walmsley Cc: Palmer Dabbelt Cc: Elliott Hughes Reviewed-by: Palmer Dabbelt Acked-by: Palmer Dabbelt --- tools/testing/selftests/vDSO/vdso_test_getcpu.c | 4 ++++ tools/testing/selftests/vDSO/vdso_test_gettimeofday.c | 3 +++ 2 files changed, 7 insertions(+) diff --git a/tools/testing/selftests/vDSO/vdso_test_getcpu.c b/tools/testing/selftests/vDSO/vdso_test_getcpu.c index fc25ede131b8..1df5d057d79f 100644 --- a/tools/testing/selftests/vDSO/vdso_test_getcpu.c +++ b/tools/testing/selftests/vDSO/vdso_test_getcpu.c @@ -14,7 +14,11 @@ #include "../kselftest.h" #include "parse_vdso.h" +#if defined(__riscv) +const char *version = "LINUX_4.15"; +#else const char *version = "LINUX_2.6"; +#endif const char *name = "__vdso_getcpu"; struct getcpu_cache; 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";