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: <20200330100502.hh2yygyxctsmwd6o@debian>
Date:   Mon, 30 Mar 2020 11:05:02 +0100
From:   Wei Liu <wei.liu@...nel.org>
To:     Vitaly Kuznetsov <vkuznets@...hat.com>
Cc:     Tianyu Lan <ltykernel@...il.com>,
        Tianyu Lan <Tianyu.Lan@...rosoft.com>,
        linux-hyperv@...r.kernel.org, linux-kernel@...r.kernel.org,
        stable@...r.kernel.org, Yubo Xie <yuboxie@...rosoft.com>,
        kys@...rosoft.com, haiyangz@...rosoft.com, sthemmin@...rosoft.com,
        liuwe@...rosoft.com, daniel.lezcano@...aro.org, tglx@...utronix.de,
        michael.h.kelley@...rosoft.com, Wei Liu <wei.liu@...nel.org>
Subject: Re: [PATCH V2] x86/Hyper-V: Fix hv sched clock function return wrong
 time unit

On Fri, Mar 27, 2020 at 09:53:39AM +0100, Vitaly Kuznetsov wrote:
> Tianyu Lan <ltykernel@...il.com> writes:
> 
> > From: Yubo Xie <yuboxie@...rosoft.com>
> >
> > sched clock callback should return time with nano second as unit
> > but current hv callback returns time with 100ns. Fix it.
> >
> > Cc: stable@...r.kernel.org
> > Signed-off-by: Yubo Xie <yuboxie@...rosoft.com>
> > Signed-off-by: Tianyu Lan <Tianyu.Lan@...rosoft.com>
> > Fixes: bd00cd52d5be ("clocksource/drivers/hyperv: Add Hyper-V specific sched clock function")
> > ---
> > Change since v1:
> > 	Update fix commit number in change log. 
> > ---
> >  drivers/clocksource/hyperv_timer.c | 6 ++++--
> >  1 file changed, 4 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/clocksource/hyperv_timer.c b/drivers/clocksource/hyperv_timer.c
> > index 9d808d595ca8..662ed978fa24 100644
> > --- a/drivers/clocksource/hyperv_timer.c
> > +++ b/drivers/clocksource/hyperv_timer.c
> > @@ -343,7 +343,8 @@ static u64 notrace read_hv_clock_tsc_cs(struct clocksource *arg)
> >  
> >  static u64 read_hv_sched_clock_tsc(void)
> >  {
> > -	return read_hv_clock_tsc() - hv_sched_clock_offset;
> > +	return (read_hv_clock_tsc() - hv_sched_clock_offset)
> > +		* (NSEC_PER_SEC / HV_CLOCK_HZ);
> >  }
> >  
> >  static void suspend_hv_clock_tsc(struct clocksource *arg)
> > @@ -398,7 +399,8 @@ static u64 notrace read_hv_clock_msr_cs(struct clocksource *arg)
> >  
> >  static u64 read_hv_sched_clock_msr(void)
> >  {
> > -	return read_hv_clock_msr() - hv_sched_clock_offset;
> > +	return (read_hv_clock_msr() - hv_sched_clock_offset)
> > +		* (NSEC_PER_SEC / HV_CLOCK_HZ);
> >  }
> >  
> >  static struct clocksource hyperv_cs_msr = {
> 
> Reviewed-by: Vitaly Kuznetsov <vkuznets@...hat.com>

Queued for hyperv-fixes. Thank you both.

Wei.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ