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, 18 Apr 2011 16:39:21 -0400
From:	Andrew Lutomirski <luto@....edu>
To:	Colin Walters <walters@...bum.org>
Cc:	linux-kernel@...r.kernel.org, Ingo Molnar <mingo@...e.hu>,
	Linus Torvalds <torvalds@...ux-foundation.org>,
	Andi Kleen <andi@...stfloor.org>, x86 <x86@...nel.org>
Subject: Re: [RFT] Please test rdtsc on various x86-64 hardware (app included)

On Mon, Apr 18, 2011 at 4:35 PM, Colin Walters <walters@...bum.org> wrote:
> On Mon, Apr 18, 2011 at 4:27 PM, Andrew Lutomirski <luto@....edu> wrote:
>
>> Well, crap.  Can you run:
>>  dmesg | grep -i tsc
>
> # dmesg|grep -i tsc
> [    0.000000] Fast TSC calibration using PIT
> [    0.098999] TSC synchronization [CPU#0 -> CPU#1]:
> [    0.098999] Measured 2399269672 cycles TSC warp between CPUs,
> turning off TSC clock.
> [    0.098999] Marking TSC unstable due to check_tsc_sync_source failed
>
>> There are two possible explanations:
>> 1. Your tscs are out of sync, and whether the test notices or not
>> depends on which cpus the scheduler sticks the threads on.
>
> Looks like that's the case?   But for what you want to do in kernel,
> the kernel already did this test and so would know to not use the TSC
> for vgettimeofday(), right?  (I only sort of followed the clock
> discussion earlier but I found it quite interesting, so decided to run
> the test).
>

Yes, the kernel won't run this code at all on your system.  That being
said, you have the constant_tsc flag and the error my tool measured is
pretty close to the error the kernel measured at boot, so it might be
interesting for the kernel to learn how to synchronize the TSCs
itself.  This is possible, abeit awkward, on newish Intel CPUs.  It's
possible but *really* awkward on older CPUs.

--Andy
--
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