From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paolo Bonzini Subject: Re: [RFC PATCH 1/2] Hyper-H reference counter Date: Thu, 16 May 2013 16:48:02 +0200 Message-ID: <5194F1A2.2060402@redhat.com> References: <1368445517-5496-1-git-send-email-vrozenfe@redhat.com> <1368445517-5496-2-git-send-email-vrozenfe@redhat.com> <20130516083450.GM26453@redhat.com> <1368695621.18400.9.camel@localhost> <20130516092128.GP26453@redhat.com> <1368696535.18400.10.camel@localhost> <5194E105.8000909@redhat.com> <1368714131.18400.11.camel@localhost> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: Gleb Natapov , kvm@vger.kernel.org, mtosatti@redhat.com, pl@dlh.net To: Vadim Rozenfeld Return-path: Received: from mx1.redhat.com ([209.132.183.28]:16788 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752157Ab3EPOsL (ORCPT ); Thu, 16 May 2013 10:48:11 -0400 In-Reply-To: <1368714131.18400.11.camel@localhost> Sender: kvm-owner@vger.kernel.org List-ID: Il 16/05/2013 16:22, Vadim Rozenfeld ha scritto: >>>>>>>>>>> > >>>>> > > > > + addr = gfn_to_hva(kvm, gfn); >>>>>>>>>>> > >>>>> > > > > + if (kvm_is_error_hva(addr)) >>>>>>>>>>> > >>>>> > > > > + return 1; >>>>>>>>>>> > >>>>> > > > > + tsc_ref = 0; >> > >> > This should write 0xFFFFFFFF. > This should write 0 No. You have not writing sensible values to TscScale/TscOffset, hence the VM should fall back to another time source. Microsoft docs say "A special value of 0xFFFFFFFF is used to indicate that this facility is no longer a reliable source of reference time and the virtual machine must fall back to a different source (for example, the virtual PM timer)". So you need to write 0xFFFFFFFF here (though my suggestion would rather be to remove this part of the patch, and do everything in the next patch). The next patch should pick 0 if constant TSC is available, 0xFFFFFFFF if it is not. If the docs are wrong, I stand corrected but then you need a comment explaining that. Paolo