[PATCH] selftests/powerpc: Fix load_unaligned_zeropad build failure

Subsystems: bitops api, kernel selftest framework, the rest

STALE930d LANDED: 1 (0M)

1 review trailer; landed in mainline as 3fe1eb4dd2e4 on 2024-03-05.

3 messages, 2 authors, 2024-03-06 · open the first message on its own page

[PATCH] selftests/powerpc: Fix load_unaligned_zeropad build failure

From: Michael Ellerman <mpe@ellerman.id.au>
Date: 2024-03-05 12:57:38

This test is userspace code, but uses some kernel headers via symlinks,
and mocks other headers, in order to test load_unaligned_zeropad().

Currently the test fails to build with:

  In file included from load_unaligned_zeropad.c:26:
  word-at-a-time.h:7:10: fatal error: linux/bitops.h: No such file or directory
      7 | #include <linux/bitops.h>

This is due to the recent changes to the kernel headers.

Fix it by symlinking the new wordpart.h, and creating an empty stub for
bitops.h which is all that's needed.

Reported-by: Sachin Sant <redacted>
Tested-by: Sachin Sant <redacted>
Fixes: 66a5c40f60f5 ("kernel.h: removed REPEAT_BYTE from kernel.h")
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
---
 tools/testing/selftests/powerpc/primitives/linux/bitops.h   | 0
 tools/testing/selftests/powerpc/primitives/linux/wordpart.h | 1 +
 2 files changed, 1 insertion(+)
 create mode 100644 tools/testing/selftests/powerpc/primitives/linux/bitops.h
 create mode 120000 tools/testing/selftests/powerpc/primitives/linux/wordpart.h

Kees, do you mind taking this one via your tree because that's where the commit
that changes the headers is?
diff --git a/tools/testing/selftests/powerpc/primitives/linux/bitops.h b/tools/testing/selftests/powerpc/primitives/linux/bitops.h
new file mode 100644
index 000000000000..e69de29bb2d1
diff --git a/tools/testing/selftests/powerpc/primitives/linux/wordpart.h b/tools/testing/selftests/powerpc/primitives/linux/wordpart.h
new file mode 120000
index 000000000000..4a74d2cbbc9b
--- /dev/null
+++ b/tools/testing/selftests/powerpc/primitives/linux/wordpart.h
@@ -0,0 +1 @@
+../../../../../../include/linux/wordpart.h
\ No newline at end of file
-- 
2.43.2

Re: [PATCH] selftests/powerpc: Fix load_unaligned_zeropad build failure

From: Kees Cook <hidden>
Date: 2024-03-05 18:31:41

On Tue, 05 Mar 2024 23:56:44 +1100, Michael Ellerman wrote:
This test is userspace code, but uses some kernel headers via symlinks,
and mocks other headers, in order to test load_unaligned_zeropad().

Currently the test fails to build with:

  In file included from load_unaligned_zeropad.c:26:
  word-at-a-time.h:7:10: fatal error: linux/bitops.h: No such file or directory
      7 | #include <linux/bitops.h>

[...]
Applied to for-next/hardening, thanks!

[1/1] selftests/powerpc: Fix load_unaligned_zeropad build failure
      https://git.kernel.org/kees/c/3fe1eb4dd2e4

Take care,

-- 
Kees Cook

Re: [PATCH] selftests/powerpc: Fix load_unaligned_zeropad build failure

From: Michael Ellerman <mpe@ellerman.id.au>
Date: 2024-03-06 03:23:52

Kees Cook [off-list ref] writes:
On Tue, 05 Mar 2024 23:56:44 +1100, Michael Ellerman wrote:
quoted
This test is userspace code, but uses some kernel headers via symlinks,
and mocks other headers, in order to test load_unaligned_zeropad().

Currently the test fails to build with:

  In file included from load_unaligned_zeropad.c:26:
  word-at-a-time.h:7:10: fatal error: linux/bitops.h: No such file or directory
      7 | #include <linux/bitops.h>

[...]
Applied to for-next/hardening, thanks!

[1/1] selftests/powerpc: Fix load_unaligned_zeropad build failure
      https://git.kernel.org/kees/c/3fe1eb4dd2e4

Take care,
Thanks.

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