Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp3144689pxa; Tue, 18 Aug 2020 07:44:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz97TZL62s24GH6o3yjCsaAdV7Qyc61JJ5txpK8Yj0SfIrUdv1lQH8eVa4bEtlT8hV2I86y X-Received: by 2002:a17:906:3911:: with SMTP id f17mr21379272eje.56.1597761862825; Tue, 18 Aug 2020 07:44:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597761862; cv=none; d=google.com; s=arc-20160816; b=RZTKNWarMOASRQoKHlsgXIC9/Vk+vYxJLhOxI/cNgmuyST7jKr06wtVLXQky1fmSBd O6B/DC0b5MfLY0h7UE/arUY8oZksnuTeoj+5YPNJ9DCY/nFByrELzA+dEJPDO9fUbiRo 5FLnQZxTMqxIeL+6CM6VnioZ5BvaZ0gqhMgDwo13NMfyp7/gEDwyeBEZb6qSYTPbVubA 6jlaWCjy2Va6txVrMGmoV7ns/oaXQLkApCQMUSTzxBpECL7NQcImcfJfFUWysAbBJrBl V9yVn1B5WrrC75WKczXGhin7lD7NswaQuigKFbt74R2TR8WJfrGcFKPgME6tWCWP/mo0 5F6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:user-agent:references :in-reply-to:subject:cc:to:from:date:content-transfer-encoding :mime-version:dkim-signature; bh=bQP458n553WrBOSXopT9D0e60f+I7Jji4FcsV3EOus4=; b=EuArg/aPTuaylY1RsL/Nmj8e7cMkujLtHOiGRWeKEGJZpvJkDz1P/Z57jJlafwllj0 E49hkV4ZfZC2+fS11FHVPuk+Kgp4AhcYkUdOglhAdhzZulojZx0yQyb539O/nw/HhdVX HOSjsCj3QXJgluXX/+zOti5X7XZje9iKMkUHze20ToukmrxHnSWnxwGfjIyHsrwhvjhe Zinyk1I9hPDNxNUv+JMDsXmFDa5pA2MDTpKkvZKJVNL5/RB2ptvBZIMTxi1CBsGECgQH /CIBxb3r4DMxCR0oJijlexAr229gLA2UiDb8TlnIX1KF2KVJQNJGpYaOzU0470WsSx0V IbGA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="AOCKY6z/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f25si13261901edq.447.2020.08.18.07.43.59; Tue, 18 Aug 2020 07:44:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="AOCKY6z/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727120AbgHROlM (ORCPT + 99 others); Tue, 18 Aug 2020 10:41:12 -0400 Received: from mail.kernel.org ([198.145.29.99]:50948 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726585AbgHROlF (ORCPT ); Tue, 18 Aug 2020 10:41:05 -0400 Received: from disco-boy.misterjones.org (disco-boy.misterjones.org [51.254.78.96]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 70C852083B; Tue, 18 Aug 2020 14:41:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597761663; bh=bJPOt4B5MgpMDT2n+zzNZ+rE9AaQj654FX1OxJw6sDk=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=AOCKY6z/atNldeFw82NlnljvDaIkZ1FqC+aSBMu3yFXm9qvkAyP1Gs4olwzL0n+JN KtfqIK08IDgo0RkpYl8PMbUn6s3DUAhVyXc/EQOmH1F+zB4VF2sIxTbf7BWv2kFOUi VkiNd596tsEYNkhmbOs65QaPxRz3BbwlGWmAiHAI= Received: from disco-boy.misterjones.org ([51.254.78.96] helo=www.loen.fr) by disco-boy.misterjones.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1k82nN-003vcz-O3; Tue, 18 Aug 2020 15:41:01 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Tue, 18 Aug 2020 15:41:01 +0100 From: Marc Zyngier To: Keqian Zhu Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org, Steven Price , Catalin Marinas , Will Deacon , James Morse , Suzuki K Poulose , wanghaibin.wang@huawei.com Subject: Re: [RFC PATCH 0/5] KVM: arm64: Add pvtime LPT support In-Reply-To: <20200817084110.2672-1-zhukeqian1@huawei.com> References: <20200817084110.2672-1-zhukeqian1@huawei.com> User-Agent: Roundcube Webmail/1.4.7 Message-ID: <8308f52e4c906cad710575724f9e3855@kernel.org> X-Sender: maz@kernel.org X-SA-Exim-Connect-IP: 51.254.78.96 X-SA-Exim-Rcpt-To: zhukeqian1@huawei.com, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org, steven.price@arm.com, catalin.marinas@arm.com, will@kernel.org, james.morse@arm.com, suzuki.poulose@arm.com, wanghaibin.wang@huawei.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2020-08-17 09:41, Keqian Zhu wrote: > Hi all, > > This patch series picks up the LPT pvtime feature originally developed > by Steven Price: https://patchwork.kernel.org/cover/10726499/ > > Backgroud: > > There is demand for cross-platform migration, which means we have to > solve different CPU features and arch counter frequency between hosts. > This patch series can solve the latter problem. > > About LPT: > > This implements support for Live Physical Time (LPT) which provides the > guest with a method to derive a stable counter of time during which the > guest is executing even when the guest is being migrated between hosts > with different physical counter frequencies. > > Changes on Steven Price's work: > 1. LPT structure: use symmatical semantics of scale multiplier, and use > fraction bits instead of "shift" to make everything clear. > 2. Structure allocation: host kernel does not allocates the LPT > structure, > instead it is allocated by userspace through VM attributes. The > save/restore > functionality can be removed. > 3. Since LPT structure just need update once for each guest run, add a > flag to > indicate the update status. This has two benifits: 1) avoid multiple > update > by each vCPUs. 2) If the update flag is not set, then return NOT > SUPPORT for > coressponding guest HVC call. > 4. Add VM device attributes interface for userspace configuration. > 5. Add a base LPT read/write layer to reduce code. > 6. Support ptimer scaling. > 7. Support timer event stream translation. > > Things need concern: > 1. https://developer.arm.com/docs/den0057/a needs update. LPT was explicitly removed from the spec because it doesn't really solve the problem, specially for the firmware: EFI knows nothing about this, for example. How is it going to work? Also, nobody was ever able to explain how this would work for nested virt. ARMv8.4 and ARMv8.6 have the feature set that is required to solve this problem without adding more PV to the kernel. M. -- Jazz is not dead. It just smells funny...