WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] [PATCH 0 of 5] PV on HVM Xen

To: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH 0 of 5] PV on HVM Xen
From: Jeremy Fitzhardinge <jeremy@xxxxxxxx>
Date: Tue, 16 Mar 2010 11:26:14 -0700
Cc: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>, Sheng Yang <sheng@xxxxxxxxxxxxxxx>
Delivery-date: Tue, 16 Mar 2010 11:28:10 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <alpine.DEB.2.00.1003161747090.23661@kaball-desktop>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <alpine.DEB.2.00.1003101457100.28412@kaball-desktop> <alpine.DEB.2.00.1003121024590.27222@kaball-desktop> <alpine.DEB.2.00.1003121432460.27222@kaball-desktop> <201003151205.29964.sheng@xxxxxxxxxxxxxxx> <alpine.DEB.2.00.1003151128010.28944@kaball-desktop> <4B9EBE03.4080105@xxxxxxxx> <alpine.DEB.2.00.1003161100540.23661@kaball-desktop> <4B9FBE94.4020303@xxxxxxxx> <alpine.DEB.2.00.1003161728550.23661@kaball-desktop> <4B9FC2B5.20103@xxxxxxxx> <alpine.DEB.2.00.1003161747090.23661@kaball-desktop>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.8) Gecko/20100301 Fedora/3.0.3-1.fc12 Lightning/1.0b2pre Thunderbird/3.0.3
On 03/16/2010 11:06 AM, Stefano Stabellini wrote:
the following is the interesting bit of the pvclock interface:

static __always_inline
u64 pvclock_get_nsec_offset(const struct pvclock_vcpu_time_info *src)
{
        u64 delta = __native_read_tsc() - src->tsc_timestamp;
        return scale_delta(delta, src->tsc_to_system_mul, src->tsc_shift);
}


xen refreshes the values in pvclock_vcpu_time_info every EPOCH (1s),
therefore if the value returned by pvclock_get_nsec_offset is greater
than EPOCH than the patch is not present in xen.

This is a simple way of detecting if the offset is taken into account or
not and it works because the offset is the value returned by rdtsc in
the host when the VM was created and we can be sure it corresponds to
more than 1 sec.

That seems pretty fragile. I don't think EPOCH is part of the ABI, and I don't think we should be relying on it.

    J

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel