Thread (64 messages) 64 messages, 10 authors, 2024-08-30

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

From: LEROY Christophe <hidden>
Date: 2024-08-26 07:35:42
Also in: linux-arch, linux-fsdevel, linux-kselftest, linux-mm, linuxppc-dev, lkml


Le 26/08/2024 à 09:28, Jason A. Donenfeld a écrit :
On Thu, Aug 22, 2024 at 09:13:22AM +0200, Christophe Leroy wrote:
quoted
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:
quoted
+	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.
Yes you are right that's more straight forward when using only one of 
the names.
I copy-pasted it from the gettimeofday test which uses several names 
from the table.

Christophe
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help