diff mbox series

[v2,13/17] selftests: vdso: Don't hard-code location of vDSO sources

Message ID a40d859dba5654239650eec44d75ab45c98221f4.1724309198.git.christophe.leroy@csgroup.eu (mailing list archive)
State Superseded
Headers show
Series Wire up getrandom() vDSO implementation on powerpc | expand

Commit Message

Christophe Leroy Aug. 22, 2024, 7:13 a.m. UTC
Architectures use different location for vDSO sources:
	arch/mips/vdso
	arch/sparc/vdso
	arch/arm64/kernel/vdso
	arch/riscv/kernel/vdso
	arch/csky/kernel/vdso
	arch/x86/um/vdso
	arch/x86/entry/vdso
	arch/powerpc/kernel/vdso
	arch/arm/vdso
	arch/loongarch/vdso

Don't hard-code vdso sources location in selftest Makefile,
instead create a vdso/ symbolic link in tools/arch/$arch/ and
update Makefile accordingly.

Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
---
 tools/arch/x86/vdso                   | 1 +
 tools/testing/selftests/vDSO/Makefile | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)
 create mode 120000 tools/arch/x86/vdso

Comments

Jason A. Donenfeld Aug. 26, 2024, 7:26 a.m. UTC | #1
On Thu, Aug 22, 2024 at 09:13:21AM +0200, Christophe Leroy wrote:
> Architectures use different location for vDSO sources:
> 	arch/mips/vdso
> 	arch/sparc/vdso
> 	arch/arm64/kernel/vdso
> 	arch/riscv/kernel/vdso
> 	arch/csky/kernel/vdso
> 	arch/x86/um/vdso
> 	arch/x86/entry/vdso
> 	arch/powerpc/kernel/vdso
> 	arch/arm/vdso
> 	arch/loongarch/vdso
> 
> Don't hard-code vdso sources location in selftest Makefile,
> instead create a vdso/ symbolic link in tools/arch/$arch/ and
> update Makefile accordingly.

That seems like a good way of handling it. As archs add their
implementations, they can just add the symlink and do no more work. It
will also make review slightly easier: if I don't see the symlink added,
I'll know the submitter didn't actually test their chacha :-P.

I'll take this into my random.git tree now as a fix.

Jason
diff mbox series

Patch

diff --git a/tools/arch/x86/vdso b/tools/arch/x86/vdso
new file mode 120000
index 000000000000..7eb962fd3454
--- /dev/null
+++ b/tools/arch/x86/vdso
@@ -0,0 +1 @@ 
+../../../arch/x86/entry/vdso/
\ No newline at end of file
diff --git a/tools/testing/selftests/vDSO/Makefile b/tools/testing/selftests/vDSO/Makefile
index 3de8e7e052ae..c9a819cacbf2 100644
--- a/tools/testing/selftests/vDSO/Makefile
+++ b/tools/testing/selftests/vDSO/Makefile
@@ -40,7 +40,7 @@  $(OUTPUT)/vdso_test_getrandom: parse_vdso.c
 $(OUTPUT)/vdso_test_getrandom: CFLAGS += -isystem $(top_srcdir)/tools/include \
                                          -isystem $(top_srcdir)/include/uapi
 
-$(OUTPUT)/vdso_test_chacha: $(top_srcdir)/arch/$(ARCH)/entry/vdso/vgetrandom-chacha.S
+$(OUTPUT)/vdso_test_chacha: $(top_srcdir)/tools/arch/$(ARCH)/vdso/vgetrandom-chacha.S
 $(OUTPUT)/vdso_test_chacha: CFLAGS += -idirafter $(top_srcdir)/tools/include \
                                       -isystem $(top_srcdir)/arch/$(ARCH)/include \
                                       -isystem $(top_srcdir)/include \