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:	Thu, 25 Nov 2010 12:55:28 +0300
From:	Alexander Gordeev <lasaine@....cs.msu.su>
To:	Thomas Gleixner <tglx@...utronix.de>
Cc:	linux-kernel@...r.kernel.org,
	"Nikita V\\. Youshchenko" <yoush@...msu.su>,
	linuxpps@...enneenne.com, Rodolfo Giometti <giometti@...eenne.com>,
	John Stultz <johnstul@...ibm.com>,
	David Howells <dhowells@...hat.com>,
	"H\\. Peter Anvin" <hpa@...or.com>,
	Magnus Damm <damm@...nsource.se>,
	Jason Wessel <jason.wessel@...driver.com>,
	Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: [PATCHv5 14/17] pps: capture MONOTONIC_RAW timestamps as well

В Wed, 24 Nov 2010 17:49:44 +0100 (CET)
Thomas Gleixner <tglx@...utronix.de> пишет:

> On Wed, 24 Nov 2010, Alexander Gordeev wrote:
> >  /**
> > + * getnstime_raw_and_real - Returns both the time of day an raw
> > + * monotonic time in a timespec format
> 
> IIRC then kerneldoc does not handle multiline comments for the
> function name

Ah, I see, fixed that.

> > + * @ts_mono_raw:	pointer to the timespec to be set to raw
> > + *			monotonic time
> > + * @ts_real:		pointer to the timespec to be set to the time
> > + *			of day
> > + */
> > +void getnstime_raw_and_real(struct timespec *ts_raw, struct timespec *ts_real)
> > +{
> > +	unsigned long seq;
> > +	s64 nsecs_raw, nsecs_real;
> > +
> > +	WARN_ON_ONCE(timekeeping_suspended);
> 
>   Shouldn't this just return an error code instead of reading some
>   stale or random value ?

Sorry, I don't know if it should, just copied it from getnstimofday().
BTW what is the bad value for timespec or you mean returning int
instead of void? I think this function should be handled the same way as
getnstimeofday() and no one currently expects that the latter can return
some bad value.

> > +	do {
> > +		u32 arch_offset;
> > +
> > +		seq = read_seqbegin(&xtime_lock);
> > +
> > +		*ts_raw = raw_time;
> > +		*ts_real = xtime;
> > +
> > +		nsecs_raw = timekeeping_get_ns_raw();
> > +		nsecs_real = timekeeping_get_ns();
> > +
> > +		/* If arch requires, add in gettimeoffset() */
> > +		arch_offset = arch_gettimeoffset();
> > +		nsecs_raw += arch_offset;
> > +		nsecs_real += arch_offset;
> > +
> > +	} while (read_seqretry(&xtime_lock, seq));
> > +
> > +	timespec_add_ns(ts_raw, nsecs_raw);
> > +	timespec_add_ns(ts_real, nsecs_real);
> > +}
> > +EXPORT_SYMBOL(getnstime_raw_and_real);
> 
> Otherwise, I'm fine with that.
> 
> Thanks,
> 
> 	tglx


-- 
  Alexander

Download attachment "signature.asc" of type "application/pgp-signature" (491 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ