selftests: vDSO: simplify getrandom thread local storage and structs
authorJason A. Donenfeld <Jason@zx2c4.com>
Mon, 29 Jul 2024 16:02:11 +0000 (18:02 +0200)
committerJason A. Donenfeld <Jason@zx2c4.com>
Fri, 30 Aug 2024 13:43:11 +0000 (15:43 +0200)
commit01b52f01c5a6bdc3b3e4229dccc84ed667e6867b
tree2d4cfe6e6e456abe3526175cb450d68f2d8285d1
parentd5d547aa7b51467b15d9caa86b116f8c2507c72a
selftests: vDSO: simplify getrandom thread local storage and structs

Rather than using pthread_get/set_specific, just use gcc's __thread
annotation, which is noticeably faster and makes the code more obvious.

Also, just have one simplified struct called vgrnd, instead of trying to
split things up semantically. Those divisions were useful when this code
was split across several commit *messages*, but doesn't make as much
sense within a single file. This should make the code more clear and
provide a better example for implementers.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
tools/testing/selftests/vDSO/vdso_test_getrandom.c