From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37270) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aLu0N-0001fo-MK for qemu-devel@nongnu.org; Wed, 20 Jan 2016 09:45:04 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aLu0K-0000EU-FE for qemu-devel@nongnu.org; Wed, 20 Jan 2016 09:45:03 -0500 Received: from mx2.parallels.com ([199.115.105.18]:48289) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aLu0K-0000BK-9h for qemu-devel@nongnu.org; Wed, 20 Jan 2016 09:45:00 -0500 References: <1450949580-25759-1-git-send-email-asmetanin@virtuozzo.com> <569DEA3B.2040107@openvz.org> <569F9419.4000601@redhat.com> From: "Denis V. Lunev" Message-ID: <569F9D61.5020203@openvz.org> Date: Wed, 20 Jan 2016 17:44:49 +0300 MIME-Version: 1.0 In-Reply-To: <569F9419.4000601@redhat.com> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v1] kvm/x86: Hyper-V tsc page setup List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini , Andrey Smetanin , kvm@vger.kernel.org Cc: Gleb Natapov , Roman Kagan , qemu-devel@nongnu.org On 01/20/2016 05:05 PM, Paolo Bonzini wrote: > > On 19/01/2016 08:48, Denis V. Lunev wrote: >>> diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h >>> index 6877b4d7e..93c9e25 100644 >>> --- a/include/linux/kvm_host.h >>> +++ b/include/linux/kvm_host.h >>> @@ -145,6 +145,7 @@ static inline bool is_error_page(struct page *page) >>> #define KVM_REQ_HV_RESET 29 >>> #define KVM_REQ_HV_EXIT 30 >>> #define KVM_REQ_HV_STIMER 31 >>> +#define KVM_REQ_HV_TSC_PAGE 32 >>> #define KVM_REQ_MAX 64 >>> >> ping > Applied with this change: > > diff --git a/arch/x86/kvm/hyperv.c b/arch/x86/kvm/hyperv.c > index d7716c6e2752..047c275717d3 100644 > --- a/arch/x86/kvm/hyperv.c > +++ b/arch/x86/kvm/hyperv.c > @@ -842,7 +842,7 @@ int kvm_hv_setup_tsc_page(struct kvm_vcpu *vcpu) > tsc_khz, tsc, tsc_scale, tsc_offset); > > tsc_ref.tsc_sequence++; > - if (tsc_ref.tsc_sequence == 0) > + if (tsc_ref.tsc_sequence == 0xFFFFFFFF tsc_ref.tsc_sequence == 0) > tsc_ref.tsc_sequence = 1; > > tsc_ref.tsc_scale = tsc_scale; > > and renumbering KVM_REQ_HV_TSC_PAGE from 32 to 31. > > Paolo the latter does not seem to be correct to me. MS spec has bug, see this thread: https://lkml.org/lkml/2015/11/2/655 and the change was Acked-by: K.Y. Den