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 439ECC2F1 for ; Thu, 30 Mar 2023 10:09:38 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id F2025C433EF; Thu, 30 Mar 2023 10:09:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1680170978; bh=LfP+Xf7RvTzu+2HSBezTLlX0xO4X6/y5lCmGsEkEsrk=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=f2aoxOt0RJ3sNSluSGgUwleIWL8eQ6qyHY+WxZJLvEPqxNOQpTwESkO8NrMzWCmHr l3Qz7znYe+oDYLfccvN8hOqWytkW7NwlAK6gIiEM5VBzA+CgURqObN4EeHtlTDQk4r qVLmzVD85hsFJD24nM5tFr5YKYGzGos9ipQLrrsnFdf2yOtIWkuQINv9YX2enHxhmt lWGxHXT+4UKSSsSjNc923e/Wat+WmGm7vyWQheBbo0//hFK6pdKAk4KKsmwFuGPnfh X+y7wvn0n6iJ7cNcAAJQZ+CezmMQzGD83VAGz5fpAslIo12nqrVbqqVhUnYWO2Nfup BYUY8AM5OUpjg== 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 1phpDr-004KD1-RP; Thu, 30 Mar 2023 11:09:36 +0100 Date: Thu, 30 Mar 2023 11:09:35 +0100 Message-ID: <86h6u2wnxc.wl-maz@kernel.org> From: Marc Zyngier To: Oliver Upton Cc: kvmarm@lists.linux.dev, kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, James Morse , Suzuki K Poulose , Zenghui Yu , Ricardo Koller , Simon Veith , Reiji Watanabe , Colton Lewis , Joey Gouly , dwmw2@infradead.org Subject: Re: [PATCH v3 05/18] KVM: arm64: timers: Allow physical offset without CNTPOFF_EL2 In-Reply-To: References: <20230324144704.4193635-1-maz@kernel.org> <20230324144704.4193635-6-maz@kernel.org> 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=US-ASCII X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: oliver.upton@linux.dev, kvmarm@lists.linux.dev, kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, james.morse@arm.com, suzuki.poulose@arm.com, yuzenghui@huawei.com, ricarkol@google.com, sveith@amazon.de, reijiw@google.com, coltonlewis@google.com, joey.gouly@arm.com, dwmw2@infradead.org X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false On Thu, 30 Mar 2023 07:42:47 +0100, Oliver Upton wrote: > > Hey Marc, > > On Fri, Mar 24, 2023 at 02:46:51PM +0000, Marc Zyngier wrote: > > CNTPOFF_EL2 is awesome, but it is mostly vapourware, and no publicly > > available implementation has it. So for the common mortals, let's > > implement the emulated version of this thing. > > > > It means trapping accesses to the physical counter and timer, and > > emulate some of it as necessary. > > > > As for CNTPOFF_EL2, nobody sets the offset yet. > > Did you consider implementing a 'fast' exit handler for counter reads? > When I took a stab at this a long time ago I had something similar [*]. > Since physical counter emulation is going to effectively be used by all > systems out there right now it might be worth giving the best emulation > implementation we can. Indeed, I have some of that in the NV code, which needs to be augmented. I'm not sure any guest deeply cares about the physical counter outside of NV, but I'm happy to hack something together if someone screams loudly enough! Thanks, M. -- Without deviation from the norm, progress is not possible.