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] [day] [month] [year] [list]
Date:	Thu, 13 Nov 2008 08:34:43 -0500
From:	Mathieu Desnoyers <mathieu.desnoyers@...ymtl.ca>
To:	Geert Uytterhoeven <geert@...ux-m68k.org>
Cc:	Linus Torvalds <torvalds@...ux-foundation.org>,
	akpm@...ux-foundation.org, Ingo Molnar <mingo@...e.hu>,
	Peter Zijlstra <a.p.zijlstra@...llo.nl>,
	Steven Rostedt <rostedt@...dmis.org>,
	linux-kernel@...r.kernel.org, David Miller <davem@...emloft.net>,
	Ingo Molnar <mingo@...hat.com>,
	Thomas Gleixner <tglx@...utronix.de>,
	linux-arch@...r.kernel.org
Subject: Re: [patch 02/17] get_cycles() : x86 HAVE_GET_CYCLES

* Geert Uytterhoeven (geert@...ux-m68k.org) wrote:
> On Wed, 12 Nov 2008, Mathieu Desnoyers wrote:
> > --- linux.trees.git.orig/arch/x86/include/asm/tsc.h	2008-11-12 18:15:25.000000000 -0500
> > +++ linux.trees.git/arch/x86/include/asm/tsc.h	2008-11-12 18:15:28.000000000 -0500
> > @@ -56,6 +56,18 @@ extern void mark_tsc_unstable(char *reas
> >  extern int unsynchronized_tsc(void);
> >  int check_tsc_unstable(void);
> >  
> > +static inline cycles_t get_cycles_rate(void)
> > +{
> > +	if (check_tsc_unstable())
> > +		return 0;
> > +	return tsc_khz;
>                    ^^^
> 
> The comment in Kconfig says:
> 
> | get_cycles_rate() : cycle counter rate, in HZ
>                                              ^^
> 
> So what should it be? Hz or kHz?
> 

HZ, for consistency.

So it becomes :

+static inline cycles_t get_cycles_rate(void)
+{
+	if (check_tsc_unstable())
+		return 0;
+	return (cycles_t)tsc_khz * 1000;
+}
+

Thanks for spotting this, will be integrated in the next release.

As a side-note, I noticed that I used CLOCK_TICK_RATE on MIPS when I
should use mips_hpt_frequency. This too will be fixed in the next
release.

Mathieu

> Gr{oetje,eeting}s,
> 
> 						Geert
> 
> --
> Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@...ux-m68k.org
> 
> In personal conversations with technical people, I call myself a hacker. But
> when I'm talking to journalists I just say "programmer" or something like that.
> 							    -- Linus Torvalds

-- 
Mathieu Desnoyers
OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F  BA06 3F25 A8FE 3BAE 9A68
--
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