These duplicate defines should automatically be picked up from kernel headers. Use KHDR_INCLUDES to add kernel header files.
Signed-off-by: Muhammad Usama Anjum usama.anjum@collabora.com --- tools/testing/selftests/capabilities/Makefile | 2 +- tools/testing/selftests/capabilities/test_execve.c | 8 -------- tools/testing/selftests/capabilities/validate_cap.c | 8 -------- 3 files changed, 1 insertion(+), 17 deletions(-)
diff --git a/tools/testing/selftests/capabilities/Makefile b/tools/testing/selftests/capabilities/Makefile index 6e9d98d457d5b..411ac098308f1 100644 --- a/tools/testing/selftests/capabilities/Makefile +++ b/tools/testing/selftests/capabilities/Makefile @@ -2,7 +2,7 @@ TEST_GEN_FILES := validate_cap TEST_GEN_PROGS := test_execve
-CFLAGS += -O2 -g -std=gnu99 -Wall +CFLAGS += -O2 -g -std=gnu99 -Wall $(KHDR_INCLUDES) LDLIBS += -lcap-ng -lrt -ldl
include ../lib.mk diff --git a/tools/testing/selftests/capabilities/test_execve.c b/tools/testing/selftests/capabilities/test_execve.c index df0ef02b40367..e3a352b020a79 100644 --- a/tools/testing/selftests/capabilities/test_execve.c +++ b/tools/testing/selftests/capabilities/test_execve.c @@ -20,14 +20,6 @@
#include "../kselftest.h"
-#ifndef PR_CAP_AMBIENT -#define PR_CAP_AMBIENT 47 -# define PR_CAP_AMBIENT_IS_SET 1 -# define PR_CAP_AMBIENT_RAISE 2 -# define PR_CAP_AMBIENT_LOWER 3 -# define PR_CAP_AMBIENT_CLEAR_ALL 4 -#endif - static int nerrs; static pid_t mpid; /* main() pid is used to avoid duplicate test counts */
diff --git a/tools/testing/selftests/capabilities/validate_cap.c b/tools/testing/selftests/capabilities/validate_cap.c index cdfc94268fe6e..60b4e7b716a75 100644 --- a/tools/testing/selftests/capabilities/validate_cap.c +++ b/tools/testing/selftests/capabilities/validate_cap.c @@ -9,14 +9,6 @@
#include "../kselftest.h"
-#ifndef PR_CAP_AMBIENT -#define PR_CAP_AMBIENT 47 -# define PR_CAP_AMBIENT_IS_SET 1 -# define PR_CAP_AMBIENT_RAISE 2 -# define PR_CAP_AMBIENT_LOWER 3 -# define PR_CAP_AMBIENT_CLEAR_ALL 4 -#endif - #if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 19) # define HAVE_GETAUXVAL #endif
Remove duplicate defines which are included in kernel headers. MAX_PID_NS_LEVEL macro is used inside kernel only. It isn't exposed to userspace. So it is never defined in test application. Remove #ifndef in this case.
Signed-off-by: Muhammad Usama Anjum usama.anjum@collabora.com --- .../clone3/clone3_cap_checkpoint_restore.c | 2 -- .../testing/selftests/clone3/clone3_clear_sighand.c | 4 ---- tools/testing/selftests/clone3/clone3_selftests.h | 13 ------------- tools/testing/selftests/clone3/clone3_set_tid.c | 2 -- 4 files changed, 21 deletions(-)
diff --git a/tools/testing/selftests/clone3/clone3_cap_checkpoint_restore.c b/tools/testing/selftests/clone3/clone3_cap_checkpoint_restore.c index 52d3f0364bdaa..31b56d6256550 100644 --- a/tools/testing/selftests/clone3/clone3_cap_checkpoint_restore.c +++ b/tools/testing/selftests/clone3/clone3_cap_checkpoint_restore.c @@ -27,9 +27,7 @@ #include "../kselftest_harness.h" #include "clone3_selftests.h"
-#ifndef MAX_PID_NS_LEVEL #define MAX_PID_NS_LEVEL 32 -#endif
static void child_exit(int ret) { diff --git a/tools/testing/selftests/clone3/clone3_clear_sighand.c b/tools/testing/selftests/clone3/clone3_clear_sighand.c index 47a8c0fc3676b..54a8b2445be99 100644 --- a/tools/testing/selftests/clone3/clone3_clear_sighand.c +++ b/tools/testing/selftests/clone3/clone3_clear_sighand.c @@ -16,10 +16,6 @@ #include "../kselftest.h" #include "clone3_selftests.h"
-#ifndef CLONE_CLEAR_SIGHAND -#define CLONE_CLEAR_SIGHAND 0x100000000ULL -#endif - static void nop_handler(int signo) { } diff --git a/tools/testing/selftests/clone3/clone3_selftests.h b/tools/testing/selftests/clone3/clone3_selftests.h index e81ffaaee02ba..3d2663fe50ba5 100644 --- a/tools/testing/selftests/clone3/clone3_selftests.h +++ b/tools/testing/selftests/clone3/clone3_selftests.h @@ -15,10 +15,6 @@
#define ptr_to_u64(ptr) ((__u64)((uintptr_t)(ptr)))
-#ifndef CLONE_INTO_CGROUP -#define CLONE_INTO_CGROUP 0x200000000ULL /* Clone into a specific cgroup given the right permissions. */ -#endif - #ifndef __NR_clone3 #define __NR_clone3 -1 #endif @@ -32,18 +28,9 @@ struct __clone_args { __aligned_u64 stack; __aligned_u64 stack_size; __aligned_u64 tls; -#ifndef CLONE_ARGS_SIZE_VER0 -#define CLONE_ARGS_SIZE_VER0 64 /* sizeof first published struct */ -#endif __aligned_u64 set_tid; __aligned_u64 set_tid_size; -#ifndef CLONE_ARGS_SIZE_VER1 -#define CLONE_ARGS_SIZE_VER1 80 /* sizeof second published struct */ -#endif __aligned_u64 cgroup; -#ifndef CLONE_ARGS_SIZE_VER2 -#define CLONE_ARGS_SIZE_VER2 88 /* sizeof third published struct */ -#endif };
static pid_t sys_clone3(struct __clone_args *args, size_t size) diff --git a/tools/testing/selftests/clone3/clone3_set_tid.c b/tools/testing/selftests/clone3/clone3_set_tid.c index 0229e9ebb995e..ed785afb60770 100644 --- a/tools/testing/selftests/clone3/clone3_set_tid.c +++ b/tools/testing/selftests/clone3/clone3_set_tid.c @@ -23,9 +23,7 @@ #include "../kselftest.h" #include "clone3_selftests.h"
-#ifndef MAX_PID_NS_LEVEL #define MAX_PID_NS_LEVEL 32 -#endif
static int pipe_1[2]; static int pipe_2[2];
Remove duplicate defines which are already defined in kernel headers and re-definition isn't required.
Signed-off-by: Muhammad Usama Anjum usama.anjum@collabora.com --- .../testing/selftests/core/close_range_test.c | 28 ------------------- 1 file changed, 28 deletions(-)
diff --git a/tools/testing/selftests/core/close_range_test.c b/tools/testing/selftests/core/close_range_test.c index 749239930ca83..534576f06df1c 100644 --- a/tools/testing/selftests/core/close_range_test.c +++ b/tools/testing/selftests/core/close_range_test.c @@ -16,34 +16,6 @@ #include "../kselftest_harness.h" #include "../clone3/clone3_selftests.h"
-#ifndef __NR_close_range - #if defined __alpha__ - #define __NR_close_range 546 - #elif defined _MIPS_SIM - #if _MIPS_SIM == _MIPS_SIM_ABI32 /* o32 */ - #define __NR_close_range (436 + 4000) - #endif - #if _MIPS_SIM == _MIPS_SIM_NABI32 /* n32 */ - #define __NR_close_range (436 + 6000) - #endif - #if _MIPS_SIM == _MIPS_SIM_ABI64 /* n64 */ - #define __NR_close_range (436 + 5000) - #endif - #elif defined __ia64__ - #define __NR_close_range (436 + 1024) - #else - #define __NR_close_range 436 - #endif -#endif - -#ifndef CLOSE_RANGE_UNSHARE -#define CLOSE_RANGE_UNSHARE (1U << 1) -#endif - -#ifndef CLOSE_RANGE_CLOEXEC -#define CLOSE_RANGE_CLOEXEC (1U << 2) -#endif - static inline int sys_close_range(unsigned int fd, unsigned int max_fd, unsigned int flags) {
These duplicate defines should automatically be picked up from kernel headers. Use KHDR_INCLUDES to add kernel header files.
Signed-off-by: Muhammad Usama Anjum usama.anjum@collabora.com --- tools/testing/selftests/fchmodat2/Makefile | 2 +- .../selftests/fchmodat2/fchmodat2_test.c | 20 ------------------- 2 files changed, 1 insertion(+), 21 deletions(-)
diff --git a/tools/testing/selftests/fchmodat2/Makefile b/tools/testing/selftests/fchmodat2/Makefile index 45b519eab8514..20839f8e43f2a 100644 --- a/tools/testing/selftests/fchmodat2/Makefile +++ b/tools/testing/selftests/fchmodat2/Makefile @@ -1,6 +1,6 @@ # SPDX-License-Identifier: GPL-2.0-or-later
-CFLAGS += -Wall -O2 -g -fsanitize=address -fsanitize=undefined +CFLAGS += -Wall -O2 -g -fsanitize=address -fsanitize=undefined $(KHDR_INCLUDES) TEST_GEN_PROGS := fchmodat2_test
include ../lib.mk diff --git a/tools/testing/selftests/fchmodat2/fchmodat2_test.c b/tools/testing/selftests/fchmodat2/fchmodat2_test.c index 2d98eb215bc6b..e0319417124d5 100644 --- a/tools/testing/selftests/fchmodat2/fchmodat2_test.c +++ b/tools/testing/selftests/fchmodat2/fchmodat2_test.c @@ -9,26 +9,6 @@
#include "../kselftest.h"
-#ifndef __NR_fchmodat2 - #if defined __alpha__ - #define __NR_fchmodat2 562 - #elif defined _MIPS_SIM - #if _MIPS_SIM == _MIPS_SIM_ABI32 /* o32 */ - #define __NR_fchmodat2 (452 + 4000) - #endif - #if _MIPS_SIM == _MIPS_SIM_NABI32 /* n32 */ - #define __NR_fchmodat2 (452 + 6000) - #endif - #if _MIPS_SIM == _MIPS_SIM_ABI64 /* n64 */ - #define __NR_fchmodat2 (452 + 5000) - #endif - #elif defined __ia64__ - #define __NR_fchmodat2 (452 + 1024) - #else - #define __NR_fchmodat2 452 - #endif -#endif - int sys_fchmodat2(int dfd, const char *filename, mode_t mode, int flags) { int ret = syscall(__NR_fchmodat2, dfd, filename, mode, flags);
On Sat, 05 Aug 2023 12:38:02 +0500, Muhammad Usama Anjum wrote:
These duplicate defines should automatically be picked up from kernel headers. Use KHDR_INCLUDES to add kernel header files.
Since the test isn't upstream yet I'm carrying it separately from the other patches which will go through the selftest tree.
---
Applied to the vfs.fchmodat2 branch of the vfs/vfs.git tree. Patches in the vfs.fchmodat2 branch should appear in linux-next soon.
Please report any outstanding bugs that were missed during review in a new review to the original patch series allowing us to drop it.
It's encouraged to provide Acked-bys and Reviewed-bys even though the patch has now been applied. If possible patch trailers will be updated.
Note that commit hashes shown below are subject to change due to rebase, trailer updates or similar. If in doubt, please check the listed branch.
tree: https://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs.git branch: vfs.fchmodat2
[4/6] selftests: fchmodat2: remove duplicate unneeded defines https://git.kernel.org/vfs/vfs/c/712143795327
These duplicate defines should automatically picked up from kernel headers.
Signed-off-by: Muhammad Usama Anjum usama.anjum@collabora.com --- tools/testing/selftests/firmware/fw_namespace.c | 4 ---- 1 file changed, 4 deletions(-)
diff --git a/tools/testing/selftests/firmware/fw_namespace.c b/tools/testing/selftests/firmware/fw_namespace.c index 4c6f0cd83c5b0..04757dc7e5467 100644 --- a/tools/testing/selftests/firmware/fw_namespace.c +++ b/tools/testing/selftests/firmware/fw_namespace.c @@ -17,10 +17,6 @@ #include <sys/wait.h> #include <unistd.h>
-#ifndef CLONE_NEWNS -# define CLONE_NEWNS 0x00020000 -#endif - static char *fw_path = NULL;
static void die(char *fmt, ...)
Kselftests are kernel tests and must be build with kernel headers from same source version. These duplicate defines should automatically picked up from kernel headers. Use KHDR_INCLUDES to add kernel header files.
Signed-off-by: Muhammad Usama Anjum usama.anjum@collabora.com --- .../selftests/futex/include/futextest.h | 22 ------------------- 1 file changed, 22 deletions(-)
diff --git a/tools/testing/selftests/futex/include/futextest.h b/tools/testing/selftests/futex/include/futextest.h index ddbcfc9b7bac4..59f66af3a6d10 100644 --- a/tools/testing/selftests/futex/include/futextest.h +++ b/tools/testing/selftests/futex/include/futextest.h @@ -25,28 +25,6 @@ typedef volatile u_int32_t futex_t; #define FUTEX_INITIALIZER 0
-/* Define the newer op codes if the system header file is not up to date. */ -#ifndef FUTEX_WAIT_BITSET -#define FUTEX_WAIT_BITSET 9 -#endif -#ifndef FUTEX_WAKE_BITSET -#define FUTEX_WAKE_BITSET 10 -#endif -#ifndef FUTEX_WAIT_REQUEUE_PI -#define FUTEX_WAIT_REQUEUE_PI 11 -#endif -#ifndef FUTEX_CMP_REQUEUE_PI -#define FUTEX_CMP_REQUEUE_PI 12 -#endif -#ifndef FUTEX_WAIT_REQUEUE_PI_PRIVATE -#define FUTEX_WAIT_REQUEUE_PI_PRIVATE (FUTEX_WAIT_REQUEUE_PI | \ - FUTEX_PRIVATE_FLAG) -#endif -#ifndef FUTEX_REQUEUE_PI_PRIVATE -#define FUTEX_CMP_REQUEUE_PI_PRIVATE (FUTEX_CMP_REQUEUE_PI | \ - FUTEX_PRIVATE_FLAG) -#endif - /** * futex() - SYS_futex syscall wrapper * @uaddr: address of first futex
* Muhammad Usama Anjum usama.anjum@collabora.com wrote:
Kselftests are kernel tests and must be build with kernel headers from same source version. These duplicate defines should automatically picked up from kernel headers. Use KHDR_INCLUDES to add kernel header files.
Signed-off-by: Muhammad Usama Anjum usama.anjum@collabora.com
.../selftests/futex/include/futextest.h | 22 ------------------- 1 file changed, 22 deletions(-)
diff --git a/tools/testing/selftests/futex/include/futextest.h b/tools/testing/selftests/futex/include/futextest.h index ddbcfc9b7bac4..59f66af3a6d10 100644 --- a/tools/testing/selftests/futex/include/futextest.h +++ b/tools/testing/selftests/futex/include/futextest.h @@ -25,28 +25,6 @@ typedef volatile u_int32_t futex_t; #define FUTEX_INITIALIZER 0 -/* Define the newer op codes if the system header file is not up to date. */ -#ifndef FUTEX_WAIT_BITSET -#define FUTEX_WAIT_BITSET 9 -#endif -#ifndef FUTEX_WAKE_BITSET -#define FUTEX_WAKE_BITSET 10 -#endif -#ifndef FUTEX_WAIT_REQUEUE_PI -#define FUTEX_WAIT_REQUEUE_PI 11 -#endif -#ifndef FUTEX_CMP_REQUEUE_PI -#define FUTEX_CMP_REQUEUE_PI 12 -#endif -#ifndef FUTEX_WAIT_REQUEUE_PI_PRIVATE -#define FUTEX_WAIT_REQUEUE_PI_PRIVATE (FUTEX_WAIT_REQUEUE_PI | \
FUTEX_PRIVATE_FLAG)
-#endif -#ifndef FUTEX_REQUEUE_PI_PRIVATE -#define FUTEX_CMP_REQUEUE_PI_PRIVATE (FUTEX_CMP_REQUEUE_PI | \
FUTEX_PRIVATE_FLAG)
-#endif
AFAICT I cannot really pick this up into the locking tree as-is, as this patch relies on the KHDR_INCLUDES change in patch #1, so that all self-tests get the kernel headers included, correct?
Thanks,
Ingo
On 10/3/23 1:46 PM, Ingo Molnar wrote:
- Muhammad Usama Anjum usama.anjum@collabora.com wrote:
Kselftests are kernel tests and must be build with kernel headers from same source version. These duplicate defines should automatically picked up from kernel headers. Use KHDR_INCLUDES to add kernel header files.
Signed-off-by: Muhammad Usama Anjum usama.anjum@collabora.com
.../selftests/futex/include/futextest.h | 22 ------------------- 1 file changed, 22 deletions(-)
diff --git a/tools/testing/selftests/futex/include/futextest.h b/tools/testing/selftests/futex/include/futextest.h index ddbcfc9b7bac4..59f66af3a6d10 100644 --- a/tools/testing/selftests/futex/include/futextest.h +++ b/tools/testing/selftests/futex/include/futextest.h @@ -25,28 +25,6 @@ typedef volatile u_int32_t futex_t; #define FUTEX_INITIALIZER 0 -/* Define the newer op codes if the system header file is not up to date. */ -#ifndef FUTEX_WAIT_BITSET -#define FUTEX_WAIT_BITSET 9 -#endif -#ifndef FUTEX_WAKE_BITSET -#define FUTEX_WAKE_BITSET 10 -#endif -#ifndef FUTEX_WAIT_REQUEUE_PI -#define FUTEX_WAIT_REQUEUE_PI 11 -#endif -#ifndef FUTEX_CMP_REQUEUE_PI -#define FUTEX_CMP_REQUEUE_PI 12 -#endif -#ifndef FUTEX_WAIT_REQUEUE_PI_PRIVATE -#define FUTEX_WAIT_REQUEUE_PI_PRIVATE (FUTEX_WAIT_REQUEUE_PI | \
FUTEX_PRIVATE_FLAG)
-#endif -#ifndef FUTEX_REQUEUE_PI_PRIVATE -#define FUTEX_CMP_REQUEUE_PI_PRIVATE (FUTEX_CMP_REQUEUE_PI | \
FUTEX_PRIVATE_FLAG)
-#endif
AFAICT I cannot really pick this up into the locking tree as-is, as this patch relies on the KHDR_INCLUDES change in patch #1, so that all self-tests get the kernel headers included, correct?
No this patch is self contained and doesn't depend on the patch #1. KHDR_INCLUDES was included several releases back in kselftest's Makefile and in kselftests of futex. Correct headers are being included already. In this patch, I'm removing just the un-needed dead code. Other patches were already picked up by other maintainers.
Thanks,
Ingo
* Muhammad Usama Anjum usama.anjum@collabora.com wrote:
On 10/3/23 1:46 PM, Ingo Molnar wrote:
- Muhammad Usama Anjum usama.anjum@collabora.com wrote:
Kselftests are kernel tests and must be build with kernel headers from same source version. These duplicate defines should automatically picked up from kernel headers. Use KHDR_INCLUDES to add kernel header files.
Signed-off-by: Muhammad Usama Anjum usama.anjum@collabora.com
.../selftests/futex/include/futextest.h | 22 ------------------- 1 file changed, 22 deletions(-)
diff --git a/tools/testing/selftests/futex/include/futextest.h b/tools/testing/selftests/futex/include/futextest.h index ddbcfc9b7bac4..59f66af3a6d10 100644 --- a/tools/testing/selftests/futex/include/futextest.h +++ b/tools/testing/selftests/futex/include/futextest.h @@ -25,28 +25,6 @@ typedef volatile u_int32_t futex_t; #define FUTEX_INITIALIZER 0 -/* Define the newer op codes if the system header file is not up to date. */ -#ifndef FUTEX_WAIT_BITSET -#define FUTEX_WAIT_BITSET 9 -#endif -#ifndef FUTEX_WAKE_BITSET -#define FUTEX_WAKE_BITSET 10 -#endif -#ifndef FUTEX_WAIT_REQUEUE_PI -#define FUTEX_WAIT_REQUEUE_PI 11 -#endif -#ifndef FUTEX_CMP_REQUEUE_PI -#define FUTEX_CMP_REQUEUE_PI 12 -#endif -#ifndef FUTEX_WAIT_REQUEUE_PI_PRIVATE -#define FUTEX_WAIT_REQUEUE_PI_PRIVATE (FUTEX_WAIT_REQUEUE_PI | \
FUTEX_PRIVATE_FLAG)
-#endif -#ifndef FUTEX_REQUEUE_PI_PRIVATE -#define FUTEX_CMP_REQUEUE_PI_PRIVATE (FUTEX_CMP_REQUEUE_PI | \
FUTEX_PRIVATE_FLAG)
-#endif
AFAICT I cannot really pick this up into the locking tree as-is, as this patch relies on the KHDR_INCLUDES change in patch #1, so that all self-tests get the kernel headers included, correct?
No this patch is self contained and doesn't depend on the patch #1. KHDR_INCLUDES was included several releases back in kselftest's Makefile and in kselftests of futex. Correct headers are being included already. In this patch, I'm removing just the un-needed dead code. Other patches were already picked up by other maintainers.
So the changelog does not match that characterization, it talks about KHDR_INCLUDES in the present tense, and patch #1 adds the KHDR_INCLUDES, which further suggested a dependency to me:
Kselftests are kernel tests and must be build with kernel headers from same source version. These duplicate defines should automatically picked up from kernel headers. Use KHDR_INCLUDES to add kernel header
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
files.
^^^^^^
Could you please re-send it with the changelog updated that makes it clear that this patch works fine standalone against current mainline kernels?
Thanks,
Ingo
On 10/6/23 1:25 AM, Ingo Molnar wrote:
- Muhammad Usama Anjum usama.anjum@collabora.com wrote:
On 10/3/23 1:46 PM, Ingo Molnar wrote:
- Muhammad Usama Anjum usama.anjum@collabora.com wrote:
Kselftests are kernel tests and must be build with kernel headers from same source version. These duplicate defines should automatically picked up from kernel headers. Use KHDR_INCLUDES to add kernel header files.
Signed-off-by: Muhammad Usama Anjum usama.anjum@collabora.com
.../selftests/futex/include/futextest.h | 22 ------------------- 1 file changed, 22 deletions(-)
diff --git a/tools/testing/selftests/futex/include/futextest.h b/tools/testing/selftests/futex/include/futextest.h index ddbcfc9b7bac4..59f66af3a6d10 100644 --- a/tools/testing/selftests/futex/include/futextest.h +++ b/tools/testing/selftests/futex/include/futextest.h @@ -25,28 +25,6 @@ typedef volatile u_int32_t futex_t; #define FUTEX_INITIALIZER 0 -/* Define the newer op codes if the system header file is not up to date. */ -#ifndef FUTEX_WAIT_BITSET -#define FUTEX_WAIT_BITSET 9 -#endif -#ifndef FUTEX_WAKE_BITSET -#define FUTEX_WAKE_BITSET 10 -#endif -#ifndef FUTEX_WAIT_REQUEUE_PI -#define FUTEX_WAIT_REQUEUE_PI 11 -#endif -#ifndef FUTEX_CMP_REQUEUE_PI -#define FUTEX_CMP_REQUEUE_PI 12 -#endif -#ifndef FUTEX_WAIT_REQUEUE_PI_PRIVATE -#define FUTEX_WAIT_REQUEUE_PI_PRIVATE (FUTEX_WAIT_REQUEUE_PI | \
FUTEX_PRIVATE_FLAG)
-#endif -#ifndef FUTEX_REQUEUE_PI_PRIVATE -#define FUTEX_CMP_REQUEUE_PI_PRIVATE (FUTEX_CMP_REQUEUE_PI | \
FUTEX_PRIVATE_FLAG)
-#endif
AFAICT I cannot really pick this up into the locking tree as-is, as this patch relies on the KHDR_INCLUDES change in patch #1, so that all self-tests get the kernel headers included, correct?
No this patch is self contained and doesn't depend on the patch #1. KHDR_INCLUDES was included several releases back in kselftest's Makefile and in kselftests of futex. Correct headers are being included already. In this patch, I'm removing just the un-needed dead code. Other patches were already picked up by other maintainers.
So the changelog does not match that characterization, it talks about KHDR_INCLUDES in the present tense, and patch #1 adds the KHDR_INCLUDES, which further suggested a dependency to me:
Sorry, so the working of the change-log isn't clear enough. I'll send the patch separately and with better wording.
Kselftests are kernel tests and must be build with kernel headers from same source version. These duplicate defines should automatically picked up from kernel headers. Use KHDR_INCLUDES to add kernel header
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
files.
^^^^^^
Could you please re-send it with the changelog updated that makes it clear that this patch works fine standalone against current mainline kernels?
Thanks,
Ingo
* Muhammad Usama Anjum usama.anjum@collabora.com wrote:
Sorry, so the working of the change-log isn't clear enough. I'll send the patch separately and with better wording.
Thank you!
Ingo
Hi Shuah,
Christian Brauner had picked [PATCH 4/6]. Others are still not picked. Please have a look.
Thanks, Usama
On 8/5/23 12:37 PM, Muhammad Usama Anjum wrote:
These duplicate defines should automatically be picked up from kernel headers. Use KHDR_INCLUDES to add kernel header files.
Signed-off-by: Muhammad Usama Anjum usama.anjum@collabora.com
tools/testing/selftests/capabilities/Makefile | 2 +- tools/testing/selftests/capabilities/test_execve.c | 8 -------- tools/testing/selftests/capabilities/validate_cap.c | 8 -------- 3 files changed, 1 insertion(+), 17 deletions(-)
diff --git a/tools/testing/selftests/capabilities/Makefile b/tools/testing/selftests/capabilities/Makefile index 6e9d98d457d5b..411ac098308f1 100644 --- a/tools/testing/selftests/capabilities/Makefile +++ b/tools/testing/selftests/capabilities/Makefile @@ -2,7 +2,7 @@ TEST_GEN_FILES := validate_cap TEST_GEN_PROGS := test_execve -CFLAGS += -O2 -g -std=gnu99 -Wall +CFLAGS += -O2 -g -std=gnu99 -Wall $(KHDR_INCLUDES) LDLIBS += -lcap-ng -lrt -ldl include ../lib.mk diff --git a/tools/testing/selftests/capabilities/test_execve.c b/tools/testing/selftests/capabilities/test_execve.c index df0ef02b40367..e3a352b020a79 100644 --- a/tools/testing/selftests/capabilities/test_execve.c +++ b/tools/testing/selftests/capabilities/test_execve.c @@ -20,14 +20,6 @@ #include "../kselftest.h" -#ifndef PR_CAP_AMBIENT -#define PR_CAP_AMBIENT 47 -# define PR_CAP_AMBIENT_IS_SET 1 -# define PR_CAP_AMBIENT_RAISE 2 -# define PR_CAP_AMBIENT_LOWER 3 -# define PR_CAP_AMBIENT_CLEAR_ALL 4 -#endif
static int nerrs; static pid_t mpid; /* main() pid is used to avoid duplicate test counts */ diff --git a/tools/testing/selftests/capabilities/validate_cap.c b/tools/testing/selftests/capabilities/validate_cap.c index cdfc94268fe6e..60b4e7b716a75 100644 --- a/tools/testing/selftests/capabilities/validate_cap.c +++ b/tools/testing/selftests/capabilities/validate_cap.c @@ -9,14 +9,6 @@ #include "../kselftest.h" -#ifndef PR_CAP_AMBIENT -#define PR_CAP_AMBIENT 47 -# define PR_CAP_AMBIENT_IS_SET 1 -# define PR_CAP_AMBIENT_RAISE 2 -# define PR_CAP_AMBIENT_LOWER 3 -# define PR_CAP_AMBIENT_CLEAR_ALL 4 -#endif
#if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 19) # define HAVE_GETAUXVAL #endif
On 8/22/23 1:57 PM, Muhammad Usama Anjum wrote:
Hi Shuah,
Christian Brauner had picked [PATCH 4/6]. Others are still not picked. Please have a look.
Soft reminder
Thanks, Usama
On 8/5/23 12:37 PM, Muhammad Usama Anjum wrote:
These duplicate defines should automatically be picked up from kernel headers. Use KHDR_INCLUDES to add kernel header files.
Signed-off-by: Muhammad Usama Anjum usama.anjum@collabora.com
tools/testing/selftests/capabilities/Makefile | 2 +- tools/testing/selftests/capabilities/test_execve.c | 8 -------- tools/testing/selftests/capabilities/validate_cap.c | 8 -------- 3 files changed, 1 insertion(+), 17 deletions(-)
diff --git a/tools/testing/selftests/capabilities/Makefile b/tools/testing/selftests/capabilities/Makefile index 6e9d98d457d5b..411ac098308f1 100644 --- a/tools/testing/selftests/capabilities/Makefile +++ b/tools/testing/selftests/capabilities/Makefile @@ -2,7 +2,7 @@ TEST_GEN_FILES := validate_cap TEST_GEN_PROGS := test_execve -CFLAGS += -O2 -g -std=gnu99 -Wall +CFLAGS += -O2 -g -std=gnu99 -Wall $(KHDR_INCLUDES) LDLIBS += -lcap-ng -lrt -ldl include ../lib.mk diff --git a/tools/testing/selftests/capabilities/test_execve.c b/tools/testing/selftests/capabilities/test_execve.c index df0ef02b40367..e3a352b020a79 100644 --- a/tools/testing/selftests/capabilities/test_execve.c +++ b/tools/testing/selftests/capabilities/test_execve.c @@ -20,14 +20,6 @@ #include "../kselftest.h" -#ifndef PR_CAP_AMBIENT -#define PR_CAP_AMBIENT 47 -# define PR_CAP_AMBIENT_IS_SET 1 -# define PR_CAP_AMBIENT_RAISE 2 -# define PR_CAP_AMBIENT_LOWER 3 -# define PR_CAP_AMBIENT_CLEAR_ALL 4 -#endif
static int nerrs; static pid_t mpid; /* main() pid is used to avoid duplicate test counts */ diff --git a/tools/testing/selftests/capabilities/validate_cap.c b/tools/testing/selftests/capabilities/validate_cap.c index cdfc94268fe6e..60b4e7b716a75 100644 --- a/tools/testing/selftests/capabilities/validate_cap.c +++ b/tools/testing/selftests/capabilities/validate_cap.c @@ -9,14 +9,6 @@ #include "../kselftest.h" -#ifndef PR_CAP_AMBIENT -#define PR_CAP_AMBIENT 47 -# define PR_CAP_AMBIENT_IS_SET 1 -# define PR_CAP_AMBIENT_RAISE 2 -# define PR_CAP_AMBIENT_LOWER 3 -# define PR_CAP_AMBIENT_CLEAR_ALL 4 -#endif
#if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 19) # define HAVE_GETAUXVAL #endif
On 9/4/23 3:48 PM, Muhammad Usama Anjum wrote:
On 8/22/23 1:57 PM, Muhammad Usama Anjum wrote:
Hi Shuah,
Christian Brauner had picked [PATCH 4/6]. Others are still not picked. Please have a look.
Shuah, I thought you had picked up these patches. But I'm unable to find them in the linux-next. I'll be re-sending 6th patch separately. Can you please pick up patch number 1, 2, 3 and 5 to your tree?
Thanks
Soft reminder
Thanks, Usama
On 8/5/23 12:37 PM, Muhammad Usama Anjum wrote:
These duplicate defines should automatically be picked up from kernel headers. Use KHDR_INCLUDES to add kernel header files.
Signed-off-by: Muhammad Usama Anjum usama.anjum@collabora.com
tools/testing/selftests/capabilities/Makefile | 2 +- tools/testing/selftests/capabilities/test_execve.c | 8 -------- tools/testing/selftests/capabilities/validate_cap.c | 8 -------- 3 files changed, 1 insertion(+), 17 deletions(-)
diff --git a/tools/testing/selftests/capabilities/Makefile b/tools/testing/selftests/capabilities/Makefile index 6e9d98d457d5b..411ac098308f1 100644 --- a/tools/testing/selftests/capabilities/Makefile +++ b/tools/testing/selftests/capabilities/Makefile @@ -2,7 +2,7 @@ TEST_GEN_FILES := validate_cap TEST_GEN_PROGS := test_execve -CFLAGS += -O2 -g -std=gnu99 -Wall +CFLAGS += -O2 -g -std=gnu99 -Wall $(KHDR_INCLUDES) LDLIBS += -lcap-ng -lrt -ldl include ../lib.mk diff --git a/tools/testing/selftests/capabilities/test_execve.c b/tools/testing/selftests/capabilities/test_execve.c index df0ef02b40367..e3a352b020a79 100644 --- a/tools/testing/selftests/capabilities/test_execve.c +++ b/tools/testing/selftests/capabilities/test_execve.c @@ -20,14 +20,6 @@ #include "../kselftest.h" -#ifndef PR_CAP_AMBIENT -#define PR_CAP_AMBIENT 47 -# define PR_CAP_AMBIENT_IS_SET 1 -# define PR_CAP_AMBIENT_RAISE 2 -# define PR_CAP_AMBIENT_LOWER 3 -# define PR_CAP_AMBIENT_CLEAR_ALL 4 -#endif
static int nerrs; static pid_t mpid; /* main() pid is used to avoid duplicate test counts */ diff --git a/tools/testing/selftests/capabilities/validate_cap.c b/tools/testing/selftests/capabilities/validate_cap.c index cdfc94268fe6e..60b4e7b716a75 100644 --- a/tools/testing/selftests/capabilities/validate_cap.c +++ b/tools/testing/selftests/capabilities/validate_cap.c @@ -9,14 +9,6 @@ #include "../kselftest.h" -#ifndef PR_CAP_AMBIENT -#define PR_CAP_AMBIENT 47 -# define PR_CAP_AMBIENT_IS_SET 1 -# define PR_CAP_AMBIENT_RAISE 2 -# define PR_CAP_AMBIENT_LOWER 3 -# define PR_CAP_AMBIENT_CLEAR_ALL 4 -#endif
#if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 19) # define HAVE_GETAUXVAL #endif
On 10/6/23 1:33 PM, Muhammad Usama Anjum wrote:
On 9/4/23 3:48 PM, Muhammad Usama Anjum wrote:
On 8/22/23 1:57 PM, Muhammad Usama Anjum wrote:
Hi Shuah,
Christian Brauner had picked [PATCH 4/6]. Others are still not picked. Please have a look.
Shuah, I thought you had picked up these patches. But I'm unable to find them in the linux-next. I'll be re-sending 6th patch separately. Can you please pick up patch number 1, 2, 3 and 5 to your tree?
Sent v2 for your ease. It has same patches. https://lore.kernel.org/all/20231006100743.1631334-1-usama.anjum@collabora.c...
Thanks
Soft reminder
Thanks, Usama
On 8/5/23 12:37 PM, Muhammad Usama Anjum wrote:
These duplicate defines should automatically be picked up from kernel headers. Use KHDR_INCLUDES to add kernel header files.
Signed-off-by: Muhammad Usama Anjum usama.anjum@collabora.com
tools/testing/selftests/capabilities/Makefile | 2 +- tools/testing/selftests/capabilities/test_execve.c | 8 -------- tools/testing/selftests/capabilities/validate_cap.c | 8 -------- 3 files changed, 1 insertion(+), 17 deletions(-)
diff --git a/tools/testing/selftests/capabilities/Makefile b/tools/testing/selftests/capabilities/Makefile index 6e9d98d457d5b..411ac098308f1 100644 --- a/tools/testing/selftests/capabilities/Makefile +++ b/tools/testing/selftests/capabilities/Makefile @@ -2,7 +2,7 @@ TEST_GEN_FILES := validate_cap TEST_GEN_PROGS := test_execve -CFLAGS += -O2 -g -std=gnu99 -Wall +CFLAGS += -O2 -g -std=gnu99 -Wall $(KHDR_INCLUDES) LDLIBS += -lcap-ng -lrt -ldl include ../lib.mk diff --git a/tools/testing/selftests/capabilities/test_execve.c b/tools/testing/selftests/capabilities/test_execve.c index df0ef02b40367..e3a352b020a79 100644 --- a/tools/testing/selftests/capabilities/test_execve.c +++ b/tools/testing/selftests/capabilities/test_execve.c @@ -20,14 +20,6 @@ #include "../kselftest.h" -#ifndef PR_CAP_AMBIENT -#define PR_CAP_AMBIENT 47 -# define PR_CAP_AMBIENT_IS_SET 1 -# define PR_CAP_AMBIENT_RAISE 2 -# define PR_CAP_AMBIENT_LOWER 3 -# define PR_CAP_AMBIENT_CLEAR_ALL 4 -#endif
static int nerrs; static pid_t mpid; /* main() pid is used to avoid duplicate test counts */ diff --git a/tools/testing/selftests/capabilities/validate_cap.c b/tools/testing/selftests/capabilities/validate_cap.c index cdfc94268fe6e..60b4e7b716a75 100644 --- a/tools/testing/selftests/capabilities/validate_cap.c +++ b/tools/testing/selftests/capabilities/validate_cap.c @@ -9,14 +9,6 @@ #include "../kselftest.h" -#ifndef PR_CAP_AMBIENT -#define PR_CAP_AMBIENT 47 -# define PR_CAP_AMBIENT_IS_SET 1 -# define PR_CAP_AMBIENT_RAISE 2 -# define PR_CAP_AMBIENT_LOWER 3 -# define PR_CAP_AMBIENT_CLEAR_ALL 4 -#endif
#if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 19) # define HAVE_GETAUXVAL #endif
On 10/6/23 04:09, Muhammad Usama Anjum wrote:
On 10/6/23 1:33 PM, Muhammad Usama Anjum wrote:
On 9/4/23 3:48 PM, Muhammad Usama Anjum wrote:
On 8/22/23 1:57 PM, Muhammad Usama Anjum wrote:
Hi Shuah,
Christian Brauner had picked [PATCH 4/6]. Others are still not picked. Please have a look.
Shuah, I thought you had picked up these patches. But I'm unable to find them in the linux-next. I'll be re-sending 6th patch separately. Can you please pick up patch number 1, 2, 3 and 5 to your tree?
I though I picked these up. Looks like I didn't.
Sent v2 for your ease. It has same patches. https://lore.kernel.org/all/20231006100743.1631334-1-usama.anjum@collabora.c...
Thank you. They are now in linux-kselftest next.
-- Shuah
linux-kselftest-mirror@lists.linaro.org