Re: [PATCH v2 14/17] selftests: vdso: Make test_vdso_getrandom look for the right vDSO function

From
Jason A. Donenfeld <Jason@zx2c4.com>
Date
2024-08-26 07:28:55
Also in
linux-arch, linux-fsdevel, linux-kselftest, linux-mm, linuxppc-dev, lkml
Reply to
Christophe Leroy, 2024-08-22
On Thu, Aug 22, 2024 at 09:13:22AM +0200, Christophe Leroy wrote:
Don't hard-code x86 specific names, use vdso_config definitions
to find the correct function matching the architecture.

Add random VDSO function names in names[][]. Remove the #ifdef
CONFIG_VDSO32, having the name there all the time is harmless
and guaranties a steady index for following strings.
This is indeed the right way of doing it. Thanks. I'll take this now,
though with one small fixup:
+	const char *version = versions[VDSO_VERSION];
+	const char **name = (const char **)&names[VDSO_NAMES];
I'll just do:

        const char *name = names[VDSO_NAMES][6];

Instead of referring to name[6] everywhere after. Seems more straight
forward.

Jason
Thread (64 messages) 64 messages, 10 authors, last reply 2024-08-30
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help