From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B8C083CD8C9 for ; Sun, 2 Aug 2026 16:53:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785689626; cv=none; b=g77HzxrO6D8yInyv+hKiPKUZS92yhDrzgpZPyATYE9+1XxCxUhm5BME1ZMYrQztVeEGZ+fWx5xL5b8xSoXoVb33xiQAuTzk8xF2+fRyKQipBX2Pu6JuTaf9nBS7ZVcnzR9zTwPlN27RXFsu/IQ/e70e+LJC3Uw3CiHLxlo7kO1s= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785689626; c=relaxed/simple; bh=2EFYN/oBtCdJKnWuKFE8dOyMNgl8TmPd50By+s9SVIo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=q/1fw9Ws9CP2WCHi2pOA6p8fZVsqJbp9JGP7r2zBxfVloXXauHfUOtV90gnkA7H1m1YxCRcZCZnHSlMQF48oHDc1TrTvr0zy1apZ7jhZVIbUn4yRIuVkbcI1QwGP4aZXBU6HMILo8kk7dT1P+tf3P4bjcsSbrCoW1L8ABjSjaiE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Enxcngrd; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Enxcngrd" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 977831F00ACF; Sun, 2 Aug 2026 16:53:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1785689624; bh=1ddJMjzmSVlj3ZFAumHWC0fEgCC+ifQjE0giD0DMzI8=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=EnxcngrdrxYgrQ68dHejrhk3OZR5ULOTHf7u56rU1kxV5VCoRKQ/RGs6wwfSR5aB6 lzDrdsH5yw1nYoqv5Mo7QVB0YSPBEBVS7dJSv2R0vAiKy+Tkco/0ZBEjTsdX5GzKvC QYBRK/a39+WiSCQ64jri1S9014b8v01NR4J6iSeBCBYWMg6gAU0XofFScnrCIHwuWO JKEU7c0w5LD5/kiz0a1xgiazTeJqiuYafE4P3RnCc0Pxn/k9fudyRXi/+8NNXAnPpG 3J7GDNaEQfuBQsWU4jVlj+P5iNoAJO1qD62pgXCwE0yzw4jfz7GnKPMpvw4pSnjFPS in7fUY5C4xkcA== Received: from sofa.misterjones.org ([185.219.108.64] helo=valley-girl.lan) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1wqZRW-0000000BVIZ-1GnL; Sun, 02 Aug 2026 16:53:42 +0000 From: Marc Zyngier To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Catalin Marinas , Will Deacon , Mark Rutland , Thomas Gleixner , Ben Horgan , Daniel Lezcano Subject: [PATCH v3 8/8] arm64: Convert __delay_cycles() to arch_timer_read_vcounter() Date: Sun, 2 Aug 2026 17:53:27 +0100 Message-ID: <20260802165327.385217-9-maz@kernel.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260802165327.385217-1-maz@kernel.org> References: <20260802165327.385217-1-maz@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, catalin.marinas@arm.com, will@kernel.org, mark.rutland@arm.com, tglx@kernel.org, ben.horgan@arm.com, daniel.lezcano@linaro.org X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false Relax the need for disabling preemption in __delay_cycles() by using arch_timer_read_vcounter(), which will disable preemption only when this is actually required. Acked-by: Catalin Marinas Signed-off-by: Marc Zyngier --- arch/arm64/lib/delay.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/arch/arm64/lib/delay.c b/arch/arm64/lib/delay.c index e278e060e78a9..a667df920697d 100644 --- a/arch/arm64/lib/delay.c +++ b/arch/arm64/lib/delay.c @@ -32,10 +32,9 @@ static inline unsigned long xloops_to_cycles(unsigned long xloops) * Note that userspace cannot change the offset behind our back either, * as the vcpu mutex is held as long as KVM_RUN is in progress. */ -static cycles_t notrace __delay_cycles(void) +static cycles_t __delay_cycles(void) { - guard(preempt_notrace)(); - return __arch_counter_get_cntvct_stable(); + return arch_timer_read_vcounter(); } void __delay(unsigned long cycles) -- 2.47.3