From: "Jan Beulich" Subject: Re: [PATCH 2/2] x86/viridian: Add partition time reference counter MSR support Date: Fri, 01 Aug 2014 16:51:32 +0100 Message-ID: <53DBD3A40200007800028909@mail.emea.novell.com> References: <1406906491-38243-1-git-send-email-paul.durrant@citrix.com> <1406906491-38243-2-git-send-email-paul.durrant@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1406906491-38243-2-git-send-email-paul.durrant@citrix.com> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Paul Durrant Cc: Keir Fraser , xen-devel@lists.xen.org, IanJackson , Ian Campbell , Stefano Stabellini List-Id: xen-devel@lists.xenproject.org >>> On 01.08.14 at 17:21, wrote: > The counter value used in this implementation properly fulfils the > documented semantics of the MSR. Does it? See below ... > @@ -344,6 +346,20 @@ int rdmsr_viridian_regs(uint32_t idx, uint64_t *val) > *val = v->arch.hvm_vcpu.viridian.apic_assist.raw; > break; > > + > + case VIRIDIAN_MSR_TIME_REF_COUNT: Please don't add a second blank line above this case. > + { > + uint64_t sec, nsec; > + > + if ( ~viridian_feature_mask(d) & HVMPV_time_ref_count ) > + return 0; > + > + perfc_incr(mshv_rdmsr_time_ref_count); > + sec = shared_info(d, wc_sec); > + nsec = shared_info(d, wc_nsec); > + *val = (SECONDS(sec) + nsec + NOW()) / 100ul; > + break; > + } Doesn't this assume fully synchronized wall clocks between source and destination hosts of a migration? And suffer from discontinuities due to host wall clock adjustments? Or domain_set_time_offset() invocations? As mentioned on IRC to Andrew the other day (not sure if he communicated this onwards), why can't the Viridian clock not use the same pt_global_vcpu_target() based approach other virtual clocks do? Jan