From patchwork Fri Nov 3 07:57:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rasmus Villemoes X-Patchwork-Id: 13444395 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 49058C4332F for ; Fri, 3 Nov 2023 07:58:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=sTT+vmra3gxq7HObo6jqREx9KjEd5tSV1R6SfQ7sIeA=; b=WD8ywDfx0h3myA jqZraMKhuKPbJrIslKEcg2REpcGvIhjIDyPQ4C4RXchdApd1aLEA2LppY9Qq+o0A9lV1rurgWrFxs 7T/IydO1zv/veL2jH8PCMsRRCm9CuQ2PNAeOaDJYegrr0R4zGf1fUbXDxAFdnR5vw4IJcS+tJySL8 qz/TZKEOPXlr238Of8Jp9XjfdnHhzt0e9w5LkFlrnHyqb2yscukzyr0WjbCbruwtyJQ4P5cnekTQM 8gguRSVHh/CocVNWSlaH/SePTzus9mfjheKn597bbPlidvIQeb1AiV0pHcpI0HksVT+85dzMHN1gH kxXzwvB2B3KsN8g6MAvA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qyp4M-00Avez-2D; Fri, 03 Nov 2023 07:58:18 +0000 Received: from mail-ed1-x534.google.com ([2a00:1450:4864:20::534]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qyp4H-00AveQ-1p for linux-arm-kernel@lists.infradead.org; Fri, 03 Nov 2023 07:58:17 +0000 Received: by mail-ed1-x534.google.com with SMTP id 4fb4d7f45d1cf-52bd9ddb741so2949231a12.0 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=lists.infradead.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=VI87/sjyeXrpIxpWLb0WSFupgYX2Izi4UNYa+iAPWl2aJJyKqLKSIfAlOhGvYNR9V4 k6IDu7q10I/PZKEBz+Z5kryyGgiypNWjeJ9WjkrfkicGcsaJlgpQJg4lJ4j4jvmgddIW XzlSoJiZaK86ES1e5rxRkW8Hl4YdPXvOeVYP0= 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=jCKI2QpRLflCGIaK4SJXg1Kyo4rXXc+EmNmjZ9hMRQ+md8N/rHvdX2yFXa9uGw7Ru2 qrxnmNE/43Owa8qRsUz9MffN5kQvVJ8vPwPPFRe5gZqGfXskIwLcyYGqTwbbpedEiqNF celOF/ivnoM9G++udzXCjEWFQXJkFR+j+hsVe1TVcYYlYqwhbjq9W2cJf6wfUaN85FcV 0IEIfD3/y50n6tQsqfYqIewXAn0CFpFCgPRVbdzDx3mWW+q6Lqre7wKTgfYK6KCiXYFb BoT1RwAcyBQCPsUWumlJodpusVtc5qze3R0HdDG1qz3fe10MoflsZBoE4MD8wjYNaNmz h1QA== X-Gm-Message-State: AOJu0Yz2oedfJXGZOKCLBxgiYBQMnIXPQoe9G7jEwLMzkw67ZMbIp5a6 zjPU5RTWnmrnU82t8mEKnnH+qg== 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231103_005813_614173_E8F34095 X-CRM114-Status: GOOD ( 17.32 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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/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;