From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 4F6F720297C; Sat, 26 Jul 2025 09:25:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1753521918; cv=none; b=FXbf+vZZS00EdMH4K/3kbbnBuSGSOU0YbKLhP2vK2i8fsy2l5qbWct0FrHrtpn0MOIQqJF4bUGpPseCOK9sBzaTMqlK6xgbJjWNEpeaexhaV7gRiuF5bncFauETFRAwcQFpOrZTa8qTsXGXIpptvN1v2I3cBjtI3U4D/efVMsBc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1753521918; c=relaxed/simple; bh=G1zXDq+dSV8P5gQI8K1WrGYlMWHSTInEUb24jJWuUM0=; h=Date:Message-ID:From:To:Cc:Subject:In-Reply-To:References: MIME-Version:Content-Type; b=aEtg/dStDjwJobRr7gayMiOpqUmsbqhvF2y2GyqY/tk56crg+4m0XJMKEidkYjTWhLcRx11D34260h1sLMnI6cGVSgHkbS5ZQmDpZp64i2gEQuKv2mK/HXEI+Ur+rLRFd34y3odx7afmBvl2Gusdx43CEq0iRxQ6b8YIc3agaR0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=GUPRjgp+; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="GUPRjgp+" Received: by smtp.kernel.org (Postfix) with ESMTPSA id BD229C4CEED; Sat, 26 Jul 2025 09:25:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1753521916; bh=G1zXDq+dSV8P5gQI8K1WrGYlMWHSTInEUb24jJWuUM0=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=GUPRjgp+BNT3teTB/i1ZeuS2ugfDmiE5OHjL9aSyor7zVLZxKJZzaApKwIQk0Cblc hKp7JswyygdYTz0UKzjPJrboEP3mLi9UcFTj9RqjkweTk1cHdkCvU8S61QjMqLZ2E8 lZc4DDwJEmHQDStESsDPw/WgpLC7YOUnzQ++hrIVs1B36fps5EWqWLhpvKe/xldC6J VE1QLuUGLK2h4D/OwFXCyJPxN+R8VxSLYWLX4QYDKQb+TnDxAAlxntJKwPYT3Uiwg5 xNMA8l+k+t0wfgLII45zb54MTGJsw8Zq85q5oYK6v1SRBdinvEKpanRQOIt+OeRQAg kfOda1TwK/OxA== Received: from sofa.misterjones.org ([185.219.108.64] helo=lobster-girl.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1ufb9W-001aBM-8Y; Sat, 26 Jul 2025 10:25:14 +0100 Date: Sat, 26 Jul 2025 10:25:07 +0100 Message-ID: <87ikjftibw.wl-maz@kernel.org> From: Marc Zyngier To: Andre Przywara Cc: Will Deacon , Julien Thierry , kvm@vger.kernel.org, kvmarm@lists.linux.dev, Alexandru Elisei Subject: Re: [PATCH kvmtool v2 4/6] arm64: Add counter offset control In-Reply-To: <20250725144100.2944226-5-andre.przywara@arm.com> References: <20250725144100.2944226-1-andre.przywara@arm.com> <20250725144100.2944226-5-andre.przywara@arm.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/30.1 (aarch64-unknown-linux-gnu) MULE/6.0 (HANACHIRUSATO) Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: andre.przywara@arm.com, will@kernel.org, julien.thierry.kdev@gmail.com, kvm@vger.kernel.org, kvmarm@lists.linux.dev, alexandru.elisei@arm.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false On Fri, 25 Jul 2025 15:40:58 +0100, Andre Przywara wrote: > > From: Marc Zyngier > > KVM now allows to offset the arch timer counter values reported to a > guest, via a per-VM ioctl. This is conceptually similar to the effects > of CNTVOFF_EL2, but applies to both the emulated physical and virtual > counter, and also to all VCPUs. Not really. Architecturally, there is only a single, global counter, and multiple *views* of that counter. What this option does is to offset the global counter. Then, the various per-CPU offsets are applied on the views that can be affected by them. This is cumulative. So for example, CNTVCT_EL0 is affected by both the global offset and CNTVOFF_EL2 when read from EL0, EL1, and EL2 when E2H==0. Behind the scenes, this is of course implemented with CNTVOFF_EL2 (when it works), but that's not really relevant here. I'd suggest something along the lines of: "KVM allows the offsetting of the global counter in order to help with migration of a VM. This offset applies cumulatively with the offsets provided by the architecture. Although kvmtool doesn't provide a way to migrate a VM, controlling this offset is useful to test the timer subsystem." Thanks, M. -- Jazz isn't dead. It just smells funny.