From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sheng Yang Subject: Re: Re: [PATCH][v4] PV extension of HVM(hybrid) support =?iso-8859-1?q?in=09Xen?= Date: Tue, 2 Mar 2010 11:36:02 +0800 Message-ID: <201003021136.02590.sheng@linux.intel.com> References: <201003011743.41341.sheng@linux.intel.com> <201003011940.50685.sheng@linux.intel.com> <4B8C6EC3.2020307@goop.org> Mime-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <4B8C6EC3.2020307@goop.org> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Jeremy Fitzhardinge Cc: Ian Campbell , Ian Pratt , xen-devel , Tim Deegan , Keir Fraser List-Id: xen-devel@lists.xenproject.org On Tuesday 02 March 2010 09:49:55 Jeremy Fitzhardinge wrote: > On 03/01/2010 03:40 AM, Sheng Yang wrote: > > The issue is pv timer. It assumed the tsc start from 0, which is > > different from HVM. So I'd like to give it a explicit call here. > > Otherwise it can be hooked in evtchn binding, but I don't think that's > > clear... > > [...] > > >> Only vcpu 0? Doesn't this do horrible things to timekeeping in the > >> guest? > > > > The other vcpus are initialized when it is brought up. TSC started from 0 > > is a fundamental assumption for pv clock in Linux... > > Could you expand on this? Do you mean in the pvops Xen time code? What > do you mean? > The function pvclock_get_nsec_offset() in Linux kernel have this: >static u64 pvclock_get_nsec_offset(struct pvclock_shadow_time *shadow) >{ > u64 delta = native_read_tsc() - shadow->tsc_timestamp; > return scale_delta(delta, shadow->tsc_to_nsec_mul, shadow- >tsc_shift); >} tsc_timestamp take the vcpu beginning at 0, so that's the assumption. So I adjusted guest TSC(the return value of native_read_tsc()) to satisfy this assumption. -- regards Yang, Sheng