From: Sheng Yang <sheng@linux.intel.com>
To: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Cc: Jeremy Fitzhardinge <jeremy@goop.org>,
"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: Re: [PATCH 0 of 5] PV on HVM Xen
Date: Wed, 17 Mar 2010 16:51:05 +0800 [thread overview]
Message-ID: <201003171651.05220.sheng@linux.intel.com> (raw)
In-Reply-To: <alpine.DEB.2.00.1003161834570.23661@kaball-desktop>
On Wednesday 17 March 2010 02:37:51 Stefano Stabellini wrote:
> On Tue, 16 Mar 2010, Jeremy Fitzhardinge wrote:
> > 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.
>
> EPOCH is certainly not part of the ABI :)
> That said the difference between a correct delta and a wrong delta is so
> big that we cannot really be mistaken.
>
> In any case I wouldn't mind a feature flag just to stay on the safe
> side, so I'll leave this decision to you and Keir (that this week is on
> vacation).
I am quite happy with a feature flag. Depends on the return of hypercall to
determine if the feature is there seems tricky to me...
Sure, I am fine with a set/remove tsc offset. And a side effort would be we
need more code to do it explicitly for SMP guest's vcpu in the guest kernel
code... But it's fine if they are elegant enough(I think setup_percpu_clockev
should be fit for it).
--
regards
Yang, Sheng
next prev parent reply other threads:[~2010-03-17 8:51 UTC|newest]
Thread overview: 67+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-03-10 15:46 [PATCH 0 of 5] PV on HVM Xen Stefano Stabellini
2010-03-10 17:33 ` [Xen-devel] " Pasi Kärkkäinen
2010-03-10 17:55 ` Stefano Stabellini
2010-03-10 19:45 ` Jeremy Fitzhardinge
2010-03-12 3:23 ` Sheng Yang
2010-03-12 10:42 ` [Xen-devel] " Stefano Stabellini
2010-03-12 16:00 ` Stefano Stabellini
2010-03-15 4:05 ` Sheng Yang
2010-03-15 8:29 ` Sheng Yang
2010-03-15 12:22 ` Stefano Stabellini
2010-03-17 9:38 ` Sheng Yang
2010-03-17 14:18 ` Konrad Rzeszutek Wilk
2010-03-17 15:21 ` Stefano Stabellini
2010-03-17 16:13 ` Jeremy Fitzhardinge
2010-03-18 1:30 ` Sheng Yang
2010-03-19 20:38 ` Jeremy Fitzhardinge
2010-03-22 6:26 ` MSI proposal and work transfer...(was: Re: [PATCH 0 of 5] PV on HVM Xen) Sheng Yang
2010-03-23 20:47 ` Jeremy Fitzhardinge
2010-03-24 8:19 ` Sheng Yang
2010-03-23 23:16 ` Stefano Stabellini
2010-03-24 8:25 ` Sheng Yang
2010-03-18 2:19 ` [PATCH 0 of 5] PV on HVM Xen Sheng Yang
2010-03-18 16:42 ` Jeremy Fitzhardinge
2010-03-17 16:13 ` Jeremy Fitzhardinge
2010-03-15 12:28 ` Stefano Stabellini
2010-03-15 23:08 ` Jeremy Fitzhardinge
2010-03-15 23:24 ` Frank van der Linden
2010-03-16 0:32 ` Dan Magenheimer
2010-03-16 6:09 ` Sheng Yang
2010-03-16 16:46 ` Dan Magenheimer
2010-03-16 11:07 ` Stefano Stabellini
2010-03-16 17:23 ` Jeremy Fitzhardinge
2010-03-16 17:32 ` Stefano Stabellini
2010-03-16 17:41 ` Jeremy Fitzhardinge
2010-03-16 18:06 ` Stefano Stabellini
2010-03-16 18:26 ` Jeremy Fitzhardinge
2010-03-16 18:37 ` Stefano Stabellini
2010-03-17 8:51 ` Sheng Yang [this message]
2010-03-17 9:18 ` Sheng Yang
2010-03-17 15:17 ` Stefano Stabellini
2010-03-17 18:20 ` Ian Campbell
2010-03-18 1:42 ` Sheng Yang
2010-03-18 1:35 ` Sheng Yang
2010-03-18 14:22 ` Stefano Stabellini
2010-03-18 16:50 ` Jeremy Fitzhardinge
2010-03-18 17:30 ` Jeremy Fitzhardinge
2010-03-12 21:53 ` [Xen-devel] " Jeremy Fitzhardinge
-- strict thread matches above, loose matches on Subject: below --
2010-03-12 11:44 Boris Derzhavets
2010-03-12 11:59 ` Stefano Stabellini
2010-03-12 15:01 ` Boris Derzhavets
2010-03-12 15:08 ` Stefano Stabellini
2010-03-12 15:09 ` Boris Derzhavets
2010-03-12 20:10 ` Jeremy Fitzhardinge
2010-03-12 21:14 ` Boris Derzhavets
2010-03-12 21:22 ` Jeremy Fitzhardinge
2010-03-12 21:28 ` Boris Derzhavets
2010-03-12 21:25 ` Boris Derzhavets
2010-03-12 21:29 ` Jeremy Fitzhardinge
2010-03-12 22:08 ` Boris Derzhavets
2010-03-12 22:11 ` Jeremy Fitzhardinge
2010-03-12 22:13 ` Boris Derzhavets
2010-03-12 22:22 ` Jeremy Fitzhardinge
2010-03-15 15:53 ` Stefano Stabellini
2010-03-15 16:02 ` Boris Derzhavets
2010-03-15 17:27 ` Stefano Stabellini
2010-03-15 17:49 ` Boris Derzhavets
2010-03-15 18:01 ` Stefano Stabellini
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=201003171651.05220.sheng@linux.intel.com \
--to=sheng@linux.intel.com \
--cc=jeremy@goop.org \
--cc=stefano.stabellini@eu.citrix.com \
--cc=xen-devel@lists.xensource.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).