lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20150522004123.GB5242@amt.cnet>
Date:	Thu, 21 May 2015 21:41:23 -0300
From:	Marcelo Tosatti <mtosatti@...hat.com>
To:	Sasha Levin <sasha.levin@...cle.com>
Cc:	KVM General <kvm@...r.kernel.org>,
	LKML <linux-kernel@...r.kernel.org>,
	Paolo Bonzini <pbonzini@...hat.com>, lcapitulino@...hat.com
Subject: Re: kvm: odd time values since "kvmclock: set scheduler clock stable"

On Mon, May 18, 2015 at 10:13:03PM -0400, Sasha Levin wrote:
> On 05/18/2015 10:02 PM, Sasha Levin wrote:
> > On 05/18/2015 08:13 PM, Marcelo Tosatti wrote:
> >> GOn Mon, May 18, 2015 at 07:45:41PM -0400, Sasha Levin wrote:
> >>>> On 05/18/2015 06:39 PM, Marcelo Tosatti wrote:
> >>>>>> On Tue, May 12, 2015 at 07:17:24PM -0400, Sasha Levin wrote:
> >>>>>>>> Hi all,
> >>>>>>>>
> >>>>>>>> I'm seeing odd jump in time values during boot of a KVM guest:
> >>>>>>>>
> >>>>>>>> [...]
> >>>>>>>> [    0.000000] tsc: Detected 2260.998 MHz processor
> >>>>>>>> [3376355.247558] Calibrating delay loop (skipped) preset value..
> >>>>>>>> [...]
> >>>>>>>>
> >>>>>>>> I've bisected it to:
> >>>>>>
> >>>>>> Paolo, Sasha,
> >>>>>>
> >>>>>> Although this might seem undesirable, there is no requirement 
> >>>>>> for sched_clock to initialize at 0:
> >>>>>>
> >>>>>> "
> >>>>>>  *
> >>>>>>  * There is no strict promise about the base, although it tends to start
> >>>>>>  * at 0 on boot (but people really shouldn't rely on that).
> >>>>>>  *
> >>>>>> "
> >>>>>>
> >>>>>> Sasha, are you seeing any problem other than the apparent time jump?
> >>>>
> >>>> Nope, but I've looked at it again and it seems that it jumps to the host's
> >>>> clock (that is, in the example above the 3376355 value was the host's clock
> >>>> value).
> >>>>
> >>>>
> >>>> Thanks,
> >>>> Sasha
> >> Sasha, thats right. Its the host monotonic clock.
> > 
> > It's worth figuring out if (what) userspace breaks on that. I know it says that
> > you shouldn't rely on that, but I'd happily place a bet on at least one userspace
> > treating it as "seconds since boot" or something similar.
> 
> Didn't need to go far... In the guest:
> 
> # date
> Tue May 19 02:11:46 UTC 2015
> # echo hi > /dev/kmsg
> [3907533.080112] hi
> # dmesg -T
> [Fri Jul  3 07:33:41 2015] hi

Sasha,

Can you give the suggested patch (hypervisor patch...) a try please?
(with a patched guest, obviously).

KVM: x86: zero kvmclock_offset when vcpu0 initializes kvmclock system
MSR


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ