Re: [PATCH] selftests: vDSO: Do not rely on $ARCH for vdso_test_getrandom && vdso_test_chacha

Christophe Leroy
2024-09-02T12:22:40Z

Hi Jason,

Le 01/09/2024 à 15:22, Jason A. Donenfeld a écrit :
> Hi Christophe,
>
> Hmm, I'm not so sure I like this very much. I think it's important for
> these tests to fail when an arch tries to hook up the function to the
> vDSO, but it's still not exported for some reason. This also regresses
> the ARCH=x86_64 vs ARCH=x86 thing, which SRCARCH fixes.
>
If we take the exemple of getcpu:

Only powerpc and s390 implement __kernel_getcpu.
Until recently, it was implemented on ppc64 but not on ppc32

Only loongarch, riscv and x86 implement __vdso_getcpu.

Nevertheless, vdso_test_getcpu is always builts, regardless of the
architecture.

When vdso_test_getcpu doesn't find the vDSO entry point, it prints an
error text and returns KSFT_SKIP

I thought it would be more correct to have the same behaviour on
vdso_test_getrandom instead of trying to build it only when the
underlying kernel supports it.

Christophe