Re: [PATCH] x86/vdso: Use non-serializing instruction rdtsc

From: Rong Tao
Date: Tue May 16 2023 - 20:48:26 EST


Thank you all very much for your responses, I tested the test code
evil-clock-test[0] provided by Andy, this patch does cause time read errors
and load errors.

$ ./evil-clock-test.out -c monotonic
CPU vendor : GenuineIntel
CPU model : Intel(R) Core(TM) i7-10710U CPU @ 1.10GHz
CPU stepping : 0
TSC flags : tsc rdtscp constant_tsc tsc_known_freq tsc_deadline_timer tsc_adjust
Will test the "CLOCK_MONOTONIC" clock.
Now test failed : worst error 255 with 81902816 samples
Load3 test failed: worst error 384 with 3284297 samples
Load test passed : margin 32 with 18848374 samples
Store test failed as expected: worst error 704 with 18213325 samples

Thanks again :)

[0] https://git.kernel.org/pub/scm/linux/kernel/git/luto/misc-tests.git/tree/evil-clock-test.cc