mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] selftests: vDSO: Fix header search list for vgetrandom-chacha.S
@ 2026-10-30 17:43 Thomas Huth
  2026-10-30 21:36 ` Arnd Bergmann
  0 siblings, 1 reply; 2+ messages in thread
From: Thomas Huth @ 2026-10-30 17:43 UTC (permalink / raw)
  To: Arnd Bergmann, Andy Lutomirski, Thomas Gleixner, Vincenzo Frascino
  Cc: soc, Shuah Khan, linux-kernel, linux-kselftest

On aarch64, vgetrandom-chacha.S includes the assembler file from
arch/arm64/kernel/vdso/vgetrandom-chacha.S, and that includes
<asm/assembler.h> which in turn includes lots of system header files.
For this, we should make sure that the kernel headers of the
*current* kernel are in the search path of the compiler, otherwise
we end up including headers from /usr/include of the current distro
instead, and this is calling for trouble! Thus use $(KHDR_INCLUDES)
here to make sure that we are using the right header files.
(This issue has been found in a patch series that replaces __ASSEMBLY__
with __ASSEMBLER__ in the various kernel headers and finally stops
defining __ASSEMBLY__ in the kernel makefiles - when vgetrandom-chacha.S
now tries to include a header from /usr/include the compilation fails
since those headers still require __ASSEMBLY__ to fence away the C code)

Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 See this link for the build failure:
 https://lore.kernel.org/oe-kbuild-all/9e294bfd-4704-42a5-a704-f301f4afe042@app.fastmail.com/

 tools/testing/selftests/vDSO/Makefile | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tools/testing/selftests/vDSO/Makefile b/tools/testing/selftests/vDSO/Makefile
index a61047bdcd576..1af346ac87081 100644
--- a/tools/testing/selftests/vDSO/Makefile
+++ b/tools/testing/selftests/vDSO/Makefile
@@ -37,7 +37,8 @@ $(OUTPUT)/vdso_test_getrandom: CFLAGS += -isystem $(top_srcdir)/tools/include \
                                          -isystem $(top_srcdir)/include/uapi
 
 $(OUTPUT)/vdso_test_chacha: vgetrandom-chacha.S
-$(OUTPUT)/vdso_test_chacha: CFLAGS += -idirafter $(top_srcdir)/tools/include \
+$(OUTPUT)/vdso_test_chacha: CFLAGS += $(KHDR_INCLUDES) \
+                                      -idirafter $(top_srcdir)/tools/include \
                                       -idirafter $(top_srcdir)/tools/include/generated \
                                       -idirafter $(top_srcdir)/arch/$(SRCARCH)/include \
                                       -idirafter $(top_srcdir)/include \
-- 
2.56.0


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] selftests: vDSO: Fix header search list for vgetrandom-chacha.S
  2026-10-30 17:43 [PATCH] selftests: vDSO: Fix header search list for vgetrandom-chacha.S Thomas Huth
@ 2026-10-30 21:36 ` Arnd Bergmann
  0 siblings, 0 replies; 2+ messages in thread
From: Arnd Bergmann @ 2026-10-30 21:36 UTC (permalink / raw)
  To: Thomas Huth, Andy Lutomirski, Thomas Gleixner, Vincenzo Frascino
  Cc: soc, shuah, linux-kernel, linux-kselftest

On Fri, Oct 30, 2026, at 18:43, Thomas Huth wrote:
> On aarch64, vgetrandom-chacha.S includes the assembler file from
> arch/arm64/kernel/vdso/vgetrandom-chacha.S, and that includes
> <asm/assembler.h> which in turn includes lots of system header files.
> For this, we should make sure that the kernel headers of the
> *current* kernel are in the search path of the compiler, otherwise
> we end up including headers from /usr/include of the current distro
> instead, and this is calling for trouble! Thus use $(KHDR_INCLUDES)
> here to make sure that we are using the right header files.
> (This issue has been found in a patch series that replaces __ASSEMBLY__
> with __ASSEMBLER__ in the various kernel headers and finally stops
> defining __ASSEMBLY__ in the kernel makefiles - when vgetrandom-chacha.S
> now tries to include a header from /usr/include the compilation fails
> since those headers still require __ASSEMBLY__ to fence away the C code)
>
> Signed-off-by: Thomas Huth <thuth@redhat.com>
> ---
>  See this link for the build failure:
>  
> https://lore.kernel.org/oe-kbuild-all/9e294bfd-4704-42a5-a704-f301f4afe042@app.fastmail.com/

Tested-by: Arnd Bergmann <arnd@arndb.de> # (build tested)

If you like, I can add this to the asm-generic tree to avoid the
regression from your series, or Shuah can pick this up the normal
way as a bugfix for kselftest.

      Arnd

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-10-30 21:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-30 17:43 [PATCH] selftests: vDSO: Fix header search list for vgetrandom-chacha.S Thomas Huth
2026-10-30 21:36 ` Arnd Bergmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®