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: <BANLkTikEAro9mbrPys+iqUEJDvGFmRvwsA@mail.gmail.com>
Date:	Mon, 18 Apr 2011 16:27:57 -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:23 PM, Colin Walters <walters@...bum.org> wrote:
> On Mon, Apr 18, 2011 at 3:32 PM, Andrew Lutomirski <luto@....edu> wrote:
>> Hi all-
>>
>> I'd appreciate some help testing rdtsc's ordering wrt memory on
>> various hardware.  You can download evil-clock-test code at:
>>
>> https://gitorious.org/linux-test-utils/linux-clock-tests/blobs/raw/master/evil-clock-test.cc
>
> Hmm...the first time I ran it, it started OK, then printed over and over:
>
>  ERROR!  Time1 went back by 2380216472
>  ERROR!  Time1 went back by 2380216080
>  ERROR!  Time1 went back by 2380215704
>  ERROR!  Time1 went back by 2380215320

Well, crap.  Can you run:
 dmesg | grep -i tsc

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.
2. I have a dumb bug that makes it malfunction.  I used to have some
of those but I thought I fixed them.

Thanks,
Andy

>
> and the original output was lost in the terminal emulator history.
> After piping it to tee a second time, of course it worked and didn't
> print any errors =)
>
> CPU vendor   : GenuineIntel
> CPU model    : Intel(R) Core(TM)2 Quad CPU    Q9400  @ 2.66GHz
> CPU stepping : 10
> TSC flags    : tsc constant_tsc
> Using lfence_rdtsc because you have an Intel CPU
> Will test the "lfence;rdtsc" clock.
> Now test passed  : margin 160 with 28911200 samples
> Load3 test passed: margin 144 with 2493322 samples
> Load test passed : margin 120 with 4929138 samples
> Store test failed as expected: worst error 2184 with 4409828 samples
>
> What's interesting is it seems unpredictable when running it whether
> it will error out =/ Here's the start of a failing trace:
>
> CPU vendor   : GenuineIntel
> CPU model    : Intel(R) Core(TM)2 Quad CPU    Q9400  @ 2.66GHz
> CPU stepping : 10
> TSC flags    : tsc constant_tsc
> Using lfence_rdtsc because you have an Intel CPU
> Will test the "lfence;rdtsc" clock.
> Now test failed  : worst error 2399269920 with 28704328 samples
>  ERROR!  Time1 went back by 2399197568
>  ERROR!  Time1 went back by 2399196984
>
--
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