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: <51358E17.8000106@linaro.org>
Date:	Tue, 05 Mar 2013 14:17:59 +0800
From:	John Stultz <john.stultz@...aro.org>
To:	Jason Gunthorpe <jgunthorpe@...idianresearch.com>
CC:	Feng Tang <feng.tang@...el.com>,
	Thomas Gleixner <tglx@...utronix.de>,
	Ingo Molnar <mingo@...e.hu>,
	"H. Peter Anvin" <hpa@...ux.intel.com>, x86@...nel.org,
	Len Brown <lenb@...nel.org>,
	"Rafael J. Wysocki" <rafael.j.wysocki@...el.com>,
	linux-kernel@...r.kernel.org, gong.chen@...ux.intel.com
Subject: Re: [RFC PATCH v2 0/4] Add support for S3 non-stop TSC support.

On 03/05/2013 12:32 PM, Jason Gunthorpe wrote:
> On Tue, Mar 05, 2013 at 11:53:02AM +0800, Feng Tang wrote:
>
>>> // Drops some small precision along the way but is simple..
>>> static inline u64 cyclecounter_cyc2ns_128(const struct cyclecounter *cc,
>>>                                            cycle_t cycles)
>>> {
>>>      u64 max = U64_MAX/cc->mult;
>>>      u64 num = cycles/max;
>>>      u64 result = num * ((max * cc->mult) >> cc->shift);
>>>      return result + cyclecounter_cyc2ns(cc, cycles - num*cc->mult);
>>> }
>> Your way is surely more accurate, if maintainers are ok with adding
>> the new API, I will use it.
> Okay, give it a good look though, I only wrote it out in email, never
> tested it :)
>
Probably want to use clocksource instead of cyclecounter, but I think 
Jason's approach sounds ok. I might suggest that you initially make the 
function static to the timekeeping code, just so we don't get unexpected 
users.

thanks
-john
--
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