2019-09-20 17:43:05

by Paolo Bonzini

[permalink] [raw]
Subject: Re: [RFC 0/2] kvm: Use host timekeeping in guest.

On 20/09/19 08:27, Suleiman Souhlal wrote:
> To do that, I am changing kvmclock to request to the host to copy
> its timekeeping parameters (mult, base, cycle_last, etc), so that
> the guest timekeeper can use the same values, so that time can
> be synchronized between the guest and the host.
>
> Any suggestions or feedback would be highly appreciated.

I'm not a timekeeping maintainer, but I don't think the
kernel/time/timekeeping.c changes are acceptable.

Is the PTP driver not enough?

Paolo


2019-09-21 15:15:45

by Thomas Gleixner

[permalink] [raw]
Subject: Re: [RFC 0/2] kvm: Use host timekeeping in guest.

On Fri, 20 Sep 2019, Paolo Bonzini wrote:

> On 20/09/19 08:27, Suleiman Souhlal wrote:
> > To do that, I am changing kvmclock to request to the host to copy
> > its timekeeping parameters (mult, base, cycle_last, etc), so that
> > the guest timekeeper can use the same values, so that time can
> > be synchronized between the guest and the host.
> >
> > Any suggestions or feedback would be highly appreciated.
>
> I'm not a timekeeping maintainer, but I don't think the
> kernel/time/timekeeping.c changes are acceptable.

Indeed. #ifdef WHATEVERTHEHECK does not go anywhere. If at all this needs
to be a runtime switch, but I have yet to understand the whole picture of
this.

Thanks,

tglx

2019-09-26 00:50:15

by Suleiman Souhlal

[permalink] [raw]
Subject: Re: [RFC 0/2] kvm: Use host timekeeping in guest.

On Fri, Sep 20, 2019 at 7:23 PM Thomas Gleixner <[email protected]> wrote:
>
> On Fri, 20 Sep 2019, Paolo Bonzini wrote:
>
> > On 20/09/19 08:27, Suleiman Souhlal wrote:
> > > To do that, I am changing kvmclock to request to the host to copy
> > > its timekeeping parameters (mult, base, cycle_last, etc), so that
> > > the guest timekeeper can use the same values, so that time can
> > > be synchronized between the guest and the host.
> > >
> > > Any suggestions or feedback would be highly appreciated.
> >
> > I'm not a timekeeping maintainer, but I don't think the
> > kernel/time/timekeeping.c changes are acceptable.
>
> Indeed. #ifdef WHATEVERTHEHECK does not go anywhere. If at all this needs
> to be a runtime switch, but I have yet to understand the whole picture of
> this.

Yeah, I will try to make this a runtime switch.

As for the PTP driver, I don't think it will work for us because we
need CLOCK_MONOTONIC and CLOCK_BOOTTIME to match the host, and from my
understanding, PTP doesn't solve that.

Thanks,
-- Suleiman