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 75BA78C02 for ; Thu, 30 Mar 2023 17:46:20 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 16B34C433D2; Thu, 30 Mar 2023 17:46:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1680198380; bh=uwg4vVca0PK6f6towdemg7iiJoZTcPoR6/nkSk4gd1A=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=EAh4y9c213YGTVz9G11YqMVR2UAROYfcLcrIn6nZzakCWpZkGFOFtgeoOyf+LO82O 7DWVpz0o2vB4nr5mqRHVPKy++qAxjV41zCKUemYFPR1iC4sIeKvlZ7CzgSGUUuPFn2 hzsG1z1c4FlJpIkxaEDfQNs8NCeC+ILTudOR+7NepHVVB2b2g5PvThlxcVVdx7PDc4 8KKkh8SlNlPpkz9LIYmVpPEa2baKinR5iuSZnFvuj/yseCuKJQziRGNreg3VFQhaub PQNlVUZ0vugF6iZxjnzoLRiYbc558GA2mOKpu4Lf6fWIaDFgX+Z81/jOfHMacctji5 LvWq1EVr/OHCw== Received: from sofa.misterjones.org ([185.219.108.64] helo=goblin-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 1phwLp-004RnV-LD; Thu, 30 Mar 2023 18:46:17 +0100 Date: Thu, 30 Mar 2023 18:46:17 +0100 Message-ID: <86cz4qw2s6.wl-maz@kernel.org> From: Marc Zyngier To: "Veith, Simon" Cc: "kvmarm@lists.linux.dev" , "kvm@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "yuzenghui@huawei.com" , "dwmw2@infradead.org" , "coltonlewis@google.com" , "james.morse@arm.com" , "suzuki.poulose@arm.com" , "oliver.upton@linux.dev" , "joey.gouly@arm.com" , "reijiw@google.com" , "ricarkol@google.com" Subject: Re: [PATCH v3 00/18] KVM: arm64: Rework timer offsetting for fun and profit In-Reply-To: <67fd090a26beb831a3ae754853c9419e1cbcfcd8.camel@amazon.de> References: <20230324144704.4193635-1-maz@kernel.org> <67fd090a26beb831a3ae754853c9419e1cbcfcd8.camel@amazon.de> 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/28.2 (aarch64-unknown-linux-gnu) MULE/6.0 (HANACHIRUSATO) Precedence: bulk X-Mailing-List: kvmarm@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: sveith@amazon.de, kvmarm@lists.linux.dev, kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, yuzenghui@huawei.com, dwmw2@infradead.org, coltonlewis@google.com, james.morse@arm.com, suzuki.poulose@arm.com, oliver.upton@linux.dev, joey.gouly@arm.com, reijiw@google.com, ricarkol@google.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false On Wed, 29 Mar 2023 06:41:07 +0100, "Veith, Simon" wrote: >=20 > Hello Marc, >=20 > thanks again for your proposal. >=20 > On Fri, 2023-03-24 at 14:46 +0000, Marc Zyngier wrote: > > This series aims at satisfying multiple goals: > >=20 > > - allow a VMM to atomically restore a timer offset for a whole VM > > =C2=A0 instead of updating the offset each time a vcpu get its counter > > =C2=A0 written > >=20 > > - allow a VMM to save/restore the physical timer context, something > > =C2=A0 that we cannot do at the moment due to the lack of offsetting > >=20 > > - provide a framework that is suitable for NV support, where we get > > =C2=A0 both global and per timer, per vcpu offsetting, and manage > > =C2=A0 interrupts in a less braindead way. > >=20 > > We fix a couple of issues along the way, both from a stylistic and > > correctness perspective. This results in a new per VM KVM API that > > allows a global offset to be set at any point in time, overriding > > both > > of the timer counter writebacks. > >=20 > > We also take this opportunity to rework the way IRQs are associated > > with timers, something that was always a bit dodgy. This relies on a > > new lock, which should disappear once Oliver's lock ordering series > > is > > merged (we can reuse the config_lock for this). > >=20 > > This has been tested with nVHE, VHE and NV. I do not have access to > > CNTPOFF-aware HW, but Colton managed to give it a go. Note that the > > NV patches in this series are here to give a perspective on how this > > gets used. > >=20 > > I've updated the arch_timer selftest to allow an offset to be > > provided > > from the command line, and fixed a couple of glaring issues along the > > way. > >=20 > > Note that this is at best 6.4 material. I have a branch stashed at > > [0] > > and based on 6.3-rc3, as well as a minimal example of the use of the > > API at [3] based on kvmtool. > >=20 > > Simon: I'd appreciate some feedback as whether this change fits your > > requirements, given that you brought this up the first place. >=20 > The interface looks good to me. I have yet to deliver on my promise to > test your patch series with our userspace; I am on leave this week, but > I'll give your latest iteration a go next week. No worries. I'm about to post v4, which I think is pretty ripe at this stage. Do let me know when you get a chance to try it. Thanks, M. --=20 Without deviation from the norm, progress is not possible.