public inbox for linux-kernel-mentees@lists.linux-foundation.org
 help / color / mirror / Atom feed
* [PATCH] selftests/x86: Add selftests include path for kselftest.h after centralization
       [not found] <CA+G9fYvKjQcCBMfXA-z2YuL2L+3Qd-pJjEUDX8PDdz2-EEQd=Q@mail.gmail.com>
@ 2025-10-22  6:29 ` Bala-Vignesh-Reddy
  2025-10-22 15:02   ` Anders Roxell
                     ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Bala-Vignesh-Reddy @ 2025-10-22  6:29 UTC (permalink / raw)
  To: naresh.kamboju, broonie
  Cc: anders.roxell, arnd, benjamin.copeland, bp, dan.carpenter,
	dave.hansen, hpa, linux-kernel, linux-kselftest, lkft-triage,
	mingo, reddybalavignesh9979, regressions, richard.weiyang, shuah,
	surenb, tglx, x86, linux-kernel-mentees,
	Linux Kernel Functional Testing

The previous change centralizing kselftest.h include path in lib.mk
caused x86 selftests to fail, as x86 Makefile overwrites CFLAGS using
":=", dropping the include path added in lib.mk. Therefore, helpers.h
could not find kselftest.h during compilation.

Fix this by adding the tools/testing/sefltest to CFLAGS in x86 Makefile.

Fixes: 4d89827dfb27 ("selftests: complete kselftest include centralization")
Reported-by: Linux Kernel Functional Testing <lkft@linaro.org>
Closes: https://lore.kernel.org/lkml/CA+G9fYvKjQcCBMfXA-z2YuL2L+3Qd-pJjEUDX8PDdz2-EEQd=Q@mail.gmail.com/T/#m83fd330231287fc9d6c921155bee16c591db7360

Signed-off-by: Bala-Vignesh-Reddy <reddybalavignesh9979@gmail.com>
---
 tools/testing/selftests/x86/Makefile | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tools/testing/selftests/x86/Makefile b/tools/testing/selftests/x86/Makefile
index 83148875a12c..434065215d12 100644
--- a/tools/testing/selftests/x86/Makefile
+++ b/tools/testing/selftests/x86/Makefile
@@ -36,6 +36,7 @@ BINARIES_32 := $(patsubst %,$(OUTPUT)/%,$(BINARIES_32))
 BINARIES_64 := $(patsubst %,$(OUTPUT)/%,$(BINARIES_64))
 
 CFLAGS := -O2 -g -std=gnu99 -pthread -Wall $(KHDR_INCLUDES)
+CFLAGS += -I $(top_srcdir)/tools/testing/selftests/
 
 # call32_from_64 in thunks.S uses absolute addresses.
 ifeq ($(CAN_BUILD_WITH_NOPIE),1)
-- 
2.43.0


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

* Re: [PATCH] selftests/x86: Add selftests include path for kselftest.h after centralization
  2025-10-22  6:29 ` [PATCH] selftests/x86: Add selftests include path for kselftest.h after centralization Bala-Vignesh-Reddy
@ 2025-10-22 15:02   ` Anders Roxell
  2026-01-12 10:27   ` Brendan Jackman
  2026-01-17 11:08   ` Borislav Petkov
  2 siblings, 0 replies; 4+ messages in thread
From: Anders Roxell @ 2025-10-22 15:02 UTC (permalink / raw)
  To: Bala-Vignesh-Reddy
  Cc: naresh.kamboju, broonie, arnd, benjamin.copeland, bp,
	dan.carpenter, dave.hansen, hpa, linux-kernel, linux-kselftest,
	lkft-triage, mingo, regressions, richard.weiyang, shuah, surenb,
	tglx, x86, linux-kernel-mentees, Linux Kernel Functional Testing

On Wed, 22 Oct 2025 at 08:29, Bala-Vignesh-Reddy
<reddybalavignesh9979@gmail.com> wrote:
>
> The previous change centralizing kselftest.h include path in lib.mk
> caused x86 selftests to fail, as x86 Makefile overwrites CFLAGS using
> ":=", dropping the include path added in lib.mk. Therefore, helpers.h
> could not find kselftest.h during compilation.
>
> Fix this by adding the tools/testing/sefltest to CFLAGS in x86 Makefile.
>
> Fixes: 4d89827dfb27 ("selftests: complete kselftest include centralization")
> Reported-by: Linux Kernel Functional Testing <lkft@linaro.org>
> Closes: https://lore.kernel.org/lkml/CA+G9fYvKjQcCBMfXA-z2YuL2L+3Qd-pJjEUDX8PDdz2-EEQd=Q@mail.gmail.com/T/#m83fd330231287fc9d6c921155bee16c591db7360
>
> Signed-off-by: Bala-Vignesh-Reddy <reddybalavignesh9979@gmail.com>

Yes, works.

Tested-by: Anders Roxell <anders.roxell@linaro.org>


Cheers,
Anders

> ---
>  tools/testing/selftests/x86/Makefile | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/tools/testing/selftests/x86/Makefile b/tools/testing/selftests/x86/Makefile
> index 83148875a12c..434065215d12 100644
> --- a/tools/testing/selftests/x86/Makefile
> +++ b/tools/testing/selftests/x86/Makefile
> @@ -36,6 +36,7 @@ BINARIES_32 := $(patsubst %,$(OUTPUT)/%,$(BINARIES_32))
>  BINARIES_64 := $(patsubst %,$(OUTPUT)/%,$(BINARIES_64))
>
>  CFLAGS := -O2 -g -std=gnu99 -pthread -Wall $(KHDR_INCLUDES)
> +CFLAGS += -I $(top_srcdir)/tools/testing/selftests/
>
>  # call32_from_64 in thunks.S uses absolute addresses.
>  ifeq ($(CAN_BUILD_WITH_NOPIE),1)
> --
> 2.43.0
>

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

* Re: [PATCH] selftests/x86: Add selftests include path for kselftest.h after centralization
  2025-10-22  6:29 ` [PATCH] selftests/x86: Add selftests include path for kselftest.h after centralization Bala-Vignesh-Reddy
  2025-10-22 15:02   ` Anders Roxell
@ 2026-01-12 10:27   ` Brendan Jackman
  2026-01-17 11:08   ` Borislav Petkov
  2 siblings, 0 replies; 4+ messages in thread
From: Brendan Jackman @ 2026-01-12 10:27 UTC (permalink / raw)
  To: Bala-Vignesh-Reddy, naresh.kamboju, broonie, bp, shuah
  Cc: anders.roxell, arnd, benjamin.copeland, bp, dan.carpenter,
	dave.hansen, hpa, linux-kernel, linux-kselftest, lkft-triage,
	mingo, regressions, richard.weiyang, shuah, surenb, tglx, x86,
	linux-kernel-mentees, Linux Kernel Functional Testing

On Wed Oct 22, 2025 at 6:29 AM UTC, Bala-Vignesh-Reddy wrote:
> The previous change centralizing kselftest.h include path in lib.mk
> caused x86 selftests to fail, as x86 Makefile overwrites CFLAGS using
> ":=", dropping the include path added in lib.mk. Therefore, helpers.h
> could not find kselftest.h during compilation.
>
> Fix this by adding the tools/testing/sefltest to CFLAGS in x86 Makefile.
>
> Fixes: 4d89827dfb27 ("selftests: complete kselftest include centralization")
> Reported-by: Linux Kernel Functional Testing <lkft@linaro.org>
> Closes: https://lore.kernel.org/lkml/CA+G9fYvKjQcCBMfXA-z2YuL2L+3Qd-pJjEUDX8PDdz2-EEQd=Q@mail.gmail.com/T/#m83fd330231287fc9d6c921155bee16c591db7360
>
> Signed-off-by: Bala-Vignesh-Reddy <reddybalavignesh9979@gmail.com>

Thanks, this fixes the issue I reported here:

https://lore.kernel.org/lkml/DFHI984SEFV3.2JL88CLHNT2SO@google.com/

Tested-by: Brendan Jackman <jackmanb@google.com>

Shuah, does this go via the kselftests tree? If not, Boris can you take
it via x86?

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

* Re: [PATCH] selftests/x86: Add selftests include path for kselftest.h after centralization
  2025-10-22  6:29 ` [PATCH] selftests/x86: Add selftests include path for kselftest.h after centralization Bala-Vignesh-Reddy
  2025-10-22 15:02   ` Anders Roxell
  2026-01-12 10:27   ` Brendan Jackman
@ 2026-01-17 11:08   ` Borislav Petkov
  2 siblings, 0 replies; 4+ messages in thread
From: Borislav Petkov @ 2026-01-17 11:08 UTC (permalink / raw)
  To: Bala-Vignesh-Reddy, Andrew Morton
  Cc: naresh.kamboju, broonie, anders.roxell, arnd, benjamin.copeland,
	dan.carpenter, dave.hansen, hpa, linux-kernel, linux-kselftest,
	lkft-triage, mingo, regressions, richard.weiyang, shuah, surenb,
	tglx, x86, linux-kernel-mentees, Linux Kernel Functional Testing

On Wed, Oct 22, 2025 at 11:59:48AM +0530, Bala-Vignesh-Reddy wrote:
> The previous change centralizing kselftest.h include path in lib.mk
> caused x86 selftests to fail, as x86 Makefile overwrites CFLAGS using
> ":=", dropping the include path added in lib.mk. Therefore, helpers.h
> could not find kselftest.h during compilation.
> 
> Fix this by adding the tools/testing/sefltest to CFLAGS in x86 Makefile.
> 
> Fixes: 4d89827dfb27 ("selftests: complete kselftest include centralization")

This should be:

e6fbd1759c9e ("selftests: complete kselftest include centralization")

@akpm: I see you took the above commit - I'll take this fix through tip.

> Reported-by: Linux Kernel Functional Testing <lkft@linaro.org>
> Closes: https://lore.kernel.org/lkml/CA+G9fYvKjQcCBMfXA-z2YuL2L+3Qd-pJjEUDX8PDdz2-EEQd=Q@mail.gmail.com/T/#m83fd330231287fc9d6c921155bee16c591db7360
> 
> Signed-off-by: Bala-Vignesh-Reddy <reddybalavignesh9979@gmail.com>
> ---
>  tools/testing/selftests/x86/Makefile | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/tools/testing/selftests/x86/Makefile b/tools/testing/selftests/x86/Makefile
> index 83148875a12c..434065215d12 100644
> --- a/tools/testing/selftests/x86/Makefile
> +++ b/tools/testing/selftests/x86/Makefile
> @@ -36,6 +36,7 @@ BINARIES_32 := $(patsubst %,$(OUTPUT)/%,$(BINARIES_32))
>  BINARIES_64 := $(patsubst %,$(OUTPUT)/%,$(BINARIES_64))
>  
>  CFLAGS := -O2 -g -std=gnu99 -pthread -Wall $(KHDR_INCLUDES)
> +CFLAGS += -I $(top_srcdir)/tools/testing/selftests/
>  
>  # call32_from_64 in thunks.S uses absolute addresses.
>  ifeq ($(CAN_BUILD_WITH_NOPIE),1)
> -- 

Thx.

-- 
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette

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

end of thread, other threads:[~2026-01-17 11:08 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <CA+G9fYvKjQcCBMfXA-z2YuL2L+3Qd-pJjEUDX8PDdz2-EEQd=Q@mail.gmail.com>
2025-10-22  6:29 ` [PATCH] selftests/x86: Add selftests include path for kselftest.h after centralization Bala-Vignesh-Reddy
2025-10-22 15:02   ` Anders Roxell
2026-01-12 10:27   ` Brendan Jackman
2026-01-17 11:08   ` Borislav Petkov

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