Received: by 2002:a05:7412:8521:b0:e2:908c:2ebd with SMTP id t33csp325790rdf; Fri, 3 Nov 2023 01:36:29 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEGkzSYUnwtwFzbSVGqxau/5lBCfjfg/Ftl68VfO6vd9IhvPMkIsURJjyPJ2kb3ytydiKuv X-Received: by 2002:a17:90a:199d:b0:280:c98f:2092 with SMTP id 29-20020a17090a199d00b00280c98f2092mr5604941pji.33.1699000589548; Fri, 03 Nov 2023 01:36:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1699000589; cv=none; d=google.com; s=arc-20160816; b=cyq3cxhdtDO673yUPyeRXO1IbgM1aEEFhSHo2KOqc0n0hNt6ZgcCo+W17XCvDsHYum rriM/9LPEtLQdg6ZdkFbejz7dVqGeSNlgOaQ69Uw0JUvPUMBO7diO5DrGv5lu3S9KlyN biZok7mAK8pNg0+V1pgizprUypjUTyg5HuIO5T69F7Vixwl+2VcLkM0EH/ILdRFHB3es SNv7ZWHwLWUuLKxqU+4Ux6sXRKuMmDNXDyolPaIe+7LdUL7X2jQB0ikTyFSj/BOX7iM/ 5FM/PVgp5Vx4zjHfC1/zp7eEDJ9tcLlNCv3GKwxiThsgkiZ27DRysI0fZHFwBbzXFei7 LBvw== 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; bh=YGfBjMVzTT1uAMasqeONHZhwyT3zyTnGo8xQoQrI83g=; fh=WWMd7qnNwLYHBq+02LYgIurb93xqOQMTZMpv5P75qTM=; b=yfH+vuVPNQooL1bsc2TSGMljgSkYO4kCPadJ0Mq7eci6JXVbObxWO+LLSxlvtme4iF Ke1fftm3UdpgzPKsLzY92AqBLZZ2KXRG5zRXXccanGmCuELvShw+Bn02PE/FP8IZp5iZ S7OR/8j1+LXzhmBpeA7Uj3FvT+2W2HzHlOsALvgkg7SQVYXMw8TnjqsfpGyYJMMIksSi mmKRTnIpHBzyFM/NI9AR/tKmnQCboMexSm+tgMoqgZD5lPAFRdGoLeZJX3GxfsAHwL9T +7FJfQBOHLEAjV5Z2/EElwYBIzrVR42+/5C6Yzwy7KI2tIDJ9DC4Ah1kUthtu15/0o5V hhew== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id cu20-20020a17090afa9400b00277387bc11dsi1150519pjb.188.2023.11.03.01.36.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Nov 2023 01:36:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id DDD4280725D4; Fri, 3 Nov 2023 01:35:22 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236002AbjKCIfJ (ORCPT + 99 others); Fri, 3 Nov 2023 04:35:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36238 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235989AbjKCIfH (ORCPT ); Fri, 3 Nov 2023 04:35:07 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 188EFD47 for ; Fri, 3 Nov 2023 01:35:04 -0700 (PDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 400A72F4; Fri, 3 Nov 2023 01:35:46 -0700 (PDT) Received: from [192.168.4.21] (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 9D6693F64C; Fri, 3 Nov 2023 01:35:02 -0700 (PDT) Message-ID: <9ef78d40-fcdd-4ff8-b5ee-58b7478534a9@arm.com> Date: Fri, 3 Nov 2023 08:35:00 +0000 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] ARM: VDSO: remove cntvct_ok global variable To: Rasmus Villemoes , Russell King Cc: Florian Fainelli , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org References: <20231103075800.3254680-1-linux@rasmusvillemoes.dk> Content-Language: en-US From: Vincenzo Frascino In-Reply-To: <20231103075800.3254680-1-linux@rasmusvillemoes.dk> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Fri, 03 Nov 2023 01:35:23 -0700 (PDT) On 11/3/23 07:57, Rasmus Villemoes wrote: > The cntvct_ok variable has not had any external user since commit > c7a18100bdff ("lib/vdso: Avoid highres update if clocksource is not > VDSO capable"). > > It also only has one user in vdso.c, once during init, so rather than > having the caller of patch_vdso() initialize cntvct_ok, just call > cntvct_functional() directly and avoid the global variable entirely. > > Signed-off-by: Rasmus Villemoes Fine by me. Reviewed-by: Vincenzo Frascino > --- > arch/arm/include/asm/vdso/vsyscall.h | 1 - > arch/arm/kernel/vdso.c | 10 +++------- > 2 files changed, 3 insertions(+), 8 deletions(-) > > diff --git a/arch/arm/include/asm/vdso/vsyscall.h b/arch/arm/include/asm/vdso/vsyscall.h > index 47e41ae8ccd0..9a2cd2673a82 100644 > --- a/arch/arm/include/asm/vdso/vsyscall.h > +++ b/arch/arm/include/asm/vdso/vsyscall.h > @@ -9,7 +9,6 @@ > #include > > extern struct vdso_data *vdso_data; > -extern bool cntvct_ok; > > /* > * Update the vDSO data page to keep in sync with kernel timekeeping. > diff --git a/arch/arm/kernel/vdso.c b/arch/arm/kernel/vdso.c > index f297d66a8a76..ba87ffc6f194 100644 > --- a/arch/arm/kernel/vdso.c > +++ b/arch/arm/kernel/vdso.c > @@ -67,11 +67,9 @@ struct elfinfo { > char *dynstr; /* ptr to .dynstr section */ > }; > > -/* Cached result of boot-time check for whether the arch timer exists, > - * and if so, whether the virtual counter is useable. > +/* Boot-time check for whether the arch timer exists, and if so, > + * whether the virtual counter is useable. > */ > -bool cntvct_ok __ro_after_init; > - > static bool __init cntvct_functional(void) > { > struct device_node *np; > @@ -172,7 +170,7 @@ static void __init patch_vdso(void *ehdr) > * want programs to incur the slight additional overhead of > * dispatching through the VDSO only to fall back to syscalls. > */ > - if (!cntvct_ok) { > + if (!cntvct_functional()) { > vdso_nullpatch_one(&einfo, "__vdso_gettimeofday"); > vdso_nullpatch_one(&einfo, "__vdso_clock_gettime"); > vdso_nullpatch_one(&einfo, "__vdso_clock_gettime64"); > @@ -213,8 +211,6 @@ static int __init vdso_init(void) > vdso_total_pages = 1; /* for the data/vvar page */ > vdso_total_pages += text_pages; > > - cntvct_ok = cntvct_functional(); > - > patch_vdso(vdso_start); > > return 0; -- Regards, Vincenzo