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:	Tue, 4 May 2010 16:51:01 -0700 (PDT)
From:	Dan Magenheimer <dan.magenheimer@...cle.com>
To:	Venkatesh Pallipadi <venki@...gle.com>
Cc:	linux-kernel@...r.kernel.org, x86@...nel.org, mingo@...hat.com
Subject: RE: [RFC] Exposing TSC "reliability" to userland

> > Running a warp test in userland is not nearly as accurate
> > as the warp test run by the kernel.  So it makes sense to expose
> > the results of the kernel warp test to userland, maybe
> > through /sys/devices/system/clocksource/tsc_reliable
> >
> > Comments?
> 
> [ Sorry if this is a duplicate. I had messed up my mail client format
> setting ]
> 
> One option is to remove tsc from
> /sys/devices/system/clocksource/clocksource*/available_clocksource
> when it is detected as unstable.
> 
> That should already be happening with NOHZ or HIGHRES selected. But,
> should be simple to add some code to do this always.
> 
> Would that work?

Hi Venki --

In some offlist discussion, a similar solution was suggested:
If /sys/devices/system/clocksource/clocksource*/current_clocksource
is "tsc" AND the "Invariant TSC" CPUID bit is set, then "reliable TSC"
can be assumed.

BUT, exposing the information explicitly from the kernel would be
more comforting rather than requiring some reverse-engineering some
combination of kernel tests that might change over time.  If the
kernel determines TSC is reliable, that seems like it should be
good enough for userland.

AND it was also pointed out that userland usage of TSC is almost
useless unless some reliable reasonably-precise frequency is also
known.  A possible solution to this is to expose:

/sys/devices/system/clocksource/clocksource*/clocksource_mult and
/sys/devices/system/clocksource/clocksource*/clocksource_shift

(or some other more TSC-specific name) and provide the same
mult/shift values the kernel uses for clocksource_cyc2ns().

By the way, excuse my ignorance, but is there ever a clocksourceN
where N is not zero?

Hope things are going well in google-land!

Thanks,
Dan
--
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