Received: by 2002:a05:6358:111d:b0:dc:6189:e246 with SMTP id f29csp3734145rwi; Wed, 2 Nov 2022 02:26:23 -0700 (PDT) X-Google-Smtp-Source: AMsMyM61i47r+uGQFxTaOXPi44o9pWqutOOoCMMXurLHzol3IfxVLRjFE5TKnwckjDqUBYPiC4c6 X-Received: by 2002:aa7:d553:0:b0:463:18d3:195c with SMTP id u19-20020aa7d553000000b0046318d3195cmr19938956edr.235.1667381183435; Wed, 02 Nov 2022 02:26:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667381183; cv=none; d=google.com; s=arc-20160816; b=aId1pyz8ETX3j/ACMTna8XY7HzaeXAGJ18lM+P8I9apTA9SCpmzzXpkn5y3e/PuU/+ I5btcVXyjELR+t+xYhaXdJxvKEgDhOhvPhd4NgwRTckCS7xF0v40adc0skxrkZgu2rmA uiisQ/1MqdGYdBPtbz1O1gpouwHpAb6taYcLah6Dfkw8FuvFp/gSkPgneEeCnF1x/db2 IFqJ0dy6f4wdIl4S86ybnBDJW40BnBQkK7QU4ipn71fr4zrWu9Rn3SNLH5UWiw1xyOqj KPoMrXKLyy2gfabCZHhejHAyr6kon819OKzaGQLCIMjYSYTIRZGpU5NjFX0CBleIX0ZX pBAQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=w7Zdgirtqci69Swtp5BTZmwtPa1KkHmxW1ALdvVO1eA=; b=hf1gIsdrZ6yICTQUHlT8OkNNhXIq+5JrtPZW3uwT/aJLen9RGsDccrygd3biiwXxrC zVz55Y8ItwmHzZQ4ZsKqhdSmdxu+GV7rjz2iGDlyXsrf924MB2/y15GgFEKtDpgBER1C ILVfCbhzuFOd8UayYLo/nnZLIpkamVCE8mhms8qUxWU75p/D4aV2Tl6IcvAXaMpx86ZC gf8SrNyMFhMo8XLqOfqmZW7nCquVWVP7DD1dCmdzIFQD3CwTzFYKRjjW18SZuvWkBage pLEYXK4m/iSZbxWr9+yVljPvJjQnGA+x6ALAF4L/FjUX0+LhXRxUSQ7obsWzla/qSgTR 4WFw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=axpjrmZw; 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=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v8-20020a170906b00800b0078dec48d442si9375688ejy.680.2022.11.02.02.25.59; Wed, 02 Nov 2022 02:26:23 -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=@linuxfoundation.org header.s=google header.b=axpjrmZw; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231290AbiKBJDI (ORCPT + 97 others); Wed, 2 Nov 2022 05:03:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34972 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231236AbiKBJCN (ORCPT ); Wed, 2 Nov 2022 05:02:13 -0400 Received: from mail-pf1-x429.google.com (mail-pf1-x429.google.com [IPv6:2607:f8b0:4864:20::429]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8040627FC3 for ; Wed, 2 Nov 2022 02:01:55 -0700 (PDT) Received: by mail-pf1-x429.google.com with SMTP id i3so15800181pfc.11 for ; Wed, 02 Nov 2022 02:01:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=w7Zdgirtqci69Swtp5BTZmwtPa1KkHmxW1ALdvVO1eA=; b=axpjrmZwJoHqm006PdecGiKFxCVrDtI7fmM+51qQj5/T8wCSt9eLlIOuHkYqtu8uHX FEIppYhPZ/F7JWjwBYb22b844jLJgqYJ9fR2AhR9yDVrRXpfyvi+o8nx9PS+wbpGb94z 5g9U6rL4KdRNHXwtLqWGSv7c+nSF5RltTj6cE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=w7Zdgirtqci69Swtp5BTZmwtPa1KkHmxW1ALdvVO1eA=; b=4zt6Sx6Vpwt39LbFA/M04VrK4hPL8xq8Hrzbemm5DfOkYvyZ9gSi1m/cTsY3ePopLg TZWHyA8aarrMe2WwtHXDmlJl5f+oqGQN1EXKnXhxFwHv7RGL/pPivS1uw/KcAV618Vsr zx2h3iKcQ6GmAiVnx2nq175Tkp8n6xUqcnJ0Ub/tuT9YU9KYicmWS4LNa1IZ6iN+i0gJ NZ907vMjbrqotaHMHgZI0clzbcbI9vjEy8DhwHFsv0fBw8652Gm50jX68ooyV1kpltC/ +6U/amp11cg7HI52puVFbfaH8XNNyEDIxBdQ09F3spiHTv+vZ5vIKMvJbDPFZ4Z1gU+9 Loyw== X-Gm-Message-State: ACrzQf1L46a7KdscmMJTEG1ax3unNXZ0OLFfx7U+cnR1I1UZ5GphIu1i FFbt+p2xt/igOZPt/M7UXqzw8A== X-Received: by 2002:a63:450c:0:b0:443:94a1:3703 with SMTP id s12-20020a63450c000000b0044394a13703mr20116187pga.565.1667379714982; Wed, 02 Nov 2022 02:01:54 -0700 (PDT) Received: from [192.168.0.168] ([103.99.10.63]) by smtp.gmail.com with ESMTPSA id d62-20020a623641000000b005627ddbc7a4sm7944965pfa.191.2022.11.02.02.01.49 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 02 Nov 2022 02:01:54 -0700 (PDT) Message-ID: Date: Wed, 2 Nov 2022 03:01:47 -0600 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.2.2 Subject: Re: [PATCH] selftests/vDSO: Add riscv getcpu & gettimeofday test To: guoren@kernel.org, arnd@arndb.de, 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 , Shuah Khan References: <20221102081531.882149-1-guoren@kernel.org> Content-Language: en-US From: Shuah Khan In-Reply-To: <20221102081531.882149-1-guoren@kernel.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_NONE,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 On 11/2/22 02:15, guoren@kernel.org wrote: > 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 name is same in both cases. Move it out of ifdef. > > 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"; Rest looks fine. Reviewed-by: Shuah Khan thanks, -- Shuah