From nobody Wed Dec 31 12:02:58 2025 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 9990DC4167D for ; Fri, 3 Nov 2023 07:58:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346392AbjKCH6S (ORCPT ); Fri, 3 Nov 2023 03:58:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37186 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346272AbjKCH6Q (ORCPT ); Fri, 3 Nov 2023 03:58:16 -0400 Received: from mail-ed1-x52c.google.com (mail-ed1-x52c.google.com [IPv6:2a00:1450:4864:20::52c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9D9FADE for ; Fri, 3 Nov 2023 00:58:10 -0700 (PDT) Received: by mail-ed1-x52c.google.com with SMTP id 4fb4d7f45d1cf-5230a22cfd1so2927597a12.1 for ; Fri, 03 Nov 2023 00:58:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rasmusvillemoes.dk; s=google; t=1698998289; x=1699603089; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=yPAmSObx1rTjBn4nXLAthbW9IygJi6dwZRaXAiU/c0k=; b=iUYsi+nYIOwDGO18ci6KREkynsVFgTPPqLnNOTd+lFrGU3oJkp6OvBGHg6cLOx0G3N fhOcrmfozaqcOa8umdvum/WMWb0o6oQPGQ22T4AqXOiyg/DMDbzXMPWKK4WgfAZpcwfa zAgGXT2yaIV4Xg+9HWx+lUbi7y88Bf1+AmDCc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698998289; x=1699603089; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=yPAmSObx1rTjBn4nXLAthbW9IygJi6dwZRaXAiU/c0k=; b=N6FZcJlTLh343g6O3zy9w2YAk/VgGaAhoZ2Ci+SAuR+hFfX2iFWrHs68Kqkp6ilAb3 uTjutNM1GbwmEuIZSATgMk9eaKTgV086/ShI272gbEfi3WxLM4GWVc1plR8CQO1tnYEz d8mzQvWQvcWDpkq3vdmIkLnCF7ZZ2QVbdZb5xUs0Ue79kD8IBn3QgfAVZBo8rMuWDlo1 5dwC5iPDVIoh7iWDhp2xCmUXhHLv41OXLDcux4g+mA/JYFbxLz7SpRLmTZVs5dM12sci vebfTZ4nRheumnMsbR63Me9jZc+aiLKXrxvqaRd7a1ADXf1iHCprtwab2t5+f6yY1ya3 lHvw== X-Gm-Message-State: AOJu0YwYTqMsTi0n1kDvFdDH380EVUYwoWfxVO1ulwOxmVhJ+DzBmKAW MkuXFAbhYXglx3jqeAPwSXrmIQ== X-Google-Smtp-Source: AGHT+IGJK4iQupnRNttfSqheROBdR5rFmsaz8iuN25//lT545h/Jxz3DPSmcllXwCFl24PhKzhp3iw== X-Received: by 2002:a17:907:3683:b0:9b2:be5e:7545 with SMTP id bi3-20020a170907368300b009b2be5e7545mr5710534ejc.36.1698998288263; Fri, 03 Nov 2023 00:58:08 -0700 (PDT) Received: from prevas-ravi.prevas.se ([81.216.59.226]) by smtp.gmail.com with ESMTPSA id m21-20020a1709066d1500b009b9aa8fffdasm598994ejr.131.2023.11.03.00.58.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Nov 2023 00:58:07 -0700 (PDT) From: Rasmus Villemoes To: Russell King Cc: Florian Fainelli , Vincenzo Frascino , Rasmus Villemoes , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH] ARM: VDSO: remove cntvct_ok global variable Date: Fri, 3 Nov 2023 08:57:59 +0100 Message-Id: <20231103075800.3254680-1-linux@rasmusvillemoes.dk> X-Mailer: git-send-email 2.40.1.1.g1c60b9335d MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" 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 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/vd= so/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 =20 extern struct vdso_data *vdso_data; -extern bool cntvct_ok; =20 /* * 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 */ }; =20 -/* 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 =3D 1; /* for the data/vvar page */ vdso_total_pages +=3D text_pages; =20 - cntvct_ok =3D cntvct_functional(); - patch_vdso(vdso_start); =20 return 0; --=20 2.40.1.1.g1c60b9335d