From: Marcelo Tosatti <mtosatti@redhat.com>
To: Roman Kagan <rkagan@virtuozzo.com>,
kvm@vger.kernel.org, Paolo Bonzini <pbonzini@redhat.com>,
"Denis V. Lunev" <den@openvz.org>
Subject: Re: [PATCH kvm-unit-tests v2] KVM: x86: add hyperv clock test case
Date: Sun, 29 May 2016 19:29:27 -0300 [thread overview]
Message-ID: <20160529222924.GB6738@amt.cnet> (raw)
In-Reply-To: <20160525183002.GA18943@rkaganb.sw.ru>
On Wed, May 25, 2016 at 09:30:02PM +0300, Roman Kagan wrote:
> On Mon, May 23, 2016 at 08:44:03PM -0300, Marcelo Tosatti wrote:
> > On Mon, May 23, 2016 at 06:55:06PM -0300, Marcelo Tosatti wrote:
> > > On Thu, Apr 21, 2016 at 08:21:25PM +0300, Roman Kagan wrote:
> > > > + if (t >= end) {
> > > > + long long ref = rdmsr(HV_X64_MSR_TIME_REF_COUNT);
> > > > + if (i == 0)
> > > > + printf("Time reference MSR drift: %lld\n\n", ref - end);
> > > > + ok[i] &= (ref - end) > -5 && (ref - end) < 5;
> > >
> > > This is prone to fail: guest can be scheduled at "***" above and
> > > test will fail.
> >
> > I suppose this would be a better test
> >
> > do {
> > u64 now_refpage; tsc_ref_read();
> > u64 now_refcount;
> >
> > now_refpage = tsc_ref_read();
> > now_refcount = rdmsr(HV_X64_MSR_TIME_REF_COUNT);
> >
> > if (now_refpage > now_refcount) {
> > printf("now_refpage %ld > now_refcount %ld\n",
> > now_refpage, now_refcount);
>
> Yes that's similar to what I posted in my other message on this thread.
> I'd also test that now_refpage >= pref_refcount, too.
>
> I'm cooking a patch with these changes, will post soonish.
>
> > which fails once you run
> >
> > void main(void)
> > {
> > int ret;
> > struct timex tx;
> > char *ptr;
> >
> > memset((void*)&tx, 0, sizeof(tx));
> >
> > tx.freq = -6553600;
> > //tx.freq = -237507;
> > tx.modes = ADJ_FREQUENCY;
> > ret = adjtimex(&tx);
>
> Right, which is a problem with kvm-clock too (as I wrote in another
> thread, pvclock_gtod_data updates don't currently trigger per-VM
> masterclock updates). I'm still struggling through the multiple lengthy
> discussions trying to figure out if it's a bug or a feature...
>
> Roman.
Its a bug, i am writing an improvement based on Paolo's change to
update the multiplier.
But the hyperv tsc reference page patches should not depend on it.
next prev parent reply other threads:[~2016-05-30 10:41 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-21 17:21 [PATCH kvm-unit-tests v2] KVM: x86: add hyperv clock test case Roman Kagan
2016-05-23 21:55 ` Marcelo Tosatti
2016-05-23 23:44 ` Marcelo Tosatti
2016-05-25 18:30 ` Roman Kagan
2016-05-29 22:29 ` Marcelo Tosatti [this message]
2016-05-30 18:09 ` Roman Kagan
2016-05-24 10:41 ` Paolo Bonzini
2016-05-24 10:57 ` Roman Kagan
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=20160529222924.GB6738@amt.cnet \
--to=mtosatti@redhat.com \
--cc=den@openvz.org \
--cc=kvm@vger.kernel.org \
--cc=pbonzini@redhat.com \
--cc=rkagan@virtuozzo.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