Received: by 2002:a05:6358:111d:b0:dc:6189:e246 with SMTP id f29csp3664253rwi; Wed, 2 Nov 2022 01:28:37 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6WinpbdfodpikALP7npqnDxieSOhLoy9W6/3wKMMmJUocVS13SP18m/04Lal5PXeW0/poX X-Received: by 2002:a17:907:2c78:b0:7ad:8a7a:3749 with SMTP id ib24-20020a1709072c7800b007ad8a7a3749mr22588892ejc.55.1667377717454; Wed, 02 Nov 2022 01:28:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667377717; cv=none; d=google.com; s=arc-20160816; b=VKG80XqlzhM+wFUMwhzOCnz6RyQcX80KirxfwHruarMvU3fVUZa2OUeZd1bTdiCMKk /DKwxWuwuZ8u8Z6oiAlXUyhZ5gIcBWreSFZ+QZSMkG5BS/rAHc39wRJNi/7hcr+EGaEX zFJO5rXlljUDYzwXor7Wgj8iT8P/5lU+b3oNxgMJm5j+lBtyRayCrNY5iZhXWKZM5Lff 16+ofvIfdfOA3Y+xyg9uK6heDAWZRBjXlFXTikP7cXeo879slOn8jr9nzwRY+RbGD26Q Id9q2v875OthpLWrZA1lnfyjTWmRFr57SEQDMiS02zQU+a4h4glOSTtoM/uoMKyzpO5T XDEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=JB+IJTJaPKPb0KfMh8kfK9hjBCBDR9vGKV7GaMYTfms=; b=aAZnu7Y9paeNyyMKDhDxEEARNJmzrFLcJ9IxaLYMoj5GOOwydKxB6NgOGfBdUkcZIO i2IogykErCUaLDr9ru6L1THNcFdfrsUIHg436AcEfjemUTRDaMJSAlooyTPHg5gbEIK1 +/h6uSjHbVN4b1Hq16cyCCYZslRpBuHhfnvRA39NwSOwAACBXeOJiiG+6QcDSpcJnlFL J4arumkQqlSFWfIazqooStwPirzeFaXZekwE5rX00Ac8ev7RYioevUKJdeJP+uevr0Tx OXIeDmfn26fV76zPPHPfNnF2Ry4S9qIcVLBII8pfMqgjQ4IdSIG8Q+j2Kf0WYH2iAOU6 Qqow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=or6LzbYC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f9-20020a17090624c900b0073db9474d06si11610038ejb.325.2022.11.02.01.28.09; Wed, 02 Nov 2022 01:28:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=or6LzbYC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230060AbiKBIPr (ORCPT + 96 others); Wed, 2 Nov 2022 04:15:47 -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 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-8.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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 --- 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"; -- 2.36.1