From mboxrd@z Thu Jan 1 00:00:00 1970 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E941DC64EC4 for ; Thu, 9 Mar 2023 08:31:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230013AbjCIIbl (ORCPT ); Thu, 9 Mar 2023 03:31:41 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42984 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230027AbjCIIbS (ORCPT ); Thu, 9 Mar 2023 03:31:18 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8B51F3668F for ; Thu, 9 Mar 2023 00:29:30 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 2694F61A70 for ; Thu, 9 Mar 2023 08:29:30 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8788DC433EF; Thu, 9 Mar 2023 08:29:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1678350569; bh=2k4s+7q61F9IqFit/joyuBMQsl0m6FGsMAJf9S5C2g4=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=uLVYAaIlDqCLGBls+WcHrQXa38GbCLAP2NAYgDd+ecIFrm6PEjfQmKGkbmjWj3de2 oq8nclAy1QzsEzfTx9EKIhppYyJUHw7o6mGItng40474B4ZDJ4/+hxsD3eF28se2/Z q4PV8U/Jryyv/5csR+cblrWy5zaq6UUafojgdM3c27zTi79IO9BtNHV1OcK2T5zkMn sQGtYbJ5+Rk4e0jN/Lod+nHcomc2x5E6yTusyiJ0aRK0bcEaHKdQLQut/h0/kG/0KN /x9hPdjAc2f6w+u0vPyS+CqT7xp5ZHTAXdzPB/OgEb2/6K4F/BR70Lm3x/60MTgf9U WUovdJzXbCYnw== Received: from 82-132-236-50.dab.02.net ([82.132.236.50] helo=wait-a-minute.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 1paBeQ-00GFIV-T6; Thu, 09 Mar 2023 08:29:27 +0000 Date: Thu, 09 Mar 2023 08:29:24 +0000 Message-ID: <87cz5i9vkr.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 , dwmw2@infradead.org Subject: Re: [PATCH 08/16] KVM: arm64: timers: Allow userspace to set the counter offsets In-Reply-To: References: <20230216142123.2638675-1-maz@kernel.org> <20230216142123.2638675-9-maz@kernel.org> <86k00gy4so.wl-maz@kernel.org> <86bkllyku2.wl-maz@kernel.org> <867cw8xmq2.wl-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/27.1 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-SA-Exim-Connect-IP: 82.132.236.50 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, 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 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org On Wed, 08 Mar 2023 07:53:46 +0000, Oliver Upton wrote: > > > I certainly agree that (2a) is highly desirable to get existing VMMs to > > 'do the right thing' for free. Playing devil's advocate, would this not > > also break the tracing example you've given of correlating timestamps > > between the host and guest? I wouldn't expect a userspace + VM tracing > > contraption to live migrate but restoring from a snapshot seems > > plausible. > > The problem I'm alluding to here is that the VMM will save/restore > the physical counter value and cause KVM to offset the physical counter. > Live migration is a pretty obvious example, but resuming from a snapshot > after resetting a system be similarly affected. My take on this is that if you have produced the snapshot on a pre-CNTPCT host, there will be no change in behaviour. If you've produced the snapshot on a new host, you get the new behaviour. I am willing to be accommodating to the use case, but only to a certain extent! ;-) M. -- Without deviation from the norm, progress is not possible.