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]
Date:	Mon, 11 Jul 2016 10:32:04 +0200 (CEST)
From:	Thomas Gleixner <tglx@...utronix.de>
To:	Nicolai Stange <nicstange@...il.com>
cc:	Ingo Molnar <mingo@...hat.com>, "H. Peter Anvin" <hpa@...or.com>,
	x86@...nel.org, John Stultz <john.stultz@...aro.org>,
	Borislav Petkov <bp@...e.de>,
	Paolo Bonzini <pbonzini@...hat.com>,
	Viresh Kumar <viresh.kumar@...aro.org>,
	Hidehiro Kawai <hidehiro.kawai.ez@...achi.com>,
	"Peter Zijlstra (Intel)" <peterz@...radead.org>,
	"Christopher S. Hall" <christopher.s.hall@...el.com>,
	Adrian Hunter <adrian.hunter@...el.com>,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 4/4] kernel/time/clockevents: compensate for monotonic
 clock's dynamic frequency

On Mon, 11 Jul 2016, Nicolai Stange wrote:
> > +	raw = ((u64)interval >> 32) * raw_mult; /* Upper half of interval */
> > +	if (raw >> 32)
> > +		return KTIME_MAX;
> > +	raw <<= 32;
> > +	tmp = ((u64)interval & U32_MAX) * raw_mult; /* Lower half of interval */
> > +	if (U64_MAX - raw < tmp)
> > +		return KTIME_MAX;
> > +	raw += tmp;
> > +
> > +	/* Finally, do raw /= mono_mult with proper rounding. */
> > +	if (U64_MAX - raw < mono_mult / 2)
> > +		return KTIME_MAX;
> > +	raw += mono_mult / 2;
> > +	do_div(raw, mono_mult);
> > +
> > +	return (s64)raw;

That's a complete insanity. No way that we are going to do all this math in
the CE programming path.

If you want to address the issue, then you need to find a way to adjust the
mult/shift factors of the clock event device occasionally.

Thanks,

	tglx

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ