From mboxrd@z Thu Jan 1 00:00:00 1970 From: Vadim Rozenfeld Subject: Re: [RFC PATCH v2 2/2] add support for Hyper-V invariant TSC Date: Mon, 27 May 2013 22:33:51 +1000 Message-ID: <1369658031.7872.32.camel@localhost> References: <1368947197-9033-1-git-send-email-vrozenfe@redhat.com> <1368947197-9033-3-git-send-email-vrozenfe@redhat.com> <20130522005046.GA7589@amt.cnet> <643480794.5761686.1369207375451.JavaMail.root@redhat.com> <20130522212330.GA29387@amt.cnet> <20130523091229.GI4725@redhat.com> <20130523135338.GA15652@amt.cnet> <20130523153110.GI26157@redhat.com> <278937736.7040157.1369390276708.JavaMail.root@redhat.com> <20130524194124.GA2888@amt.cnet> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Cc: Gleb Natapov , kvm@vger.kernel.org, pl@dlh.net To: Marcelo Tosatti Return-path: Received: from mx1.redhat.com ([209.132.183.28]:44056 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932343Ab3E0MeB (ORCPT ); Mon, 27 May 2013 08:34:01 -0400 In-Reply-To: <20130524194124.GA2888@amt.cnet> Sender: kvm-owner@vger.kernel.org List-ID: On Fri, 2013-05-24 at 16:41 -0300, Marcelo Tosatti wrote: > On Fri, May 24, 2013 at 06:11:16AM -0400, Vadim Rozenfeld wrote: > > > Is there a better option? > > > > > If setting TscSequence to zero makes Windows fall back to the MSR this is a > > better option. > > > > +1 > > This is why MS has two different mechanisms: > > iTSC as a primary, reference counters as a fall-back. > > Ok, is it documented that transition > > iTSC valid (Sequence != 0 and != 0xFFFFFFFF) -> > iTSC not valid but ref MSR valid (Sequence = 0), > > is a valid transition? > Yes, it's true. > It was not obvious for me. Can you point to documentation? > > Hypervisor Functional Specification v2.0a: For Windows Server 2008 R2 http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=18673 "15.4.3.3 Reference TSC during Save/Restore and Migration To address migration scenarios to physical platforms which do not support iTSC, the TscSequence field is used. In the event a guest partition is migrated from an iTSC capable host to a non-iTSC capable host, the hypervisor sets TscSequence to the special value of 0x0, which directs the guest operating system to fall back to a different clock source (the virtual PM timer)." Now what the virtual PM timer is - if hypervisor provides PM Timer assist support (HvPartitionPropertyPmTimerAssist partition property), it will use partition reference counters to calculate PM Timer value. If partition has no HvPartitionPropertyPmTimerAssist - guest will use reference counters MSR directly. Currently we don't support PM timer assist, so TscSequence 0x0 means fallback to reference counters.