Received: by 2002:a25:ca44:0:0:0:0:0 with SMTP id a65csp783553ybg; Tue, 28 Jul 2020 20:00:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxEk09sDl05iT5dXIkYHzmGgZIsbg3uEiz8cj0+adJymFM8FJNwMUG0tBMISS/rZEFUYnfW X-Received: by 2002:a17:906:3614:: with SMTP id q20mr22427876ejb.142.1595991643936; Tue, 28 Jul 2020 20:00:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595991643; cv=none; d=google.com; s=arc-20160816; b=GeaPlTqgXT/rd8MBzBnB32MY2ttvvi5L5OOvBAZI5Bpg2TH0ZJpV8j9SFU6/dKvBY9 SIQCP9G4arRpca7Ud3f1dBiAX3kYMDD56t/rPb0eEjRFej9YW/pfnEWipNdcGZrxaGtb 0qTVS6+4UovKqsWNp3RY+4NTK7hP5EBWacjeVq5lg4+f/2z/vEQydXUNjCj2l01URlwT mgD7E/C0QWsfr3UlqBhAQvfFVYsO48L3noUhsZPwkm3YH7Dh+zHRpE3LLDiR5jQFn6ZI 3LI1z+LlLimpOBDJSJQPbWy3L9HzSfk5/4sr067K7a94QiTJQAKAd2kCAPA3dNGH6FB/ DiVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:in-reply-to :mime-version:user-agent:date:message-id:cc:references:to:subject :from; bh=wCO78LhhZPHSCdd2BZMrrc9qxrK5eb0XWCeP7jDM/VQ=; b=Al4bRvfRy+N7A3vnvUeJ6B60nmztaN+gtXPNRqFt5QaugbDpeZonRrPb2ZVigKa+GA Enos5hbO8d+EExMSWEitRaLMDSov7UzmjZy4X8l/SuRUXpAro3unOoZGmCf0Kq8Ozcwd 4I6LLRL/5UMuCI0UlCPtbp3t26PKKdZhRLqISkAOMyUvmQDHpcIqXOi+q9OtQlpfBWJ0 fuu0mvccqA3DX9U88vEr1rmaeqoPVwel/lXrp/tXWsJiv4EdzRJELlt3kCfpkaTmkxQe AMqzgGzUc8TJtCu3EH6hX1BCI2CT+CBEtVY5h+AWVB2p3PAqzjoxLFyx4yg6f+sCeaf1 Dtmw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a14si490773eda.58.2020.07.28.20.00.20; Tue, 28 Jul 2020 20:00:43 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731171AbgG2C5m (ORCPT + 99 others); Tue, 28 Jul 2020 22:57:42 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:8846 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728401AbgG2C5l (ORCPT ); Tue, 28 Jul 2020 22:57:41 -0400 Received: from DGGEMS405-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id DEDAF5C6B6236BE30C72; Wed, 29 Jul 2020 10:57:38 +0800 (CST) Received: from [10.174.187.22] (10.174.187.22) by DGGEMS405-HUB.china.huawei.com (10.3.19.205) with Microsoft SMTP Server id 14.3.487.0; Wed, 29 Jul 2020 10:57:30 +0800 From: zhukeqian Subject: Re: [PATCH 0/9] arm64: Stolen time support To: Steven Price References: <20190802145017.42543-1-steven.price@arm.com> <1611996b-1ec1-dee7-ed61-b3b9df23f138@huawei.com> <25c7f2e2-e779-4e97-fdc5-0aba9fcf0fbc@arm.com> CC: , , Catalin Marinas , , Russell King , , Marc Zyngier , Paolo Bonzini , Will Deacon , , , , "wanghaibin.wang@huawei.com >> Wanghaibin (D)" Message-ID: <816e3b46-07fc-0274-deb2-0d026d50b989@huawei.com> Date: Wed, 29 Jul 2020 10:57:30 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.7.1 MIME-Version: 1.0 In-Reply-To: <25c7f2e2-e779-4e97-fdc5-0aba9fcf0fbc@arm.com> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.174.187.22] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Steven, On 2020/7/27 18:48, Steven Price wrote: > On 21/07/2020 04:26, zhukeqian wrote: >> Hi Steven, > > Hi Keqian, > >> On 2019/8/2 22:50, Steven Price wrote: >>> This series add support for paravirtualized time for arm64 guests and >>> KVM hosts following the specification in Arm's document DEN 0057A: >>> >>> https://developer.arm.com/docs/den0057/a >>> >>> It implements support for stolen time, allowing the guest to >>> identify time when it is forcibly not executing. >>> >>> It doesn't implement support for Live Physical Time (LPT) as there are >>> some concerns about the overheads and approach in the above >> Do you plan to pick up LPT support? As there is demand of cross-frequency migration >> (from older platform to newer platform). > > I don't have any plans to pick up the LPT support at the moment - feel free to pick it up! ;) > >> I am not clear about the overheads and approach problem here, could you please >> give some detail information? Maybe we can work together to solve these concerns. :-) > > Fundamentally the issue here is that LPT only solves one small part of migration between different hosts. To successfully migrate between hosts with different CPU implementations it is also necessary to be able to virtualise various ID registers (e.g. MIDR_EL1, REVIDR_EL1, AIDR_EL1) which we have no support for currently. > Yeah, currently we are trying to do both timer freq virtualization and CPU feature virtualization. > The problem with just virtualising the registers is how you handle errata. The guest will currently use those (and other) ID registers to decide whether to enable specific errata workarounds. But what errata should be enabled for a guest which might migrate to another host? > Thanks for pointing this out. I think the most important thing is that we should introduce a concept named CPU baseline which represents a standard platform. If we bring up a guest with a specific CPU baseline, then this guest can only run on a platform that is compatible with this CPU baseline. So "baseline" and "compatible" are the key point to promise successful cross-platform migration. > What we ideally need is a mechanism to communicate to the guest what workarounds are required to successfully run on any of the hosts that the guest may be migrated to. You may also have the situation where the workarounds required for two hosts are mutually incompatible - something needs to understand this and do the "right thing" (most likely just reject this situation, i.e. prevent the migration). > > There are various options here: e.g. a para-virtualised interface to describe the workarounds (but this is hard to do in an OS-agnostic way), or virtual-ID registers describing an idealised environment where no workarounds are required (and only hosts that have no errata affecting a guest would be able to provide this). > My idea is similar with the "idealised environment", but errata workaround still exists. We do not provide para-virtualised interface, and migration is restricted between platforms that are compatible with baseline. Baseline should has two aspects: CPU feature and errata. These platforms that are compatible with a specific baseline should have the corresponding CPU feature and errata. > Given the above complexity and the fact that Armv8.6-A standardises the frequency to 1GHz this didn't seem worth continuing with. So LPT was dropped from the spec and patches to avoid holding up the stolen time support. > > However, if you have a use case which doesn't require such a generic migration (e.g. perhaps old and new platforms are based on the same IP) then it might be worth looking at bring this back. But to make the problem solvable it either needs to be restricted to platforms which are substantially the same (so the errata list will be identical), or there's work to be done in preparation to deal with migrating a guest successfully between hosts with potentially different errata requirements. > > Can you share more details about the hosts that you are interested in migrating between? Here we have new platform with 1GHz timer, and old platform is 100MHZ, so we want to solve the cross-platform migration firstly. Thanks, Keqian > > Thanks, > > Steve > . >