Define _GNU_SOURCE for sources using
Subsystems (43)
v2 cover Define _GNU_SOURCE for sources using
809216233555 ("selftests/harness: remove use of LINE_MAX") introduced asprintf into kselftest_harness.h, which is a GNU extension and needs _GNU_SOURCE to either be defined prior to including headers or with the -D_GNU_SOURCE flag passed to the compiler.
v1: https://lore.kernel.org/linux-kselftest/20240430235057.1351993-1-edliaw at google.com/
v2: add -D_GNU_SOURCE to KHDR_INCLUDES so that it is in a single
location. Remove #define _GNU_SOURCE from source code to resolve redefinition warnings.
Edward Liaw (5):
selftests: Compile kselftest headers with -D_GNU_SOURCE selftests/sgx: Include KHDR_INCLUDES in Makefile
selftests: Include KHDR_INCLUDES in Makefile
selftests: Drop define _GNU_SOURCE
selftests: Drop duplicate -D_GNU_SOURCE
tools/testing/selftests/Makefile | 4 ++-- tools/testing/selftests/alsa/Makefile | 2 +- tools/testing/selftests/arm64/signal/Makefile | 2 +- tools/testing/selftests/cachestat/test_cachestat.c | 2 -- tools/testing/selftests/capabilities/test_execve.c | 2 -- tools/testing/selftests/clone3/clone3.c | 2 -- .../testing/selftests/clone3/clone3_cap_checkpoint_restore.c | 2 -- tools/testing/selftests/clone3/clone3_clear_sighand.c | 2 -- tools/testing/selftests/clone3/clone3_selftests.h | 1 - tools/testing/selftests/clone3/clone3_set_tid.c | 2 -- tools/testing/selftests/core/close_range_test.c | 2 -- tools/testing/selftests/drivers/dma-buf/udmabuf.c | 1 - tools/testing/selftests/exec/Makefile | 2 +- tools/testing/selftests/fchmodat2/fchmodat2_test.c | 2 -- tools/testing/selftests/filesystems/binderfs/binderfs_test.c | 2 -- tools/testing/selftests/filesystems/devpts_pts.c | 1 - tools/testing/selftests/filesystems/dnotify_test.c | 1 - tools/testing/selftests/filesystems/epoll/epoll_wakeup_test.c | 2 -- tools/testing/selftests/filesystems/eventfd/eventfd_test.c | 2 -- tools/testing/selftests/filesystems/fat/rename_exchange.c | 2 -- tools/testing/selftests/filesystems/overlayfs/Makefile | 2 +- tools/testing/selftests/filesystems/overlayfs/dev_in_maps.c | 2 -- .../testing/selftests/filesystems/statmount/statmount_test.c | 3 --- tools/testing/selftests/futex/functional/Makefile | 2 +- tools/testing/selftests/futex/functional/futex_requeue_pi.c | 3 --- tools/testing/selftests/hid/Makefile | 2 +- tools/testing/selftests/iommu/Makefile | 2 -- tools/testing/selftests/ipc/msgque.c | 1 - tools/testing/selftests/kcmp/kcmp_test.c | 2 -- tools/testing/selftests/kselftest_harness.h | 2 +- tools/testing/selftests/kvm/aarch64/arch_timer.c | 2 -- tools/testing/selftests/kvm/aarch64/page_fault_test.c | 1 - tools/testing/selftests/kvm/aarch64/psci_test.c | 3 --- tools/testing/selftests/kvm/aarch64/vgic_init.c | 1 - tools/testing/selftests/kvm/arch_timer.c | 3 --- tools/testing/selftests/kvm/demand_paging_test.c | 3 --- tools/testing/selftests/kvm/dirty_log_test.c | 3 --- tools/testing/selftests/kvm/guest_memfd_test.c | 2 -- tools/testing/selftests/kvm/hardware_disable_test.c | 3 --- tools/testing/selftests/kvm/include/userfaultfd_util.h | 3 --- tools/testing/selftests/kvm/kvm_binary_stats_test.c | 2 -- tools/testing/selftests/kvm/kvm_create_max_vcpus.c | 2 -- tools/testing/selftests/kvm/kvm_page_table_test.c | 3 --- tools/testing/selftests/kvm/lib/assert.c | 3 --- tools/testing/selftests/kvm/lib/kvm_util.c | 2 -- tools/testing/selftests/kvm/lib/memstress.c | 2 -- tools/testing/selftests/kvm/lib/test_util.c | 2 -- tools/testing/selftests/kvm/lib/userfaultfd_util.c | 3 --- tools/testing/selftests/kvm/lib/x86_64/sev.c | 1 - tools/testing/selftests/kvm/max_guest_memory_test.c | 2 -- .../testing/selftests/kvm/memslot_modification_stress_test.c | 3 --- tools/testing/selftests/kvm/riscv/arch_timer.c | 3 --- tools/testing/selftests/kvm/rseq_test.c | 1 - tools/testing/selftests/kvm/s390x/cmma_test.c | 2 -- tools/testing/selftests/kvm/s390x/sync_regs_test.c | 2 -- tools/testing/selftests/kvm/set_memory_region_test.c | 1 - tools/testing/selftests/kvm/steal_time.c | 1 - tools/testing/selftests/kvm/x86_64/amx_test.c | 2 -- .../selftests/kvm/x86_64/exit_on_emulation_failure_test.c | 3 --- tools/testing/selftests/kvm/x86_64/hwcr_msr_test.c | 2 -- tools/testing/selftests/kvm/x86_64/hyperv_cpuid.c | 2 -- tools/testing/selftests/kvm/x86_64/hyperv_evmcs.c | 1 - tools/testing/selftests/kvm/x86_64/hyperv_ipi.c | 2 -- tools/testing/selftests/kvm/x86_64/hyperv_svm_test.c | 1 - tools/testing/selftests/kvm/x86_64/hyperv_tlb_flush.c | 2 -- tools/testing/selftests/kvm/x86_64/nested_exceptions_test.c | 2 -- tools/testing/selftests/kvm/x86_64/nx_huge_pages_test.c | 3 --- tools/testing/selftests/kvm/x86_64/platform_info_test.c | 2 -- tools/testing/selftests/kvm/x86_64/pmu_counters_test.c | 2 -- tools/testing/selftests/kvm/x86_64/pmu_event_filter_test.c | 3 --- .../selftests/kvm/x86_64/private_mem_conversions_test.c | 1 - tools/testing/selftests/kvm/x86_64/set_boot_cpu_id.c | 1 - tools/testing/selftests/kvm/x86_64/set_sregs_test.c | 1 - .../selftests/kvm/x86_64/smaller_maxphyaddr_emulation_test.c | 3 --- tools/testing/selftests/kvm/x86_64/smm_test.c | 1 - tools/testing/selftests/kvm/x86_64/state_test.c | 1 - tools/testing/selftests/kvm/x86_64/sync_regs_test.c | 2 -- tools/testing/selftests/kvm/x86_64/ucna_injection_test.c | 2 -- tools/testing/selftests/kvm/x86_64/userspace_msr_exit_test.c | 2 -- tools/testing/selftests/kvm/x86_64/vmx_dirty_log_test.c | 3 --- tools/testing/selftests/kvm/x86_64/vmx_pmu_caps_test.c | 1 - .../testing/selftests/kvm/x86_64/vmx_preemption_timer_test.c | 1 - tools/testing/selftests/kvm/x86_64/xapic_ipi_test.c | 2 -- tools/testing/selftests/kvm/x86_64/xapic_state_test.c | 1 - tools/testing/selftests/kvm/x86_64/xss_msr_test.c | 2 -- tools/testing/selftests/landlock/base_test.c | 2 -- tools/testing/selftests/landlock/fs_test.c | 2 -- tools/testing/selftests/landlock/net_test.c | 2 -- tools/testing/selftests/landlock/ptrace_test.c | 2 -- tools/testing/selftests/lib.mk | 2 +- tools/testing/selftests/lsm/common.c | 2 -- tools/testing/selftests/lsm/lsm_get_self_attr_test.c | 2 -- tools/testing/selftests/lsm/lsm_list_modules_test.c | 2 -- tools/testing/selftests/lsm/lsm_set_self_attr_test.c | 2 -- tools/testing/selftests/membarrier/membarrier_test_impl.h | 1 - .../selftests/membarrier/membarrier_test_multi_thread.c | 1 - .../selftests/membarrier/membarrier_test_single_thread.c | 1 - tools/testing/selftests/memfd/common.c | 1 - tools/testing/selftests/memfd/fuse_test.c | 2 -- tools/testing/selftests/memfd/memfd_test.c | 1 - tools/testing/selftests/mm/cow.c | 1 - tools/testing/selftests/mm/gup_longterm.c | 1 - tools/testing/selftests/mm/hugepage-mmap.c | 1 - tools/testing/selftests/mm/hugepage-mremap.c | 2 -- tools/testing/selftests/mm/hugetlb-madvise.c | 2 -- tools/testing/selftests/mm/hugetlb-read-hwpoison.c | 2 -- tools/testing/selftests/mm/khugepaged.c | 1 - tools/testing/selftests/mm/ksm_functional_tests.c | 1 - tools/testing/selftests/mm/madv_populate.c | 1 - tools/testing/selftests/mm/map_populate.c | 2 -- tools/testing/selftests/mm/mdwe_test.c | 1 - tools/testing/selftests/mm/memfd_secret.c | 2 -- tools/testing/selftests/mm/mlock2-tests.c | 1 - tools/testing/selftests/mm/mrelease_test.c | 1 - tools/testing/selftests/mm/mremap_dontunmap.c | 1 - tools/testing/selftests/mm/mremap_test.c | 2 -- tools/testing/selftests/mm/pagemap_ioctl.c | 1 - tools/testing/selftests/mm/pkey-helpers.h | 1 - tools/testing/selftests/mm/protection_keys.c | 1 - tools/testing/selftests/mm/split_huge_page_test.c | 2 -- tools/testing/selftests/mm/thuge-gen.c | 2 -- tools/testing/selftests/mm/uffd-common.h | 1 - tools/testing/selftests/mount_setattr/mount_setattr_test.c | 1 - .../move_mount_set_group/move_mount_set_group_test.c | 1 - tools/testing/selftests/nci/Makefile | 2 +- tools/testing/selftests/net/af_unix/diag_uid.c | 2 -- tools/testing/selftests/net/af_unix/scm_pidfd.c | 1 - tools/testing/selftests/net/af_unix/unix_connect.c | 2 -- tools/testing/selftests/net/csum.c | 3 --- tools/testing/selftests/net/gro.c | 3 --- tools/testing/selftests/net/ip_defrag.c | 3 --- tools/testing/selftests/net/ipsec.c | 3 --- tools/testing/selftests/net/ipv6_flowlabel.c | 3 --- tools/testing/selftests/net/ipv6_flowlabel_mgr.c | 3 --- tools/testing/selftests/net/mptcp/mptcp_connect.c | 3 --- tools/testing/selftests/net/mptcp/mptcp_inq.c | 3 --- tools/testing/selftests/net/mptcp/mptcp_sockopt.c | 3 --- tools/testing/selftests/net/msg_zerocopy.c | 3 --- tools/testing/selftests/net/nettest.c | 2 -- tools/testing/selftests/net/psock_fanout.c | 3 --- tools/testing/selftests/net/psock_snd.c | 3 --- tools/testing/selftests/net/reuseport_addr_any.c | 3 --- tools/testing/selftests/net/reuseport_bpf_cpu.c | 3 --- tools/testing/selftests/net/reuseport_bpf_numa.c | 3 --- tools/testing/selftests/net/reuseport_dualstack.c | 3 --- tools/testing/selftests/net/so_incoming_cpu.c | 1 - tools/testing/selftests/net/so_netns_cookie.c | 1 - tools/testing/selftests/net/so_txtime.c | 3 --- tools/testing/selftests/net/tap.c | 3 --- tools/testing/selftests/net/tcp_ao/Makefile | 2 +- tools/testing/selftests/net/tcp_fastopen_backup_key.c | 1 - tools/testing/selftests/net/tcp_inq.c | 2 -- tools/testing/selftests/net/tcp_mmap.c | 1 - tools/testing/selftests/net/tls.c | 3 --- tools/testing/selftests/net/toeplitz.c | 3 --- tools/testing/selftests/net/tun.c | 3 --- tools/testing/selftests/net/txring_overwrite.c | 3 --- tools/testing/selftests/net/txtimestamp.c | 3 --- tools/testing/selftests/net/udpgso.c | 3 --- tools/testing/selftests/net/udpgso_bench_rx.c | 3 --- tools/testing/selftests/net/udpgso_bench_tx.c | 3 --- tools/testing/selftests/perf_events/remove_on_exec.c | 2 -- tools/testing/selftests/perf_events/sigtrap_threads.c | 2 -- tools/testing/selftests/pid_namespace/regression_enomem.c | 1 - tools/testing/selftests/pidfd/pidfd.h | 1 - tools/testing/selftests/pidfd/pidfd_fdinfo_test.c | 2 -- tools/testing/selftests/pidfd/pidfd_getfd_test.c | 2 -- tools/testing/selftests/pidfd/pidfd_open_test.c | 2 -- tools/testing/selftests/pidfd/pidfd_poll_test.c | 2 -- tools/testing/selftests/pidfd/pidfd_setns_test.c | 2 -- tools/testing/selftests/pidfd/pidfd_test.c | 2 -- tools/testing/selftests/pidfd/pidfd_wait.c | 2 -- tools/testing/selftests/prctl/Makefile | 2 ++ tools/testing/selftests/proc/Makefile | 2 +- tools/testing/selftests/ptrace/get_set_sud.c | 1 - tools/testing/selftests/ptrace/peeksiginfo.c | 1 - tools/testing/selftests/resctrl/Makefile | 2 +- tools/testing/selftests/riscv/mm/Makefile | 2 +- tools/testing/selftests/rseq/basic_percpu_ops_test.c | 1 - tools/testing/selftests/rseq/basic_test.c | 2 -- tools/testing/selftests/rseq/param_test.c | 1 - tools/testing/selftests/rseq/rseq.c | 2 -- tools/testing/selftests/rtc/Makefile | 2 +- tools/testing/selftests/seccomp/seccomp_benchmark.c | 1 - tools/testing/selftests/seccomp/seccomp_bpf.c | 2 -- tools/testing/selftests/sgx/Makefile | 2 +- tools/testing/selftests/sgx/sigstruct.c | 1 - tools/testing/selftests/tmpfs/Makefile | 2 +- tools/testing/selftests/user_events/abi_test.c | 2 -- tools/testing/selftests/x86/amx.c | 2 -- tools/testing/selftests/x86/check_initial_reg_state.c | 3 --- tools/testing/selftests/x86/corrupt_xstate_header.c | 3 --- tools/testing/selftests/x86/entry_from_vm86.c | 3 --- tools/testing/selftests/x86/fsgsbase.c | 2 -- tools/testing/selftests/x86/fsgsbase_restore.c | 2 -- tools/testing/selftests/x86/ioperm.c | 2 -- tools/testing/selftests/x86/iopl.c | 2 -- tools/testing/selftests/x86/lam.c | 1 - tools/testing/selftests/x86/ldt_gdt.c | 2 -- tools/testing/selftests/x86/mov_ss_trap.c | 2 -- tools/testing/selftests/x86/nx_stack.c | 2 -- tools/testing/selftests/x86/ptrace_syscall.c | 2 -- tools/testing/selftests/x86/sigaltstack.c | 2 -- tools/testing/selftests/x86/sigreturn.c | 3 --- tools/testing/selftests/x86/single_step_syscall.c | 3 --- tools/testing/selftests/x86/syscall_arg_fault.c | 3 --- tools/testing/selftests/x86/syscall_numbering.c | 3 --- tools/testing/selftests/x86/sysret_rip.c | 3 --- tools/testing/selftests/x86/sysret_ss_attrs.c | 3 --- tools/testing/selftests/x86/test_FCMOV.c | 4 ---- tools/testing/selftests/x86/test_FCOMI.c | 4 ---- tools/testing/selftests/x86/test_FISTTP.c | 4 ---- tools/testing/selftests/x86/test_mremap_vdso.c | 1 - tools/testing/selftests/x86/test_shadow_stack.c | 3 --- tools/testing/selftests/x86/test_syscall_vdso.c | 4 ---- tools/testing/selftests/x86/test_vsyscall.c | 3 --- tools/testing/selftests/x86/unwind_vdso.c | 3 --- tools/testing/selftests/x86/vdso_restorer.c | 3 --- 218 files changed, 20 insertions(+), 426 deletions(-)
--
2.45.0.rc1.225.g2a3ae87e7f-goog
PATCH v2 1/5 selftests: Compile kselftest headers with -D_GNU_SOURCE
Add the -D_GNU_SOURCE flag to KHDR_INCLUDES so that it is defined in a central location.
809216233555 ("selftests/harness: remove use of LINE_MAX") introduced asprintf into kselftest_harness.h, which is a GNU extension and needs _GNU_SOURCE to either be defined prior to including headers or with the -D_GNU_SOURCE flag passed to the compiler.
--- tools/testing/selftests/Makefile | 4 ++-- tools/testing/selftests/kselftest_harness.h | 2 +- tools/testing/selftests/lib.mk | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-)
tools/testing/selftests/Makefile +2 -2
@@ -161,11 +161,11 @@ ifneq ($(KBUILD_OUTPUT),) # $(realpath ...) resolves symlinks abs_objtree := $(realpath $(abs_objtree)) BUILD := $(abs_objtree)/kselftest - KHDR_INCLUDES := -isystem ${abs_objtree}/usr/include + KHDR_INCLUDES := -D_GNU_SOURCE -isystem ${abs_objtree}/usr/include else BUILD := $(CURDIR) abs_srctree := $(shell cd $(top_srcdir) && pwd) - KHDR_INCLUDES := -isystem ${abs_srctree}/usr/include + KHDR_INCLUDES := -D_GNU_SOURCE -isystem ${abs_srctree}/usr/include DEFAULT_INSTALL_HDR_PATH := 1 endif
tools/testing/selftests/kselftest_harness.h +1 -1
@@ -51,7 +51,7 @@#define __KSELFTEST_HARNESS_H#ifndef _GNU_SOURCE -#define _GNU_SOURCE +static_assert (0 ,"kselftest harness requires _GNU_SOURCE to be defined" );#endif #include <asm/types.h> #include <ctype.h>
tools/testing/selftests/lib.mk +1 -1
@@ -45,7 +45,7 @@ selfdir = $(realpath $(dir $(filter %/lib.mk,$(MAKEFILE_LIST)))) top_srcdir = $(selfdir)/../../.. ifeq ($(KHDR_INCLUDES),) -KHDR_INCLUDES := -isystem $(top_srcdir)/usr/include +KHDR_INCLUDES := -D_GNU_SOURCE -isystem $(top_srcdir)/usr/include endif # The following are built by lib.mk common compile rules.
Signature · 1 line
2.45.0.rc1.225.g2a3ae87e7f-goog
Re: [PATCH v2 1/5] selftests: Compile kselftest headers with -D_GNU_SOURCE
Thanks for patches
Quoted 8 lines · Edward Liaw
Add the -D_GNU_SOURCE flag to
KHDR_INCLUDESso that it is defined in a central location.809216233555 ("selftests/harness: remove use of
LINE_MAX") introduced asprintf intokselftest_harness.h, which is a GNU extension and needs_GNU_SOURCEto either be defined prior to including headers or with the -D_GNU_SOURCE flag passed to the compiler.
Quoted 4 lines
Fixes 809216233555 ("selftests/harness: remove use of LINE_MAX")Reported-by kernel test robot <[email protected]>Closes https://lore.kernel.org/oe-lkp/202404301040.3bea5782-oliver.sang at intel.comSigned-off-by Edward Liaw <[email protected]>
Quoted 50 lines
--- tools/testing/selftests/Makefile | 4 ++-- tools/testing/selftests/kselftest_harness.h | 2 +- tools/testing/selftests/lib.mk | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-)tools/testing/selftests/Makefile +2
-2@@ -161,11 +161,11 @@ ifneq ($(KBUILD_OUTPUT),) # $(realpath ...) resolves symlinks abs_objtree := $(realpath $(abs_objtree)) BUILD := $(abs_objtree)/kselftest - KHDR_INCLUDES := -isystem ${abs_objtree}/usr/include + KHDR_INCLUDES := -D_GNU_SOURCE -isystem ${abs_objtree}/usr/include else BUILD := $(CURDIR) abs_srctree := $(shell cd $(top_srcdir) && pwd) - KHDR_INCLUDES := -isystem ${abs_srctree}/usr/include + KHDR_INCLUDES := -D_GNU_SOURCE -isystem ${abs_srctree}/usr/include DEFAULT_INSTALL_HDR_PATH := 1 endiftools/testing/selftests/kselftest_harness.h +1
-1@@ -51,7 +51,7 @@#define __KSELFTEST_HARNESS_H#ifndef _GNU_SOURCE -#define _GNU_SOURCE +static_assert (0 ,"kselftest harness requires _GNU_SOURCE to be defined" );#endif #include <asm/types.h> #include <ctype.h> tools/testing/selftests/lib.mk +1
-1@@ -45,7 +45,7 @@ selfdir = $(realpath $(dir $(filter %/lib.mk,$(MAKEFILE_LIST)))) top_srcdir = $(selfdir)/../../.. ifeq ($(KHDR_INCLUDES),) -KHDR_INCLUDES := -isystem $(top_srcdir)/usr/include +KHDR_INCLUDES := -D_GNU_SOURCE -isystem $(top_srcdir)/usr/include endif # The following are built by lib.mk common compile rules.
Signature · 2 lines
BR, Muhammad Usama Anjum
Re: [PATCH v2 1/5] selftests: Compile kselftest headers with -D_GNU_SOURCE
In reply to Edward LiawQuoted 7 lines · Edward Liaw
Add the -D_GNU_SOURCE flag to
KHDR_INCLUDESso that it is defined in a central location.809216233555 ("selftests/harness: remove use of
LINE_MAX") introduced asprintf intokselftest_harness.h, which is a GNU extension and needs_GNU_SOURCEto either be defined prior to including headers or with the -D_GNU_SOURCE flag passed to the compiler.
This does mean we define _GNU_SOURCE for nolibc (and I guess any other
libc people use like bionic) but hopefully nobody's using the same
define with a different meaning so should be fine.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/kvm-riscv/attachments/20240508/1fcf014f/attachment.sig>
Re: [PATCH v2 1/5] selftests: Compile kselftest headers with -D_GNU_SOURCE
In reply to Edward LiawQuoted 25 lines · Edward Liaw
Add the -D_GNU_SOURCE flag to
KHDR_INCLUDESso that it is defined in a central location.809216233555 ("selftests/harness: remove use of
LINE_MAX") introduced asprintf intokselftest_harness.h, which is a GNU extension and needs_GNU_SOURCEto either be defined prior to including headers or with the -D_GNU_SOURCE flag passed to the compiler.Fixes 809216233555 ("selftests/harness: remove use of LINE_MAX")Reported-by kernel test robot <[email protected]>Closes https://lore.kernel.org/oe-lkp/202404301040.3bea5782-oliver.sang at intel.comSigned-off-by Edward Liaw <[email protected]>--- tools/testing/selftests/Makefile | 4 ++-- tools/testing/selftests/kselftest_harness.h | 2 +- tools/testing/selftests/lib.mk | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-)tools/testing/selftests/Makefile +0
-0@@ -161,11 +161,11 @@ ifneq ($(KBUILD_OUTPUT),) # $(realpath ...) resolves symlinks abs_objtree := $(realpath $(abs_objtree))
tools/testing/selftests/Makefile ifneq ($(KBUILD_OUTPUT),) · line 170
Quoted 10 lines
tools/testing/selftests/Makefile +2
-2BUILD := $(abs_objtree)/kselftest - KHDR_INCLUDES := -isystem ${abs_objtree}/usr/include + KHDR_INCLUDES := -D_GNU_SOURCE -isystem ${abs_objtree}/usr/include else BUILD := $(CURDIR) abs_srctree := $(shell cd $(top_srcdir) && pwd) - KHDR_INCLUDES := -isystem ${abs_srctree}/usr/include + KHDR_INCLUDES := -D_GNU_SOURCE -isystem ${abs_srctree}/usr/include DEFAULT_INSTALL_HDR_PATH := 1 endif
Just a small copy-paste duplication request: can we maybe do it this way, instead, to remove the duplication? It's small *so far*, but still. :)
tools/testing/selftests/Makefile +4 -2
@@ -152,6 +152,8 @@ ifeq ("$(origin O)", "command line") KBUILD_OUTPUT := $(O) endif +KHDR_INCLUDES := -D_GNU_SOURCE + ifneq ($(KBUILD_OUTPUT),) # Make's built-in functions such as $(abspath ...), $(realpath ...) cannot # expand a shell special character '~'. We use a somewhat tedious way here.
@@ -161,11 +163,11 @@ ifneq ($(KBUILD_OUTPUT),) # $(realpath ...) resolves symlinks abs_objtree := $(realpath $(abs_objtree)) BUILD := $(abs_objtree)/kselftest - KHDR_INCLUDES := -isystem ${abs_objtree}/usr/include + KHDR_INCLUDES += -isystem ${abs_objtree}/usr/include else BUILD := $(CURDIR) abs_srctree := $(shell cd $(top_srcdir) && pwd) - KHDR_INCLUDES := -isystem ${abs_srctree}/usr/include + KHDR_INCLUDES += -isystem ${abs_srctree}/usr/include DEFAULT_INSTALL_HDR_PATH := 1 endif
Quoted 19 lines
tools/testing/selftests/kselftest_harness.h +1
-1@@ -51,7 +51,7 @@#define __KSELFTEST_HARNESS_H#ifndef _GNU_SOURCE -#define _GNU_SOURCE +static_assert (0 ,"kselftest harness requires _GNU_SOURCE to be defined" );#endif #include <asm/types.h> #include <ctype.h> tools/testing/selftests/lib.mk +0
-0
tools/testing/selftests/lib.mk selfdir = $(realpath $(dir $(filter %/lib.mk,$(MAKEFILE_LIST)))) · line 51
Quoted 8 lines
tools/testing/selftests/lib.mk +1
-1@@ -45,7 +45,7 @@ selfdir = $(realpath $(dir $(filter %/lib.mk,$(MAKEFILE_LIST)))) top_srcdir = $(selfdir)/../../.. ifeq ($(KHDR_INCLUDES),) -KHDR_INCLUDES := -isystem $(top_srcdir)/usr/include +KHDR_INCLUDES := -D_GNU_SOURCE -isystem $(top_srcdir)/usr/include endif # The following are built by lib.mk common compile rules.
The rest looks good. And whether you accept my recommendation above, or not, either way this patch looks good, so please feel free to add:
thanks,
Signature · 2 lines
John Hubbard NVIDIA
PATCH v2 2/5 selftests/sgx: Include KHDR_INCLUDES in Makefile
In reply to Edward LiawAdd KHDR_INCLUDES to the CFLAGS to pull in the kselftest harness dependencies (-D_GNU_SOURCE).
Also, remove redefinitions of _GNU_SOURCE in the source code.
--- tools/testing/selftests/sgx/Makefile | 2 +- tools/testing/selftests/sgx/sigstruct.c | 1 - 2 files changed, 1 insertion(+), 2 deletions(-)
tools/testing/selftests/sgx/Makefile +1 -1
@@ -12,7 +12,7 @@ OBJCOPY := $(CROSS_COMPILE)objcopy endif INCLUDES := -I$(top_srcdir)/tools/include -HOST_CFLAGS := -Wall -Werror -g $(INCLUDES) -fPIC +HOST_CFLAGS := -Wall -Werror $(KHDR_INCLUDES) -g $(INCLUDES) -fPIC HOST_LDFLAGS := -z noexecstack -lcrypto ENCL_CFLAGS += -Wall -Werror -static-pie -nostdlib -ffreestanding -fPIE \ -fno-stack-protector -mrdrnd $(INCLUDES)
tools/testing/selftests/sgx/sigstruct.c +0 -1
@@ -1,7 +1,6 @@// SPDX-License-Identifier: GPL-2.0 /* Copyright(c) 2016-20 Intel Corporation. */ -#define _GNU_SOURCE#include <assert.h> #include <getopt.h> #include <stdbool.h>
Signature · 1 line
2.45.0.rc1.225.g2a3ae87e7f-goog
Re: [PATCH v2 2/5] selftests/sgx: Include KHDR_INCLUDES in Makefile
Quoted 9 lines · Edward Liaw
Add
KHDR_INCLUDESto the CFLAGS to pull in the kselftest harness dependencies (-D_GNU_SOURCE).Also, remove redefinitions of
_GNU_SOURCEin the source code.Fixes 809216233555 ("selftests/harness: remove use of LINE_MAX")Reported-by kernel test robot <[email protected]>Closes https://lore.kernel.org/oe-lkp/202404301040.3bea5782-oliver.sang at intel.comSigned-off-by Edward Liaw <[email protected]>
Quoted 30 lines
--- tools/testing/selftests/sgx/Makefile | 2 +- tools/testing/selftests/sgx/sigstruct.c | 1 - 2 files changed, 1 insertion(+), 2 deletions(-)tools/testing/selftests/sgx/Makefile +1
-1@@ -12,7 +12,7 @@ OBJCOPY := $(CROSS_COMPILE)objcopy endif INCLUDES := -I$(top_srcdir)/tools/include -HOST_CFLAGS := -Wall -Werror -g $(INCLUDES) -fPIC +HOST_CFLAGS := -Wall -Werror $(KHDR_INCLUDES) -g $(INCLUDES) -fPIC HOST_LDFLAGS := -z noexecstack -lcrypto ENCL_CFLAGS += -Wall -Werror -static-pie -nostdlib -ffreestanding -fPIE \ -fno-stack-protector -mrdrnd $(INCLUDES)tools/testing/selftests/sgx/sigstruct.c +0
-1@@ -1,7 +1,6 @@// SPDX-License-Identifier: GPL-2.0 /* Copyright(c) 2016-20 Intel Corporation. */ -#define _GNU_SOURCE#include <assert.h> #include <getopt.h> #include <stdbool.h>
Signature · 2 lines
BR, Muhammad Usama Anjum
Re: [PATCH v2 2/5] selftests/sgx: Include KHDR_INCLUDES in Makefile
In reply to Edward LiawQuoted 4 lines · Edward Liaw
Add
KHDR_INCLUDESto the CFLAGS to pull in the kselftest harness dependencies (-D_GNU_SOURCE).Also, remove redefinitions of
_GNU_SOURCEin the source code.
From an x86 and SGX perspective, looks fine. I assume Shuah is planning on taking this pile.
Re: [PATCH v2 2/5] selftests/sgx: Include KHDR_INCLUDES in Makefile
Quoted 10 lines · Dave Hansen
Quoted 4 lines · Edward Liaw
Add
KHDR_INCLUDESto the CFLAGS to pull in the kselftest harness dependencies (-D_GNU_SOURCE).Also, remove redefinitions of
_GNU_SOURCEin the source code.From an x86 and SGX perspective, looks fine. I assume Shuah is planning on taking this pile.
Acked-by Dave Hansen <[email protected]>
Yep,
I also quickly tested with NUC7 for what it is worth:
BR, Jarkko
Re: [PATCH v2 2/5] selftests/sgx: Include KHDR_INCLUDES in Makefile
In reply to Edward LiawQuoted 5 lines · Edward Liaw
Add
KHDR_INCLUDESto the CFLAGS to pull in the kselftest harness dependencies (-D_GNU_SOURCE).Also, remove redefinitions of
_GNU_SOURCEin the source code.
Quoted 8 lines
Fixes 809216233555 ("selftests/harness: remove use of LINE_MAX")Reported-by kernel test robot <[email protected]>Closes https://lore.kernel.org/oe-lkp/202404301040.3bea5782-oliver.sang at intel.comSigned-off-by Edward Liaw <[email protected]>--- tools/testing/selftests/sgx/Makefile | 2 +- tools/testing/selftests/sgx/sigstruct.c | 1 - 2 files changed, 1 insertion(+), 2 deletions(-)
Looks good, and also still works with a clang/LLVM build (that is, with the whole series applied.
thanks,
Signature · 2 lines
John Hubbard NVIDIA
Quoted 26 lines
tools/testing/selftests/sgx/Makefile +1
-1@@ -12,7 +12,7 @@ OBJCOPY := $(CROSS_COMPILE)objcopy endif INCLUDES := -I$(top_srcdir)/tools/include -HOST_CFLAGS := -Wall -Werror -g $(INCLUDES) -fPIC +HOST_CFLAGS := -Wall -Werror $(KHDR_INCLUDES) -g $(INCLUDES) -fPIC HOST_LDFLAGS := -z noexecstack -lcrypto ENCL_CFLAGS += -Wall -Werror -static-pie -nostdlib -ffreestanding -fPIE \ -fno-stack-protector -mrdrnd $(INCLUDES)tools/testing/selftests/sgx/sigstruct.c +0
-1@@ -1,7 +1,6 @@// SPDX-License-Identifier: GPL-2.0 /* Copyright(c) 2016-20 Intel Corporation. */ -#define _GNU_SOURCE#include <assert.h> #include <getopt.h> #include <stdbool.h>
PATCH v2 3/5 selftests: Include KHDR_INCLUDES in Makefile
In reply to Edward LiawAdd KHDR_INCLUDES to CFLAGS to pull in the kselftest harness dependencies (-D_GNU_SOURCE).
--- tools/testing/selftests/alsa/Makefile | 2 +- tools/testing/selftests/arm64/signal/Makefile | 2 +- tools/testing/selftests/exec/Makefile | 2 +- tools/testing/selftests/filesystems/overlayfs/Makefile | 2 +- tools/testing/selftests/hid/Makefile | 2 +- tools/testing/selftests/nci/Makefile | 2 +- tools/testing/selftests/prctl/Makefile | 2 ++ tools/testing/selftests/proc/Makefile | 2 +- tools/testing/selftests/riscv/mm/Makefile | 2 +- tools/testing/selftests/rtc/Makefile | 2 +- tools/testing/selftests/tmpfs/Makefile | 2 +- 11 files changed, 12 insertions(+), 10 deletions(-)
tools/testing/selftests/alsa/Makefile +1 -1
@@ -6,7 +6,7 @@ LDLIBS += $(shell pkg-config --libs alsa) ifeq ($(LDLIBS),) LDLIBS += -lasound endif -CFLAGS += -L$(OUTPUT) -Wl,-rpath=./ +CFLAGS += $(KHDR_INCLUDES) -L$(OUTPUT) -Wl,-rpath=./ LDLIBS+=-lpthread
tools/testing/selftests/arm64/signal/Makefile +1 -1
@@ -2,7 +2,7 @@ # Copyright (C) 2019 ARM Limited # Additional include paths needed by kselftest.h and local headers -CFLAGS += -D_GNU_SOURCE -std=gnu99 -I. +CFLAGS += $(KHDR_INCLUDES) -std=gnu99 -I. SRCS := $(filter-out testcases/testcases.c,$(wildcard testcases/*.c)) PROGS := $(patsubst %.c,%,$(SRCS))
tools/testing/selftests/exec/Makefile +1 -1
@@ -1,7 +1,7 @@ # SPDX-License-Identifier: GPL-2.0 CFLAGS = -Wall CFLAGS += -Wno-nonnull -CFLAGS += -D_GNU_SOURCE +CFLAGS += $(KHDR_INCLUDES) TEST_PROGS := binfmt_script.py TEST_GEN_PROGS := execveat load_address_4096 load_address_2097152 load_address_16777216 non-regular
tools/testing/selftests/filesystems/overlayfs/Makefile +1 -1
@@ -2,6 +2,6 @@ TEST_GEN_PROGS := dev_in_maps -CFLAGS := -Wall -Werror +CFLAGS := -Wall -Werror $(KHDR_INCLUDES) include ../../lib.mk
tools/testing/selftests/hid/Makefile +1 -1
@@ -21,7 +21,7 @@ CXX ?= $(CROSS_COMPILE)g++ HOSTPKG_CONFIG := pkg-config -CFLAGS += -g -O0 -rdynamic -Wall -Werror -I$(OUTPUT) +CFLAGS += -g -O0 -rdynamic -Wall -Werror $(KHDR_INCLUDES) -I$(OUTPUT) CFLAGS += -I$(OUTPUT)/tools/include LDLIBS += -lelf -lz -lrt -lpthread
tools/testing/selftests/nci/Makefile +1 -1
@@ -1,5 +1,5 @@ # SPDX-License-Identifier: GPL-2.0 -CFLAGS += -Wl,-no-as-needed -Wall +CFLAGS += -Wl,-no-as-needed -Wall $(KHDR_INCLUDES) LDFLAGS += -lpthread TEST_GEN_PROGS := nci_dev
tools/testing/selftests/prctl/Makefile +2 -0
@@ -6,6 +6,8 @@ ARCH ?= $(shell echo $(uname_M) | sed -e s/i.86/x86/ -e s/x86_64/x86/) ifeq ($(ARCH),x86) TEST_PROGS := disable-tsc-ctxt-sw-stress-test disable-tsc-on-off-stress-test \ disable-tsc-test set-anon-vma-name-test set-process-name + +CFLAGS += $(KHDR_INCLUDES) all: $(TEST_PROGS) include ../lib.mk
tools/testing/selftests/proc/Makefile +1 -1
@@ -1,6 +1,6 @@ # SPDX-License-Identifier: GPL-2.0-only CFLAGS += -Wall -O2 -Wno-unused-function -CFLAGS += -D_GNU_SOURCE +CFLAGS += $(KHDR_INCLUDES) LDFLAGS += -pthread TEST_GEN_PROGS :=
tools/testing/selftests/riscv/mm/Makefile +1 -1
@@ -3,7 +3,7 @@ # Originally tools/testing/arm64/abi/Makefile # Additional include paths needed by kselftest.h and local headers -CFLAGS += -D_GNU_SOURCE -std=gnu99 -I. +CFLAGS += $(KHDR_INCLUDES) -std=gnu99 -I. TEST_GEN_FILES := mmap_default mmap_bottomup
tools/testing/selftests/rtc/Makefile +1 -1
@@ -1,5 +1,5 @@ # SPDX-License-Identifier: GPL-2.0 -CFLAGS += -O3 -Wl,-no-as-needed -Wall +CFLAGS += -O3 -Wl,-no-as-needed -Wall $(KHDR_INCLUDES) LDLIBS += -lrt -lpthread -lm TEST_GEN_PROGS = rtctest
tools/testing/selftests/tmpfs/Makefile +1 -1
@@ -1,6 +1,6 @@ # SPDX-License-Identifier: GPL-2.0-only CFLAGS += -Wall -O2 -CFLAGS += -D_GNU_SOURCE +CFLAGS += $(KHDR_INCLUDES) TEST_GEN_PROGS := TEST_GEN_PROGS += bug-link-o-tmpfile
Signature · 1 line
2.45.0.rc1.225.g2a3ae87e7f-goog
Re: [PATCH v2 3/5] selftests: Include KHDR_INCLUDES in Makefile
Quoted 5 lines · Edward Liaw
Add
KHDR_INCLUDESto CFLAGS to pull in the kselftest harness dependencies (-D_GNU_SOURCE).Fixes 809216233555 ("selftests/harness: remove use of LINE_MAX")Signed-off-by Edward Liaw <[email protected]>
Oops, this is not for this patch but for SGX. Pressed D by mistake in aerch, so for SGX one:
BR, Jarkko
Re: [PATCH v2 3/5] selftests: Include KHDR_INCLUDES in Makefile
In reply to Edward LiawQuoted 5 lines · Edward Liaw
Add
KHDR_INCLUDESto CFLAGS to pull in the kselftest harness dependencies (-D_GNU_SOURCE).Fixes 809216233555 ("selftests/harness: remove use of LINE_MAX")Signed-off-by Edward Liaw <[email protected]>
Quoted 150 lines
--- tools/testing/selftests/alsa/Makefile | 2 +- tools/testing/selftests/arm64/signal/Makefile | 2 +- tools/testing/selftests/exec/Makefile | 2 +- tools/testing/selftests/filesystems/overlayfs/Makefile | 2 +- tools/testing/selftests/hid/Makefile | 2 +- tools/testing/selftests/nci/Makefile | 2 +- tools/testing/selftests/prctl/Makefile | 2 ++ tools/testing/selftests/proc/Makefile | 2 +- tools/testing/selftests/riscv/mm/Makefile | 2 +- tools/testing/selftests/rtc/Makefile | 2 +- tools/testing/selftests/tmpfs/Makefile | 2 +- 11 files changed, 12 insertions(+), 10 deletions(-)tools/testing/selftests/alsa/Makefile +1
-1@@ -6,7 +6,7 @@ LDLIBS += $(shell pkg-config --libs alsa) ifeq ($(LDLIBS),) LDLIBS += -lasound endif -CFLAGS += -L$(OUTPUT) -Wl,-rpath=./ +CFLAGS += $(KHDR_INCLUDES) -L$(OUTPUT) -Wl,-rpath=./ LDLIBS+=-lpthreadtools/testing/selftests/arm64/signal/Makefile +1
-1@@ -2,7 +2,7 @@ # Copyright (C) 2019 ARM Limited # Additional include paths needed by kselftest.h and local headers -CFLAGS += -D_GNU_SOURCE -std=gnu99 -I. +CFLAGS += $(KHDR_INCLUDES) -std=gnu99 -I. SRCS := $(filter-out testcases/testcases.c,$(wildcard testcases/*.c)) PROGS := $(patsubst %.c,%,$(SRCS))tools/testing/selftests/exec/Makefile +1
-1@@ -1,7 +1,7 @@ # SPDX-License-Identifier: GPL-2.0 CFLAGS = -Wall CFLAGS += -Wno-nonnull -CFLAGS += -D_GNU_SOURCE +CFLAGS += $(KHDR_INCLUDES) TEST_PROGS := binfmt_script.py TEST_GEN_PROGS := execveat load_address_4096 load_address_2097152 load_address_16777216 non-regulartools/testing/selftests/filesystems/overlayfs/Makefile +1
-1@@ -2,6 +2,6 @@ TEST_GEN_PROGS := dev_in_maps -CFLAGS := -Wall -Werror +CFLAGS := -Wall -Werror $(KHDR_INCLUDES) include ../../lib.mktools/testing/selftests/hid/Makefile +1
-1@@ -21,7 +21,7 @@ CXX ?= $(CROSS_COMPILE)g++ HOSTPKG_CONFIG := pkg-config -CFLAGS += -g -O0 -rdynamic -Wall -Werror -I$(OUTPUT) +CFLAGS += -g -O0 -rdynamic -Wall -Werror $(KHDR_INCLUDES) -I$(OUTPUT) CFLAGS += -I$(OUTPUT)/tools/include LDLIBS += -lelf -lz -lrt -lpthreadtools/testing/selftests/nci/Makefile +1
-1@@ -1,5 +1,5 @@ # SPDX-License-Identifier: GPL-2.0 -CFLAGS += -Wl,-no-as-needed -Wall +CFLAGS += -Wl,-no-as-needed -Wall $(KHDR_INCLUDES) LDFLAGS += -lpthread TEST_GEN_PROGS := nci_devtools/testing/selftests/prctl/Makefile +2
-0@@ -6,6 +6,8 @@ ARCH ?= $(shell echo $(uname_M) | sed -e s/i.86/x86/ -e s/x86_64/x86/) ifeq ($(ARCH),x86) TEST_PROGS := disable-tsc-ctxt-sw-stress-test disable-tsc-on-off-stress-test \ disable-tsc-test set-anon-vma-name-test set-process-name + +CFLAGS += $(KHDR_INCLUDES) all: $(TEST_PROGS) include ../lib.mktools/testing/selftests/proc/Makefile +1
-1@@ -1,6 +1,6 @@ # SPDX-License-Identifier: GPL-2.0-only CFLAGS += -Wall -O2 -Wno-unused-function -CFLAGS += -D_GNU_SOURCE +CFLAGS += $(KHDR_INCLUDES) LDFLAGS += -pthread TEST_GEN_PROGS :=tools/testing/selftests/riscv/mm/Makefile +1
-1@@ -3,7 +3,7 @@ # Originally tools/testing/arm64/abi/Makefile # Additional include paths needed by kselftest.h and local headers -CFLAGS += -D_GNU_SOURCE -std=gnu99 -I. +CFLAGS += $(KHDR_INCLUDES) -std=gnu99 -I. TEST_GEN_FILES := mmap_default mmap_bottomuptools/testing/selftests/rtc/Makefile +1
-1@@ -1,5 +1,5 @@ # SPDX-License-Identifier: GPL-2.0 -CFLAGS += -O3 -Wl,-no-as-needed -Wall +CFLAGS += -O3 -Wl,-no-as-needed -Wall $(KHDR_INCLUDES) LDLIBS += -lrt -lpthread -lm TEST_GEN_PROGS = rtctesttools/testing/selftests/tmpfs/Makefile +1
-1@@ -1,6 +1,6 @@ # SPDX-License-Identifier: GPL-2.0-only CFLAGS += -Wall -O2 -CFLAGS += -D_GNU_SOURCE +CFLAGS += $(KHDR_INCLUDES) TEST_GEN_PROGS := TEST_GEN_PROGS += bug-link-o-tmpfile
Signature · 2 lines
BR, Muhammad Usama Anjum
John Hubbard
reviewerRe: [PATCH v2 3/5] selftests: Include KHDR_INCLUDES in Makefile
In reply to Edward LiawQuoted 5 lines · Edward Liaw
Add
KHDR_INCLUDESto CFLAGS to pull in the kselftest harness dependencies (-D_GNU_SOURCE).Fixes 809216233555 ("selftests/harness: remove use of LINE_MAX")Signed-off-by Edward Liaw <[email protected]>
Quoted 13 lines
--- tools/testing/selftests/alsa/Makefile | 2 +- tools/testing/selftests/arm64/signal/Makefile | 2 +- tools/testing/selftests/exec/Makefile | 2 +- tools/testing/selftests/filesystems/overlayfs/Makefile | 2 +- tools/testing/selftests/hid/Makefile | 2 +- tools/testing/selftests/nci/Makefile | 2 +- tools/testing/selftests/prctl/Makefile | 2 ++ tools/testing/selftests/proc/Makefile | 2 +- tools/testing/selftests/riscv/mm/Makefile | 2 +- tools/testing/selftests/rtc/Makefile | 2 +- tools/testing/selftests/tmpfs/Makefile | 2 +- 11 files changed, 12 insertions(+), 10 deletions(-)
Hi Edward,
Seeing as how these all include lib.mk, and all use CFLAGS, is there any reason not to simply fix this in lib.mk instead? Like this:
tools/testing/selftests/lib.mk +2 -0
@@ -170,6 +170,8 @@ clean: $(if $(TEST_GEN_MODS_DIR),clean_mods_dir) CFLAGS += $(USERCFLAGS) LDFLAGS += $(USERLDFLAGS) +CFLAGS += $(KHDR_INCLUDES) + # When make O= with kselftest target from main level # the following aren't defined. #
thanks,
Signature · 2 lines
John Hubbard NVIDIA
Quoted 137 lines
tools/testing/selftests/alsa/Makefile +1
-1@@ -6,7 +6,7 @@ LDLIBS += $(shell pkg-config --libs alsa) ifeq ($(LDLIBS),) LDLIBS += -lasound endif -CFLAGS += -L$(OUTPUT) -Wl,-rpath=./ +CFLAGS += $(KHDR_INCLUDES) -L$(OUTPUT) -Wl,-rpath=./ LDLIBS+=-lpthreadtools/testing/selftests/arm64/signal/Makefile +1
-1@@ -2,7 +2,7 @@ # Copyright (C) 2019 ARM Limited # Additional include paths needed by kselftest.h and local headers -CFLAGS += -D_GNU_SOURCE -std=gnu99 -I. +CFLAGS += $(KHDR_INCLUDES) -std=gnu99 -I. SRCS := $(filter-out testcases/testcases.c,$(wildcard testcases/*.c)) PROGS := $(patsubst %.c,%,$(SRCS))tools/testing/selftests/exec/Makefile +1
-1@@ -1,7 +1,7 @@ # SPDX-License-Identifier: GPL-2.0 CFLAGS = -Wall CFLAGS += -Wno-nonnull -CFLAGS += -D_GNU_SOURCE +CFLAGS += $(KHDR_INCLUDES) TEST_PROGS := binfmt_script.py TEST_GEN_PROGS := execveat load_address_4096 load_address_2097152 load_address_16777216 non-regulartools/testing/selftests/filesystems/overlayfs/Makefile +1
-1@@ -2,6 +2,6 @@ TEST_GEN_PROGS := dev_in_maps -CFLAGS := -Wall -Werror +CFLAGS := -Wall -Werror $(KHDR_INCLUDES) include ../../lib.mktools/testing/selftests/hid/Makefile +1
-1@@ -21,7 +21,7 @@ CXX ?= $(CROSS_COMPILE)g++ HOSTPKG_CONFIG := pkg-config -CFLAGS += -g -O0 -rdynamic -Wall -Werror -I$(OUTPUT) +CFLAGS += -g -O0 -rdynamic -Wall -Werror $(KHDR_INCLUDES) -I$(OUTPUT) CFLAGS += -I$(OUTPUT)/tools/include LDLIBS += -lelf -lz -lrt -lpthreadtools/testing/selftests/nci/Makefile +1
-1@@ -1,5 +1,5 @@ # SPDX-License-Identifier: GPL-2.0 -CFLAGS += -Wl,-no-as-needed -Wall +CFLAGS += -Wl,-no-as-needed -Wall $(KHDR_INCLUDES) LDFLAGS += -lpthread TEST_GEN_PROGS := nci_devtools/testing/selftests/prctl/Makefile +2
-0@@ -6,6 +6,8 @@ ARCH ?= $(shell echo $(uname_M) | sed -e s/i.86/x86/ -e s/x86_64/x86/) ifeq ($(ARCH),x86) TEST_PROGS := disable-tsc-ctxt-sw-stress-test disable-tsc-on-off-stress-test \ disable-tsc-test set-anon-vma-name-test set-process-name + +CFLAGS += $(KHDR_INCLUDES) all: $(TEST_PROGS) include ../lib.mktools/testing/selftests/proc/Makefile +1
-1@@ -1,6 +1,6 @@ # SPDX-License-Identifier: GPL-2.0-only CFLAGS += -Wall -O2 -Wno-unused-function -CFLAGS += -D_GNU_SOURCE +CFLAGS += $(KHDR_INCLUDES) LDFLAGS += -pthread TEST_GEN_PROGS :=tools/testing/selftests/riscv/mm/Makefile +1
-1@@ -3,7 +3,7 @@ # Originally tools/testing/arm64/abi/Makefile # Additional include paths needed by kselftest.h and local headers -CFLAGS += -D_GNU_SOURCE -std=gnu99 -I. +CFLAGS += $(KHDR_INCLUDES) -std=gnu99 -I. TEST_GEN_FILES := mmap_default mmap_bottomuptools/testing/selftests/rtc/Makefile +1
-1@@ -1,5 +1,5 @@ # SPDX-License-Identifier: GPL-2.0 -CFLAGS += -O3 -Wl,-no-as-needed -Wall +CFLAGS += -O3 -Wl,-no-as-needed -Wall $(KHDR_INCLUDES) LDLIBS += -lrt -lpthread -lm TEST_GEN_PROGS = rtctesttools/testing/selftests/tmpfs/Makefile +1
-1@@ -1,6 +1,6 @@ # SPDX-License-Identifier: GPL-2.0-only CFLAGS += -Wall -O2 -CFLAGS += -D_GNU_SOURCE +CFLAGS += $(KHDR_INCLUDES) TEST_GEN_PROGS := TEST_GEN_PROGS += bug-link-o-tmpfile
Re: [PATCH v2 3/5] selftests: Include KHDR_INCLUDES in Makefile
Quoted 32 lines · On Wed, May 8, 2024 at 2:41?PM John Hubbard <[email protected]> wrote:
Quoted 5 lines · Edward Liaw
Add
KHDR_INCLUDESto CFLAGS to pull in the kselftest harness dependencies (-D_GNU_SOURCE).Fixes 809216233555 ("selftests/harness: remove use of LINE_MAX")Signed-off-by Edward Liaw <[email protected]>Quoted 13 lines
--- tools/testing/selftests/alsa/Makefile | 2 +- tools/testing/selftests/arm64/signal/Makefile | 2 +- tools/testing/selftests/exec/Makefile | 2 +- tools/testing/selftests/filesystems/overlayfs/Makefile | 2 +- tools/testing/selftests/hid/Makefile | 2 +- tools/testing/selftests/nci/Makefile | 2 +- tools/testing/selftests/prctl/Makefile | 2 ++ tools/testing/selftests/proc/Makefile | 2 +- tools/testing/selftests/riscv/mm/Makefile | 2 +- tools/testing/selftests/rtc/Makefile | 2 +- tools/testing/selftests/tmpfs/Makefile | 2 +- 11 files changed, 12 insertions(+), 10 deletions(-)Hi Edward,
Seeing as how these all include lib.mk, and all use CFLAGS, is there any reason not to simply fix this in lib.mk instead? Like this:
tools/testing/selftests/lib.mk +0
-0
tools/testing/selftests/lib.mk clean: $(if $(TEST_GEN_MODS_DIR),clean_mods_dir) · line 177
Quoted 8 lines
tools/testing/selftests/lib.mk +2
-0@@ -170,6 +170,8 @@ clean: $(if $(TEST_GEN_MODS_DIR),clean_mods_dir) CFLAGS += $(USERCFLAGS) LDFLAGS += $(USERLDFLAGS) +CFLAGS += $(KHDR_INCLUDES) + # When make O= with kselftest target from main level # the following aren't defined. #
Or how about just adding -D_GNU_SOURCE to CFLAGS then?
Quoted 145 lines
thanks,
--
John Hubbard
NVIDIAQuoted 137 lines
tools/testing/selftests/alsa/Makefile +1
-1@@ -6,7 +6,7 @@ LDLIBS += $(shell pkg-config --libs alsa) ifeq ($(LDLIBS),) LDLIBS += -lasound endif -CFLAGS += -L$(OUTPUT) -Wl,-rpath=./ +CFLAGS += $(KHDR_INCLUDES) -L$(OUTPUT) -Wl,-rpath=./ LDLIBS+=-lpthreadtools/testing/selftests/arm64/signal/Makefile +1
-1@@ -2,7 +2,7 @@ # Copyright (C) 2019 ARM Limited # Additional include paths needed by kselftest.h and local headers -CFLAGS += -D_GNU_SOURCE -std=gnu99 -I. +CFLAGS += $(KHDR_INCLUDES) -std=gnu99 -I. SRCS := $(filter-out testcases/testcases.c,$(wildcard testcases/*.c)) PROGS := $(patsubst %.c,%,$(SRCS))tools/testing/selftests/exec/Makefile +1
-1@@ -1,7 +1,7 @@ # SPDX-License-Identifier: GPL-2.0 CFLAGS = -Wall CFLAGS += -Wno-nonnull -CFLAGS += -D_GNU_SOURCE +CFLAGS += $(KHDR_INCLUDES) TEST_PROGS := binfmt_script.py TEST_GEN_PROGS := execveat load_address_4096 load_address_2097152 load_address_16777216 non-regulartools/testing/selftests/filesystems/overlayfs/Makefile +1
-1@@ -2,6 +2,6 @@ TEST_GEN_PROGS := dev_in_maps -CFLAGS := -Wall -Werror +CFLAGS := -Wall -Werror $(KHDR_INCLUDES) include ../../lib.mktools/testing/selftests/hid/Makefile +1
-1@@ -21,7 +21,7 @@ CXX ?= $(CROSS_COMPILE)g++ HOSTPKG_CONFIG := pkg-config -CFLAGS += -g -O0 -rdynamic -Wall -Werror -I$(OUTPUT) +CFLAGS += -g -O0 -rdynamic -Wall -Werror $(KHDR_INCLUDES) -I$(OUTPUT) CFLAGS += -I$(OUTPUT)/tools/include LDLIBS += -lelf -lz -lrt -lpthreadtools/testing/selftests/nci/Makefile +1
-1@@ -1,5 +1,5 @@ # SPDX-License-Identifier: GPL-2.0 -CFLAGS += -Wl,-no-as-needed -Wall +CFLAGS += -Wl,-no-as-needed -Wall $(KHDR_INCLUDES) LDFLAGS += -lpthread TEST_GEN_PROGS := nci_devtools/testing/selftests/prctl/Makefile +2
-0@@ -6,6 +6,8 @@ ARCH ?= $(shell echo $(uname_M) | sed -e s/i.86/x86/ -e s/x86_64/x86/) ifeq ($(ARCH),x86) TEST_PROGS := disable-tsc-ctxt-sw-stress-test disable-tsc-on-off-stress-test \ disable-tsc-test set-anon-vma-name-test set-process-name + +CFLAGS += $(KHDR_INCLUDES) all: $(TEST_PROGS) include ../lib.mktools/testing/selftests/proc/Makefile +1
-1@@ -1,6 +1,6 @@ # SPDX-License-Identifier: GPL-2.0-only CFLAGS += -Wall -O2 -Wno-unused-function -CFLAGS += -D_GNU_SOURCE +CFLAGS += $(KHDR_INCLUDES) LDFLAGS += -pthread TEST_GEN_PROGS :=tools/testing/selftests/riscv/mm/Makefile +1
-1@@ -3,7 +3,7 @@ # Originally tools/testing/arm64/abi/Makefile # Additional include paths needed by kselftest.h and local headers -CFLAGS += -D_GNU_SOURCE -std=gnu99 -I. +CFLAGS += $(KHDR_INCLUDES) -std=gnu99 -I. TEST_GEN_FILES := mmap_default mmap_bottomuptools/testing/selftests/rtc/Makefile +1
-1@@ -1,5 +1,5 @@ # SPDX-License-Identifier: GPL-2.0 -CFLAGS += -O3 -Wl,-no-as-needed -Wall +CFLAGS += -O3 -Wl,-no-as-needed -Wall $(KHDR_INCLUDES) LDLIBS += -lrt -lpthread -lm TEST_GEN_PROGS = rtctesttools/testing/selftests/tmpfs/Makefile +1
-1@@ -1,6 +1,6 @@ # SPDX-License-Identifier: GPL-2.0-only CFLAGS += -Wall -O2 -CFLAGS += -D_GNU_SOURCE +CFLAGS += $(KHDR_INCLUDES) TEST_GEN_PROGS := TEST_GEN_PROGS += bug-link-o-tmpfile
John Hubbard
reviewerRe: [PATCH v2 3/5] selftests: Include KHDR_INCLUDES in Makefile
Quoted 2 lines · Edward Liaw
Quoted 1 line · On Wed, May 8, 2024 at 2:41?PM John Hubbard <[email protected]> wrote:
On 5/7/24 2:38 PM, Edward Liaw wrote:
...
Quoted 11 lines
Quoted 11 lines
Seeing as how these all include lib.mk, and all use CFLAGS, is there any reason not to simply fix this in lib.mk instead? Like this:
tools/testing/selftests/lib.mk +0
-0@@ -170,6 +170,8 @@ clean: $(if $(TEST_GEN_MODS_DIR),clean_mods_dir) CFLAGS += $(USERCFLAGS) LDFLAGS += $(USERLDFLAGS)
Quoted 8 lines
tools/testing/selftests/lib.mk clean: $(if $(TEST_GEN_MODS_DIR),clean_mods_dir) · line 177
Quoted 6 lines
tools/testing/selftests/lib.mk +2
-0+CFLAGS += $(KHDR_INCLUDES) + # When make O= with kselftest target from main level # the following aren't defined. #Or how about just adding -D_GNU_SOURCE to CFLAGS then?
Yes, that would also work. I think either one would be good.
thanks,
Signature · 2 lines
John Hubbard NVIDIA
Mark Brown
maintainerRe: [PATCH v2 3/5] selftests: Include KHDR_INCLUDES in Makefile
In reply to Edward LiawQuoted 1 line · Edward Liaw
tools/testing/selftests/arm64/signal/Makefile | 2 +-
This is not really using any of the kselftest framework at all to build
so I'm not sure the change makes sense for it. OTOH it does no harm... -------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/kvm-riscv/attachments/20240509/8584a92d/attachment.sig>
PATCH v2 4/5 selftests: Drop define _GNU_SOURCE
In reply to Edward Liaw_GNU_SOURCE is provided by KHDR_INCLUDES, so it should be dropped to prevent _GNU_SOURCE redefined warnings.
--- tools/testing/selftests/cachestat/test_cachestat.c | 2 -- tools/testing/selftests/capabilities/test_execve.c | 2 -- tools/testing/selftests/clone3/clone3.c | 2 -- .../testing/selftests/clone3/clone3_cap_checkpoint_restore.c | 2 -- tools/testing/selftests/clone3/clone3_clear_sighand.c | 2 -- tools/testing/selftests/clone3/clone3_selftests.h | 1 - tools/testing/selftests/clone3/clone3_set_tid.c | 2 -- tools/testing/selftests/core/close_range_test.c | 2 -- tools/testing/selftests/drivers/dma-buf/udmabuf.c | 1 - tools/testing/selftests/fchmodat2/fchmodat2_test.c | 2 -- tools/testing/selftests/filesystems/binderfs/binderfs_test.c | 2 -- tools/testing/selftests/filesystems/devpts_pts.c | 1 - tools/testing/selftests/filesystems/dnotify_test.c | 1 - tools/testing/selftests/filesystems/epoll/epoll_wakeup_test.c | 2 -- tools/testing/selftests/filesystems/eventfd/eventfd_test.c | 2 -- tools/testing/selftests/filesystems/fat/rename_exchange.c | 2 -- tools/testing/selftests/filesystems/overlayfs/dev_in_maps.c | 2 -- .../testing/selftests/filesystems/statmount/statmount_test.c | 3 --- tools/testing/selftests/futex/functional/futex_requeue_pi.c | 3 --- tools/testing/selftests/ipc/msgque.c | 1 - tools/testing/selftests/kcmp/kcmp_test.c | 2 -- tools/testing/selftests/kvm/aarch64/arch_timer.c | 2 -- tools/testing/selftests/kvm/aarch64/page_fault_test.c | 1 - tools/testing/selftests/kvm/aarch64/psci_test.c | 3 --- tools/testing/selftests/kvm/aarch64/vgic_init.c | 1 - tools/testing/selftests/kvm/arch_timer.c | 3 --- tools/testing/selftests/kvm/demand_paging_test.c | 3 --- tools/testing/selftests/kvm/dirty_log_test.c | 3 --- tools/testing/selftests/kvm/guest_memfd_test.c | 2 -- tools/testing/selftests/kvm/hardware_disable_test.c | 3 --- tools/testing/selftests/kvm/include/userfaultfd_util.h | 3 --- tools/testing/selftests/kvm/kvm_binary_stats_test.c | 2 -- tools/testing/selftests/kvm/kvm_create_max_vcpus.c | 2 -- tools/testing/selftests/kvm/kvm_page_table_test.c | 3 --- tools/testing/selftests/kvm/lib/assert.c | 3 --- tools/testing/selftests/kvm/lib/kvm_util.c | 2 -- tools/testing/selftests/kvm/lib/memstress.c | 2 -- tools/testing/selftests/kvm/lib/test_util.c | 2 -- tools/testing/selftests/kvm/lib/userfaultfd_util.c | 3 --- tools/testing/selftests/kvm/lib/x86_64/sev.c | 1 - tools/testing/selftests/kvm/max_guest_memory_test.c | 2 -- .../testing/selftests/kvm/memslot_modification_stress_test.c | 3 --- tools/testing/selftests/kvm/riscv/arch_timer.c | 3 --- tools/testing/selftests/kvm/rseq_test.c | 1 - tools/testing/selftests/kvm/s390x/cmma_test.c | 2 -- tools/testing/selftests/kvm/s390x/sync_regs_test.c | 2 -- tools/testing/selftests/kvm/set_memory_region_test.c | 1 - tools/testing/selftests/kvm/steal_time.c | 1 - tools/testing/selftests/kvm/x86_64/amx_test.c | 2 -- .../selftests/kvm/x86_64/exit_on_emulation_failure_test.c | 3 --- tools/testing/selftests/kvm/x86_64/hwcr_msr_test.c | 2 -- tools/testing/selftests/kvm/x86_64/hyperv_cpuid.c | 2 -- tools/testing/selftests/kvm/x86_64/hyperv_evmcs.c | 1 - tools/testing/selftests/kvm/x86_64/hyperv_ipi.c | 2 -- tools/testing/selftests/kvm/x86_64/hyperv_svm_test.c | 1 - tools/testing/selftests/kvm/x86_64/hyperv_tlb_flush.c | 2 -- tools/testing/selftests/kvm/x86_64/nested_exceptions_test.c | 2 -- tools/testing/selftests/kvm/x86_64/nx_huge_pages_test.c | 3 --- tools/testing/selftests/kvm/x86_64/platform_info_test.c | 2 -- tools/testing/selftests/kvm/x86_64/pmu_counters_test.c | 2 -- tools/testing/selftests/kvm/x86_64/pmu_event_filter_test.c | 3 --- .../selftests/kvm/x86_64/private_mem_conversions_test.c | 1 - tools/testing/selftests/kvm/x86_64/set_boot_cpu_id.c | 1 - tools/testing/selftests/kvm/x86_64/set_sregs_test.c | 1 - .../selftests/kvm/x86_64/smaller_maxphyaddr_emulation_test.c | 3 --- tools/testing/selftests/kvm/x86_64/smm_test.c | 1 - tools/testing/selftests/kvm/x86_64/state_test.c | 1 - tools/testing/selftests/kvm/x86_64/sync_regs_test.c | 2 -- tools/testing/selftests/kvm/x86_64/ucna_injection_test.c | 2 -- tools/testing/selftests/kvm/x86_64/userspace_msr_exit_test.c | 2 -- tools/testing/selftests/kvm/x86_64/vmx_dirty_log_test.c | 3 --- tools/testing/selftests/kvm/x86_64/vmx_pmu_caps_test.c | 1 - .../testing/selftests/kvm/x86_64/vmx_preemption_timer_test.c | 1 - tools/testing/selftests/kvm/x86_64/xapic_ipi_test.c | 2 -- tools/testing/selftests/kvm/x86_64/xapic_state_test.c | 1 - tools/testing/selftests/kvm/x86_64/xss_msr_test.c | 2 -- tools/testing/selftests/landlock/base_test.c | 2 -- tools/testing/selftests/landlock/fs_test.c | 2 -- tools/testing/selftests/landlock/net_test.c | 2 -- tools/testing/selftests/landlock/ptrace_test.c | 2 -- tools/testing/selftests/lsm/common.c | 2 -- tools/testing/selftests/lsm/lsm_get_self_attr_test.c | 2 -- tools/testing/selftests/lsm/lsm_list_modules_test.c | 2 -- tools/testing/selftests/lsm/lsm_set_self_attr_test.c | 2 -- tools/testing/selftests/membarrier/membarrier_test_impl.h | 1 - .../selftests/membarrier/membarrier_test_multi_thread.c | 1 - .../selftests/membarrier/membarrier_test_single_thread.c | 1 - tools/testing/selftests/memfd/common.c | 1 - tools/testing/selftests/memfd/fuse_test.c | 2 -- tools/testing/selftests/memfd/memfd_test.c | 1 - tools/testing/selftests/mm/cow.c | 1 - tools/testing/selftests/mm/gup_longterm.c | 1 - tools/testing/selftests/mm/hugepage-mmap.c | 1 - tools/testing/selftests/mm/hugepage-mremap.c | 2 -- tools/testing/selftests/mm/hugetlb-madvise.c | 2 -- tools/testing/selftests/mm/hugetlb-read-hwpoison.c | 2 -- tools/testing/selftests/mm/khugepaged.c | 1 - tools/testing/selftests/mm/ksm_functional_tests.c | 1 - tools/testing/selftests/mm/madv_populate.c | 1 - tools/testing/selftests/mm/map_populate.c | 2 -- tools/testing/selftests/mm/mdwe_test.c | 1 - tools/testing/selftests/mm/memfd_secret.c | 2 -- tools/testing/selftests/mm/mlock2-tests.c | 1 - tools/testing/selftests/mm/mrelease_test.c | 1 - tools/testing/selftests/mm/mremap_dontunmap.c | 1 - tools/testing/selftests/mm/mremap_test.c | 2 -- tools/testing/selftests/mm/pagemap_ioctl.c | 1 - tools/testing/selftests/mm/pkey-helpers.h | 1 - tools/testing/selftests/mm/protection_keys.c | 1 - tools/testing/selftests/mm/split_huge_page_test.c | 2 -- tools/testing/selftests/mm/thuge-gen.c | 2 -- tools/testing/selftests/mm/uffd-common.h | 1 - tools/testing/selftests/mount_setattr/mount_setattr_test.c | 1 - .../move_mount_set_group/move_mount_set_group_test.c | 1 - tools/testing/selftests/net/af_unix/diag_uid.c | 2 -- tools/testing/selftests/net/af_unix/scm_pidfd.c | 1 - tools/testing/selftests/net/af_unix/unix_connect.c | 2 -- tools/testing/selftests/net/csum.c | 3 --- tools/testing/selftests/net/gro.c | 3 --- tools/testing/selftests/net/ip_defrag.c | 3 --- tools/testing/selftests/net/ipsec.c | 3 --- tools/testing/selftests/net/ipv6_flowlabel.c | 3 --- tools/testing/selftests/net/ipv6_flowlabel_mgr.c | 3 --- tools/testing/selftests/net/mptcp/mptcp_connect.c | 3 --- tools/testing/selftests/net/mptcp/mptcp_inq.c | 3 --- tools/testing/selftests/net/mptcp/mptcp_sockopt.c | 3 --- tools/testing/selftests/net/msg_zerocopy.c | 3 --- tools/testing/selftests/net/nettest.c | 2 -- tools/testing/selftests/net/psock_fanout.c | 3 --- tools/testing/selftests/net/psock_snd.c | 3 --- tools/testing/selftests/net/reuseport_addr_any.c | 3 --- tools/testing/selftests/net/reuseport_bpf_cpu.c | 3 --- tools/testing/selftests/net/reuseport_bpf_numa.c | 3 --- tools/testing/selftests/net/reuseport_dualstack.c | 3 --- tools/testing/selftests/net/so_incoming_cpu.c | 1 - tools/testing/selftests/net/so_netns_cookie.c | 1 - tools/testing/selftests/net/so_txtime.c | 3 --- tools/testing/selftests/net/tap.c | 3 --- tools/testing/selftests/net/tcp_fastopen_backup_key.c | 1 - tools/testing/selftests/net/tcp_inq.c | 2 -- tools/testing/selftests/net/tcp_mmap.c | 1 - tools/testing/selftests/net/tls.c | 3 --- tools/testing/selftests/net/toeplitz.c | 3 --- tools/testing/selftests/net/tun.c | 3 --- tools/testing/selftests/net/txring_overwrite.c | 3 --- tools/testing/selftests/net/txtimestamp.c | 3 --- tools/testing/selftests/net/udpgso.c | 3 --- tools/testing/selftests/net/udpgso_bench_rx.c | 3 --- tools/testing/selftests/net/udpgso_bench_tx.c | 3 --- tools/testing/selftests/perf_events/remove_on_exec.c | 2 -- tools/testing/selftests/perf_events/sigtrap_threads.c | 2 -- tools/testing/selftests/pid_namespace/regression_enomem.c | 1 - tools/testing/selftests/pidfd/pidfd.h | 1 - tools/testing/selftests/pidfd/pidfd_fdinfo_test.c | 2 -- tools/testing/selftests/pidfd/pidfd_getfd_test.c | 2 -- tools/testing/selftests/pidfd/pidfd_open_test.c | 2 -- tools/testing/selftests/pidfd/pidfd_poll_test.c | 2 -- tools/testing/selftests/pidfd/pidfd_setns_test.c | 2 -- tools/testing/selftests/pidfd/pidfd_test.c | 2 -- tools/testing/selftests/pidfd/pidfd_wait.c | 2 -- tools/testing/selftests/ptrace/get_set_sud.c | 1 - tools/testing/selftests/ptrace/peeksiginfo.c | 1 - tools/testing/selftests/rseq/basic_percpu_ops_test.c | 1 - tools/testing/selftests/rseq/basic_test.c | 2 -- tools/testing/selftests/rseq/param_test.c | 1 - tools/testing/selftests/rseq/rseq.c | 2 -- tools/testing/selftests/seccomp/seccomp_benchmark.c | 1 - tools/testing/selftests/seccomp/seccomp_bpf.c | 2 -- tools/testing/selftests/user_events/abi_test.c | 2 -- tools/testing/selftests/x86/amx.c | 2 -- tools/testing/selftests/x86/check_initial_reg_state.c | 3 --- tools/testing/selftests/x86/corrupt_xstate_header.c | 3 --- tools/testing/selftests/x86/entry_from_vm86.c | 3 --- tools/testing/selftests/x86/fsgsbase.c | 2 -- tools/testing/selftests/x86/fsgsbase_restore.c | 2 -- tools/testing/selftests/x86/ioperm.c | 2 -- tools/testing/selftests/x86/iopl.c | 2 -- tools/testing/selftests/x86/lam.c | 1 - tools/testing/selftests/x86/ldt_gdt.c | 2 -- tools/testing/selftests/x86/mov_ss_trap.c | 2 -- tools/testing/selftests/x86/nx_stack.c | 2 -- tools/testing/selftests/x86/ptrace_syscall.c | 2 -- tools/testing/selftests/x86/sigaltstack.c | 2 -- tools/testing/selftests/x86/sigreturn.c | 3 --- tools/testing/selftests/x86/single_step_syscall.c | 3 --- tools/testing/selftests/x86/syscall_arg_fault.c | 3 --- tools/testing/selftests/x86/syscall_numbering.c | 3 --- tools/testing/selftests/x86/sysret_rip.c | 3 --- tools/testing/selftests/x86/sysret_ss_attrs.c | 3 --- tools/testing/selftests/x86/test_FCMOV.c | 4 ---- tools/testing/selftests/x86/test_FCOMI.c | 4 ---- tools/testing/selftests/x86/test_FISTTP.c | 4 ---- tools/testing/selftests/x86/test_mremap_vdso.c | 1 - tools/testing/selftests/x86/test_shadow_stack.c | 3 --- tools/testing/selftests/x86/test_syscall_vdso.c | 4 ---- tools/testing/selftests/x86/test_vsyscall.c | 3 --- tools/testing/selftests/x86/unwind_vdso.c | 3 --- tools/testing/selftests/x86/vdso_restorer.c | 3 --- 198 files changed, 405 deletions(-)
tools/testing/selftests/cachestat/test_cachestat.c +0 -2
@@ -1,6 +1,4 @@// SPDX-License-Identifier: GPL-2.0 -#define _GNU_SOURCE -#include <stdio.h> #include <stdbool.h> #include <linux/kernel.h>
tools/testing/selftests/capabilities/test_execve.c +0 -2
@@ -1,6 +1,4 @@// SPDX-License-Identifier: GPL-2.0 -#define _GNU_SOURCE -#include <cap-ng.h> #include <linux/capability.h> #include <stdbool.h>
tools/testing/selftests/clone3/clone3.c +0 -2
@@ -1,8 +1,6 @@// SPDX-License-Identifier: GPL-2.0 /* Based on Christian Brauner's clone3() example */ - -#define _GNU_SOURCE#include <errno.h> #include <inttypes.h> #include <linux/types.h>
tools/testing/selftests/clone3/clone3_cap_checkpoint_restore.c +0 -2
@@ -7,8 +7,6 @@*/ /* capabilities related code based on selftests/bpf/test_verifier.c */ - -#define _GNU_SOURCE#include <errno.h> #include <linux/types.h> #include <linux/sched.h>
tools/testing/selftests/clone3/clone3_clear_sighand.c +0 -2
@@ -1,6 +1,4 @@/* SPDX-License-Identifier: GPL-2.0 */ - -#define _GNU_SOURCE#include <errno.h> #include <sched.h> #include <signal.h>
tools/testing/selftests/clone3/clone3_selftests.h +0 -1
@@ -3,7 +3,6 @@#ifndef _CLONE3_SELFTESTS_H#define _CLONE3_SELFTESTS_H -#define _GNU_SOURCE#include <sched.h> #include <linux/sched.h> #include <linux/types.h>
tools/testing/selftests/clone3/clone3_set_tid.c +0 -2
@@ -5,8 +5,6 @@* These tests are assuming to be running in the host's * PID namespace. */ - -#define _GNU_SOURCE#include <errno.h> #include <linux/types.h> #include <linux/sched.h>
tools/testing/selftests/core/close_range_test.c +0 -2
@@ -1,6 +1,4 @@// SPDX-License-Identifier: GPL-2.0 - -#define _GNU_SOURCE#include <errno.h> #include <fcntl.h> #include <linux/kernel.h>
tools/testing/selftests/drivers/dma-buf/udmabuf.c +0 -1
@@ -1,5 +1,4 @@// SPDX-License-Identifier: GPL-2.0 -#define _GNU_SOURCE#define __EXPORTED_HEADERS__#include <stdio.h>
tools/testing/selftests/fchmodat2/fchmodat2_test.c +0 -2
@@ -1,6 +1,4 @@// SPDX-License-Identifier: GPL-2.0-or-later - -#define _GNU_SOURCE#include <fcntl.h> #include <sys/stat.h> #include <sys/types.h>
tools/testing/selftests/filesystems/binderfs/binderfs_test.c +0 -2
@@ -1,6 +1,4 @@// SPDX-License-Identifier: GPL-2.0 - -#define _GNU_SOURCE#include <errno.h> #include <fcntl.h> #include <pthread.h>
tools/testing/selftests/filesystems/devpts_pts.c +0 -1
@@ -1,5 +1,4 @@// SPDX-License-Identifier: GPL-2.0 -#define _GNU_SOURCE#include <errno.h> #include <fcntl.h> #include <sched.h>
tools/testing/selftests/filesystems/dnotify_test.c +0 -1
@@ -1,5 +1,4 @@// SPDX-License-Identifier: GPL-2.0 -#define _GNU_SOURCE/* needed to get the defines */ #include <fcntl.h> /* in glibc 2.2 this has the needed values defined */ #include <signal.h>
tools/testing/selftests/filesystems/epoll/epoll_wakeup_test.c +0 -2
@@ -1,6 +1,4 @@// SPDX-License-Identifier: GPL-2.0 - -#define _GNU_SOURCE#include <asm/unistd.h> #include <linux/time_types.h> #include <poll.h>
tools/testing/selftests/filesystems/eventfd/eventfd_test.c +0 -2
@@ -1,6 +1,4 @@// SPDX-License-Identifier: GPL-2.0 - -#define _GNU_SOURCE#include <errno.h> #include <fcntl.h> #include <asm/unistd.h>
tools/testing/selftests/filesystems/fat/rename_exchange.c +0 -2
@@ -6,8 +6,6 @@* Copyright 2022 Red Hat Inc. * Author: Javier Martinez Canillas <[email protected]> */ - -#define _GNU_SOURCE#include <fcntl.h> #include <stdio.h> #include <stdlib.h>
tools/testing/selftests/filesystems/overlayfs/dev_in_maps.c +0 -2
@@ -1,6 +1,4 @@// SPDX-License-Identifier: GPL-2.0 -#define _GNU_SOURCE -#include <inttypes.h> #include <unistd.h> #include <stdio.h>
tools/testing/selftests/filesystems/statmount/statmount_test.c +0 -3
@@ -1,7 +1,4 @@// SPDX-License-Identifier: GPL-2.0-or-later - -#define _GNU_SOURCE -#include <assert.h> #include <stdint.h> #include <sched.h>
tools/testing/selftests/futex/functional/futex_requeue_pi.c +0 -3
@@ -16,9 +16,6 @@* 2009-Nov-6: futex test adaptation by Darren Hart <[email protected]> * *****************************************************************************/ - -#define _GNU_SOURCE -#include <errno.h> #include <limits.h> #include <pthread.h>
tools/testing/selftests/ipc/msgque.c +0 -1
@@ -1,5 +1,4 @@// SPDX-License-Identifier: GPL-2.0 -#define _GNU_SOURCE#include <stdlib.h> #include <stdio.h> #include <string.h>
tools/testing/selftests/kcmp/kcmp_test.c +0 -2
@@ -1,6 +1,4 @@// SPDX-License-Identifier: GPL-2.0 -#define _GNU_SOURCE -#include <stdio.h> #include <stdlib.h> #include <signal.h>
tools/testing/selftests/kvm/aarch64/arch_timer.c +0 -2
@@ -5,8 +5,6 @@* * Copyright (c) 2021, Google LLC. */ -#define _GNU_SOURCE -#include "arch_timer.h" #include "delay.h" #include "gic.h"
tools/testing/selftests/kvm/aarch64/page_fault_test.c +0 -1
@@ -7,7 +7,6 @@* hugetlbfs with a hole). It checks that the expected handling method is * called (e.g., uffd faults with the right address and write/read flag). */ -#define _GNU_SOURCE#include <linux/bitmap.h> #include <fcntl.h> #include <test_util.h>
tools/testing/selftests/kvm/aarch64/psci_test.c +0 -3
@@ -10,9 +10,6 @@* - A test for KVM's handling of PSCI SYSTEM_SUSPEND and the associated * KVM_SYSTEM_EVENT_SUSPEND UAPI. */ - -#define _GNU_SOURCE -#include <linux/psci.h> #include "kvm_util.h"
tools/testing/selftests/kvm/aarch64/vgic_init.c +0 -1
@@ -4,7 +4,6 @@* * Copyright (C) 2020, Red Hat, Inc. */ -#define _GNU_SOURCE#include <linux/kernel.h> #include <sys/syscall.h> #include <asm/kvm.h>
tools/testing/selftests/kvm/arch_timer.c +0 -3
@@ -19,9 +19,6 @@* * Copyright (c) 2021, Google LLC. */ - -#define _GNU_SOURCE -#include <stdlib.h> #include <pthread.h> #include <linux/sizes.h>
tools/testing/selftests/kvm/demand_paging_test.c +0 -3
@@ -6,9 +6,6 @@* Copyright (C) 2018, Red Hat, Inc. * Copyright (C) 2019, Google, Inc. */ - -#define _GNU_SOURCE/* for pipe2 */ -#include <inttypes.h> #include <stdio.h> #include <stdlib.h>
tools/testing/selftests/kvm/dirty_log_test.c +0 -3
@@ -4,9 +4,6 @@* * Copyright (C) 2018, Red Hat, Inc. */ - -#define _GNU_SOURCE/* for program_invocation_name */ -#include <stdio.h> #include <stdlib.h> #include <pthread.h>
tools/testing/selftests/kvm/guest_memfd_test.c +0 -2
@@ -4,8 +4,6 @@* * Author: Chao Peng <[email protected]> */ - -#define _GNU_SOURCE#include <stdlib.h> #include <string.h> #include <unistd.h>
tools/testing/selftests/kvm/hardware_disable_test.c +0 -3
@@ -4,9 +4,6 @@* kvm_arch_hardware_disable is called and it attempts to unregister the user * return notifiers. */ - -#define _GNU_SOURCE -#include <fcntl.h> #include <pthread.h> #include <semaphore.h>
tools/testing/selftests/kvm/include/userfaultfd_util.h +0 -3
@@ -5,9 +5,6 @@* Copyright (C) 2018, Red Hat, Inc. * Copyright (C) 2019-2022 Google LLC */ - -#define _GNU_SOURCE/* for pipe2 */ -#include <inttypes.h> #include <time.h> #include <pthread.h>
tools/testing/selftests/kvm/kvm_binary_stats_test.c +0 -2
@@ -6,8 +6,6 @@* * Test the fd-based interface for KVM statistics. */ - -#define _GNU_SOURCE/* for program_invocation_short_name */ #include <fcntl.h> #include <stdio.h> #include <stdlib.h>
tools/testing/selftests/kvm/kvm_create_max_vcpus.c +0 -2
@@ -6,8 +6,6 @@* * Test for KVM_CAP_MAX_VCPUS and KVM_CAP_MAX_VCPU_ID. */ - -#define _GNU_SOURCE/* for program_invocation_short_name */ #include <fcntl.h> #include <stdio.h> #include <stdlib.h>
tools/testing/selftests/kvm/kvm_page_table_test.c +0 -3
@@ -8,9 +8,6 @@* page size have been pre-allocated on your system, if you are planning to * use hugepages to back the guest memory for testing. */ - -#define _GNU_SOURCE/* for program_invocation_name */ -#include <stdio.h> #include <stdlib.h> #include <time.h>
tools/testing/selftests/kvm/lib/assert.c +0 -3
@@ -4,9 +4,6 @@* * Copyright (C) 2018, Google LLC. */ - -#define _GNU_SOURCE/* for getline(3) and strchrnul(3)*/ -#include "test_util.h" #include <execinfo.h>
tools/testing/selftests/kvm/lib/kvm_util.c +0 -2
@@ -4,8 +4,6 @@* * Copyright (C) 2018, Google LLC. */ - -#define _GNU_SOURCE/* for program_invocation_name */ #include "test_util.h" #include "kvm_util.h" #include "processor.h"
tools/testing/selftests/kvm/lib/memstress.c +0 -2
@@ -2,8 +2,6 @@/* * Copyright (C) 2020, Google LLC. */ -#define _GNU_SOURCE -#include <inttypes.h> #include <linux/bitmap.h>
tools/testing/selftests/kvm/lib/test_util.c +0 -2
@@ -4,8 +4,6 @@* * Copyright (C) 2020, Google LLC. */ - -#define _GNU_SOURCE#include <stdio.h> #include <stdarg.h> #include <assert.h>
tools/testing/selftests/kvm/lib/userfaultfd_util.c +0 -3
@@ -6,9 +6,6 @@* Copyright (C) 2018, Red Hat, Inc. * Copyright (C) 2019-2022 Google LLC */ - -#define _GNU_SOURCE/* for pipe2 */ -#include <inttypes.h> #include <stdio.h> #include <stdlib.h>
tools/testing/selftests/kvm/lib/x86_64/sev.c +0 -1
@@ -1,5 +1,4 @@// SPDX-License-Identifier: GPL-2.0-only -#define _GNU_SOURCE/* for program_invocation_short_name */ #include <stdint.h> #include <stdbool.h>
tools/testing/selftests/kvm/max_guest_memory_test.c +0 -2
@@ -1,6 +1,4 @@// SPDX-License-Identifier: GPL-2.0 -#define _GNU_SOURCE -#include <stdio.h> #include <stdlib.h> #include <pthread.h>
tools/testing/selftests/kvm/memslot_modification_stress_test.c +0 -3
@@ -6,9 +6,6 @@* Copyright (C) 2018, Red Hat, Inc. * Copyright (C) 2020, Google, Inc. */ - -#define _GNU_SOURCE/* for program_invocation_name */ -#include <stdio.h> #include <stdlib.h> #include <sys/syscall.h>
tools/testing/selftests/kvm/riscv/arch_timer.c +0 -3
@@ -7,9 +7,6 @@* * Copyright (c) 2024, Intel Corporation. */ - -#define _GNU_SOURCE -#include "arch_timer.h" #include "kvm_util.h" #include "processor.h"
tools/testing/selftests/kvm/rseq_test.c +0 -1
@@ -1,5 +1,4 @@// SPDX-License-Identifier: GPL-2.0-only -#define _GNU_SOURCE/* for program_invocation_short_name */ #include <errno.h> #include <fcntl.h> #include <pthread.h>
tools/testing/selftests/kvm/s390x/cmma_test.c +0 -2
@@ -7,8 +7,6 @@* Authors: * Nico Boehr <[email protected]> */ - -#define _GNU_SOURCE/* for program_invocation_short_name */ #include <fcntl.h> #include <stdio.h> #include <stdlib.h>
tools/testing/selftests/kvm/s390x/sync_regs_test.c +0 -2
@@ -10,8 +10,6 @@* * Test expected behavior of the KVM_CAP_SYNC_REGS functionality. */ - -#define _GNU_SOURCE/* for program_invocation_short_name */ #include <fcntl.h> #include <stdio.h> #include <stdlib.h>
tools/testing/selftests/kvm/set_memory_region_test.c +0 -1
@@ -1,5 +1,4 @@// SPDX-License-Identifier: GPL-2.0 -#define _GNU_SOURCE/* for program_invocation_short_name */ #include <fcntl.h> #include <pthread.h> #include <sched.h>
tools/testing/selftests/kvm/steal_time.c +0 -1
@@ -4,7 +4,6 @@* * Copyright (C) 2020, Red Hat, Inc. */ -#define _GNU_SOURCE#include <stdio.h> #include <time.h> #include <sched.h>
tools/testing/selftests/kvm/x86_64/amx_test.c +0 -2
@@ -6,8 +6,6 @@* * Tests for amx #NM exception and save/restore. */ - -#define _GNU_SOURCE/* for program_invocation_short_name */ #include <fcntl.h> #include <stdio.h> #include <stdlib.h>
tools/testing/selftests/kvm/x86_64/exit_on_emulation_failure_test.c +0 -3
@@ -4,9 +4,6 @@* * Test for KVM_CAP_EXIT_ON_EMULATION_FAILURE. */ - -#define _GNU_SOURCE/* for program_invocation_short_name */ -#include "flds_emulation.h" #include "test_util.h"
tools/testing/selftests/kvm/x86_64/hwcr_msr_test.c +0 -2
@@ -2,8 +2,6 @@/* * Copyright (C) 2023, Google LLC. */ - -#define _GNU_SOURCE/* for program_invocation_short_name */ #include <sys/ioctl.h> #include "test_util.h"
tools/testing/selftests/kvm/x86_64/hyperv_cpuid.c +0 -2
@@ -7,8 +7,6 @@* This work is licensed under the terms of the GNU GPL, version 2. * */ - -#define _GNU_SOURCE/* for program_invocation_short_name */ #include <fcntl.h> #include <stdio.h> #include <stdlib.h>
tools/testing/selftests/kvm/x86_64/hyperv_evmcs.c +0 -1
@@ -4,7 +4,6 @@* * Tests for Enlightened VMCS, including nested guest state. */ -#define _GNU_SOURCE/* for program_invocation_short_name */ #include <fcntl.h> #include <stdio.h> #include <stdlib.h>
tools/testing/selftests/kvm/x86_64/hyperv_ipi.c +0 -2
@@ -5,8 +5,6 @@* Copyright (C) 2022, Red Hat, Inc. * */ - -#define _GNU_SOURCE/* for program_invocation_short_name */ #include <pthread.h> #include <inttypes.h>
tools/testing/selftests/kvm/x86_64/hyperv_svm_test.c +0 -1
@@ -4,7 +4,6 @@* * Tests for Hyper-V extensions to SVM. */ -#define _GNU_SOURCE/* for program_invocation_short_name */ #include <fcntl.h> #include <stdio.h> #include <stdlib.h>
tools/testing/selftests/kvm/x86_64/hyperv_tlb_flush.c +0 -2
@@ -5,8 +5,6 @@* Copyright (C) 2022, Red Hat, Inc. * */ - -#define _GNU_SOURCE/* for program_invocation_short_name */ #include <asm/barrier.h> #include <pthread.h> #include <inttypes.h>
tools/testing/selftests/kvm/x86_64/nested_exceptions_test.c +0 -2
@@ -1,6 +1,4 @@// SPDX-License-Identifier: GPL-2.0-only -#define _GNU_SOURCE/* for program_invocation_short_name */ -#include "test_util.h" #include "kvm_util.h" #include "processor.h"
tools/testing/selftests/kvm/x86_64/nx_huge_pages_test.c +0 -3
@@ -5,9 +5,6 @@* * Copyright (C) 2022, Google LLC. */ - -#define _GNU_SOURCE -#include <fcntl.h> #include <stdint.h> #include <time.h>
tools/testing/selftests/kvm/x86_64/platform_info_test.c +0 -2
@@ -9,8 +9,6 @@* Verifies expected behavior of controlling guest access to * MSR_PLATFORM_INFO. */ - -#define _GNU_SOURCE/* for program_invocation_short_name */ #include <fcntl.h> #include <stdio.h> #include <stdlib.h>
tools/testing/selftests/kvm/x86_64/pmu_counters_test.c +0 -2
@@ -2,8 +2,6 @@/* * Copyright (C) 2023, Tencent, Inc. */ - -#define _GNU_SOURCE/* for program_invocation_short_name */ #include <x86intrin.h> #include "pmu.h"
tools/testing/selftests/kvm/x86_64/pmu_event_filter_test.c +0 -3
@@ -9,9 +9,6 @@* Verifies the expected behavior of allow lists and deny lists for * virtual PMU events. */ - -#define _GNU_SOURCE/* for program_invocation_short_name */ -#include "kvm_util.h" #include "pmu.h" #include "processor.h"
tools/testing/selftests/kvm/x86_64/private_mem_conversions_test.c +0 -1
@@ -2,7 +2,6 @@/* * Copyright (C) 2022, Google LLC. */ -#define _GNU_SOURCE/* for program_invocation_short_name */ #include <fcntl.h> #include <limits.h> #include <pthread.h>
tools/testing/selftests/kvm/x86_64/set_boot_cpu_id.c +0 -1
@@ -4,7 +4,6 @@* * Copyright (C) 2020, Red Hat, Inc. */ -#define _GNU_SOURCE/* for program_invocation_name */ #include <fcntl.h> #include <stdio.h> #include <stdlib.h>
tools/testing/selftests/kvm/x86_64/set_sregs_test.c +0 -1
@@ -10,7 +10,6 @@* That bug allowed a user-mode program that called the KVM_SET_SREGS * ioctl to put a VCPU's local APIC into an invalid state. */ -#define _GNU_SOURCE/* for program_invocation_short_name */ #include <fcntl.h> #include <stdio.h> #include <stdlib.h>
tools/testing/selftests/kvm/x86_64/smaller_maxphyaddr_emulation_test.c +0 -3
@@ -5,9 +5,6 @@* Test that KVM emulates instructions in response to EPT violations when * allow_smaller_maxphyaddr is enabled and guest.MAXPHYADDR < host.MAXPHYADDR. */ - -#define _GNU_SOURCE/* for program_invocation_short_name */ -#include "flds_emulation.h" #include "test_util.h"
tools/testing/selftests/kvm/x86_64/smm_test.c +0 -1
@@ -4,7 +4,6 @@* * Tests for SMM. */ -#define _GNU_SOURCE/* for program_invocation_short_name */ #include <fcntl.h> #include <stdio.h> #include <stdlib.h>
tools/testing/selftests/kvm/x86_64/state_test.c +0 -1
@@ -6,7 +6,6 @@* * Tests for vCPU state save/restore, including nested guest state. */ -#define _GNU_SOURCE/* for program_invocation_short_name */ #include <fcntl.h> #include <stdio.h> #include <stdlib.h>
tools/testing/selftests/kvm/x86_64/sync_regs_test.c +0 -2
@@ -8,8 +8,6 @@* including requesting an invalid register set, updates to/from values * in kvm_run.s.regs when kvm_valid_regs and kvm_dirty_regs are toggled. */ - -#define _GNU_SOURCE/* for program_invocation_short_name */ #include <fcntl.h> #include <stdio.h> #include <stdlib.h>
tools/testing/selftests/kvm/x86_64/ucna_injection_test.c +0 -2
@@ -17,8 +17,6 @@* delivered into the guest or not. * */ - -#define _GNU_SOURCE/* for program_invocation_short_name */ #include <pthread.h> #include <inttypes.h> #include <string.h>
tools/testing/selftests/kvm/x86_64/userspace_msr_exit_test.c +0 -2
@@ -4,8 +4,6 @@* * Tests for exiting into userspace on registered MSRs */ - -#define _GNU_SOURCE/* for program_invocation_short_name */ #include <sys/ioctl.h> #include "kvm_test_harness.h"
tools/testing/selftests/kvm/x86_64/vmx_dirty_log_test.c +0 -3
@@ -4,9 +4,6 @@* * Copyright (C) 2018, Red Hat, Inc. */ - -#define _GNU_SOURCE/* for program_invocation_name */ -#include <stdio.h> #include <stdlib.h> #include <linux/bitmap.h>
tools/testing/selftests/kvm/x86_64/vmx_pmu_caps_test.c +0 -1
@@ -10,7 +10,6 @@* and check it can be retrieved with KVM_GET_MSR, also test * the invalid LBR formats are rejected. */ -#define _GNU_SOURCE/* for program_invocation_short_name */ #include <sys/ioctl.h> #include <linux/bitmap.h>
tools/testing/selftests/kvm/x86_64/vmx_preemption_timer_test.c +0 -1
@@ -9,7 +9,6 @@* value instead of partially decayed timer value * */ -#define _GNU_SOURCE/* for program_invocation_short_name */ #include <fcntl.h> #include <stdio.h> #include <stdlib.h>
tools/testing/selftests/kvm/x86_64/xapic_ipi_test.c +0 -2
@@ -19,8 +19,6 @@* Migration is a command line option. When used on non-numa machines will * exit with error. Test is still usefull on non-numa for testing IPIs. */ - -#define _GNU_SOURCE/* for program_invocation_short_name */ #include <getopt.h> #include <pthread.h> #include <inttypes.h>
tools/testing/selftests/kvm/x86_64/xapic_state_test.c +0 -1
@@ -1,5 +1,4 @@// SPDX-License-Identifier: GPL-2.0-only -#define _GNU_SOURCE/* for program_invocation_short_name */ #include <fcntl.h> #include <stdio.h> #include <stdlib.h>
tools/testing/selftests/kvm/x86_64/xss_msr_test.c +0 -2
@@ -4,8 +4,6 @@* * Tests for the IA32_XSS MSR. */ - -#define _GNU_SOURCE/* for program_invocation_short_name */ #include <sys/ioctl.h> #include "test_util.h"
tools/testing/selftests/landlock/base_test.c +0 -2
@@ -5,8 +5,6 @@* Copyright ? 2017-2020 Micka?l Sala?n <[email protected]> * Copyright ? 2019-2020 ANSSI */ - -#define _GNU_SOURCE#include <errno.h> #include <fcntl.h> #include <linux/landlock.h>
tools/testing/selftests/landlock/fs_test.c +0 -2
@@ -6,8 +6,6 @@* Copyright ? 2020 ANSSI * Copyright ? 2020-2022 Microsoft Corporation */ - -#define _GNU_SOURCE#include <fcntl.h> #include <linux/landlock.h> #include <linux/magic.h>
tools/testing/selftests/landlock/net_test.c +0 -2
@@ -5,8 +5,6 @@* Copyright ? 2022-2023 Huawei Tech. Co., Ltd. * Copyright ? 2023 Microsoft Corporation */ - -#define _GNU_SOURCE#include <arpa/inet.h> #include <errno.h> #include <fcntl.h>
tools/testing/selftests/landlock/ptrace_test.c +0 -2
@@ -5,8 +5,6 @@* Copyright ? 2017-2020 Micka?l Sala?n <[email protected]> * Copyright ? 2019-2020 ANSSI */ - -#define _GNU_SOURCE#include <errno.h> #include <fcntl.h> #include <linux/landlock.h>
tools/testing/selftests/lsm/common.c +0 -2
@@ -4,8 +4,6 @@* * Copyright ? 2023 Casey Schaufler <[email protected]> */ - -#define _GNU_SOURCE#include <linux/lsm.h> #include <fcntl.h> #include <string.h>
tools/testing/selftests/lsm/lsm_get_self_attr_test.c +0 -2
@@ -5,8 +5,6 @@* * Copyright ? 2022 Casey Schaufler <[email protected]> */ - -#define _GNU_SOURCE#include <linux/lsm.h> #include <fcntl.h> #include <string.h>
tools/testing/selftests/lsm/lsm_list_modules_test.c +0 -2
@@ -5,8 +5,6 @@* * Copyright ? 2022 Casey Schaufler <[email protected]> */ - -#define _GNU_SOURCE#include <linux/lsm.h> #include <string.h> #include <stdio.h>
tools/testing/selftests/lsm/lsm_set_self_attr_test.c +0 -2
@@ -5,8 +5,6 @@* * Copyright ? 2022 Casey Schaufler <[email protected]> */ - -#define _GNU_SOURCE#include <linux/lsm.h> #include <string.h> #include <stdio.h>
tools/testing/selftests/membarrier/membarrier_test_impl.h +0 -1
@@ -1,5 +1,4 @@/* SPDX-License-Identifier: GPL-2.0 */ -#define _GNU_SOURCE#include <linux/membarrier.h> #include <syscall.h> #include <stdio.h>
tools/testing/selftests/membarrier/membarrier_test_multi_thread.c +0 -1
@@ -1,5 +1,4 @@// SPDX-License-Identifier: GPL-2.0 -#define _GNU_SOURCE#include <linux/membarrier.h> #include <syscall.h> #include <stdio.h>
tools/testing/selftests/membarrier/membarrier_test_single_thread.c +0 -1
@@ -1,5 +1,4 @@// SPDX-License-Identifier: GPL-2.0 -#define _GNU_SOURCE#include <linux/membarrier.h> #include <syscall.h> #include <stdio.h>
tools/testing/selftests/memfd/common.c +0 -1
@@ -1,5 +1,4 @@// SPDX-License-Identifier: GPL-2.0 -#define _GNU_SOURCE#define __EXPORTED_HEADERS__#include <stdio.h>
tools/testing/selftests/memfd/fuse_test.c +0 -2
@@ -12,8 +12,6 @@* the read() syscall with our memory-mapped memfd object as receive buffer to * force the kernel to write into our memfd object. */ - -#define _GNU_SOURCE#define __EXPORTED_HEADERS__#include <errno.h>
tools/testing/selftests/memfd/memfd_test.c +0 -1
@@ -1,5 +1,4 @@// SPDX-License-Identifier: GPL-2.0 -#define _GNU_SOURCE#define __EXPORTED_HEADERS__#include <errno.h>
tools/testing/selftests/mm/cow.c +0 -1
@@ -6,7 +6,6 @@* * Author(s): David Hildenbrand <[email protected]> */ -#define _GNU_SOURCE#include <stdlib.h> #include <string.h> #include <stdbool.h>
tools/testing/selftests/mm/gup_longterm.c +0 -1
@@ -6,7 +6,6 @@* * Author(s): David Hildenbrand <[email protected]> */ -#define _GNU_SOURCE#include <stdlib.h> #include <string.h> #include <stdbool.h>
tools/testing/selftests/mm/hugepage-mmap.c +0 -1
@@ -16,7 +16,6 @@* range. * Other architectures, such as ppc64, i386 or x86_64 are not so constrained. */ -#define _GNU_SOURCE#include <stdlib.h> #include <stdio.h> #include <unistd.h>
tools/testing/selftests/mm/hugepage-mremap.c +0 -2
@@ -11,8 +11,6 @@* To make sure the test triggers pmd sharing and goes through the 'unshare' * path in the mremap code use 1GB (1024) or more. */ - -#define _GNU_SOURCE#include <stdlib.h> #include <stdio.h> #include <unistd.h>
tools/testing/selftests/mm/hugetlb-madvise.c +0 -2
@@ -11,8 +11,6 @@* filesystem. Therefore, a hugetlbfs filesystem must be mounted on some * directory. */ - -#define _GNU_SOURCE#include <stdlib.h> #include <stdio.h> #include <unistd.h>
tools/testing/selftests/mm/hugetlb-read-hwpoison.c +0 -2
@@ -1,6 +1,4 @@// SPDX-License-Identifier: GPL-2.0 - -#define _GNU_SOURCE#include <stdlib.h> #include <stdio.h> #include <string.h>
tools/testing/selftests/mm/khugepaged.c +0 -1
@@ -1,4 +1,3 @@ -#define _GNU_SOURCE#include <ctype.h> #include <errno.h> #include <fcntl.h>
tools/testing/selftests/mm/ksm_functional_tests.c +0 -1
@@ -6,7 +6,6 @@* * Author(s): David Hildenbrand <[email protected]> */ -#define _GNU_SOURCE#include <stdlib.h> #include <string.h> #include <stdbool.h>
tools/testing/selftests/mm/madv_populate.c +0 -1
@@ -6,7 +6,6 @@* * Author(s): David Hildenbrand <[email protected]> */ -#define _GNU_SOURCE#include <stdlib.h> #include <string.h> #include <stdbool.h>
tools/testing/selftests/mm/map_populate.c +0 -2
@@ -4,8 +4,6 @@* * MAP_POPULATE | MAP_PRIVATE should COW VMA pages. */ - -#define _GNU_SOURCE#include <errno.h> #include <fcntl.h> #include <sys/mman.h>
tools/testing/selftests/mm/mdwe_test.c +0 -1
@@ -7,7 +7,6 @@#include <linux/mman.h> #include <linux/prctl.h> -#define _GNU_SOURCE#include <stdio.h> #include <stdlib.h> #include <sys/auxv.h>
tools/testing/selftests/mm/memfd_secret.c +0 -2
@@ -4,8 +4,6 @@* * Author: Mike Rapoport <[email protected]> */ - -#define _GNU_SOURCE#include <sys/uio.h> #include <sys/mman.h> #include <sys/wait.h>
tools/testing/selftests/mm/mlock2-tests.c +0 -1
@@ -1,5 +1,4 @@// SPDX-License-Identifier: GPL-2.0 -#define _GNU_SOURCE#include <sys/mman.h> #include <stdint.h> #include <unistd.h>
tools/testing/selftests/mm/mrelease_test.c +0 -1
@@ -2,7 +2,6 @@/* * Copyright 2022 Google LLC */ -#define _GNU_SOURCE#include <errno.h> #include <stdbool.h> #include <stdio.h>
tools/testing/selftests/mm/mremap_dontunmap.c +0 -1
@@ -5,7 +5,6 @@* * Copyright 2020, Brian Geffon <[email protected]> */ -#define _GNU_SOURCE#include <sys/mman.h> #include <linux/mman.h> #include <errno.h>
tools/testing/selftests/mm/mremap_test.c +0 -2
@@ -2,8 +2,6 @@/* * Copyright 2020 Google LLC */ -#define _GNU_SOURCE -#include <errno.h> #include <stdlib.h> #include <stdio.h>
tools/testing/selftests/mm/pagemap_ioctl.c +0 -1
@@ -1,5 +1,4 @@// SPDX-License-Identifier: GPL-2.0 -#define _GNU_SOURCE#include <stdio.h> #include <fcntl.h> #include <string.h>
tools/testing/selftests/mm/pkey-helpers.h +0 -1
@@ -1,7 +1,6 @@/* SPDX-License-Identifier: GPL-2.0 */ #ifndef _PKEYS_HELPER_H#define _PKEYS_HELPER_H -#define _GNU_SOURCE#include <string.h> #include <stdarg.h> #include <stdio.h>
tools/testing/selftests/mm/protection_keys.c +0 -1
@@ -21,7 +21,6 @@* gcc -mxsave -o protection_keys -O2 -g -std=gnu99 -pthread -Wall protection_keys.c -lrt -ldl -lm * gcc -mxsave -m32 -o protection_keys_32 -O2 -g -std=gnu99 -pthread -Wall protection_keys.c -lrt -ldl -lm */ -#define _GNU_SOURCE#define __SANE_USERSPACE_TYPES__#include <errno.h> #include <linux/elf.h>
tools/testing/selftests/mm/split_huge_page_test.c +0 -2
@@ -3,8 +3,6 @@* A test of splitting PMD THPs and PTE-mapped THPs from a specified virtual * address range in a process via <debugfs>/split_huge_pages interface. */ - -#define _GNU_SOURCE#include <stdio.h> #include <stdlib.h> #include <stdarg.h>
tools/testing/selftests/mm/thuge-gen.c +0 -2
@@ -12,8 +12,6 @@ipcrm -m by hand, like this sudo ipcs | awk '$1 == "0x00000000" {print $2}' | xargs -n1 sudo ipcrm -m (warning this will remove all if someone else uses them) */ - -#define _GNU_SOURCE 1#include <sys/mman.h> #include <stdlib.h> #include <stdio.h>
tools/testing/selftests/mm/uffd-common.h +0 -1
@@ -7,7 +7,6 @@#ifndef __UFFD_COMMON_H__#define __UFFD_COMMON_H__ -#define _GNU_SOURCE#include <stdio.h> #include <errno.h> #include <unistd.h>
tools/testing/selftests/mount_setattr/mount_setattr_test.c +0 -1
@@ -1,5 +1,4 @@// SPDX-License-Identifier: GPL-2.0 -#define _GNU_SOURCE#include <sched.h> #include <stdio.h> #include <errno.h>
tools/testing/selftests/move_mount_set_group/move_mount_set_group_test.c +0 -1
@@ -1,5 +1,4 @@// SPDX-License-Identifier: GPL-2.0 -#define _GNU_SOURCE#include <sched.h> #include <stdio.h> #include <errno.h>
tools/testing/selftests/net/af_unix/diag_uid.c +0 -2
@@ -1,7 +1,5 @@// SPDX-License-Identifier: GPL-2.0 /* Copyright Amazon.com Inc. or its affiliates. */ - -#define _GNU_SOURCE#include <sched.h> #include <unistd.h>
tools/testing/selftests/net/af_unix/scm_pidfd.c +0 -1
@@ -1,5 +1,4 @@// SPDX-License-Identifier: GPL-2.0 OR MIT -#define _GNU_SOURCE#include <error.h> #include <limits.h> #include <stddef.h>
tools/testing/selftests/net/af_unix/unix_connect.c +0 -2
@@ -1,6 +1,4 @@// SPDX-License-Identifier: GPL-2.0 - -#define _GNU_SOURCE#include <sched.h> #include <stddef.h>
tools/testing/selftests/net/csum.c +0 -3
@@ -58,9 +58,6 @@* different seed for each run (and logs this for reproducibility). It * is advised to enable this for extra coverage in continuous testing. */ - -#define _GNU_SOURCE -#include <arpa/inet.h> #include <asm/byteorder.h> #include <errno.h>
tools/testing/selftests/net/gro.c +0 -3
@@ -34,9 +34,6 @@* flakiness is to be expected. * */ - -#define _GNU_SOURCE -#include <arpa/inet.h> #include <errno.h> #include <error.h>
tools/testing/selftests/net/ip_defrag.c +0 -3
@@ -1,7 +1,4 @@// SPDX-License-Identifier: GPL-2.0 - -#define _GNU_SOURCE -#include <arpa/inet.h> #include <errno.h> #include <error.h>
tools/testing/selftests/net/ipsec.c +0 -3
@@ -3,9 +3,6 @@* ipsec.c - Check xfrm on veth inside a net-ns. * Copyright (c) 2018 Dmitry Safonov */ - -#define _GNU_SOURCE -#include <arpa/inet.h> #include <asm/types.h> #include <errno.h>
tools/testing/selftests/net/ipv6_flowlabel.c +0 -3
@@ -1,8 +1,5 @@// SPDX-License-Identifier: GPL-2.0 /* Test IPV6_FLOWINFO cmsg on send and recv */ - -#define _GNU_SOURCE -#include <arpa/inet.h> #include <asm/byteorder.h> #include <error.h>
tools/testing/selftests/net/ipv6_flowlabel_mgr.c +0 -3
@@ -1,8 +1,5 @@// SPDX-License-Identifier: GPL-2.0 /* Test IPV6_FLOWINFO_MGR */ - -#define _GNU_SOURCE -#include <arpa/inet.h> #include <error.h> #include <errno.h>
tools/testing/selftests/net/mptcp/mptcp_connect.c +0 -3
@@ -1,7 +1,4 @@// SPDX-License-Identifier: GPL-2.0 - -#define _GNU_SOURCE -#include <errno.h> #include <limits.h> #include <fcntl.h>
tools/testing/selftests/net/mptcp/mptcp_inq.c +0 -3
@@ -1,7 +1,4 @@// SPDX-License-Identifier: GPL-2.0 - -#define _GNU_SOURCE -#include <assert.h> #include <errno.h> #include <fcntl.h>
tools/testing/selftests/net/mptcp/mptcp_sockopt.c +0 -3
@@ -1,7 +1,4 @@// SPDX-License-Identifier: GPL-2.0 - -#define _GNU_SOURCE -#include <assert.h> #include <errno.h> #include <fcntl.h>
tools/testing/selftests/net/msg_zerocopy.c +0 -3
@@ -24,9 +24,6 @@* the kernel queues completions on the error queue for all zerocopy * transfers. */ - -#define _GNU_SOURCE -#include <arpa/inet.h> #include <error.h> #include <errno.h>
tools/testing/selftests/net/nettest.c +0 -2
@@ -3,8 +3,6 @@* * Copyright (c) 2013-2019 David Ahern <[email protected]>. All rights reserved. */ - -#define _GNU_SOURCE#include <features.h> #include <sys/types.h> #include <sys/ioctl.h>
tools/testing/selftests/net/psock_fanout.c +0 -3
@@ -26,9 +26,6 @@* Todo: * - functionality: PACKET_FANOUT_FLAG_DEFRAG */ - -#define _GNU_SOURCE/* for sched_setaffinity */ -#include <arpa/inet.h> #include <errno.h> #include <fcntl.h>
tools/testing/selftests/net/psock_snd.c +0 -3
@@ -1,7 +1,4 @@// SPDX-License-Identifier: GPL-2.0 - -#define _GNU_SOURCE -#include <arpa/inet.h> #include <errno.h> #include <error.h>
tools/testing/selftests/net/reuseport_addr_any.c +0 -3
@@ -3,9 +3,6 @@/* Test that sockets listening on a specific address are preferred * over sockets listening on addr_any. */ - -#define _GNU_SOURCE -#include <arpa/inet.h> #include <errno.h> #include <error.h>
tools/testing/selftests/net/reuseport_bpf_cpu.c +0 -3
@@ -11,9 +11,6 @@* This entire process is done for several different core id permutations * and for each IPv4/IPv6 and TCP/UDP combination. */ - -#define _GNU_SOURCE -#include <arpa/inet.h> #include <errno.h> #include <error.h>
tools/testing/selftests/net/reuseport_bpf_numa.c +0 -3
@@ -3,9 +3,6 @@* Test functionality of BPF filters with SO_REUSEPORT. Same test as * in reuseport_bpf_cpu, only as one socket per NUMA node. */ - -#define _GNU_SOURCE -#include <arpa/inet.h> #include <errno.h> #include <error.h>
tools/testing/selftests/net/reuseport_dualstack.c +0 -3
@@ -10,9 +10,6 @@* This test creates these mixed AF_INET/AF_INET6 sockets and asserts the * AF_INET preference for v4 packets. */ - -#define _GNU_SOURCE -#include <arpa/inet.h> #include <errno.h> #include <error.h>
tools/testing/selftests/net/so_incoming_cpu.c +0 -1
@@ -1,6 +1,5 @@// SPDX-License-Identifier: GPL-2.0 /* Copyright Amazon.com Inc. or its affiliates. */ -#define _GNU_SOURCE#include <sched.h> #include <fcntl.h>
tools/testing/selftests/net/so_netns_cookie.c +0 -1
@@ -1,5 +1,4 @@// SPDX-License-Identifier: GPL-2.0 -#define _GNU_SOURCE#include <sched.h> #include <unistd.h> #include <stdio.h>
tools/testing/selftests/net/so_txtime.c +0 -3
@@ -9,9 +9,6 @@* the expected stream. Sender will read transmit timestamps from the error * queue. The streams can differ due to out-of-order delivery and drops. */ - -#define _GNU_SOURCE -#include <arpa/inet.h> #include <error.h> #include <errno.h>
tools/testing/selftests/net/tap.c +0 -3
@@ -1,7 +1,4 @@// SPDX-License-Identifier: GPL-2.0 - -#define _GNU_SOURCE -#include <errno.h> #include <fcntl.h> #include <stdio.h>
tools/testing/selftests/net/tcp_fastopen_backup_key.c +0 -1
@@ -12,7 +12,6 @@* there are no cases in which a cookie is not accepted by verifying * that TcpExtTCPFastOpenPassiveFail remains 0. */ -#define _GNU_SOURCE#include <arpa/inet.h> #include <errno.h> #include <error.h>
tools/testing/selftests/net/tcp_inq.c +0 -2
@@ -5,8 +5,6 @@* * Simple example on how to use TCP_INQ and TCP_CM_INQ. */ -#define _GNU_SOURCE -#include <error.h> #include <netinet/in.h> #include <netinet/tcp.h>
tools/testing/selftests/net/tcp_mmap.c +0 -1
@@ -46,7 +46,6 @@* received 32768 MB (99.9939 % mmap'ed) in 7.43764 s, 36.9577 Gbit * cpu usage user:0.035 sys:3.467, 106.873 usec per MB, 65530 c-switches */ -#define _GNU_SOURCE#include <pthread.h> #include <sys/types.h> #include <fcntl.h>
tools/testing/selftests/net/tls.c +0 -3
@@ -1,7 +1,4 @@// SPDX-License-Identifier: GPL-2.0 - -#define _GNU_SOURCE -#include <arpa/inet.h> #include <errno.h> #include <error.h>
tools/testing/selftests/net/toeplitz.c +0 -3
@@ -20,9 +20,6 @@* 5. Compute the cpu that RPS should select based on rx_hash and $rps_bitmap * 6. Compare the cpus from 4 and 5 */ - -#define _GNU_SOURCE -#include <arpa/inet.h> #include <errno.h> #include <error.h>
tools/testing/selftests/net/tun.c +0 -3
@@ -1,7 +1,4 @@// SPDX-License-Identifier: GPL-2.0 - -#define _GNU_SOURCE -#include <errno.h> #include <fcntl.h> #include <stdio.h>
tools/testing/selftests/net/txring_overwrite.c +0 -3
@@ -4,9 +4,6 @@* Verify that consecutive sends over packet tx_ring are mirrored * with their original content intact. */ - -#define _GNU_SOURCE -#include <arpa/inet.h> #include <assert.h> #include <error.h>
tools/testing/selftests/net/txtimestamp.c +0 -3
@@ -16,9 +16,6 @@* This test requires a dummy TCP server. * A simple `nc6 [-u] -l -p $DESTPORT` will do */ - -#define _GNU_SOURCE -#include <arpa/inet.h> #include <asm/types.h> #include <error.h>
tools/testing/selftests/net/udpgso.c +0 -3
@@ -1,7 +1,4 @@// SPDX-License-Identifier: GPL-2.0 - -#define _GNU_SOURCE -#include <stddef.h> #include <arpa/inet.h> #include <error.h>
tools/testing/selftests/net/udpgso_bench_rx.c +0 -3
@@ -1,7 +1,4 @@// SPDX-License-Identifier: GPL-2.0 - -#define _GNU_SOURCE -#include <arpa/inet.h> #include <error.h> #include <errno.h>
tools/testing/selftests/net/udpgso_bench_tx.c +0 -3
@@ -1,7 +1,4 @@// SPDX-License-Identifier: GPL-2.0 - -#define _GNU_SOURCE -#include <arpa/inet.h> #include <errno.h> #include <error.h>
tools/testing/selftests/perf_events/remove_on_exec.c +0 -2
@@ -5,8 +5,6 @@* Copyright (C) 2021, Google LLC. */ -#define _GNU_SOURCE -/* We need the latest siginfo from the kernel repo. */ #include <sys/types.h> #include <asm/siginfo.h>
tools/testing/selftests/perf_events/sigtrap_threads.c +0 -2
@@ -5,8 +5,6 @@* Copyright (C) 2021, Google LLC. */ -#define _GNU_SOURCE -/* We need the latest siginfo from the kernel repo. */ #include <sys/types.h> #include <asm/siginfo.h>
tools/testing/selftests/pid_namespace/regression_enomem.c +0 -1
@@ -1,4 +1,3 @@ -#define _GNU_SOURCE#include <assert.h> #include <errno.h> #include <fcntl.h>
tools/testing/selftests/pidfd/pidfd.h +0 -1
@@ -3,7 +3,6 @@#ifndef __PIDFD_H#define __PIDFD_H -#define _GNU_SOURCE#include <errno.h> #include <fcntl.h> #include <sched.h>
tools/testing/selftests/pidfd/pidfd_fdinfo_test.c +0 -2
@@ -1,6 +1,4 @@// SPDX-License-Identifier: GPL-2.0 - -#define _GNU_SOURCE#include <assert.h> #include <errno.h> #include <fcntl.h>
tools/testing/selftests/pidfd/pidfd_getfd_test.c +0 -2
@@ -1,6 +1,4 @@// SPDX-License-Identifier: GPL-2.0 - -#define _GNU_SOURCE#include <errno.h> #include <fcntl.h> #include <limits.h>
tools/testing/selftests/pidfd/pidfd_open_test.c +0 -2
@@ -1,6 +1,4 @@// SPDX-License-Identifier: GPL-2.0 - -#define _GNU_SOURCE#include <errno.h> #include <fcntl.h> #include <inttypes.h>
tools/testing/selftests/pidfd/pidfd_poll_test.c +0 -2
@@ -1,6 +1,4 @@// SPDX-License-Identifier: GPL-2.0 - -#define _GNU_SOURCE#include <errno.h> #include <linux/types.h> #include <poll.h>
tools/testing/selftests/pidfd/pidfd_setns_test.c +0 -2
@@ -1,6 +1,4 @@// SPDX-License-Identifier: GPL-2.0 - -#define _GNU_SOURCE#include <errno.h> #include <fcntl.h> #include <limits.h>
tools/testing/selftests/pidfd/pidfd_test.c +0 -2
@@ -1,6 +1,4 @@/* SPDX-License-Identifier: GPL-2.0 */ - -#define _GNU_SOURCE#include <errno.h> #include <fcntl.h> #include <linux/types.h>
tools/testing/selftests/pidfd/pidfd_wait.c +0 -2
@@ -1,6 +1,4 @@/* SPDX-License-Identifier: GPL-2.0 */ - -#define _GNU_SOURCE#include <errno.h> #include <linux/sched.h> #include <linux/types.h>
tools/testing/selftests/ptrace/get_set_sud.c +0 -1
@@ -1,5 +1,4 @@// SPDX-License-Identifier: GPL-2.0 -#define _GNU_SOURCE#include "../kselftest_harness.h" #include <stdio.h> #include <string.h>
tools/testing/selftests/ptrace/peeksiginfo.c +0 -1
@@ -1,5 +1,4 @@// SPDX-License-Identifier: GPL-2.0 -#define _GNU_SOURCE#include <stdio.h> #include <signal.h> #include <unistd.h>
tools/testing/selftests/rseq/basic_percpu_ops_test.c +0 -1
@@ -1,5 +1,4 @@// SPDX-License-Identifier: LGPL-2.1 -#define _GNU_SOURCE#include <assert.h> #include <pthread.h> #include <sched.h>
tools/testing/selftests/rseq/basic_test.c +0 -2
@@ -2,8 +2,6 @@/* * Basic test coverage for critical regions and rseq_current_cpu(). */ - -#define _GNU_SOURCE#include <assert.h> #include <sched.h> #include <signal.h>
tools/testing/selftests/rseq/param_test.c +0 -1
@@ -1,5 +1,4 @@// SPDX-License-Identifier: LGPL-2.1 -#define _GNU_SOURCE#include <assert.h> #include <linux/membarrier.h> #include <pthread.h>
tools/testing/selftests/rseq/rseq.c +0 -2
@@ -14,8 +14,6 @@* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. */ - -#define _GNU_SOURCE#include <errno.h> #include <sched.h> #include <stdio.h>
tools/testing/selftests/seccomp/seccomp_benchmark.c +0 -1
@@ -2,7 +2,6 @@* Strictly speaking, this is not a test. But it can report during test * runs so relative performace can be measured. */ -#define _GNU_SOURCE#include <assert.h> #include <err.h> #include <limits.h>
tools/testing/selftests/seccomp/seccomp_bpf.c +0 -2
@@ -4,8 +4,6 @@* * Test code for seccomp bpf. */ - -#define _GNU_SOURCE#include <sys/types.h> /*
tools/testing/selftests/user_events/abi_test.c +0 -2
@@ -4,8 +4,6 @@* * Copyright (c) 2022 Beau Belgrave <[email protected]> */ - -#define _GNU_SOURCE#include <sched.h> #include <errno.h>
tools/testing/selftests/x86/amx.c +0 -2
@@ -1,6 +1,4 @@// SPDX-License-Identifier: GPL-2.0 - -#define _GNU_SOURCE#include <err.h> #include <errno.h> #include <pthread.h>
tools/testing/selftests/x86/check_initial_reg_state.c +0 -3
@@ -3,9 +3,6 @@* check_initial_reg_state.c - check that execve sets the correct state * Copyright (c) 2014-2016 Andrew Lutomirski */ - -#define _GNU_SOURCE -#include <stdio.h> unsigned long ax, bx, cx, dx, si, di, bp, sp, flags;
tools/testing/selftests/x86/corrupt_xstate_header.c +0 -3
@@ -4,9 +4,6 @@* * Based on analysis and a test case from Thomas Gleixner. */ - -#define _GNU_SOURCE -#include <stdlib.h> #include <stdio.h> #include <string.h>
tools/testing/selftests/x86/entry_from_vm86.c +0 -3
@@ -5,9 +5,6 @@* * This exercises a few paths that need to special-case vm86 mode. */ - -#define _GNU_SOURCE -#include <assert.h> #include <stdlib.h> #include <sys/syscall.h>
tools/testing/selftests/x86/fsgsbase.c +0 -2
@@ -3,8 +3,6 @@* fsgsbase.c, an fsgsbase test * Copyright (c) 2014-2016 Andy Lutomirski */ - -#define _GNU_SOURCE#include <stdio.h> #include <stdlib.h> #include <stdbool.h>
tools/testing/selftests/x86/fsgsbase_restore.c +0 -2
@@ -12,8 +12,6 @@* * This is not part of fsgsbase.c, because that test is 64-bit only. */ - -#define _GNU_SOURCE#include <stdio.h> #include <stdlib.h> #include <stdbool.h>
tools/testing/selftests/x86/ioperm.c +0 -2
@@ -3,8 +3,6 @@* ioperm.c - Test case for ioperm(2) * Copyright (c) 2015 Andrew Lutomirski */ - -#define _GNU_SOURCE#include <err.h> #include <stdio.h> #include <stdint.h>
tools/testing/selftests/x86/iopl.c +0 -2
@@ -3,8 +3,6 @@* iopl.c - Test case for a Linux on Xen 64-bit bug * Copyright (c) 2015 Andrew Lutomirski */ - -#define _GNU_SOURCE#include <err.h> #include <stdio.h> #include <stdint.h>
tools/testing/selftests/x86/lam.c +0 -1
@@ -1,5 +1,4 @@// SPDX-License-Identifier: GPL-2.0 -#define _GNU_SOURCE#include <stdio.h> #include <stdlib.h> #include <string.h>
tools/testing/selftests/x86/ldt_gdt.c +0 -2
@@ -3,8 +3,6 @@* ldt_gdt.c - Test cases for LDT and GDT access * Copyright (c) 2015 Andrew Lutomirski */ - -#define _GNU_SOURCE#include <err.h> #include <stdio.h> #include <stdint.h>
tools/testing/selftests/x86/mov_ss_trap.c +0 -2
@@ -19,8 +19,6 @@* * This should mostly cover CVE-2018-1087 and CVE-2018-8897. */ -#define _GNU_SOURCE -#include <stdlib.h> #include <sys/ptrace.h> #include <sys/types.h>
tools/testing/selftests/x86/nx_stack.c +0 -2
@@ -23,8 +23,6 @@* Regular stack is completely overwritten before testing. * Test doesn't exit SIGSEGV handler after first fault at INT3. */ -#undef _GNU_SOURCE -#define _GNU_SOURCE#undef NDEBUG#include <assert.h> #include <signal.h>
tools/testing/selftests/x86/ptrace_syscall.c +0 -2
@@ -1,6 +1,4 @@// SPDX-License-Identifier: GPL-2.0 -#define _GNU_SOURCE -#include <sys/ptrace.h> #include <sys/types.h> #include <sys/wait.h>
tools/testing/selftests/x86/sigaltstack.c +0 -2
@@ -1,6 +1,4 @@// SPDX-License-Identifier: GPL-2.0-only - -#define _GNU_SOURCE#include <signal.h> #include <stdio.h> #include <stdbool.h>
tools/testing/selftests/x86/sigreturn.c +0 -3
@@ -24,9 +24,6 @@* * Do not run on outdated, unpatched kernels at risk of nasty crashes. */ - -#define _GNU_SOURCE -#include <sys/time.h> #include <time.h> #include <stdlib.h>
tools/testing/selftests/x86/single_step_syscall.c +0 -3
@@ -9,9 +9,6 @@* immediately issues #DB from CPL 0. This requires special handling in * the kernel. */ - -#define _GNU_SOURCE -#include <sys/time.h> #include <time.h> #include <stdlib.h>
tools/testing/selftests/x86/syscall_arg_fault.c +0 -3
@@ -3,9 +3,6 @@* syscall_arg_fault.c - tests faults 32-bit fast syscall stack args * Copyright (c) 2015 Andrew Lutomirski */ - -#define _GNU_SOURCE -#include <stdlib.h> #include <stdio.h> #include <string.h>
tools/testing/selftests/x86/syscall_numbering.c +0 -3
@@ -5,9 +5,6 @@* * Copyright (c) 2018 Andrew Lutomirski */ - -#define _GNU_SOURCE -#include <stdlib.h> #include <stdio.h> #include <stdbool.h>
tools/testing/selftests/x86/sysret_rip.c +0 -3
@@ -3,9 +3,6 @@* sigreturn.c - tests that x86 avoids Intel SYSRET pitfalls * Copyright (c) 2014-2016 Andrew Lutomirski */ - -#define _GNU_SOURCE -#include <stdlib.h> #include <unistd.h> #include <stdio.h>
tools/testing/selftests/x86/sysret_ss_attrs.c +0 -3
@@ -7,9 +7,6 @@* the hidden attributes set to an unusable state. Make sure the kernel * doesn't let this happen. */ - -#define _GNU_SOURCE -#include <stdlib.h> #include <unistd.h> #include <stdio.h>
tools/testing/selftests/x86/test_FCMOV.c +0 -4
@@ -1,8 +1,4 @@// SPDX-License-Identifier: GPL-2.0 -#undef _GNU_SOURCE -#define _GNU_SOURCE 1 -#undef __USE_GNU -#define __USE_GNU 1#include <unistd.h> #include <stdlib.h> #include <string.h>
tools/testing/selftests/x86/test_FCOMI.c +0 -4
@@ -1,8 +1,4 @@// SPDX-License-Identifier: GPL-2.0 -#undef _GNU_SOURCE -#define _GNU_SOURCE 1 -#undef __USE_GNU -#define __USE_GNU 1#include <unistd.h> #include <stdlib.h> #include <string.h>
tools/testing/selftests/x86/test_FISTTP.c +0 -4
@@ -1,8 +1,4 @@// SPDX-License-Identifier: GPL-2.0 -#undef _GNU_SOURCE -#define _GNU_SOURCE 1 -#undef __USE_GNU -#define __USE_GNU 1#include <unistd.h> #include <stdlib.h> #include <string.h>
tools/testing/selftests/x86/test_mremap_vdso.c +0 -1
@@ -9,7 +9,6 @@* Can be built statically: * gcc -Os -Wall -static -m32 test_mremap_vdso.c */ -#define _GNU_SOURCE#include <stdio.h> #include <errno.h> #include <unistd.h>
tools/testing/selftests/x86/test_shadow_stack.c +0 -3
@@ -7,9 +7,6 @@* special glibc shadow stack support (longjmp(), swapcontext(), etc). Just * stick to the basics and hope the compiler doesn't do anything strange. */ - -#define _GNU_SOURCE -#include <sys/syscall.h> #include <asm/mman.h> #include <sys/mman.h>
tools/testing/selftests/x86/test_syscall_vdso.c +0 -4
@@ -8,10 +8,6 @@* Can be built statically: * gcc -Os -Wall -static -m32 test_syscall_vdso.c thunks_32.S */ -#undef _GNU_SOURCE -#define _GNU_SOURCE 1 -#undef __USE_GNU -#define __USE_GNU 1#include <unistd.h> #include <stdlib.h> #include <string.h>
tools/testing/selftests/x86/test_vsyscall.c +0 -3
@@ -1,7 +1,4 @@/* SPDX-License-Identifier: GPL-2.0 */ - -#define _GNU_SOURCE -#include <stdio.h> #include <sys/time.h> #include <time.h>
tools/testing/selftests/x86/unwind_vdso.c +0 -3
@@ -5,9 +5,6 @@* * This tests __kernel_vsyscall's unwind info. */ - -#define _GNU_SOURCE -#include <features.h> #include <stdio.h>
tools/testing/selftests/x86/vdso_restorer.c +0 -3
@@ -10,9 +10,6 @@* 64-bit userspace has never supported sa_restorer == NULL, so this is * 32-bit only. */ - -#define _GNU_SOURCE -#include <err.h> #include <stdio.h> #include <dlfcn.h>
Signature · 1 line
2.45.0.rc1.225.g2a3ae87e7f-goog
Re: [PATCH v2 4/5] selftests: Drop define _GNU_SOURCE
Quoted 5 lines · Edward Liaw
_GNU_SOURCEis provided byKHDR_INCLUDES, so it should be dropped to prevent_GNU_SOURCEredefined warnings.Fixes 809216233555 ("selftests/harness: remove use of LINE_MAX")Signed-off-by Edward Liaw <[email protected]>
Quoted 2,646 lines
--- tools/testing/selftests/cachestat/test_cachestat.c | 2 -- tools/testing/selftests/capabilities/test_execve.c | 2 -- tools/testing/selftests/clone3/clone3.c | 2 -- .../testing/selftests/clone3/clone3_cap_checkpoint_restore.c | 2 -- tools/testing/selftests/clone3/clone3_clear_sighand.c | 2 -- tools/testing/selftests/clone3/clone3_selftests.h | 1 - tools/testing/selftests/clone3/clone3_set_tid.c | 2 -- tools/testing/selftests/core/close_range_test.c | 2 -- tools/testing/selftests/drivers/dma-buf/udmabuf.c | 1 - tools/testing/selftests/fchmodat2/fchmodat2_test.c | 2 -- tools/testing/selftests/filesystems/binderfs/binderfs_test.c | 2 -- tools/testing/selftests/filesystems/devpts_pts.c | 1 - tools/testing/selftests/filesystems/dnotify_test.c | 1 - tools/testing/selftests/filesystems/epoll/epoll_wakeup_test.c | 2 -- tools/testing/selftests/filesystems/eventfd/eventfd_test.c | 2 -- tools/testing/selftests/filesystems/fat/rename_exchange.c | 2 -- tools/testing/selftests/filesystems/overlayfs/dev_in_maps.c | 2 -- .../testing/selftests/filesystems/statmount/statmount_test.c | 3 --- tools/testing/selftests/futex/functional/futex_requeue_pi.c | 3 --- tools/testing/selftests/ipc/msgque.c | 1 - tools/testing/selftests/kcmp/kcmp_test.c | 2 -- tools/testing/selftests/kvm/aarch64/arch_timer.c | 2 -- tools/testing/selftests/kvm/aarch64/page_fault_test.c | 1 - tools/testing/selftests/kvm/aarch64/psci_test.c | 3 --- tools/testing/selftests/kvm/aarch64/vgic_init.c | 1 - tools/testing/selftests/kvm/arch_timer.c | 3 --- tools/testing/selftests/kvm/demand_paging_test.c | 3 --- tools/testing/selftests/kvm/dirty_log_test.c | 3 --- tools/testing/selftests/kvm/guest_memfd_test.c | 2 -- tools/testing/selftests/kvm/hardware_disable_test.c | 3 --- tools/testing/selftests/kvm/include/userfaultfd_util.h | 3 --- tools/testing/selftests/kvm/kvm_binary_stats_test.c | 2 -- tools/testing/selftests/kvm/kvm_create_max_vcpus.c | 2 -- tools/testing/selftests/kvm/kvm_page_table_test.c | 3 --- tools/testing/selftests/kvm/lib/assert.c | 3 --- tools/testing/selftests/kvm/lib/kvm_util.c | 2 -- tools/testing/selftests/kvm/lib/memstress.c | 2 -- tools/testing/selftests/kvm/lib/test_util.c | 2 -- tools/testing/selftests/kvm/lib/userfaultfd_util.c | 3 --- tools/testing/selftests/kvm/lib/x86_64/sev.c | 1 - tools/testing/selftests/kvm/max_guest_memory_test.c | 2 -- .../testing/selftests/kvm/memslot_modification_stress_test.c | 3 --- tools/testing/selftests/kvm/riscv/arch_timer.c | 3 --- tools/testing/selftests/kvm/rseq_test.c | 1 - tools/testing/selftests/kvm/s390x/cmma_test.c | 2 -- tools/testing/selftests/kvm/s390x/sync_regs_test.c | 2 -- tools/testing/selftests/kvm/set_memory_region_test.c | 1 - tools/testing/selftests/kvm/steal_time.c | 1 - tools/testing/selftests/kvm/x86_64/amx_test.c | 2 -- .../selftests/kvm/x86_64/exit_on_emulation_failure_test.c | 3 --- tools/testing/selftests/kvm/x86_64/hwcr_msr_test.c | 2 -- tools/testing/selftests/kvm/x86_64/hyperv_cpuid.c | 2 -- tools/testing/selftests/kvm/x86_64/hyperv_evmcs.c | 1 - tools/testing/selftests/kvm/x86_64/hyperv_ipi.c | 2 -- tools/testing/selftests/kvm/x86_64/hyperv_svm_test.c | 1 - tools/testing/selftests/kvm/x86_64/hyperv_tlb_flush.c | 2 -- tools/testing/selftests/kvm/x86_64/nested_exceptions_test.c | 2 -- tools/testing/selftests/kvm/x86_64/nx_huge_pages_test.c | 3 --- tools/testing/selftests/kvm/x86_64/platform_info_test.c | 2 -- tools/testing/selftests/kvm/x86_64/pmu_counters_test.c | 2 -- tools/testing/selftests/kvm/x86_64/pmu_event_filter_test.c | 3 --- .../selftests/kvm/x86_64/private_mem_conversions_test.c | 1 - tools/testing/selftests/kvm/x86_64/set_boot_cpu_id.c | 1 - tools/testing/selftests/kvm/x86_64/set_sregs_test.c | 1 - .../selftests/kvm/x86_64/smaller_maxphyaddr_emulation_test.c | 3 --- tools/testing/selftests/kvm/x86_64/smm_test.c | 1 - tools/testing/selftests/kvm/x86_64/state_test.c | 1 - tools/testing/selftests/kvm/x86_64/sync_regs_test.c | 2 -- tools/testing/selftests/kvm/x86_64/ucna_injection_test.c | 2 -- tools/testing/selftests/kvm/x86_64/userspace_msr_exit_test.c | 2 -- tools/testing/selftests/kvm/x86_64/vmx_dirty_log_test.c | 3 --- tools/testing/selftests/kvm/x86_64/vmx_pmu_caps_test.c | 1 - .../testing/selftests/kvm/x86_64/vmx_preemption_timer_test.c | 1 - tools/testing/selftests/kvm/x86_64/xapic_ipi_test.c | 2 -- tools/testing/selftests/kvm/x86_64/xapic_state_test.c | 1 - tools/testing/selftests/kvm/x86_64/xss_msr_test.c | 2 -- tools/testing/selftests/landlock/base_test.c | 2 -- tools/testing/selftests/landlock/fs_test.c | 2 -- tools/testing/selftests/landlock/net_test.c | 2 -- tools/testing/selftests/landlock/ptrace_test.c | 2 -- tools/testing/selftests/lsm/common.c | 2 -- tools/testing/selftests/lsm/lsm_get_self_attr_test.c | 2 -- tools/testing/selftests/lsm/lsm_list_modules_test.c | 2 -- tools/testing/selftests/lsm/lsm_set_self_attr_test.c | 2 -- tools/testing/selftests/membarrier/membarrier_test_impl.h | 1 - .../selftests/membarrier/membarrier_test_multi_thread.c | 1 - .../selftests/membarrier/membarrier_test_single_thread.c | 1 - tools/testing/selftests/memfd/common.c | 1 - tools/testing/selftests/memfd/fuse_test.c | 2 -- tools/testing/selftests/memfd/memfd_test.c | 1 - tools/testing/selftests/mm/cow.c | 1 - tools/testing/selftests/mm/gup_longterm.c | 1 - tools/testing/selftests/mm/hugepage-mmap.c | 1 - tools/testing/selftests/mm/hugepage-mremap.c | 2 -- tools/testing/selftests/mm/hugetlb-madvise.c | 2 -- tools/testing/selftests/mm/hugetlb-read-hwpoison.c | 2 -- tools/testing/selftests/mm/khugepaged.c | 1 - tools/testing/selftests/mm/ksm_functional_tests.c | 1 - tools/testing/selftests/mm/madv_populate.c | 1 - tools/testing/selftests/mm/map_populate.c | 2 -- tools/testing/selftests/mm/mdwe_test.c | 1 - tools/testing/selftests/mm/memfd_secret.c | 2 -- tools/testing/selftests/mm/mlock2-tests.c | 1 - tools/testing/selftests/mm/mrelease_test.c | 1 - tools/testing/selftests/mm/mremap_dontunmap.c | 1 - tools/testing/selftests/mm/mremap_test.c | 2 -- tools/testing/selftests/mm/pagemap_ioctl.c | 1 - tools/testing/selftests/mm/pkey-helpers.h | 1 - tools/testing/selftests/mm/protection_keys.c | 1 - tools/testing/selftests/mm/split_huge_page_test.c | 2 -- tools/testing/selftests/mm/thuge-gen.c | 2 -- tools/testing/selftests/mm/uffd-common.h | 1 - tools/testing/selftests/mount_setattr/mount_setattr_test.c | 1 - .../move_mount_set_group/move_mount_set_group_test.c | 1 - tools/testing/selftests/net/af_unix/diag_uid.c | 2 -- tools/testing/selftests/net/af_unix/scm_pidfd.c | 1 - tools/testing/selftests/net/af_unix/unix_connect.c | 2 -- tools/testing/selftests/net/csum.c | 3 --- tools/testing/selftests/net/gro.c | 3 --- tools/testing/selftests/net/ip_defrag.c | 3 --- tools/testing/selftests/net/ipsec.c | 3 --- tools/testing/selftests/net/ipv6_flowlabel.c | 3 --- tools/testing/selftests/net/ipv6_flowlabel_mgr.c | 3 --- tools/testing/selftests/net/mptcp/mptcp_connect.c | 3 --- tools/testing/selftests/net/mptcp/mptcp_inq.c | 3 --- tools/testing/selftests/net/mptcp/mptcp_sockopt.c | 3 --- tools/testing/selftests/net/msg_zerocopy.c | 3 --- tools/testing/selftests/net/nettest.c | 2 -- tools/testing/selftests/net/psock_fanout.c | 3 --- tools/testing/selftests/net/psock_snd.c | 3 --- tools/testing/selftests/net/reuseport_addr_any.c | 3 --- tools/testing/selftests/net/reuseport_bpf_cpu.c | 3 --- tools/testing/selftests/net/reuseport_bpf_numa.c | 3 --- tools/testing/selftests/net/reuseport_dualstack.c | 3 --- tools/testing/selftests/net/so_incoming_cpu.c | 1 - tools/testing/selftests/net/so_netns_cookie.c | 1 - tools/testing/selftests/net/so_txtime.c | 3 --- tools/testing/selftests/net/tap.c | 3 --- tools/testing/selftests/net/tcp_fastopen_backup_key.c | 1 - tools/testing/selftests/net/tcp_inq.c | 2 -- tools/testing/selftests/net/tcp_mmap.c | 1 - tools/testing/selftests/net/tls.c | 3 --- tools/testing/selftests/net/toeplitz.c | 3 --- tools/testing/selftests/net/tun.c | 3 --- tools/testing/selftests/net/txring_overwrite.c | 3 --- tools/testing/selftests/net/txtimestamp.c | 3 --- tools/testing/selftests/net/udpgso.c | 3 --- tools/testing/selftests/net/udpgso_bench_rx.c | 3 --- tools/testing/selftests/net/udpgso_bench_tx.c | 3 --- tools/testing/selftests/perf_events/remove_on_exec.c | 2 -- tools/testing/selftests/perf_events/sigtrap_threads.c | 2 -- tools/testing/selftests/pid_namespace/regression_enomem.c | 1 - tools/testing/selftests/pidfd/pidfd.h | 1 - tools/testing/selftests/pidfd/pidfd_fdinfo_test.c | 2 -- tools/testing/selftests/pidfd/pidfd_getfd_test.c | 2 -- tools/testing/selftests/pidfd/pidfd_open_test.c | 2 -- tools/testing/selftests/pidfd/pidfd_poll_test.c | 2 -- tools/testing/selftests/pidfd/pidfd_setns_test.c | 2 -- tools/testing/selftests/pidfd/pidfd_test.c | 2 -- tools/testing/selftests/pidfd/pidfd_wait.c | 2 -- tools/testing/selftests/ptrace/get_set_sud.c | 1 - tools/testing/selftests/ptrace/peeksiginfo.c | 1 - tools/testing/selftests/rseq/basic_percpu_ops_test.c | 1 - tools/testing/selftests/rseq/basic_test.c | 2 -- tools/testing/selftests/rseq/param_test.c | 1 - tools/testing/selftests/rseq/rseq.c | 2 -- tools/testing/selftests/seccomp/seccomp_benchmark.c | 1 - tools/testing/selftests/seccomp/seccomp_bpf.c | 2 -- tools/testing/selftests/user_events/abi_test.c | 2 -- tools/testing/selftests/x86/amx.c | 2 -- tools/testing/selftests/x86/check_initial_reg_state.c | 3 --- tools/testing/selftests/x86/corrupt_xstate_header.c | 3 --- tools/testing/selftests/x86/entry_from_vm86.c | 3 --- tools/testing/selftests/x86/fsgsbase.c | 2 -- tools/testing/selftests/x86/fsgsbase_restore.c | 2 -- tools/testing/selftests/x86/ioperm.c | 2 -- tools/testing/selftests/x86/iopl.c | 2 -- tools/testing/selftests/x86/lam.c | 1 - tools/testing/selftests/x86/ldt_gdt.c | 2 -- tools/testing/selftests/x86/mov_ss_trap.c | 2 -- tools/testing/selftests/x86/nx_stack.c | 2 -- tools/testing/selftests/x86/ptrace_syscall.c | 2 -- tools/testing/selftests/x86/sigaltstack.c | 2 -- tools/testing/selftests/x86/sigreturn.c | 3 --- tools/testing/selftests/x86/single_step_syscall.c | 3 --- tools/testing/selftests/x86/syscall_arg_fault.c | 3 --- tools/testing/selftests/x86/syscall_numbering.c | 3 --- tools/testing/selftests/x86/sysret_rip.c | 3 --- tools/testing/selftests/x86/sysret_ss_attrs.c | 3 --- tools/testing/selftests/x86/test_FCMOV.c | 4 ---- tools/testing/selftests/x86/test_FCOMI.c | 4 ---- tools/testing/selftests/x86/test_FISTTP.c | 4 ---- tools/testing/selftests/x86/test_mremap_vdso.c | 1 - tools/testing/selftests/x86/test_shadow_stack.c | 3 --- tools/testing/selftests/x86/test_syscall_vdso.c | 4 ---- tools/testing/selftests/x86/test_vsyscall.c | 3 --- tools/testing/selftests/x86/unwind_vdso.c | 3 --- tools/testing/selftests/x86/vdso_restorer.c | 3 --- 198 files changed, 405 deletions(-)tools/testing/selftests/cachestat/test_cachestat.c +0
-2@@ -1,6 +1,4 @@// SPDX-License-Identifier: GPL-2.0 -#define _GNU_SOURCE -#include <stdio.h> #include <stdbool.h> #include <linux/kernel.h> tools/testing/selftests/capabilities/test_execve.c +0
-2@@ -1,6 +1,4 @@// SPDX-License-Identifier: GPL-2.0 -#define _GNU_SOURCE -#include <cap-ng.h> #include <linux/capability.h> #include <stdbool.h> tools/testing/selftests/clone3/clone3.c +0
-2@@ -1,8 +1,6 @@// SPDX-License-Identifier: GPL-2.0 /* Based on Christian Brauner's clone3() example */ - -#define _GNU_SOURCE#include <errno.h> #include <inttypes.h> #include <linux/types.h> tools/testing/selftests/clone3/clone3_cap_checkpoint_restore.c +0
-2@@ -7,8 +7,6 @@*/ /* capabilities related code based on selftests/bpf/test_verifier.c */ - -#define _GNU_SOURCE#include <errno.h> #include <linux/types.h> #include <linux/sched.h> tools/testing/selftests/clone3/clone3_clear_sighand.c +0
-2@@ -1,6 +1,4 @@/* SPDX-License-Identifier: GPL-2.0 */ - -#define _GNU_SOURCE#include <errno.h> #include <sched.h> #include <signal.h> tools/testing/selftests/clone3/clone3_selftests.h +0
-1@@ -3,7 +3,6 @@#ifndef _CLONE3_SELFTESTS_H#define _CLONE3_SELFTESTS_H -#define _GNU_SOURCE#include <sched.h> #include <linux/sched.h> #include <linux/types.h> tools/testing/selftests/clone3/clone3_set_tid.c +0
-2@@ -5,8 +5,6 @@* These tests are assuming to be running in the host's * PID namespace. */ - -#define _GNU_SOURCE#include <errno.h> #include <linux/types.h> #include <linux/sched.h> tools/testing/selftests/core/close_range_test.c +0
-2@@ -1,6 +1,4 @@// SPDX-License-Identifier: GPL-2.0 - -#define _GNU_SOURCE#include <errno.h> #include <fcntl.h> #include <linux/kernel.h> tools/testing/selftests/drivers/dma-buf/udmabuf.c +0
-1@@ -1,5 +1,4 @@// SPDX-License-Identifier: GPL-2.0 -#define _GNU_SOURCE#define __EXPORTED_HEADERS__#include <stdio.h> tools/testing/selftests/fchmodat2/fchmodat2_test.c +0
-2@@ -1,6 +1,4 @@// SPDX-License-Identifier: GPL-2.0-or-later - -#define _GNU_SOURCE#include <fcntl.h> #include <sys/stat.h> #include <sys/types.h> tools/testing/selftests/filesystems/binderfs/binderfs_test.c +0
-2@@ -1,6 +1,4 @@// SPDX-License-Identifier: GPL-2.0 - -#define _GNU_SOURCE#include <errno.h> #include <fcntl.h> #include <pthread.h> tools/testing/selftests/filesystems/devpts_pts.c +0
-1@@ -1,5 +1,4 @@// SPDX-License-Identifier: GPL-2.0 -#define _GNU_SOURCE#include <errno.h> #include <fcntl.h> #include <sched.h> tools/testing/selftests/filesystems/dnotify_test.c +0
-1@@ -1,5 +1,4 @@// SPDX-License-Identifier: GPL-2.0 -#define _GNU_SOURCE/* needed to get the defines */ #include <fcntl.h> /* in glibc 2.2 this has the needed values defined */ #include <signal.h> tools/testing/selftests/filesystems/epoll/epoll_wakeup_test.c +0
-2@@ -1,6 +1,4 @@// SPDX-License-Identifier: GPL-2.0 - -#define _GNU_SOURCE#include <asm/unistd.h> #include <linux/time_types.h> #include <poll.h> tools/testing/selftests/filesystems/eventfd/eventfd_test.c +0
-2@@ -1,6 +1,4 @@// SPDX-License-Identifier: GPL-2.0 - -#define _GNU_SOURCE#include <errno.h> #include <fcntl.h> #include <asm/unistd.h> tools/testing/selftests/filesystems/fat/rename_exchange.c +0
-2@@ -6,8 +6,6 @@* Copyright 2022 Red Hat Inc. * Author: Javier Martinez Canillas <[email protected]> */ - -#define _GNU_SOURCE#include <fcntl.h> #include <stdio.h> #include <stdlib.h> tools/testing/selftests/filesystems/overlayfs/dev_in_maps.c +0
-2@@ -1,6 +1,4 @@// SPDX-License-Identifier: GPL-2.0 -#define _GNU_SOURCE -#include <inttypes.h> #include <unistd.h> #include <stdio.h> tools/testing/selftests/filesystems/statmount/statmount_test.c +0
-3@@ -1,7 +1,4 @@// SPDX-License-Identifier: GPL-2.0-or-later - -#define _GNU_SOURCE -#include <assert.h> #include <stdint.h> #include <sched.h> tools/testing/selftests/futex/functional/futex_requeue_pi.c +0
-3@@ -16,9 +16,6 @@* 2009-Nov-6: futex test adaptation by Darren Hart <[email protected]> * *****************************************************************************/ - -#define _GNU_SOURCE -#include <errno.h> #include <limits.h> #include <pthread.h> tools/testing/selftests/ipc/msgque.c +0
-1@@ -1,5 +1,4 @@// SPDX-License-Identifier: GPL-2.0 -#define _GNU_SOURCE#include <stdlib.h> #include <stdio.h> #include <string.h> tools/testing/selftests/kcmp/kcmp_test.c +0
-2@@ -1,6 +1,4 @@// SPDX-License-Identifier: GPL-2.0 -#define _GNU_SOURCE -#include <stdio.h> #include <stdlib.h> #include <signal.h> tools/testing/selftests/kvm/aarch64/arch_timer.c +0
-2@@ -5,8 +5,6 @@* * Copyright (c) 2021, Google LLC. */ -#define _GNU_SOURCE -#include "arch_timer.h" #include "delay.h" #include "gic.h" tools/testing/selftests/kvm/aarch64/page_fault_test.c +0
-1@@ -7,7 +7,6 @@* hugetlbfs with a hole). It checks that the expected handling method is * called (e.g., uffd faults with the right address and write/read flag). */ -#define _GNU_SOURCE#include <linux/bitmap.h> #include <fcntl.h> #include <test_util.h> tools/testing/selftests/kvm/aarch64/psci_test.c +0
-3@@ -10,9 +10,6 @@* - A test for KVM's handling of PSCI SYSTEM_SUSPEND and the associated * KVM_SYSTEM_EVENT_SUSPEND UAPI. */ - -#define _GNU_SOURCE -#include <linux/psci.h> #include "kvm_util.h" tools/testing/selftests/kvm/aarch64/vgic_init.c +0
-1@@ -4,7 +4,6 @@* * Copyright (C) 2020, Red Hat, Inc. */ -#define _GNU_SOURCE#include <linux/kernel.h> #include <sys/syscall.h> #include <asm/kvm.h> tools/testing/selftests/kvm/arch_timer.c +0
-3@@ -19,9 +19,6 @@* * Copyright (c) 2021, Google LLC. */ - -#define _GNU_SOURCE -#include <stdlib.h> #include <pthread.h> #include <linux/sizes.h> tools/testing/selftests/kvm/demand_paging_test.c +0
-3@@ -6,9 +6,6 @@* Copyright (C) 2018, Red Hat, Inc. * Copyright (C) 2019, Google, Inc. */ - -#define _GNU_SOURCE/* for pipe2 */ -#include <inttypes.h> #include <stdio.h> #include <stdlib.h> tools/testing/selftests/kvm/dirty_log_test.c +0
-3@@ -4,9 +4,6 @@* * Copyright (C) 2018, Red Hat, Inc. */ - -#define _GNU_SOURCE/* for program_invocation_name */ -#include <stdio.h> #include <stdlib.h> #include <pthread.h> tools/testing/selftests/kvm/guest_memfd_test.c +0
-2@@ -4,8 +4,6 @@* * Author: Chao Peng <[email protected]> */ - -#define _GNU_SOURCE#include <stdlib.h> #include <string.h> #include <unistd.h> tools/testing/selftests/kvm/hardware_disable_test.c +0
-3@@ -4,9 +4,6 @@* kvm_arch_hardware_disable is called and it attempts to unregister the user * return notifiers. */ - -#define _GNU_SOURCE -#include <fcntl.h> #include <pthread.h> #include <semaphore.h> tools/testing/selftests/kvm/include/userfaultfd_util.h +0
-3@@ -5,9 +5,6 @@* Copyright (C) 2018, Red Hat, Inc. * Copyright (C) 2019-2022 Google LLC */ - -#define _GNU_SOURCE/* for pipe2 */ -#include <inttypes.h> #include <time.h> #include <pthread.h> tools/testing/selftests/kvm/kvm_binary_stats_test.c +0
-2@@ -6,8 +6,6 @@* * Test the fd-based interface for KVM statistics. */ - -#define _GNU_SOURCE/* for program_invocation_short_name */ #include <fcntl.h> #include <stdio.h> #include <stdlib.h> tools/testing/selftests/kvm/kvm_create_max_vcpus.c +0
-2@@ -6,8 +6,6 @@* * Test for KVM_CAP_MAX_VCPUS and KVM_CAP_MAX_VCPU_ID. */ - -#define _GNU_SOURCE/* for program_invocation_short_name */ #include <fcntl.h> #include <stdio.h> #include <stdlib.h> tools/testing/selftests/kvm/kvm_page_table_test.c +0
-3@@ -8,9 +8,6 @@* page size have been pre-allocated on your system, if you are planning to * use hugepages to back the guest memory for testing. */ - -#define _GNU_SOURCE/* for program_invocation_name */ -#include <stdio.h> #include <stdlib.h> #include <time.h> tools/testing/selftests/kvm/lib/assert.c +0
-3@@ -4,9 +4,6 @@* * Copyright (C) 2018, Google LLC. */ - -#define _GNU_SOURCE/* for getline(3) and strchrnul(3)*/ -#include "test_util.h" #include <execinfo.h> tools/testing/selftests/kvm/lib/kvm_util.c +0
-2@@ -4,8 +4,6 @@* * Copyright (C) 2018, Google LLC. */ - -#define _GNU_SOURCE/* for program_invocation_name */ #include "test_util.h" #include "kvm_util.h" #include "processor.h" tools/testing/selftests/kvm/lib/memstress.c +0
-2@@ -2,8 +2,6 @@/* * Copyright (C) 2020, Google LLC. */ -#define _GNU_SOURCE -#include <inttypes.h> #include <linux/bitmap.h> tools/testing/selftests/kvm/lib/test_util.c +0
-2@@ -4,8 +4,6 @@* * Copyright (C) 2020, Google LLC. */ - -#define _GNU_SOURCE#include <stdio.h> #include <stdarg.h> #include <assert.h> tools/testing/selftests/kvm/lib/userfaultfd_util.c +0
-3@@ -6,9 +6,6 @@* Copyright (C) 2018, Red Hat, Inc. * Copyright (C) 2019-2022 Google LLC */ - -#define _GNU_SOURCE/* for pipe2 */ -#include <inttypes.h> #include <stdio.h> #include <stdlib.h> tools/testing/selftests/kvm/lib/x86_64/sev.c +0
-1@@ -1,5 +1,4 @@// SPDX-License-Identifier: GPL-2.0-only -#define _GNU_SOURCE/* for program_invocation_short_name */ #include <stdint.h> #include <stdbool.h> tools/testing/selftests/kvm/max_guest_memory_test.c +0
-2@@ -1,6 +1,4 @@// SPDX-License-Identifier: GPL-2.0 -#define _GNU_SOURCE -#include <stdio.h> #include <stdlib.h> #include <pthread.h> tools/testing/selftests/kvm/memslot_modification_stress_test.c +0
-3@@ -6,9 +6,6 @@* Copyright (C) 2018, Red Hat, Inc. * Copyright (C) 2020, Google, Inc. */ - -#define _GNU_SOURCE/* for program_invocation_name */ -#include <stdio.h> #include <stdlib.h> #include <sys/syscall.h> tools/testing/selftests/kvm/riscv/arch_timer.c +0
-3@@ -7,9 +7,6 @@* * Copyright (c) 2024, Intel Corporation. */ - -#define _GNU_SOURCE -#include "arch_timer.h" #include "kvm_util.h" #include "processor.h" tools/testing/selftests/kvm/rseq_test.c +0
-1@@ -1,5 +1,4 @@// SPDX-License-Identifier: GPL-2.0-only -#define _GNU_SOURCE/* for program_invocation_short_name */ #include <errno.h> #include <fcntl.h> #include <pthread.h> tools/testing/selftests/kvm/s390x/cmma_test.c +0
-2@@ -7,8 +7,6 @@* Authors: * Nico Boehr <[email protected]> */ - -#define _GNU_SOURCE/* for program_invocation_short_name */ #include <fcntl.h> #include <stdio.h> #include <stdlib.h> tools/testing/selftests/kvm/s390x/sync_regs_test.c +0
-2@@ -10,8 +10,6 @@* * Test expected behavior of the KVM_CAP_SYNC_REGS functionality. */ - -#define _GNU_SOURCE/* for program_invocation_short_name */ #include <fcntl.h> #include <stdio.h> #include <stdlib.h> tools/testing/selftests/kvm/set_memory_region_test.c +0
-1@@ -1,5 +1,4 @@// SPDX-License-Identifier: GPL-2.0 -#define _GNU_SOURCE/* for program_invocation_short_name */ #include <fcntl.h> #include <pthread.h> #include <sched.h> tools/testing/selftests/kvm/steal_time.c +0
-1@@ -4,7 +4,6 @@* * Copyright (C) 2020, Red Hat, Inc. */ -#define _GNU_SOURCE#include <stdio.h> #include <time.h> #include <sched.h> tools/testing/selftests/kvm/x86_64/amx_test.c +0
-2@@ -6,8 +6,6 @@* * Tests for amx #NM exception and save/restore. */ - -#define _GNU_SOURCE/* for program_invocation_short_name */ #include <fcntl.h> #include <stdio.h> #include <stdlib.h> tools/testing/selftests/kvm/x86_64/exit_on_emulation_failure_test.c +0
-3@@ -4,9 +4,6 @@* * Test for KVM_CAP_EXIT_ON_EMULATION_FAILURE. */ - -#define _GNU_SOURCE/* for program_invocation_short_name */ -#include "flds_emulation.h" #include "test_util.h" tools/testing/selftests/kvm/x86_64/hwcr_msr_test.c +0
-2@@ -2,8 +2,6 @@/* * Copyright (C) 2023, Google LLC. */ - -#define _GNU_SOURCE/* for program_invocation_short_name */ #include <sys/ioctl.h> #include "test_util.h" tools/testing/selftests/kvm/x86_64/hyperv_cpuid.c +0
-2@@ -7,8 +7,6 @@* This work is licensed under the terms of the GNU GPL, version 2. * */ - -#define _GNU_SOURCE/* for program_invocation_short_name */ #include <fcntl.h> #include <stdio.h> #include <stdlib.h> tools/testing/selftests/kvm/x86_64/hyperv_evmcs.c +0
-1@@ -4,7 +4,6 @@* * Tests for Enlightened VMCS, including nested guest state. */ -#define _GNU_SOURCE/* for program_invocation_short_name */ #include <fcntl.h> #include <stdio.h> #include <stdlib.h> tools/testing/selftests/kvm/x86_64/hyperv_ipi.c +0
-2@@ -5,8 +5,6 @@* Copyright (C) 2022, Red Hat, Inc. * */ - -#define _GNU_SOURCE/* for program_invocation_short_name */ #include <pthread.h> #include <inttypes.h> tools/testing/selftests/kvm/x86_64/hyperv_svm_test.c +0
-1@@ -4,7 +4,6 @@* * Tests for Hyper-V extensions to SVM. */ -#define _GNU_SOURCE/* for program_invocation_short_name */ #include <fcntl.h> #include <stdio.h> #include <stdlib.h> tools/testing/selftests/kvm/x86_64/hyperv_tlb_flush.c +0
-2@@ -5,8 +5,6 @@* Copyright (C) 2022, Red Hat, Inc. * */ - -#define _GNU_SOURCE/* for program_invocation_short_name */ #include <asm/barrier.h> #include <pthread.h> #include <inttypes.h> tools/testing/selftests/kvm/x86_64/nested_exceptions_test.c +0
-2@@ -1,6 +1,4 @@// SPDX-License-Identifier: GPL-2.0-only -#define _GNU_SOURCE/* for program_invocation_short_name */ -#include "test_util.h" #include "kvm_util.h" #include "processor.h" tools/testing/selftests/kvm/x86_64/nx_huge_pages_test.c +0
-3@@ -5,9 +5,6 @@* * Copyright (C) 2022, Google LLC. */ - -#define _GNU_SOURCE -#include <fcntl.h> #include <stdint.h> #include <time.h> tools/testing/selftests/kvm/x86_64/platform_info_test.c +0
-2@@ -9,8 +9,6 @@* Verifies expected behavior of controlling guest access to * MSR_PLATFORM_INFO. */ - -#define _GNU_SOURCE/* for program_invocation_short_name */ #include <fcntl.h> #include <stdio.h> #include <stdlib.h> tools/testing/selftests/kvm/x86_64/pmu_counters_test.c +0
-2@@ -2,8 +2,6 @@/* * Copyright (C) 2023, Tencent, Inc. */ - -#define _GNU_SOURCE/* for program_invocation_short_name */ #include <x86intrin.h> #include "pmu.h" tools/testing/selftests/kvm/x86_64/pmu_event_filter_test.c +0
-3@@ -9,9 +9,6 @@* Verifies the expected behavior of allow lists and deny lists for * virtual PMU events. */ - -#define _GNU_SOURCE/* for program_invocation_short_name */ -#include "kvm_util.h" #include "pmu.h" #include "processor.h" tools/testing/selftests/kvm/x86_64/private_mem_conversions_test.c +0
-1@@ -2,7 +2,6 @@/* * Copyright (C) 2022, Google LLC. */ -#define _GNU_SOURCE/* for program_invocation_short_name */ #include <fcntl.h> #include <limits.h> #include <pthread.h> tools/testing/selftests/kvm/x86_64/set_boot_cpu_id.c +0
-1@@ -4,7 +4,6 @@* * Copyright (C) 2020, Red Hat, Inc. */ -#define _GNU_SOURCE/* for program_invocation_name */ #include <fcntl.h> #include <stdio.h> #include <stdlib.h> tools/testing/selftests/kvm/x86_64/set_sregs_test.c +0
-1@@ -10,7 +10,6 @@* That bug allowed a user-mode program that called the KVM_SET_SREGS * ioctl to put a VCPU's local APIC into an invalid state. */ -#define _GNU_SOURCE/* for program_invocation_short_name */ #include <fcntl.h> #include <stdio.h> #include <stdlib.h> tools/testing/selftests/kvm/x86_64/smaller_maxphyaddr_emulation_test.c +0
-3@@ -5,9 +5,6 @@* Test that KVM emulates instructions in response to EPT violations when * allow_smaller_maxphyaddr is enabled and guest.MAXPHYADDR < host.MAXPHYADDR. */ - -#define _GNU_SOURCE/* for program_invocation_short_name */ -#include "flds_emulation.h" #include "test_util.h" tools/testing/selftests/kvm/x86_64/smm_test.c +0
-1@@ -4,7 +4,6 @@* * Tests for SMM. */ -#define _GNU_SOURCE/* for program_invocation_short_name */ #include <fcntl.h> #include <stdio.h> #include <stdlib.h> tools/testing/selftests/kvm/x86_64/state_test.c +0
-1@@ -6,7 +6,6 @@* * Tests for vCPU state save/restore, including nested guest state. */ -#define _GNU_SOURCE/* for program_invocation_short_name */ #include <fcntl.h> #include <stdio.h> #include <stdlib.h> tools/testing/selftests/kvm/x86_64/sync_regs_test.c +0
-2@@ -8,8 +8,6 @@* including requesting an invalid register set, updates to/from values * in kvm_run.s.regs when kvm_valid_regs and kvm_dirty_regs are toggled. */ - -#define _GNU_SOURCE/* for program_invocation_short_name */ #include <fcntl.h> #include <stdio.h> #include <stdlib.h> tools/testing/selftests/kvm/x86_64/ucna_injection_test.c +0
-2@@ -17,8 +17,6 @@* delivered into the guest or not. * */ - -#define _GNU_SOURCE/* for program_invocation_short_name */ #include <pthread.h> #include <inttypes.h> #include <string.h> tools/testing/selftests/kvm/x86_64/userspace_msr_exit_test.c +0
-2@@ -4,8 +4,6 @@* * Tests for exiting into userspace on registered MSRs */ - -#define _GNU_SOURCE/* for program_invocation_short_name */ #include <sys/ioctl.h> #include "kvm_test_harness.h" tools/testing/selftests/kvm/x86_64/vmx_dirty_log_test.c +0
-3@@ -4,9 +4,6 @@* * Copyright (C) 2018, Red Hat, Inc. */ - -#define _GNU_SOURCE/* for program_invocation_name */ -#include <stdio.h> #include <stdlib.h> #include <linux/bitmap.h> tools/testing/selftests/kvm/x86_64/vmx_pmu_caps_test.c +0
-1@@ -10,7 +10,6 @@* and check it can be retrieved with KVM_GET_MSR, also test * the invalid LBR formats are rejected. */ -#define _GNU_SOURCE/* for program_invocation_short_name */ #include <sys/ioctl.h> #include <linux/bitmap.h> tools/testing/selftests/kvm/x86_64/vmx_preemption_timer_test.c +0
-1@@ -9,7 +9,6 @@* value instead of partially decayed timer value * */ -#define _GNU_SOURCE/* for program_invocation_short_name */ #include <fcntl.h> #include <stdio.h> #include <stdlib.h> tools/testing/selftests/kvm/x86_64/xapic_ipi_test.c +0
-2@@ -19,8 +19,6 @@* Migration is a command line option. When used on non-numa machines will * exit with error. Test is still usefull on non-numa for testing IPIs. */ - -#define _GNU_SOURCE/* for program_invocation_short_name */ #include <getopt.h> #include <pthread.h> #include <inttypes.h> tools/testing/selftests/kvm/x86_64/xapic_state_test.c +0
-1@@ -1,5 +1,4 @@// SPDX-License-Identifier: GPL-2.0-only -#define _GNU_SOURCE/* for program_invocation_short_name */ #include <fcntl.h> #include <stdio.h> #include <stdlib.h> tools/testing/selftests/kvm/x86_64/xss_msr_test.c +0
-2@@ -4,8 +4,6 @@* * Tests for the IA32_XSS MSR. */ - -#define _GNU_SOURCE/* for program_invocation_short_name */ #include <sys/ioctl.h> #include "test_util.h" tools/testing/selftests/landlock/base_test.c +0
-2@@ -5,8 +5,6 @@* Copyright ? 2017-2020 Micka?l Sala?n <[email protected]> * Copyright ? 2019-2020 ANSSI */ - -#define _GNU_SOURCE#include <errno.h> #include <fcntl.h> #include <linux/landlock.h> tools/testing/selftests/landlock/fs_test.c +0
-2@@ -6,8 +6,6 @@* Copyright ? 2020 ANSSI * Copyright ? 2020-2022 Microsoft Corporation */ - -#define _GNU_SOURCE#include <fcntl.h> #include <linux/landlock.h> #include <linux/magic.h> tools/testing/selftests/landlock/net_test.c +0
-2@@ -5,8 +5,6 @@* Copyright ? 2022-2023 Huawei Tech. Co., Ltd. * Copyright ? 2023 Microsoft Corporation */ - -#define _GNU_SOURCE#include <arpa/inet.h> #include <errno.h> #include <fcntl.h> tools/testing/selftests/landlock/ptrace_test.c +0
-2@@ -5,8 +5,6 @@* Copyright ? 2017-2020 Micka?l Sala?n <[email protected]> * Copyright ? 2019-2020 ANSSI */ - -#define _GNU_SOURCE#include <errno.h> #include <fcntl.h> #include <linux/landlock.h> tools/testing/selftests/lsm/common.c +0
-2@@ -4,8 +4,6 @@* * Copyright ? 2023 Casey Schaufler <[email protected]> */ - -#define _GNU_SOURCE#include <linux/lsm.h> #include <fcntl.h> #include <string.h> tools/testing/selftests/lsm/lsm_get_self_attr_test.c +0
-2@@ -5,8 +5,6 @@* * Copyright ? 2022 Casey Schaufler <[email protected]> */ - -#define _GNU_SOURCE#include <linux/lsm.h> #include <fcntl.h> #include <string.h> tools/testing/selftests/lsm/lsm_list_modules_test.c +0
-2@@ -5,8 +5,6 @@* * Copyright ? 2022 Casey Schaufler <[email protected]> */ - -#define _GNU_SOURCE#include <linux/lsm.h> #include <string.h> #include <stdio.h> tools/testing/selftests/lsm/lsm_set_self_attr_test.c +0
-2@@ -5,8 +5,6 @@* * Copyright ? 2022 Casey Schaufler <[email protected]> */ - -#define _GNU_SOURCE#include <linux/lsm.h> #include <string.h> #include <stdio.h> tools/testing/selftests/membarrier/membarrier_test_impl.h +0
-1@@ -1,5 +1,4 @@/* SPDX-License-Identifier: GPL-2.0 */ -#define _GNU_SOURCE#include <linux/membarrier.h> #include <syscall.h> #include <stdio.h> tools/testing/selftests/membarrier/membarrier_test_multi_thread.c +0
-1@@ -1,5 +1,4 @@// SPDX-License-Identifier: GPL-2.0 -#define _GNU_SOURCE#include <linux/membarrier.h> #include <syscall.h> #include <stdio.h> tools/testing/selftests/membarrier/membarrier_test_single_thread.c +0
-1@@ -1,5 +1,4 @@// SPDX-License-Identifier: GPL-2.0 -#define _GNU_SOURCE#include <linux/membarrier.h> #include <syscall.h> #include <stdio.h> tools/testing/selftests/memfd/common.c +0
-1@@ -1,5 +1,4 @@// SPDX-License-Identifier: GPL-2.0 -#define _GNU_SOURCE#define __EXPORTED_HEADERS__#include <stdio.h> tools/testing/selftests/memfd/fuse_test.c +0
-2@@ -12,8 +12,6 @@* the read() syscall with our memory-mapped memfd object as receive buffer to * force the kernel to write into our memfd object. */ - -#define _GNU_SOURCE#define __EXPORTED_HEADERS__#include <errno.h> tools/testing/selftests/memfd/memfd_test.c +0
-1@@ -1,5 +1,4 @@// SPDX-License-Identifier: GPL-2.0 -#define _GNU_SOURCE#define __EXPORTED_HEADERS__#include <errno.h> tools/testing/selftests/mm/cow.c +0
-1@@ -6,7 +6,6 @@* * Author(s): David Hildenbrand <[email protected]> */ -#define _GNU_SOURCE#include <stdlib.h> #include <string.h> #include <stdbool.h> tools/testing/selftests/mm/gup_longterm.c +0
-1@@ -6,7 +6,6 @@* * Author(s): David Hildenbrand <[email protected]> */ -#define _GNU_SOURCE#include <stdlib.h> #include <string.h> #include <stdbool.h> tools/testing/selftests/mm/hugepage-mmap.c +0
-1@@ -16,7 +16,6 @@* range. * Other architectures, such as ppc64, i386 or x86_64 are not so constrained. */ -#define _GNU_SOURCE#include <stdlib.h> #include <stdio.h> #include <unistd.h> tools/testing/selftests/mm/hugepage-mremap.c +0
-2@@ -11,8 +11,6 @@* To make sure the test triggers pmd sharing and goes through the 'unshare' * path in the mremap code use 1GB (1024) or more. */ - -#define _GNU_SOURCE#include <stdlib.h> #include <stdio.h> #include <unistd.h> tools/testing/selftests/mm/hugetlb-madvise.c +0
-2@@ -11,8 +11,6 @@* filesystem. Therefore, a hugetlbfs filesystem must be mounted on some * directory. */ - -#define _GNU_SOURCE#include <stdlib.h> #include <stdio.h> #include <unistd.h> tools/testing/selftests/mm/hugetlb-read-hwpoison.c +0
-2@@ -1,6 +1,4 @@// SPDX-License-Identifier: GPL-2.0 - -#define _GNU_SOURCE#include <stdlib.h> #include <stdio.h> #include <string.h> tools/testing/selftests/mm/khugepaged.c +0
-1@@ -1,4 +1,3 @@ -#define _GNU_SOURCE#include <ctype.h> #include <errno.h> #include <fcntl.h> tools/testing/selftests/mm/ksm_functional_tests.c +0
-1@@ -6,7 +6,6 @@* * Author(s): David Hildenbrand <[email protected]> */ -#define _GNU_SOURCE#include <stdlib.h> #include <string.h> #include <stdbool.h> tools/testing/selftests/mm/madv_populate.c +0
-1@@ -6,7 +6,6 @@* * Author(s): David Hildenbrand <[email protected]> */ -#define _GNU_SOURCE#include <stdlib.h> #include <string.h> #include <stdbool.h> tools/testing/selftests/mm/map_populate.c +0
-2@@ -4,8 +4,6 @@* * MAP_POPULATE | MAP_PRIVATE should COW VMA pages. */ - -#define _GNU_SOURCE#include <errno.h> #include <fcntl.h> #include <sys/mman.h> tools/testing/selftests/mm/mdwe_test.c +0
-1@@ -7,7 +7,6 @@#include <linux/mman.h> #include <linux/prctl.h> -#define _GNU_SOURCE#include <stdio.h> #include <stdlib.h> #include <sys/auxv.h> tools/testing/selftests/mm/memfd_secret.c +0
-2@@ -4,8 +4,6 @@* * Author: Mike Rapoport <[email protected]> */ - -#define _GNU_SOURCE#include <sys/uio.h> #include <sys/mman.h> #include <sys/wait.h> tools/testing/selftests/mm/mlock2-tests.c +0
-1@@ -1,5 +1,4 @@// SPDX-License-Identifier: GPL-2.0 -#define _GNU_SOURCE#include <sys/mman.h> #include <stdint.h> #include <unistd.h> tools/testing/selftests/mm/mrelease_test.c +0
-1@@ -2,7 +2,6 @@/* * Copyright 2022 Google LLC */ -#define _GNU_SOURCE#include <errno.h> #include <stdbool.h> #include <stdio.h> tools/testing/selftests/mm/mremap_dontunmap.c +0
-1@@ -5,7 +5,6 @@* * Copyright 2020, Brian Geffon <[email protected]> */ -#define _GNU_SOURCE#include <sys/mman.h> #include <linux/mman.h> #include <errno.h> tools/testing/selftests/mm/mremap_test.c +0
-2@@ -2,8 +2,6 @@/* * Copyright 2020 Google LLC */ -#define _GNU_SOURCE -#include <errno.h> #include <stdlib.h> #include <stdio.h> tools/testing/selftests/mm/pagemap_ioctl.c +0
-1@@ -1,5 +1,4 @@// SPDX-License-Identifier: GPL-2.0 -#define _GNU_SOURCE#include <stdio.h> #include <fcntl.h> #include <string.h> tools/testing/selftests/mm/pkey-helpers.h +0
-1@@ -1,7 +1,6 @@/* SPDX-License-Identifier: GPL-2.0 */ #ifndef _PKEYS_HELPER_H#define _PKEYS_HELPER_H -#define _GNU_SOURCE#include <string.h> #include <stdarg.h> #include <stdio.h> tools/testing/selftests/mm/protection_keys.c +0
-1@@ -21,7 +21,6 @@* gcc -mxsave -o protection_keys -O2 -g -std=gnu99 -pthread -Wall protection_keys.c -lrt -ldl -lm * gcc -mxsave -m32 -o protection_keys_32 -O2 -g -std=gnu99 -pthread -Wall protection_keys.c -lrt -ldl -lm */ -#define _GNU_SOURCE#define __SANE_USERSPACE_TYPES__#include <errno.h> #include <linux/elf.h> tools/testing/selftests/mm/split_huge_page_test.c +0
-2@@ -3,8 +3,6 @@* A test of splitting PMD THPs and PTE-mapped THPs from a specified virtual * address range in a process via <debugfs>/split_huge_pages interface. */ - -#define _GNU_SOURCE#include <stdio.h> #include <stdlib.h> #include <stdarg.h> tools/testing/selftests/mm/thuge-gen.c +0
-2@@ -12,8 +12,6 @@ipcrm -m by hand, like this sudo ipcs | awk '$1 == "0x00000000" {print $2}' | xargs -n1 sudo ipcrm -m (warning this will remove all if someone else uses them) */ - -#define _GNU_SOURCE 1#include <sys/mman.h> #include <stdlib.h> #include <stdio.h> tools/testing/selftests/mm/uffd-common.h +0
-1@@ -7,7 +7,6 @@#ifndef __UFFD_COMMON_H__#define __UFFD_COMMON_H__ -#define _GNU_SOURCE#include <stdio.h> #include <errno.h> #include <unistd.h> tools/testing/selftests/mount_setattr/mount_setattr_test.c +0
-1@@ -1,5 +1,4 @@// SPDX-License-Identifier: GPL-2.0 -#define _GNU_SOURCE#include <sched.h> #include <stdio.h> #include <errno.h> tools/testing/selftests/move_mount_set_group/move_mount_set_group_test.c +0
-1@@ -1,5 +1,4 @@// SPDX-License-Identifier: GPL-2.0 -#define _GNU_SOURCE#include <sched.h> #include <stdio.h> #include <errno.h> tools/testing/selftests/net/af_unix/diag_uid.c +0
-2@@ -1,7 +1,5 @@// SPDX-License-Identifier: GPL-2.0 /* Copyright Amazon.com Inc. or its affiliates. */ - -#define _GNU_SOURCE#include <sched.h> #include <unistd.h> tools/testing/selftests/net/af_unix/scm_pidfd.c +0
-1@@ -1,5 +1,4 @@// SPDX-License-Identifier: GPL-2.0 OR MIT -#define _GNU_SOURCE#include <error.h> #include <limits.h> #include <stddef.h> tools/testing/selftests/net/af_unix/unix_connect.c +0
-2@@ -1,6 +1,4 @@// SPDX-License-Identifier: GPL-2.0 - -#define _GNU_SOURCE#include <sched.h> #include <stddef.h> tools/testing/selftests/net/csum.c +0
-3@@ -58,9 +58,6 @@* different seed for each run (and logs this for reproducibility). It * is advised to enable this for extra coverage in continuous testing. */ - -#define _GNU_SOURCE -#include <arpa/inet.h> #include <asm/byteorder.h> #include <errno.h> tools/testing/selftests/net/gro.c +0
-3@@ -34,9 +34,6 @@* flakiness is to be expected. * */ - -#define _GNU_SOURCE -#include <arpa/inet.h> #include <errno.h> #include <error.h> tools/testing/selftests/net/ip_defrag.c +0
-3@@ -1,7 +1,4 @@// SPDX-License-Identifier: GPL-2.0 - -#define _GNU_SOURCE -#include <arpa/inet.h> #include <errno.h> #include <error.h> tools/testing/selftests/net/ipsec.c +0
-3@@ -3,9 +3,6 @@* ipsec.c - Check xfrm on veth inside a net-ns. * Copyright (c) 2018 Dmitry Safonov */ - -#define _GNU_SOURCE -#include <arpa/inet.h> #include <asm/types.h> #include <errno.h> tools/testing/selftests/net/ipv6_flowlabel.c +0
-3@@ -1,8 +1,5 @@// SPDX-License-Identifier: GPL-2.0 /* Test IPV6_FLOWINFO cmsg on send and recv */ - -#define _GNU_SOURCE -#include <arpa/inet.h> #include <asm/byteorder.h> #include <error.h> tools/testing/selftests/net/ipv6_flowlabel_mgr.c +0
-3@@ -1,8 +1,5 @@// SPDX-License-Identifier: GPL-2.0 /* Test IPV6_FLOWINFO_MGR */ - -#define _GNU_SOURCE -#include <arpa/inet.h> #include <error.h> #include <errno.h> tools/testing/selftests/net/mptcp/mptcp_connect.c +0
-3@@ -1,7 +1,4 @@// SPDX-License-Identifier: GPL-2.0 - -#define _GNU_SOURCE -#include <errno.h> #include <limits.h> #include <fcntl.h> tools/testing/selftests/net/mptcp/mptcp_inq.c +0
-3@@ -1,7 +1,4 @@// SPDX-License-Identifier: GPL-2.0 - -#define _GNU_SOURCE -#include <assert.h> #include <errno.h> #include <fcntl.h> tools/testing/selftests/net/mptcp/mptcp_sockopt.c +0
-3@@ -1,7 +1,4 @@// SPDX-License-Identifier: GPL-2.0 - -#define _GNU_SOURCE -#include <assert.h> #include <errno.h> #include <fcntl.h> tools/testing/selftests/net/msg_zerocopy.c +0
-3@@ -24,9 +24,6 @@* the kernel queues completions on the error queue for all zerocopy * transfers. */ - -#define _GNU_SOURCE -#include <arpa/inet.h> #include <error.h> #include <errno.h> tools/testing/selftests/net/nettest.c +0
-2@@ -3,8 +3,6 @@* * Copyright (c) 2013-2019 David Ahern <[email protected]>. All rights reserved. */ - -#define _GNU_SOURCE#include <features.h> #include <sys/types.h> #include <sys/ioctl.h> tools/testing/selftests/net/psock_fanout.c +0
-3@@ -26,9 +26,6 @@* Todo: * - functionality: PACKET_FANOUT_FLAG_DEFRAG */ - -#define _GNU_SOURCE/* for sched_setaffinity */ -#include <arpa/inet.h> #include <errno.h> #include <fcntl.h> tools/testing/selftests/net/psock_snd.c +0
-3@@ -1,7 +1,4 @@// SPDX-License-Identifier: GPL-2.0 - -#define _GNU_SOURCE -#include <arpa/inet.h> #include <errno.h> #include <error.h> tools/testing/selftests/net/reuseport_addr_any.c +0
-3@@ -3,9 +3,6 @@/* Test that sockets listening on a specific address are preferred * over sockets listening on addr_any. */ - -#define _GNU_SOURCE -#include <arpa/inet.h> #include <errno.h> #include <error.h> tools/testing/selftests/net/reuseport_bpf_cpu.c +0
-3@@ -11,9 +11,6 @@* This entire process is done for several different core id permutations * and for each IPv4/IPv6 and TCP/UDP combination. */ - -#define _GNU_SOURCE -#include <arpa/inet.h> #include <errno.h> #include <error.h> tools/testing/selftests/net/reuseport_bpf_numa.c +0
-3@@ -3,9 +3,6 @@* Test functionality of BPF filters with SO_REUSEPORT. Same test as * in reuseport_bpf_cpu, only as one socket per NUMA node. */ - -#define _GNU_SOURCE -#include <arpa/inet.h> #include <errno.h> #include <error.h> tools/testing/selftests/net/reuseport_dualstack.c +0
-3@@ -10,9 +10,6 @@* This test creates these mixed AF_INET/AF_INET6 sockets and asserts the * AF_INET preference for v4 packets. */ - -#define _GNU_SOURCE -#include <arpa/inet.h> #include <errno.h> #include <error.h> tools/testing/selftests/net/so_incoming_cpu.c +0
-1@@ -1,6 +1,5 @@// SPDX-License-Identifier: GPL-2.0 /* Copyright Amazon.com Inc. or its affiliates. */ -#define _GNU_SOURCE#include <sched.h> #include <fcntl.h> tools/testing/selftests/net/so_netns_cookie.c +0
-1@@ -1,5 +1,4 @@// SPDX-License-Identifier: GPL-2.0 -#define _GNU_SOURCE#include <sched.h> #include <unistd.h> #include <stdio.h> tools/testing/selftests/net/so_txtime.c +0
-3@@ -9,9 +9,6 @@* the expected stream. Sender will read transmit timestamps from the error * queue. The streams can differ due to out-of-order delivery and drops. */ - -#define _GNU_SOURCE -#include <arpa/inet.h> #include <error.h> #include <errno.h> tools/testing/selftests/net/tap.c +0
-3@@ -1,7 +1,4 @@// SPDX-License-Identifier: GPL-2.0 - -#define _GNU_SOURCE -#include <errno.h> #include <fcntl.h> #include <stdio.h> tools/testing/selftests/net/tcp_fastopen_backup_key.c +0
-1@@ -12,7 +12,6 @@* there are no cases in which a cookie is not accepted by verifying * that TcpExtTCPFastOpenPassiveFail remains 0. */ -#define _GNU_SOURCE#include <arpa/inet.h> #include <errno.h> #include <error.h> tools/testing/selftests/net/tcp_inq.c +0
-2@@ -5,8 +5,6 @@* * Simple example on how to use TCP_INQ and TCP_CM_INQ. */ -#define _GNU_SOURCE -#include <error.h> #include <netinet/in.h> #include <netinet/tcp.h> tools/testing/selftests/net/tcp_mmap.c +0
-1@@ -46,7 +46,6 @@* received 32768 MB (99.9939 % mmap'ed) in 7.43764 s, 36.9577 Gbit * cpu usage user:0.035 sys:3.467, 106.873 usec per MB, 65530 c-switches */ -#define _GNU_SOURCE#include <pthread.h> #include <sys/types.h> #include <fcntl.h> tools/testing/selftests/net/tls.c +0
-3@@ -1,7 +1,4 @@// SPDX-License-Identifier: GPL-2.0 - -#define _GNU_SOURCE -#include <arpa/inet.h> #include <errno.h> #include <error.h> tools/testing/selftests/net/toeplitz.c +0
-3@@ -20,9 +20,6 @@* 5. Compute the cpu that RPS should select based on rx_hash and $rps_bitmap * 6. Compare the cpus from 4 and 5 */ - -#define _GNU_SOURCE -#include <arpa/inet.h> #include <errno.h> #include <error.h> tools/testing/selftests/net/tun.c +0
-3@@ -1,7 +1,4 @@// SPDX-License-Identifier: GPL-2.0 - -#define _GNU_SOURCE -#include <errno.h> #include <fcntl.h> #include <stdio.h> tools/testing/selftests/net/txring_overwrite.c +0
-3@@ -4,9 +4,6 @@* Verify that consecutive sends over packet tx_ring are mirrored * with their original content intact. */ - -#define _GNU_SOURCE -#include <arpa/inet.h> #include <assert.h> #include <error.h> tools/testing/selftests/net/txtimestamp.c +0
-3@@ -16,9 +16,6 @@* This test requires a dummy TCP server. * A simple `nc6 [-u] -l -p $DESTPORT` will do */ - -#define _GNU_SOURCE -#include <arpa/inet.h> #include <asm/types.h> #include <error.h> tools/testing/selftests/net/udpgso.c +0
-3@@ -1,7 +1,4 @@// SPDX-License-Identifier: GPL-2.0 - -#define _GNU_SOURCE -#include <stddef.h> #include <arpa/inet.h> #include <error.h> tools/testing/selftests/net/udpgso_bench_rx.c +0
-3@@ -1,7 +1,4 @@// SPDX-License-Identifier: GPL-2.0 - -#define _GNU_SOURCE -#include <arpa/inet.h> #include <error.h> #include <errno.h> tools/testing/selftests/net/udpgso_bench_tx.c +0
-3@@ -1,7 +1,4 @@// SPDX-License-Identifier: GPL-2.0 - -#define _GNU_SOURCE -#include <arpa/inet.h> #include <errno.h> #include <error.h> tools/testing/selftests/perf_events/remove_on_exec.c +0
-2@@ -5,8 +5,6 @@* Copyright (C) 2021, Google LLC. */ -#define _GNU_SOURCE -/* We need the latest siginfo from the kernel repo. */ #include <sys/types.h> #include <asm/siginfo.h> tools/testing/selftests/perf_events/sigtrap_threads.c +0
-2@@ -5,8 +5,6 @@* Copyright (C) 2021, Google LLC. */ -#define _GNU_SOURCE -/* We need the latest siginfo from the kernel repo. */ #include <sys/types.h> #include <asm/siginfo.h> tools/testing/selftests/pid_namespace/regression_enomem.c +0
-1@@ -1,4 +1,3 @@ -#define _GNU_SOURCE#include <assert.h> #include <errno.h> #include <fcntl.h> tools/testing/selftests/pidfd/pidfd.h +0
-1@@ -3,7 +3,6 @@#ifndef __PIDFD_H#define __PIDFD_H -#define _GNU_SOURCE#include <errno.h> #include <fcntl.h> #include <sched.h> tools/testing/selftests/pidfd/pidfd_fdinfo_test.c +0
-2@@ -1,6 +1,4 @@// SPDX-License-Identifier: GPL-2.0 - -#define _GNU_SOURCE#include <assert.h> #include <errno.h> #include <fcntl.h> tools/testing/selftests/pidfd/pidfd_getfd_test.c +0
-2@@ -1,6 +1,4 @@// SPDX-License-Identifier: GPL-2.0 - -#define _GNU_SOURCE#include <errno.h> #include <fcntl.h> #include <limits.h> tools/testing/selftests/pidfd/pidfd_open_test.c +0
-2@@ -1,6 +1,4 @@// SPDX-License-Identifier: GPL-2.0 - -#define _GNU_SOURCE#include <errno.h> #include <fcntl.h> #include <inttypes.h> tools/testing/selftests/pidfd/pidfd_poll_test.c +0
-2@@ -1,6 +1,4 @@// SPDX-License-Identifier: GPL-2.0 - -#define _GNU_SOURCE#include <errno.h> #include <linux/types.h> #include <poll.h> tools/testing/selftests/pidfd/pidfd_setns_test.c +0
-2@@ -1,6 +1,4 @@// SPDX-License-Identifier: GPL-2.0 - -#define _GNU_SOURCE#include <errno.h> #include <fcntl.h> #include <limits.h> tools/testing/selftests/pidfd/pidfd_test.c +0
-2@@ -1,6 +1,4 @@/* SPDX-License-Identifier: GPL-2.0 */ - -#define _GNU_SOURCE#include <errno.h> #include <fcntl.h> #include <linux/types.h> tools/testing/selftests/pidfd/pidfd_wait.c +0
-2@@ -1,6 +1,4 @@/* SPDX-License-Identifier: GPL-2.0 */ - -#define _GNU_SOURCE#include <errno.h> #include <linux/sched.h> #include <linux/types.h> tools/testing/selftests/ptrace/get_set_sud.c +0
-1@@ -1,5 +1,4 @@// SPDX-License-Identifier: GPL-2.0 -#define _GNU_SOURCE#include "../kselftest_harness.h" #include <stdio.h> #include <string.h> tools/testing/selftests/ptrace/peeksiginfo.c +0
-1@@ -1,5 +1,4 @@// SPDX-License-Identifier: GPL-2.0 -#define _GNU_SOURCE#include <stdio.h> #include <signal.h> #include <unistd.h> tools/testing/selftests/rseq/basic_percpu_ops_test.c +0
-1@@ -1,5 +1,4 @@// SPDX-License-Identifier: LGPL-2.1 -#define _GNU_SOURCE#include <assert.h> #include <pthread.h> #include <sched.h> tools/testing/selftests/rseq/basic_test.c +0
-2@@ -2,8 +2,6 @@/* * Basic test coverage for critical regions and rseq_current_cpu(). */ - -#define _GNU_SOURCE#include <assert.h> #include <sched.h> #include <signal.h> tools/testing/selftests/rseq/param_test.c +0
-1@@ -1,5 +1,4 @@// SPDX-License-Identifier: LGPL-2.1 -#define _GNU_SOURCE#include <assert.h> #include <linux/membarrier.h> #include <pthread.h> tools/testing/selftests/rseq/rseq.c +0
-2@@ -14,8 +14,6 @@* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. */ - -#define _GNU_SOURCE#include <errno.h> #include <sched.h> #include <stdio.h> tools/testing/selftests/seccomp/seccomp_benchmark.c +0
-1@@ -2,7 +2,6 @@* Strictly speaking, this is not a test. But it can report during test * runs so relative performace can be measured. */ -#define _GNU_SOURCE#include <assert.h> #include <err.h> #include <limits.h> tools/testing/selftests/seccomp/seccomp_bpf.c +0
-2@@ -4,8 +4,6 @@* * Test code for seccomp bpf. */ - -#define _GNU_SOURCE#include <sys/types.h> /* tools/testing/selftests/user_events/abi_test.c +0
-2@@ -4,8 +4,6 @@* * Copyright (c) 2022 Beau Belgrave <[email protected]> */ - -#define _GNU_SOURCE#include <sched.h> #include <errno.h> tools/testing/selftests/x86/amx.c +0
-2@@ -1,6 +1,4 @@// SPDX-License-Identifier: GPL-2.0 - -#define _GNU_SOURCE#include <err.h> #include <errno.h> #include <pthread.h> tools/testing/selftests/x86/check_initial_reg_state.c +0
-3@@ -3,9 +3,6 @@* check_initial_reg_state.c - check that execve sets the correct state * Copyright (c) 2014-2016 Andrew Lutomirski */ - -#define _GNU_SOURCE -#include <stdio.h> unsigned long ax, bx, cx, dx, si, di, bp, sp, flags;tools/testing/selftests/x86/corrupt_xstate_header.c +0
-3@@ -4,9 +4,6 @@* * Based on analysis and a test case from Thomas Gleixner. */ - -#define _GNU_SOURCE -#include <stdlib.h> #include <stdio.h> #include <string.h> tools/testing/selftests/x86/entry_from_vm86.c +0
-3@@ -5,9 +5,6 @@* * This exercises a few paths that need to special-case vm86 mode. */ - -#define _GNU_SOURCE -#include <assert.h> #include <stdlib.h> #include <sys/syscall.h> tools/testing/selftests/x86/fsgsbase.c +0
-2@@ -3,8 +3,6 @@* fsgsbase.c, an fsgsbase test * Copyright (c) 2014-2016 Andy Lutomirski */ - -#define _GNU_SOURCE#include <stdio.h> #include <stdlib.h> #include <stdbool.h> tools/testing/selftests/x86/fsgsbase_restore.c +0
-2@@ -12,8 +12,6 @@* * This is not part of fsgsbase.c, because that test is 64-bit only. */ - -#define _GNU_SOURCE#include <stdio.h> #include <stdlib.h> #include <stdbool.h> tools/testing/selftests/x86/ioperm.c +0
-2@@ -3,8 +3,6 @@* ioperm.c - Test case for ioperm(2) * Copyright (c) 2015 Andrew Lutomirski */ - -#define _GNU_SOURCE#include <err.h> #include <stdio.h> #include <stdint.h> tools/testing/selftests/x86/iopl.c +0
-2@@ -3,8 +3,6 @@* iopl.c - Test case for a Linux on Xen 64-bit bug * Copyright (c) 2015 Andrew Lutomirski */ - -#define _GNU_SOURCE#include <err.h> #include <stdio.h> #include <stdint.h> tools/testing/selftests/x86/lam.c +0
-1@@ -1,5 +1,4 @@// SPDX-License-Identifier: GPL-2.0 -#define _GNU_SOURCE#include <stdio.h> #include <stdlib.h> #include <string.h> tools/testing/selftests/x86/ldt_gdt.c +0
-2@@ -3,8 +3,6 @@* ldt_gdt.c - Test cases for LDT and GDT access * Copyright (c) 2015 Andrew Lutomirski */ - -#define _GNU_SOURCE#include <err.h> #include <stdio.h> #include <stdint.h> tools/testing/selftests/x86/mov_ss_trap.c +0
-2@@ -19,8 +19,6 @@* * This should mostly cover CVE-2018-1087 and CVE-2018-8897. */ -#define _GNU_SOURCE -#include <stdlib.h> #include <sys/ptrace.h> #include <sys/types.h> tools/testing/selftests/x86/nx_stack.c +0
-2@@ -23,8 +23,6 @@* Regular stack is completely overwritten before testing. * Test doesn't exit SIGSEGV handler after first fault at INT3. */ -#undef _GNU_SOURCE -#define _GNU_SOURCE#undef NDEBUG#include <assert.h> #include <signal.h> tools/testing/selftests/x86/ptrace_syscall.c +0
-2@@ -1,6 +1,4 @@// SPDX-License-Identifier: GPL-2.0 -#define _GNU_SOURCE -#include <sys/ptrace.h> #include <sys/types.h> #include <sys/wait.h> tools/testing/selftests/x86/sigaltstack.c +0
-2@@ -1,6 +1,4 @@// SPDX-License-Identifier: GPL-2.0-only - -#define _GNU_SOURCE#include <signal.h> #include <stdio.h> #include <stdbool.h> tools/testing/selftests/x86/sigreturn.c +0
-3@@ -24,9 +24,6 @@* * Do not run on outdated, unpatched kernels at risk of nasty crashes. */ - -#define _GNU_SOURCE -#include <sys/time.h> #include <time.h> #include <stdlib.h> tools/testing/selftests/x86/single_step_syscall.c +0
-3@@ -9,9 +9,6 @@* immediately issues #DB from CPL 0. This requires special handling in * the kernel. */ - -#define _GNU_SOURCE -#include <sys/time.h> #include <time.h> #include <stdlib.h> tools/testing/selftests/x86/syscall_arg_fault.c +0
-3@@ -3,9 +3,6 @@* syscall_arg_fault.c - tests faults 32-bit fast syscall stack args * Copyright (c) 2015 Andrew Lutomirski */ - -#define _GNU_SOURCE -#include <stdlib.h> #include <stdio.h> #include <string.h> tools/testing/selftests/x86/syscall_numbering.c +0
-3@@ -5,9 +5,6 @@* * Copyright (c) 2018 Andrew Lutomirski */ - -#define _GNU_SOURCE -#include <stdlib.h> #include <stdio.h> #include <stdbool.h> tools/testing/selftests/x86/sysret_rip.c +0
-3@@ -3,9 +3,6 @@* sigreturn.c - tests that x86 avoids Intel SYSRET pitfalls * Copyright (c) 2014-2016 Andrew Lutomirski */ - -#define _GNU_SOURCE -#include <stdlib.h> #include <unistd.h> #include <stdio.h> tools/testing/selftests/x86/sysret_ss_attrs.c +0
-3@@ -7,9 +7,6 @@* the hidden attributes set to an unusable state. Make sure the kernel * doesn't let this happen. */ - -#define _GNU_SOURCE -#include <stdlib.h> #include <unistd.h> #include <stdio.h> tools/testing/selftests/x86/test_FCMOV.c +0
-4@@ -1,8 +1,4 @@// SPDX-License-Identifier: GPL-2.0 -#undef _GNU_SOURCE -#define _GNU_SOURCE 1 -#undef __USE_GNU -#define __USE_GNU 1#include <unistd.h> #include <stdlib.h> #include <string.h> tools/testing/selftests/x86/test_FCOMI.c +0
-4@@ -1,8 +1,4 @@// SPDX-License-Identifier: GPL-2.0 -#undef _GNU_SOURCE -#define _GNU_SOURCE 1 -#undef __USE_GNU -#define __USE_GNU 1#include <unistd.h> #include <stdlib.h> #include <string.h> tools/testing/selftests/x86/test_FISTTP.c +0
-4@@ -1,8 +1,4 @@// SPDX-License-Identifier: GPL-2.0 -#undef _GNU_SOURCE -#define _GNU_SOURCE 1 -#undef __USE_GNU -#define __USE_GNU 1#include <unistd.h> #include <stdlib.h> #include <string.h> tools/testing/selftests/x86/test_mremap_vdso.c +0
-1@@ -9,7 +9,6 @@* Can be built statically: * gcc -Os -Wall -static -m32 test_mremap_vdso.c */ -#define _GNU_SOURCE#include <stdio.h> #include <errno.h> #include <unistd.h> tools/testing/selftests/x86/test_shadow_stack.c +0
-3@@ -7,9 +7,6 @@* special glibc shadow stack support (longjmp(), swapcontext(), etc). Just * stick to the basics and hope the compiler doesn't do anything strange. */ - -#define _GNU_SOURCE -#include <sys/syscall.h> #include <asm/mman.h> #include <sys/mman.h> tools/testing/selftests/x86/test_syscall_vdso.c +0
-4@@ -8,10 +8,6 @@* Can be built statically: * gcc -Os -Wall -static -m32 test_syscall_vdso.c thunks_32.S */ -#undef _GNU_SOURCE -#define _GNU_SOURCE 1 -#undef __USE_GNU -#define __USE_GNU 1#include <unistd.h> #include <stdlib.h> #include <string.h> tools/testing/selftests/x86/test_vsyscall.c +0
-3@@ -1,7 +1,4 @@/* SPDX-License-Identifier: GPL-2.0 */ - -#define _GNU_SOURCE -#include <stdio.h> #include <sys/time.h> #include <time.h> tools/testing/selftests/x86/unwind_vdso.c +0
-3@@ -5,9 +5,6 @@* * This tests __kernel_vsyscall's unwind info. */ - -#define _GNU_SOURCE -#include <features.h> #include <stdio.h> tools/testing/selftests/x86/vdso_restorer.c +0
-3@@ -10,9 +10,6 @@* 64-bit userspace has never supported sa_restorer == NULL, so this is * 32-bit only. */ - -#define _GNU_SOURCE -#include <err.h> #include <stdio.h> #include <dlfcn.h>
Signature · 2 lines
BR, Muhammad Usama Anjum
Sean Christopherson
reviewerRe: [PATCH v2 4/5] selftests: Drop define _GNU_SOURCE
In reply to Edward LiawQuoted 2 lines · Edward Liaw
_GNU_SOURCEis provided byKHDR_INCLUDES, so it should be dropped to prevent_GNU_SOURCEredefined warnings.
...
tools/testing/selftests/x86/test_syscall_vdso.c line 14
Quoted 12 lines
tools/testing/selftests/x86/test_syscall_vdso.c +0
-4@@ -8,10 +8,6 @@* Can be built statically: * gcc -Os -Wall -static -m32 test_syscall_vdso.c thunks_32.S */ -#undef _GNU_SOURCE -#define _GNU_SOURCE 1 -#undef __USE_GNU -#define __USE_GNU 1
AFAICT, manually defining __USE_GNU is frowned upon, so I'm guessing the __USE_GNU stuff is just the result of misguided copy+paste. But it would be nice to get confirmation that this test isn't doing something clever. Or at the very least, explain the removal of __USE_GNU in the changelog.
Quoted 3 lines
tools/testing/selftests/x86/test_syscall_vdso.c +0
-0#include <unistd.h> #include <stdlib.h> #include <string.h>
Re: [PATCH v2 4/5] selftests: Drop define _GNU_SOURCE
Quoted 16 lines · On Wed, May 8, 2024 at 6:54?AM Sean Christopherson <[email protected]> wrote:
Quoted 2 lines · Edward Liaw
_GNU_SOURCEis provided byKHDR_INCLUDES, so it should be dropped to prevent_GNU_SOURCEredefined warnings....
Quoted 9 lines
tools/testing/selftests/x86/test_syscall_vdso.c +0
-1@@ -8,10 +8,6 @@* Can be built statically: * gcc -Os -Wall -static -m32 test_syscall_vdso.c thunks_32.S */ -#undef _GNU_SOURCE
Quoted 8 lines
tools/testing/selftests/x86/test_syscall_vdso.c line 14
Quoted 3 lines
tools/testing/selftests/x86/test_syscall_vdso.c +0
-3-#define _GNU_SOURCE 1 -#undef __USE_GNU -#define __USE_GNU 1AFAICT, manually defining
__USE_GNUis frowned upon, so I'm guessing the__USE_GNUstuff is just the result of misguided copy+paste. But it would be nice to get confirmation that this test isn't doing something clever. Or at the very least, explain the removal of__USE_GNUin the changelog.
It looks like test_syscall_vdso, test_FCMOV, test_FCOMI, and test_FISTTP don't actually use any GNU extensions. I'll add that to the commit message.
Quoted 4 lines
Quoted 4 lines
tools/testing/selftests/x86/test_syscall_vdso.c +0
-0#include <unistd.h> #include <stdlib.h> #include <string.h>
Re: [PATCH v2 4/5] selftests: Drop define _GNU_SOURCE
In reply to Edward LiawQuoted 6 lines · Edward Liaw
_GNU_SOURCEis provided byKHDR_INCLUDES, so it should be dropped to prevent_GNU_SOURCEredefined warnings.Fixes 809216233555 ("selftests/harness: remove use of LINE_MAX")Signed-off-by Edward Liaw <[email protected]>---
Very nice.
thanks,
Signature · 2 lines
John Hubbard NVIDIA
Quoted 2,645 lines
tools/testing/selftests/cachestat/test_cachestat.c | 2 -- tools/testing/selftests/capabilities/test_execve.c | 2 -- tools/testing/selftests/clone3/clone3.c | 2 -- .../testing/selftests/clone3/clone3_cap_checkpoint_restore.c | 2 -- tools/testing/selftests/clone3/clone3_clear_sighand.c | 2 -- tools/testing/selftests/clone3/clone3_selftests.h | 1 - tools/testing/selftests/clone3/clone3_set_tid.c | 2 -- tools/testing/selftests/core/close_range_test.c | 2 -- tools/testing/selftests/drivers/dma-buf/udmabuf.c | 1 - tools/testing/selftests/fchmodat2/fchmodat2_test.c | 2 -- tools/testing/selftests/filesystems/binderfs/binderfs_test.c | 2 -- tools/testing/selftests/filesystems/devpts_pts.c | 1 - tools/testing/selftests/filesystems/dnotify_test.c | 1 - tools/testing/selftests/filesystems/epoll/epoll_wakeup_test.c | 2 -- tools/testing/selftests/filesystems/eventfd/eventfd_test.c | 2 -- tools/testing/selftests/filesystems/fat/rename_exchange.c | 2 -- tools/testing/selftests/filesystems/overlayfs/dev_in_maps.c | 2 -- .../testing/selftests/filesystems/statmount/statmount_test.c | 3 --- tools/testing/selftests/futex/functional/futex_requeue_pi.c | 3 --- tools/testing/selftests/ipc/msgque.c | 1 - tools/testing/selftests/kcmp/kcmp_test.c | 2 -- tools/testing/selftests/kvm/aarch64/arch_timer.c | 2 -- tools/testing/selftests/kvm/aarch64/page_fault_test.c | 1 - tools/testing/selftests/kvm/aarch64/psci_test.c | 3 --- tools/testing/selftests/kvm/aarch64/vgic_init.c | 1 - tools/testing/selftests/kvm/arch_timer.c | 3 --- tools/testing/selftests/kvm/demand_paging_test.c | 3 --- tools/testing/selftests/kvm/dirty_log_test.c | 3 --- tools/testing/selftests/kvm/guest_memfd_test.c | 2 -- tools/testing/selftests/kvm/hardware_disable_test.c | 3 --- tools/testing/selftests/kvm/include/userfaultfd_util.h | 3 --- tools/testing/selftests/kvm/kvm_binary_stats_test.c | 2 -- tools/testing/selftests/kvm/kvm_create_max_vcpus.c | 2 -- tools/testing/selftests/kvm/kvm_page_table_test.c | 3 --- tools/testing/selftests/kvm/lib/assert.c | 3 --- tools/testing/selftests/kvm/lib/kvm_util.c | 2 -- tools/testing/selftests/kvm/lib/memstress.c | 2 -- tools/testing/selftests/kvm/lib/test_util.c | 2 -- tools/testing/selftests/kvm/lib/userfaultfd_util.c | 3 --- tools/testing/selftests/kvm/lib/x86_64/sev.c | 1 - tools/testing/selftests/kvm/max_guest_memory_test.c | 2 -- .../testing/selftests/kvm/memslot_modification_stress_test.c | 3 --- tools/testing/selftests/kvm/riscv/arch_timer.c | 3 --- tools/testing/selftests/kvm/rseq_test.c | 1 - tools/testing/selftests/kvm/s390x/cmma_test.c | 2 -- tools/testing/selftests/kvm/s390x/sync_regs_test.c | 2 -- tools/testing/selftests/kvm/set_memory_region_test.c | 1 - tools/testing/selftests/kvm/steal_time.c | 1 - tools/testing/selftests/kvm/x86_64/amx_test.c | 2 -- .../selftests/kvm/x86_64/exit_on_emulation_failure_test.c | 3 --- tools/testing/selftests/kvm/x86_64/hwcr_msr_test.c | 2 -- tools/testing/selftests/kvm/x86_64/hyperv_cpuid.c | 2 -- tools/testing/selftests/kvm/x86_64/hyperv_evmcs.c | 1 - tools/testing/selftests/kvm/x86_64/hyperv_ipi.c | 2 -- tools/testing/selftests/kvm/x86_64/hyperv_svm_test.c | 1 - tools/testing/selftests/kvm/x86_64/hyperv_tlb_flush.c | 2 -- tools/testing/selftests/kvm/x86_64/nested_exceptions_test.c | 2 -- tools/testing/selftests/kvm/x86_64/nx_huge_pages_test.c | 3 --- tools/testing/selftests/kvm/x86_64/platform_info_test.c | 2 -- tools/testing/selftests/kvm/x86_64/pmu_counters_test.c | 2 -- tools/testing/selftests/kvm/x86_64/pmu_event_filter_test.c | 3 --- .../selftests/kvm/x86_64/private_mem_conversions_test.c | 1 - tools/testing/selftests/kvm/x86_64/set_boot_cpu_id.c | 1 - tools/testing/selftests/kvm/x86_64/set_sregs_test.c | 1 - .../selftests/kvm/x86_64/smaller_maxphyaddr_emulation_test.c | 3 --- tools/testing/selftests/kvm/x86_64/smm_test.c | 1 - tools/testing/selftests/kvm/x86_64/state_test.c | 1 - tools/testing/selftests/kvm/x86_64/sync_regs_test.c | 2 -- tools/testing/selftests/kvm/x86_64/ucna_injection_test.c | 2 -- tools/testing/selftests/kvm/x86_64/userspace_msr_exit_test.c | 2 -- tools/testing/selftests/kvm/x86_64/vmx_dirty_log_test.c | 3 --- tools/testing/selftests/kvm/x86_64/vmx_pmu_caps_test.c | 1 - .../testing/selftests/kvm/x86_64/vmx_preemption_timer_test.c | 1 - tools/testing/selftests/kvm/x86_64/xapic_ipi_test.c | 2 -- tools/testing/selftests/kvm/x86_64/xapic_state_test.c | 1 - tools/testing/selftests/kvm/x86_64/xss_msr_test.c | 2 -- tools/testing/selftests/landlock/base_test.c | 2 -- tools/testing/selftests/landlock/fs_test.c | 2 -- tools/testing/selftests/landlock/net_test.c | 2 -- tools/testing/selftests/landlock/ptrace_test.c | 2 -- tools/testing/selftests/lsm/common.c | 2 -- tools/testing/selftests/lsm/lsm_get_self_attr_test.c | 2 -- tools/testing/selftests/lsm/lsm_list_modules_test.c | 2 -- tools/testing/selftests/lsm/lsm_set_self_attr_test.c | 2 -- tools/testing/selftests/membarrier/membarrier_test_impl.h | 1 - .../selftests/membarrier/membarrier_test_multi_thread.c | 1 - .../selftests/membarrier/membarrier_test_single_thread.c | 1 - tools/testing/selftests/memfd/common.c | 1 - tools/testing/selftests/memfd/fuse_test.c | 2 -- tools/testing/selftests/memfd/memfd_test.c | 1 - tools/testing/selftests/mm/cow.c | 1 - tools/testing/selftests/mm/gup_longterm.c | 1 - tools/testing/selftests/mm/hugepage-mmap.c | 1 - tools/testing/selftests/mm/hugepage-mremap.c | 2 -- tools/testing/selftests/mm/hugetlb-madvise.c | 2 -- tools/testing/selftests/mm/hugetlb-read-hwpoison.c | 2 -- tools/testing/selftests/mm/khugepaged.c | 1 - tools/testing/selftests/mm/ksm_functional_tests.c | 1 - tools/testing/selftests/mm/madv_populate.c | 1 - tools/testing/selftests/mm/map_populate.c | 2 -- tools/testing/selftests/mm/mdwe_test.c | 1 - tools/testing/selftests/mm/memfd_secret.c | 2 -- tools/testing/selftests/mm/mlock2-tests.c | 1 - tools/testing/selftests/mm/mrelease_test.c | 1 - tools/testing/selftests/mm/mremap_dontunmap.c | 1 - tools/testing/selftests/mm/mremap_test.c | 2 -- tools/testing/selftests/mm/pagemap_ioctl.c | 1 - tools/testing/selftests/mm/pkey-helpers.h | 1 - tools/testing/selftests/mm/protection_keys.c | 1 - tools/testing/selftests/mm/split_huge_page_test.c | 2 -- tools/testing/selftests/mm/thuge-gen.c | 2 -- tools/testing/selftests/mm/uffd-common.h | 1 - tools/testing/selftests/mount_setattr/mount_setattr_test.c | 1 - .../move_mount_set_group/move_mount_set_group_test.c | 1 - tools/testing/selftests/net/af_unix/diag_uid.c | 2 -- tools/testing/selftests/net/af_unix/scm_pidfd.c | 1 - tools/testing/selftests/net/af_unix/unix_connect.c | 2 -- tools/testing/selftests/net/csum.c | 3 --- tools/testing/selftests/net/gro.c | 3 --- tools/testing/selftests/net/ip_defrag.c | 3 --- tools/testing/selftests/net/ipsec.c | 3 --- tools/testing/selftests/net/ipv6_flowlabel.c | 3 --- tools/testing/selftests/net/ipv6_flowlabel_mgr.c | 3 --- tools/testing/selftests/net/mptcp/mptcp_connect.c | 3 --- tools/testing/selftests/net/mptcp/mptcp_inq.c | 3 --- tools/testing/selftests/net/mptcp/mptcp_sockopt.c | 3 --- tools/testing/selftests/net/msg_zerocopy.c | 3 --- tools/testing/selftests/net/nettest.c | 2 -- tools/testing/selftests/net/psock_fanout.c | 3 --- tools/testing/selftests/net/psock_snd.c | 3 --- tools/testing/selftests/net/reuseport_addr_any.c | 3 --- tools/testing/selftests/net/reuseport_bpf_cpu.c | 3 --- tools/testing/selftests/net/reuseport_bpf_numa.c | 3 --- tools/testing/selftests/net/reuseport_dualstack.c | 3 --- tools/testing/selftests/net/so_incoming_cpu.c | 1 - tools/testing/selftests/net/so_netns_cookie.c | 1 - tools/testing/selftests/net/so_txtime.c | 3 --- tools/testing/selftests/net/tap.c | 3 --- tools/testing/selftests/net/tcp_fastopen_backup_key.c | 1 - tools/testing/selftests/net/tcp_inq.c | 2 -- tools/testing/selftests/net/tcp_mmap.c | 1 - tools/testing/selftests/net/tls.c | 3 --- tools/testing/selftests/net/toeplitz.c | 3 --- tools/testing/selftests/net/tun.c | 3 --- tools/testing/selftests/net/txring_overwrite.c | 3 --- tools/testing/selftests/net/txtimestamp.c | 3 --- tools/testing/selftests/net/udpgso.c | 3 --- tools/testing/selftests/net/udpgso_bench_rx.c | 3 --- tools/testing/selftests/net/udpgso_bench_tx.c | 3 --- tools/testing/selftests/perf_events/remove_on_exec.c | 2 -- tools/testing/selftests/perf_events/sigtrap_threads.c | 2 -- tools/testing/selftests/pid_namespace/regression_enomem.c | 1 - tools/testing/selftests/pidfd/pidfd.h | 1 - tools/testing/selftests/pidfd/pidfd_fdinfo_test.c | 2 -- tools/testing/selftests/pidfd/pidfd_getfd_test.c | 2 -- tools/testing/selftests/pidfd/pidfd_open_test.c | 2 -- tools/testing/selftests/pidfd/pidfd_poll_test.c | 2 -- tools/testing/selftests/pidfd/pidfd_setns_test.c | 2 -- tools/testing/selftests/pidfd/pidfd_test.c | 2 -- tools/testing/selftests/pidfd/pidfd_wait.c | 2 -- tools/testing/selftests/ptrace/get_set_sud.c | 1 - tools/testing/selftests/ptrace/peeksiginfo.c | 1 - tools/testing/selftests/rseq/basic_percpu_ops_test.c | 1 - tools/testing/selftests/rseq/basic_test.c | 2 -- tools/testing/selftests/rseq/param_test.c | 1 - tools/testing/selftests/rseq/rseq.c | 2 -- tools/testing/selftests/seccomp/seccomp_benchmark.c | 1 - tools/testing/selftests/seccomp/seccomp_bpf.c | 2 -- tools/testing/selftests/user_events/abi_test.c | 2 -- tools/testing/selftests/x86/amx.c | 2 -- tools/testing/selftests/x86/check_initial_reg_state.c | 3 --- tools/testing/selftests/x86/corrupt_xstate_header.c | 3 --- tools/testing/selftests/x86/entry_from_vm86.c | 3 --- tools/testing/selftests/x86/fsgsbase.c | 2 -- tools/testing/selftests/x86/fsgsbase_restore.c | 2 -- tools/testing/selftests/x86/ioperm.c | 2 -- tools/testing/selftests/x86/iopl.c | 2 -- tools/testing/selftests/x86/lam.c | 1 - tools/testing/selftests/x86/ldt_gdt.c | 2 -- tools/testing/selftests/x86/mov_ss_trap.c | 2 -- tools/testing/selftests/x86/nx_stack.c | 2 -- tools/testing/selftests/x86/ptrace_syscall.c | 2 -- tools/testing/selftests/x86/sigaltstack.c | 2 -- tools/testing/selftests/x86/sigreturn.c | 3 --- tools/testing/selftests/x86/single_step_syscall.c | 3 --- tools/testing/selftests/x86/syscall_arg_fault.c | 3 --- tools/testing/selftests/x86/syscall_numbering.c | 3 --- tools/testing/selftests/x86/sysret_rip.c | 3 --- tools/testing/selftests/x86/sysret_ss_attrs.c | 3 --- tools/testing/selftests/x86/test_FCMOV.c | 4 ---- tools/testing/selftests/x86/test_FCOMI.c | 4 ---- tools/testing/selftests/x86/test_FISTTP.c | 4 ---- tools/testing/selftests/x86/test_mremap_vdso.c | 1 - tools/testing/selftests/x86/test_shadow_stack.c | 3 --- tools/testing/selftests/x86/test_syscall_vdso.c | 4 ---- tools/testing/selftests/x86/test_vsyscall.c | 3 --- tools/testing/selftests/x86/unwind_vdso.c | 3 --- tools/testing/selftests/x86/vdso_restorer.c | 3 --- 198 files changed, 405 deletions(-)tools/testing/selftests/cachestat/test_cachestat.c +0
-2@@ -1,6 +1,4 @@// SPDX-License-Identifier: GPL-2.0 -#define _GNU_SOURCE -#include <stdio.h> #include <stdbool.h> #include <linux/kernel.h> tools/testing/selftests/capabilities/test_execve.c +0
-2@@ -1,6 +1,4 @@// SPDX-License-Identifier: GPL-2.0 -#define _GNU_SOURCE -#include <cap-ng.h> #include <linux/capability.h> #include <stdbool.h> tools/testing/selftests/clone3/clone3.c +0
-2@@ -1,8 +1,6 @@// SPDX-License-Identifier: GPL-2.0 /* Based on Christian Brauner's clone3() example */ - -#define _GNU_SOURCE#include <errno.h> #include <inttypes.h> #include <linux/types.h> tools/testing/selftests/clone3/clone3_cap_checkpoint_restore.c +0
-2@@ -7,8 +7,6 @@*/ /* capabilities related code based on selftests/bpf/test_verifier.c */ - -#define _GNU_SOURCE#include <errno.h> #include <linux/types.h> #include <linux/sched.h> tools/testing/selftests/clone3/clone3_clear_sighand.c +0
-2@@ -1,6 +1,4 @@/* SPDX-License-Identifier: GPL-2.0 */ - -#define _GNU_SOURCE#include <errno.h> #include <sched.h> #include <signal.h> tools/testing/selftests/clone3/clone3_selftests.h +0
-1@@ -3,7 +3,6 @@#ifndef _CLONE3_SELFTESTS_H#define _CLONE3_SELFTESTS_H -#define _GNU_SOURCE#include <sched.h> #include <linux/sched.h> #include <linux/types.h> tools/testing/selftests/clone3/clone3_set_tid.c +0
-2@@ -5,8 +5,6 @@* These tests are assuming to be running in the host's * PID namespace. */ - -#define _GNU_SOURCE#include <errno.h> #include <linux/types.h> #include <linux/sched.h> tools/testing/selftests/core/close_range_test.c +0
-2@@ -1,6 +1,4 @@// SPDX-License-Identifier: GPL-2.0 - -#define _GNU_SOURCE#include <errno.h> #include <fcntl.h> #include <linux/kernel.h> tools/testing/selftests/drivers/dma-buf/udmabuf.c +0
-1@@ -1,5 +1,4 @@// SPDX-License-Identifier: GPL-2.0 -#define _GNU_SOURCE#define __EXPORTED_HEADERS__#include <stdio.h> tools/testing/selftests/fchmodat2/fchmodat2_test.c +0
-2@@ -1,6 +1,4 @@// SPDX-License-Identifier: GPL-2.0-or-later - -#define _GNU_SOURCE#include <fcntl.h> #include <sys/stat.h> #include <sys/types.h> tools/testing/selftests/filesystems/binderfs/binderfs_test.c +0
-2@@ -1,6 +1,4 @@// SPDX-License-Identifier: GPL-2.0 - -#define _GNU_SOURCE#include <errno.h> #include <fcntl.h> #include <pthread.h> tools/testing/selftests/filesystems/devpts_pts.c +0
-1@@ -1,5 +1,4 @@// SPDX-License-Identifier: GPL-2.0 -#define _GNU_SOURCE#include <errno.h> #include <fcntl.h> #include <sched.h> tools/testing/selftests/filesystems/dnotify_test.c +0
-1@@ -1,5 +1,4 @@// SPDX-License-Identifier: GPL-2.0 -#define _GNU_SOURCE/* needed to get the defines */ #include <fcntl.h> /* in glibc 2.2 this has the needed values defined */ #include <signal.h> tools/testing/selftests/filesystems/epoll/epoll_wakeup_test.c +0
-2@@ -1,6 +1,4 @@// SPDX-License-Identifier: GPL-2.0 - -#define _GNU_SOURCE#include <asm/unistd.h> #include <linux/time_types.h> #include <poll.h> tools/testing/selftests/filesystems/eventfd/eventfd_test.c +0
-2@@ -1,6 +1,4 @@// SPDX-License-Identifier: GPL-2.0 - -#define _GNU_SOURCE#include <errno.h> #include <fcntl.h> #include <asm/unistd.h> tools/testing/selftests/filesystems/fat/rename_exchange.c +0
-2@@ -6,8 +6,6 @@* Copyright 2022 Red Hat Inc. * Author: Javier Martinez Canillas <[email protected]> */ - -#define _GNU_SOURCE#include <fcntl.h> #include <stdio.h> #include <stdlib.h> tools/testing/selftests/filesystems/overlayfs/dev_in_maps.c +0
-2@@ -1,6 +1,4 @@// SPDX-License-Identifier: GPL-2.0 -#define _GNU_SOURCE -#include <inttypes.h> #include <unistd.h> #include <stdio.h> tools/testing/selftests/filesystems/statmount/statmount_test.c +0
-3@@ -1,7 +1,4 @@// SPDX-License-Identifier: GPL-2.0-or-later - -#define _GNU_SOURCE -#include <assert.h> #include <stdint.h> #include <sched.h> tools/testing/selftests/futex/functional/futex_requeue_pi.c +0
-3@@ -16,9 +16,6 @@* 2009-Nov-6: futex test adaptation by Darren Hart <[email protected]> * *****************************************************************************/ - -#define _GNU_SOURCE -#include <errno.h> #include <limits.h> #include <pthread.h> tools/testing/selftests/ipc/msgque.c +0
-1@@ -1,5 +1,4 @@// SPDX-License-Identifier: GPL-2.0 -#define _GNU_SOURCE#include <stdlib.h> #include <stdio.h> #include <string.h> tools/testing/selftests/kcmp/kcmp_test.c +0
-2@@ -1,6 +1,4 @@// SPDX-License-Identifier: GPL-2.0 -#define _GNU_SOURCE -#include <stdio.h> #include <stdlib.h> #include <signal.h> tools/testing/selftests/kvm/aarch64/arch_timer.c +0
-2@@ -5,8 +5,6 @@* * Copyright (c) 2021, Google LLC. */ -#define _GNU_SOURCE -#include "arch_timer.h" #include "delay.h" #include "gic.h" tools/testing/selftests/kvm/aarch64/page_fault_test.c +0
-1@@ -7,7 +7,6 @@* hugetlbfs with a hole). It checks that the expected handling method is * called (e.g., uffd faults with the right address and write/read flag). */ -#define _GNU_SOURCE#include <linux/bitmap.h> #include <fcntl.h> #include <test_util.h> tools/testing/selftests/kvm/aarch64/psci_test.c +0
-3@@ -10,9 +10,6 @@* - A test for KVM's handling of PSCI SYSTEM_SUSPEND and the associated * KVM_SYSTEM_EVENT_SUSPEND UAPI. */ - -#define _GNU_SOURCE -#include <linux/psci.h> #include "kvm_util.h" tools/testing/selftests/kvm/aarch64/vgic_init.c +0
-1@@ -4,7 +4,6 @@* * Copyright (C) 2020, Red Hat, Inc. */ -#define _GNU_SOURCE#include <linux/kernel.h> #include <sys/syscall.h> #include <asm/kvm.h> tools/testing/selftests/kvm/arch_timer.c +0
-3@@ -19,9 +19,6 @@* * Copyright (c) 2021, Google LLC. */ - -#define _GNU_SOURCE -#include <stdlib.h> #include <pthread.h> #include <linux/sizes.h> tools/testing/selftests/kvm/demand_paging_test.c +0
-3@@ -6,9 +6,6 @@* Copyright (C) 2018, Red Hat, Inc. * Copyright (C) 2019, Google, Inc. */ - -#define _GNU_SOURCE/* for pipe2 */ -#include <inttypes.h> #include <stdio.h> #include <stdlib.h> tools/testing/selftests/kvm/dirty_log_test.c +0
-3@@ -4,9 +4,6 @@* * Copyright (C) 2018, Red Hat, Inc. */ - -#define _GNU_SOURCE/* for program_invocation_name */ -#include <stdio.h> #include <stdlib.h> #include <pthread.h> tools/testing/selftests/kvm/guest_memfd_test.c +0
-2@@ -4,8 +4,6 @@* * Author: Chao Peng <[email protected]> */ - -#define _GNU_SOURCE#include <stdlib.h> #include <string.h> #include <unistd.h> tools/testing/selftests/kvm/hardware_disable_test.c +0
-3@@ -4,9 +4,6 @@* kvm_arch_hardware_disable is called and it attempts to unregister the user * return notifiers. */ - -#define _GNU_SOURCE -#include <fcntl.h> #include <pthread.h> #include <semaphore.h> tools/testing/selftests/kvm/include/userfaultfd_util.h +0
-3@@ -5,9 +5,6 @@* Copyright (C) 2018, Red Hat, Inc. * Copyright (C) 2019-2022 Google LLC */ - -#define _GNU_SOURCE/* for pipe2 */ -#include <inttypes.h> #include <time.h> #include <pthread.h> tools/testing/selftests/kvm/kvm_binary_stats_test.c +0
-2@@ -6,8 +6,6 @@* * Test the fd-based interface for KVM statistics. */ - -#define _GNU_SOURCE/* for program_invocation_short_name */ #include <fcntl.h> #include <stdio.h> #include <stdlib.h> tools/testing/selftests/kvm/kvm_create_max_vcpus.c +0
-2@@ -6,8 +6,6 @@* * Test for KVM_CAP_MAX_VCPUS and KVM_CAP_MAX_VCPU_ID. */ - -#define _GNU_SOURCE/* for program_invocation_short_name */ #include <fcntl.h> #include <stdio.h> #include <stdlib.h> tools/testing/selftests/kvm/kvm_page_table_test.c +0
-3@@ -8,9 +8,6 @@* page size have been pre-allocated on your system, if you are planning to * use hugepages to back the guest memory for testing. */ - -#define _GNU_SOURCE/* for program_invocation_name */ -#include <stdio.h> #include <stdlib.h> #include <time.h> tools/testing/selftests/kvm/lib/assert.c +0
-3@@ -4,9 +4,6 @@* * Copyright (C) 2018, Google LLC. */ - -#define _GNU_SOURCE/* for getline(3) and strchrnul(3)*/ -#include "test_util.h" #include <execinfo.h> tools/testing/selftests/kvm/lib/kvm_util.c +0
-2@@ -4,8 +4,6 @@* * Copyright (C) 2018, Google LLC. */ - -#define _GNU_SOURCE/* for program_invocation_name */ #include "test_util.h" #include "kvm_util.h" #include "processor.h" tools/testing/selftests/kvm/lib/memstress.c +0
-2@@ -2,8 +2,6 @@/* * Copyright (C) 2020, Google LLC. */ -#define _GNU_SOURCE -#include <inttypes.h> #include <linux/bitmap.h> tools/testing/selftests/kvm/lib/test_util.c +0
-2@@ -4,8 +4,6 @@* * Copyright (C) 2020, Google LLC. */ - -#define _GNU_SOURCE#include <stdio.h> #include <stdarg.h> #include <assert.h> tools/testing/selftests/kvm/lib/userfaultfd_util.c +0
-3@@ -6,9 +6,6 @@* Copyright (C) 2018, Red Hat, Inc. * Copyright (C) 2019-2022 Google LLC */ - -#define _GNU_SOURCE/* for pipe2 */ -#include <inttypes.h> #include <stdio.h> #include <stdlib.h> tools/testing/selftests/kvm/lib/x86_64/sev.c +0
-1@@ -1,5 +1,4 @@// SPDX-License-Identifier: GPL-2.0-only -#define _GNU_SOURCE/* for program_invocation_short_name */ #include <stdint.h> #include <stdbool.h> tools/testing/selftests/kvm/max_guest_memory_test.c +0
-2@@ -1,6 +1,4 @@// SPDX-License-Identifier: GPL-2.0 -#define _GNU_SOURCE -#include <stdio.h> #include <stdlib.h> #include <pthread.h> tools/testing/selftests/kvm/memslot_modification_stress_test.c +0
-3@@ -6,9 +6,6 @@* Copyright (C) 2018, Red Hat, Inc. * Copyright (C) 2020, Google, Inc. */ - -#define _GNU_SOURCE/* for program_invocation_name */ -#include <stdio.h> #include <stdlib.h> #include <sys/syscall.h> tools/testing/selftests/kvm/riscv/arch_timer.c +0
-3@@ -7,9 +7,6 @@* * Copyright (c) 2024, Intel Corporation. */ - -#define _GNU_SOURCE -#include "arch_timer.h" #include "kvm_util.h" #include "processor.h" tools/testing/selftests/kvm/rseq_test.c +0
-1@@ -1,5 +1,4 @@// SPDX-License-Identifier: GPL-2.0-only -#define _GNU_SOURCE/* for program_invocation_short_name */ #include <errno.h> #include <fcntl.h> #include <pthread.h> tools/testing/selftests/kvm/s390x/cmma_test.c +0
-2@@ -7,8 +7,6 @@* Authors: * Nico Boehr <[email protected]> */ - -#define _GNU_SOURCE/* for program_invocation_short_name */ #include <fcntl.h> #include <stdio.h> #include <stdlib.h> tools/testing/selftests/kvm/s390x/sync_regs_test.c +0
-2@@ -10,8 +10,6 @@* * Test expected behavior of the KVM_CAP_SYNC_REGS functionality. */ - -#define _GNU_SOURCE/* for program_invocation_short_name */ #include <fcntl.h> #include <stdio.h> #include <stdlib.h> tools/testing/selftests/kvm/set_memory_region_test.c +0
-1@@ -1,5 +1,4 @@// SPDX-License-Identifier: GPL-2.0 -#define _GNU_SOURCE/* for program_invocation_short_name */ #include <fcntl.h> #include <pthread.h> #include <sched.h> tools/testing/selftests/kvm/steal_time.c +0
-1@@ -4,7 +4,6 @@* * Copyright (C) 2020, Red Hat, Inc. */ -#define _GNU_SOURCE#include <stdio.h> #include <time.h> #include <sched.h> tools/testing/selftests/kvm/x86_64/amx_test.c +0
-2@@ -6,8 +6,6 @@* * Tests for amx #NM exception and save/restore. */ - -#define _GNU_SOURCE/* for program_invocation_short_name */ #include <fcntl.h> #include <stdio.h> #include <stdlib.h> tools/testing/selftests/kvm/x86_64/exit_on_emulation_failure_test.c +0
-3@@ -4,9 +4,6 @@* * Test for KVM_CAP_EXIT_ON_EMULATION_FAILURE. */ - -#define _GNU_SOURCE/* for program_invocation_short_name */ -#include "flds_emulation.h" #include "test_util.h" tools/testing/selftests/kvm/x86_64/hwcr_msr_test.c +0
-2@@ -2,8 +2,6 @@/* * Copyright (C) 2023, Google LLC. */ - -#define _GNU_SOURCE/* for program_invocation_short_name */ #include <sys/ioctl.h> #include "test_util.h" tools/testing/selftests/kvm/x86_64/hyperv_cpuid.c +0
-2@@ -7,8 +7,6 @@* This work is licensed under the terms of the GNU GPL, version 2. * */ - -#define _GNU_SOURCE/* for program_invocation_short_name */ #include <fcntl.h> #include <stdio.h> #include <stdlib.h> tools/testing/selftests/kvm/x86_64/hyperv_evmcs.c +0
-1@@ -4,7 +4,6 @@* * Tests for Enlightened VMCS, including nested guest state. */ -#define _GNU_SOURCE/* for program_invocation_short_name */ #include <fcntl.h> #include <stdio.h> #include <stdlib.h> tools/testing/selftests/kvm/x86_64/hyperv_ipi.c +0
-2@@ -5,8 +5,6 @@* Copyright (C) 2022, Red Hat, Inc. * */ - -#define _GNU_SOURCE/* for program_invocation_short_name */ #include <pthread.h> #include <inttypes.h> tools/testing/selftests/kvm/x86_64/hyperv_svm_test.c +0
-1@@ -4,7 +4,6 @@* * Tests for Hyper-V extensions to SVM. */ -#define _GNU_SOURCE/* for program_invocation_short_name */ #include <fcntl.h> #include <stdio.h> #include <stdlib.h> tools/testing/selftests/kvm/x86_64/hyperv_tlb_flush.c +0
-2@@ -5,8 +5,6 @@* Copyright (C) 2022, Red Hat, Inc. * */ - -#define _GNU_SOURCE/* for program_invocation_short_name */ #include <asm/barrier.h> #include <pthread.h> #include <inttypes.h> tools/testing/selftests/kvm/x86_64/nested_exceptions_test.c +0
-2@@ -1,6 +1,4 @@// SPDX-License-Identifier: GPL-2.0-only -#define _GNU_SOURCE/* for program_invocation_short_name */ -#include "test_util.h" #include "kvm_util.h" #include "processor.h" tools/testing/selftests/kvm/x86_64/nx_huge_pages_test.c +0
-3@@ -5,9 +5,6 @@* * Copyright (C) 2022, Google LLC. */ - -#define _GNU_SOURCE -#include <fcntl.h> #include <stdint.h> #include <time.h> tools/testing/selftests/kvm/x86_64/platform_info_test.c +0
-2@@ -9,8 +9,6 @@* Verifies expected behavior of controlling guest access to * MSR_PLATFORM_INFO. */ - -#define _GNU_SOURCE/* for program_invocation_short_name */ #include <fcntl.h> #include <stdio.h> #include <stdlib.h> tools/testing/selftests/kvm/x86_64/pmu_counters_test.c +0
-2@@ -2,8 +2,6 @@/* * Copyright (C) 2023, Tencent, Inc. */ - -#define _GNU_SOURCE/* for program_invocation_short_name */ #include <x86intrin.h> #include "pmu.h" tools/testing/selftests/kvm/x86_64/pmu_event_filter_test.c +0
-3@@ -9,9 +9,6 @@* Verifies the expected behavior of allow lists and deny lists for * virtual PMU events. */ - -#define _GNU_SOURCE/* for program_invocation_short_name */ -#include "kvm_util.h" #include "pmu.h" #include "processor.h" tools/testing/selftests/kvm/x86_64/private_mem_conversions_test.c +0
-1@@ -2,7 +2,6 @@/* * Copyright (C) 2022, Google LLC. */ -#define _GNU_SOURCE/* for program_invocation_short_name */ #include <fcntl.h> #include <limits.h> #include <pthread.h> tools/testing/selftests/kvm/x86_64/set_boot_cpu_id.c +0
-1@@ -4,7 +4,6 @@* * Copyright (C) 2020, Red Hat, Inc. */ -#define _GNU_SOURCE/* for program_invocation_name */ #include <fcntl.h> #include <stdio.h> #include <stdlib.h> tools/testing/selftests/kvm/x86_64/set_sregs_test.c +0
-1@@ -10,7 +10,6 @@* That bug allowed a user-mode program that called the KVM_SET_SREGS * ioctl to put a VCPU's local APIC into an invalid state. */ -#define _GNU_SOURCE/* for program_invocation_short_name */ #include <fcntl.h> #include <stdio.h> #include <stdlib.h> tools/testing/selftests/kvm/x86_64/smaller_maxphyaddr_emulation_test.c +0
-3@@ -5,9 +5,6 @@* Test that KVM emulates instructions in response to EPT violations when * allow_smaller_maxphyaddr is enabled and guest.MAXPHYADDR < host.MAXPHYADDR. */ - -#define _GNU_SOURCE/* for program_invocation_short_name */ -#include "flds_emulation.h" #include "test_util.h" tools/testing/selftests/kvm/x86_64/smm_test.c +0
-1@@ -4,7 +4,6 @@* * Tests for SMM. */ -#define _GNU_SOURCE/* for program_invocation_short_name */ #include <fcntl.h> #include <stdio.h> #include <stdlib.h> tools/testing/selftests/kvm/x86_64/state_test.c +0
-1@@ -6,7 +6,6 @@* * Tests for vCPU state save/restore, including nested guest state. */ -#define _GNU_SOURCE/* for program_invocation_short_name */ #include <fcntl.h> #include <stdio.h> #include <stdlib.h> tools/testing/selftests/kvm/x86_64/sync_regs_test.c +0
-2@@ -8,8 +8,6 @@* including requesting an invalid register set, updates to/from values * in kvm_run.s.regs when kvm_valid_regs and kvm_dirty_regs are toggled. */ - -#define _GNU_SOURCE/* for program_invocation_short_name */ #include <fcntl.h> #include <stdio.h> #include <stdlib.h> tools/testing/selftests/kvm/x86_64/ucna_injection_test.c +0
-2@@ -17,8 +17,6 @@* delivered into the guest or not. * */ - -#define _GNU_SOURCE/* for program_invocation_short_name */ #include <pthread.h> #include <inttypes.h> #include <string.h> tools/testing/selftests/kvm/x86_64/userspace_msr_exit_test.c +0
-2@@ -4,8 +4,6 @@* * Tests for exiting into userspace on registered MSRs */ - -#define _GNU_SOURCE/* for program_invocation_short_name */ #include <sys/ioctl.h> #include "kvm_test_harness.h" tools/testing/selftests/kvm/x86_64/vmx_dirty_log_test.c +0
-3@@ -4,9 +4,6 @@* * Copyright (C) 2018, Red Hat, Inc. */ - -#define _GNU_SOURCE/* for program_invocation_name */ -#include <stdio.h> #include <stdlib.h> #include <linux/bitmap.h> tools/testing/selftests/kvm/x86_64/vmx_pmu_caps_test.c +0
-1@@ -10,7 +10,6 @@* and check it can be retrieved with KVM_GET_MSR, also test * the invalid LBR formats are rejected. */ -#define _GNU_SOURCE/* for program_invocation_short_name */ #include <sys/ioctl.h> #include <linux/bitmap.h> tools/testing/selftests/kvm/x86_64/vmx_preemption_timer_test.c +0
-1@@ -9,7 +9,6 @@* value instead of partially decayed timer value * */ -#define _GNU_SOURCE/* for program_invocation_short_name */ #include <fcntl.h> #include <stdio.h> #include <stdlib.h> tools/testing/selftests/kvm/x86_64/xapic_ipi_test.c +0
-2@@ -19,8 +19,6 @@* Migration is a command line option. When used on non-numa machines will * exit with error. Test is still usefull on non-numa for testing IPIs. */ - -#define _GNU_SOURCE/* for program_invocation_short_name */ #include <getopt.h> #include <pthread.h> #include <inttypes.h> tools/testing/selftests/kvm/x86_64/xapic_state_test.c +0
-1@@ -1,5 +1,4 @@// SPDX-License-Identifier: GPL-2.0-only -#define _GNU_SOURCE/* for program_invocation_short_name */ #include <fcntl.h> #include <stdio.h> #include <stdlib.h> tools/testing/selftests/kvm/x86_64/xss_msr_test.c +0
-2@@ -4,8 +4,6 @@* * Tests for the IA32_XSS MSR. */ - -#define _GNU_SOURCE/* for program_invocation_short_name */ #include <sys/ioctl.h> #include "test_util.h" tools/testing/selftests/landlock/base_test.c +0
-2@@ -5,8 +5,6 @@* Copyright ? 2017-2020 Micka?l Sala?n <[email protected]> * Copyright ? 2019-2020 ANSSI */ - -#define _GNU_SOURCE#include <errno.h> #include <fcntl.h> #include <linux/landlock.h> tools/testing/selftests/landlock/fs_test.c +0
-2@@ -6,8 +6,6 @@* Copyright ? 2020 ANSSI * Copyright ? 2020-2022 Microsoft Corporation */ - -#define _GNU_SOURCE#include <fcntl.h> #include <linux/landlock.h> #include <linux/magic.h> tools/testing/selftests/landlock/net_test.c +0
-2@@ -5,8 +5,6 @@* Copyright ? 2022-2023 Huawei Tech. Co., Ltd. * Copyright ? 2023 Microsoft Corporation */ - -#define _GNU_SOURCE#include <arpa/inet.h> #include <errno.h> #include <fcntl.h> tools/testing/selftests/landlock/ptrace_test.c +0
-2@@ -5,8 +5,6 @@* Copyright ? 2017-2020 Micka?l Sala?n <[email protected]> * Copyright ? 2019-2020 ANSSI */ - -#define _GNU_SOURCE#include <errno.h> #include <fcntl.h> #include <linux/landlock.h> tools/testing/selftests/lsm/common.c +0
-2@@ -4,8 +4,6 @@* * Copyright ? 2023 Casey Schaufler <[email protected]> */ - -#define _GNU_SOURCE#include <linux/lsm.h> #include <fcntl.h> #include <string.h> tools/testing/selftests/lsm/lsm_get_self_attr_test.c +0
-2@@ -5,8 +5,6 @@* * Copyright ? 2022 Casey Schaufler <[email protected]> */ - -#define _GNU_SOURCE#include <linux/lsm.h> #include <fcntl.h> #include <string.h> tools/testing/selftests/lsm/lsm_list_modules_test.c +0
-2@@ -5,8 +5,6 @@* * Copyright ? 2022 Casey Schaufler <[email protected]> */ - -#define _GNU_SOURCE#include <linux/lsm.h> #include <string.h> #include <stdio.h> tools/testing/selftests/lsm/lsm_set_self_attr_test.c +0
-2@@ -5,8 +5,6 @@* * Copyright ? 2022 Casey Schaufler <[email protected]> */ - -#define _GNU_SOURCE#include <linux/lsm.h> #include <string.h> #include <stdio.h> tools/testing/selftests/membarrier/membarrier_test_impl.h +0
-1@@ -1,5 +1,4 @@/* SPDX-License-Identifier: GPL-2.0 */ -#define _GNU_SOURCE#include <linux/membarrier.h> #include <syscall.h> #include <stdio.h> tools/testing/selftests/membarrier/membarrier_test_multi_thread.c +0
-1@@ -1,5 +1,4 @@// SPDX-License-Identifier: GPL-2.0 -#define _GNU_SOURCE#include <linux/membarrier.h> #include <syscall.h> #include <stdio.h> tools/testing/selftests/membarrier/membarrier_test_single_thread.c +0
-1@@ -1,5 +1,4 @@// SPDX-License-Identifier: GPL-2.0 -#define _GNU_SOURCE#include <linux/membarrier.h> #include <syscall.h> #include <stdio.h> tools/testing/selftests/memfd/common.c +0
-1@@ -1,5 +1,4 @@// SPDX-License-Identifier: GPL-2.0 -#define _GNU_SOURCE#define __EXPORTED_HEADERS__#include <stdio.h> tools/testing/selftests/memfd/fuse_test.c +0
-2@@ -12,8 +12,6 @@* the read() syscall with our memory-mapped memfd object as receive buffer to * force the kernel to write into our memfd object. */ - -#define _GNU_SOURCE#define __EXPORTED_HEADERS__#include <errno.h> tools/testing/selftests/memfd/memfd_test.c +0
-1@@ -1,5 +1,4 @@// SPDX-License-Identifier: GPL-2.0 -#define _GNU_SOURCE#define __EXPORTED_HEADERS__#include <errno.h> tools/testing/selftests/mm/cow.c +0
-1@@ -6,7 +6,6 @@* * Author(s): David Hildenbrand <[email protected]> */ -#define _GNU_SOURCE#include <stdlib.h> #include <string.h> #include <stdbool.h> tools/testing/selftests/mm/gup_longterm.c +0
-1@@ -6,7 +6,6 @@* * Author(s): David Hildenbrand <[email protected]> */ -#define _GNU_SOURCE#include <stdlib.h> #include <string.h> #include <stdbool.h> tools/testing/selftests/mm/hugepage-mmap.c +0
-1@@ -16,7 +16,6 @@* range. * Other architectures, such as ppc64, i386 or x86_64 are not so constrained. */ -#define _GNU_SOURCE#include <stdlib.h> #include <stdio.h> #include <unistd.h> tools/testing/selftests/mm/hugepage-mremap.c +0
-2@@ -11,8 +11,6 @@* To make sure the test triggers pmd sharing and goes through the 'unshare' * path in the mremap code use 1GB (1024) or more. */ - -#define _GNU_SOURCE#include <stdlib.h> #include <stdio.h> #include <unistd.h> tools/testing/selftests/mm/hugetlb-madvise.c +0
-2@@ -11,8 +11,6 @@* filesystem. Therefore, a hugetlbfs filesystem must be mounted on some * directory. */ - -#define _GNU_SOURCE#include <stdlib.h> #include <stdio.h> #include <unistd.h> tools/testing/selftests/mm/hugetlb-read-hwpoison.c +0
-2@@ -1,6 +1,4 @@// SPDX-License-Identifier: GPL-2.0 - -#define _GNU_SOURCE#include <stdlib.h> #include <stdio.h> #include <string.h> tools/testing/selftests/mm/khugepaged.c +0
-1@@ -1,4 +1,3 @@ -#define _GNU_SOURCE#include <ctype.h> #include <errno.h> #include <fcntl.h> tools/testing/selftests/mm/ksm_functional_tests.c +0
-1@@ -6,7 +6,6 @@* * Author(s): David Hildenbrand <[email protected]> */ -#define _GNU_SOURCE#include <stdlib.h> #include <string.h> #include <stdbool.h> tools/testing/selftests/mm/madv_populate.c +0
-1@@ -6,7 +6,6 @@* * Author(s): David Hildenbrand <[email protected]> */ -#define _GNU_SOURCE#include <stdlib.h> #include <string.h> #include <stdbool.h> tools/testing/selftests/mm/map_populate.c +0
-2@@ -4,8 +4,6 @@* * MAP_POPULATE | MAP_PRIVATE should COW VMA pages. */ - -#define _GNU_SOURCE#include <errno.h> #include <fcntl.h> #include <sys/mman.h> tools/testing/selftests/mm/mdwe_test.c +0
-1@@ -7,7 +7,6 @@#include <linux/mman.h> #include <linux/prctl.h> -#define _GNU_SOURCE#include <stdio.h> #include <stdlib.h> #include <sys/auxv.h> tools/testing/selftests/mm/memfd_secret.c +0
-2@@ -4,8 +4,6 @@* * Author: Mike Rapoport <[email protected]> */ - -#define _GNU_SOURCE#include <sys/uio.h> #include <sys/mman.h> #include <sys/wait.h> tools/testing/selftests/mm/mlock2-tests.c +0
-1@@ -1,5 +1,4 @@// SPDX-License-Identifier: GPL-2.0 -#define _GNU_SOURCE#include <sys/mman.h> #include <stdint.h> #include <unistd.h> tools/testing/selftests/mm/mrelease_test.c +0
-1@@ -2,7 +2,6 @@/* * Copyright 2022 Google LLC */ -#define _GNU_SOURCE#include <errno.h> #include <stdbool.h> #include <stdio.h> tools/testing/selftests/mm/mremap_dontunmap.c +0
-1@@ -5,7 +5,6 @@* * Copyright 2020, Brian Geffon <[email protected]> */ -#define _GNU_SOURCE#include <sys/mman.h> #include <linux/mman.h> #include <errno.h> tools/testing/selftests/mm/mremap_test.c +0
-2@@ -2,8 +2,6 @@/* * Copyright 2020 Google LLC */ -#define _GNU_SOURCE -#include <errno.h> #include <stdlib.h> #include <stdio.h> tools/testing/selftests/mm/pagemap_ioctl.c +0
-1@@ -1,5 +1,4 @@// SPDX-License-Identifier: GPL-2.0 -#define _GNU_SOURCE#include <stdio.h> #include <fcntl.h> #include <string.h> tools/testing/selftests/mm/pkey-helpers.h +0
-1@@ -1,7 +1,6 @@/* SPDX-License-Identifier: GPL-2.0 */ #ifndef _PKEYS_HELPER_H#define _PKEYS_HELPER_H -#define _GNU_SOURCE#include <string.h> #include <stdarg.h> #include <stdio.h> tools/testing/selftests/mm/protection_keys.c +0
-1@@ -21,7 +21,6 @@* gcc -mxsave -o protection_keys -O2 -g -std=gnu99 -pthread -Wall protection_keys.c -lrt -ldl -lm * gcc -mxsave -m32 -o protection_keys_32 -O2 -g -std=gnu99 -pthread -Wall protection_keys.c -lrt -ldl -lm */ -#define _GNU_SOURCE#define __SANE_USERSPACE_TYPES__#include <errno.h> #include <linux/elf.h> tools/testing/selftests/mm/split_huge_page_test.c +0
-2@@ -3,8 +3,6 @@* A test of splitting PMD THPs and PTE-mapped THPs from a specified virtual * address range in a process via <debugfs>/split_huge_pages interface. */ - -#define _GNU_SOURCE#include <stdio.h> #include <stdlib.h> #include <stdarg.h> tools/testing/selftests/mm/thuge-gen.c +0
-2@@ -12,8 +12,6 @@ipcrm -m by hand, like this sudo ipcs | awk '$1 == "0x00000000" {print $2}' | xargs -n1 sudo ipcrm -m (warning this will remove all if someone else uses them) */ - -#define _GNU_SOURCE 1#include <sys/mman.h> #include <stdlib.h> #include <stdio.h> tools/testing/selftests/mm/uffd-common.h +0
-1@@ -7,7 +7,6 @@#ifndef __UFFD_COMMON_H__#define __UFFD_COMMON_H__ -#define _GNU_SOURCE#include <stdio.h> #include <errno.h> #include <unistd.h> tools/testing/selftests/mount_setattr/mount_setattr_test.c +0
-1@@ -1,5 +1,4 @@// SPDX-License-Identifier: GPL-2.0 -#define _GNU_SOURCE#include <sched.h> #include <stdio.h> #include <errno.h> tools/testing/selftests/move_mount_set_group/move_mount_set_group_test.c +0
-1@@ -1,5 +1,4 @@// SPDX-License-Identifier: GPL-2.0 -#define _GNU_SOURCE#include <sched.h> #include <stdio.h> #include <errno.h> tools/testing/selftests/net/af_unix/diag_uid.c +0
-2@@ -1,7 +1,5 @@// SPDX-License-Identifier: GPL-2.0 /* Copyright Amazon.com Inc. or its affiliates. */ - -#define _GNU_SOURCE#include <sched.h> #include <unistd.h> tools/testing/selftests/net/af_unix/scm_pidfd.c +0
-1@@ -1,5 +1,4 @@// SPDX-License-Identifier: GPL-2.0 OR MIT -#define _GNU_SOURCE#include <error.h> #include <limits.h> #include <stddef.h> tools/testing/selftests/net/af_unix/unix_connect.c +0
-2@@ -1,6 +1,4 @@// SPDX-License-Identifier: GPL-2.0 - -#define _GNU_SOURCE#include <sched.h> #include <stddef.h> tools/testing/selftests/net/csum.c +0
-3@@ -58,9 +58,6 @@* different seed for each run (and logs this for reproducibility). It * is advised to enable this for extra coverage in continuous testing. */ - -#define _GNU_SOURCE -#include <arpa/inet.h> #include <asm/byteorder.h> #include <errno.h> tools/testing/selftests/net/gro.c +0
-3@@ -34,9 +34,6 @@* flakiness is to be expected. * */ - -#define _GNU_SOURCE -#include <arpa/inet.h> #include <errno.h> #include <error.h> tools/testing/selftests/net/ip_defrag.c +0
-3@@ -1,7 +1,4 @@// SPDX-License-Identifier: GPL-2.0 - -#define _GNU_SOURCE -#include <arpa/inet.h> #include <errno.h> #include <error.h> tools/testing/selftests/net/ipsec.c +0
-3@@ -3,9 +3,6 @@* ipsec.c - Check xfrm on veth inside a net-ns. * Copyright (c) 2018 Dmitry Safonov */ - -#define _GNU_SOURCE -#include <arpa/inet.h> #include <asm/types.h> #include <errno.h> tools/testing/selftests/net/ipv6_flowlabel.c +0
-3@@ -1,8 +1,5 @@// SPDX-License-Identifier: GPL-2.0 /* Test IPV6_FLOWINFO cmsg on send and recv */ - -#define _GNU_SOURCE -#include <arpa/inet.h> #include <asm/byteorder.h> #include <error.h> tools/testing/selftests/net/ipv6_flowlabel_mgr.c +0
-3@@ -1,8 +1,5 @@// SPDX-License-Identifier: GPL-2.0 /* Test IPV6_FLOWINFO_MGR */ - -#define _GNU_SOURCE -#include <arpa/inet.h> #include <error.h> #include <errno.h> tools/testing/selftests/net/mptcp/mptcp_connect.c +0
-3@@ -1,7 +1,4 @@// SPDX-License-Identifier: GPL-2.0 - -#define _GNU_SOURCE -#include <errno.h> #include <limits.h> #include <fcntl.h> tools/testing/selftests/net/mptcp/mptcp_inq.c +0
-3@@ -1,7 +1,4 @@// SPDX-License-Identifier: GPL-2.0 - -#define _GNU_SOURCE -#include <assert.h> #include <errno.h> #include <fcntl.h> tools/testing/selftests/net/mptcp/mptcp_sockopt.c +0
-3@@ -1,7 +1,4 @@// SPDX-License-Identifier: GPL-2.0 - -#define _GNU_SOURCE -#include <assert.h> #include <errno.h> #include <fcntl.h> tools/testing/selftests/net/msg_zerocopy.c +0
-3@@ -24,9 +24,6 @@* the kernel queues completions on the error queue for all zerocopy * transfers. */ - -#define _GNU_SOURCE -#include <arpa/inet.h> #include <error.h> #include <errno.h> tools/testing/selftests/net/nettest.c +0
-2@@ -3,8 +3,6 @@* * Copyright (c) 2013-2019 David Ahern <[email protected]>. All rights reserved. */ - -#define _GNU_SOURCE#include <features.h> #include <sys/types.h> #include <sys/ioctl.h> tools/testing/selftests/net/psock_fanout.c +0
-3@@ -26,9 +26,6 @@* Todo: * - functionality: PACKET_FANOUT_FLAG_DEFRAG */ - -#define _GNU_SOURCE/* for sched_setaffinity */ -#include <arpa/inet.h> #include <errno.h> #include <fcntl.h> tools/testing/selftests/net/psock_snd.c +0
-3@@ -1,7 +1,4 @@// SPDX-License-Identifier: GPL-2.0 - -#define _GNU_SOURCE -#include <arpa/inet.h> #include <errno.h> #include <error.h> tools/testing/selftests/net/reuseport_addr_any.c +0
-3@@ -3,9 +3,6 @@/* Test that sockets listening on a specific address are preferred * over sockets listening on addr_any. */ - -#define _GNU_SOURCE -#include <arpa/inet.h> #include <errno.h> #include <error.h> tools/testing/selftests/net/reuseport_bpf_cpu.c +0
-3@@ -11,9 +11,6 @@* This entire process is done for several different core id permutations * and for each IPv4/IPv6 and TCP/UDP combination. */ - -#define _GNU_SOURCE -#include <arpa/inet.h> #include <errno.h> #include <error.h> tools/testing/selftests/net/reuseport_bpf_numa.c +0
-3@@ -3,9 +3,6 @@* Test functionality of BPF filters with SO_REUSEPORT. Same test as * in reuseport_bpf_cpu, only as one socket per NUMA node. */ - -#define _GNU_SOURCE -#include <arpa/inet.h> #include <errno.h> #include <error.h> tools/testing/selftests/net/reuseport_dualstack.c +0
-3@@ -10,9 +10,6 @@* This test creates these mixed AF_INET/AF_INET6 sockets and asserts the * AF_INET preference for v4 packets. */ - -#define _GNU_SOURCE -#include <arpa/inet.h> #include <errno.h> #include <error.h> tools/testing/selftests/net/so_incoming_cpu.c +0
-1@@ -1,6 +1,5 @@// SPDX-License-Identifier: GPL-2.0 /* Copyright Amazon.com Inc. or its affiliates. */ -#define _GNU_SOURCE#include <sched.h> #include <fcntl.h> tools/testing/selftests/net/so_netns_cookie.c +0
-1@@ -1,5 +1,4 @@// SPDX-License-Identifier: GPL-2.0 -#define _GNU_SOURCE#include <sched.h> #include <unistd.h> #include <stdio.h> tools/testing/selftests/net/so_txtime.c +0
-3@@ -9,9 +9,6 @@* the expected stream. Sender will read transmit timestamps from the error * queue. The streams can differ due to out-of-order delivery and drops. */ - -#define _GNU_SOURCE -#include <arpa/inet.h> #include <error.h> #include <errno.h> tools/testing/selftests/net/tap.c +0
-3@@ -1,7 +1,4 @@// SPDX-License-Identifier: GPL-2.0 - -#define _GNU_SOURCE -#include <errno.h> #include <fcntl.h> #include <stdio.h> tools/testing/selftests/net/tcp_fastopen_backup_key.c +0
-1@@ -12,7 +12,6 @@* there are no cases in which a cookie is not accepted by verifying * that TcpExtTCPFastOpenPassiveFail remains 0. */ -#define _GNU_SOURCE#include <arpa/inet.h> #include <errno.h> #include <error.h> tools/testing/selftests/net/tcp_inq.c +0
-2@@ -5,8 +5,6 @@* * Simple example on how to use TCP_INQ and TCP_CM_INQ. */ -#define _GNU_SOURCE -#include <error.h> #include <netinet/in.h> #include <netinet/tcp.h> tools/testing/selftests/net/tcp_mmap.c +0
-1@@ -46,7 +46,6 @@* received 32768 MB (99.9939 % mmap'ed) in 7.43764 s, 36.9577 Gbit * cpu usage user:0.035 sys:3.467, 106.873 usec per MB, 65530 c-switches */ -#define _GNU_SOURCE#include <pthread.h> #include <sys/types.h> #include <fcntl.h> tools/testing/selftests/net/tls.c +0
-3@@ -1,7 +1,4 @@// SPDX-License-Identifier: GPL-2.0 - -#define _GNU_SOURCE -#include <arpa/inet.h> #include <errno.h> #include <error.h> tools/testing/selftests/net/toeplitz.c +0
-3@@ -20,9 +20,6 @@* 5. Compute the cpu that RPS should select based on rx_hash and $rps_bitmap * 6. Compare the cpus from 4 and 5 */ - -#define _GNU_SOURCE -#include <arpa/inet.h> #include <errno.h> #include <error.h> tools/testing/selftests/net/tun.c +0
-3@@ -1,7 +1,4 @@// SPDX-License-Identifier: GPL-2.0 - -#define _GNU_SOURCE -#include <errno.h> #include <fcntl.h> #include <stdio.h> tools/testing/selftests/net/txring_overwrite.c +0
-3@@ -4,9 +4,6 @@* Verify that consecutive sends over packet tx_ring are mirrored * with their original content intact. */ - -#define _GNU_SOURCE -#include <arpa/inet.h> #include <assert.h> #include <error.h> tools/testing/selftests/net/txtimestamp.c +0
-3@@ -16,9 +16,6 @@* This test requires a dummy TCP server. * A simple `nc6 [-u] -l -p $DESTPORT` will do */ - -#define _GNU_SOURCE -#include <arpa/inet.h> #include <asm/types.h> #include <error.h> tools/testing/selftests/net/udpgso.c +0
-3@@ -1,7 +1,4 @@// SPDX-License-Identifier: GPL-2.0 - -#define _GNU_SOURCE -#include <stddef.h> #include <arpa/inet.h> #include <error.h> tools/testing/selftests/net/udpgso_bench_rx.c +0
-3@@ -1,7 +1,4 @@// SPDX-License-Identifier: GPL-2.0 - -#define _GNU_SOURCE -#include <arpa/inet.h> #include <error.h> #include <errno.h> tools/testing/selftests/net/udpgso_bench_tx.c +0
-3@@ -1,7 +1,4 @@// SPDX-License-Identifier: GPL-2.0 - -#define _GNU_SOURCE -#include <arpa/inet.h> #include <errno.h> #include <error.h> tools/testing/selftests/perf_events/remove_on_exec.c +0
-2@@ -5,8 +5,6 @@* Copyright (C) 2021, Google LLC. */ -#define _GNU_SOURCE -/* We need the latest siginfo from the kernel repo. */ #include <sys/types.h> #include <asm/siginfo.h> tools/testing/selftests/perf_events/sigtrap_threads.c +0
-2@@ -5,8 +5,6 @@* Copyright (C) 2021, Google LLC. */ -#define _GNU_SOURCE -/* We need the latest siginfo from the kernel repo. */ #include <sys/types.h> #include <asm/siginfo.h> tools/testing/selftests/pid_namespace/regression_enomem.c +0
-1@@ -1,4 +1,3 @@ -#define _GNU_SOURCE#include <assert.h> #include <errno.h> #include <fcntl.h> tools/testing/selftests/pidfd/pidfd.h +0
-1@@ -3,7 +3,6 @@#ifndef __PIDFD_H#define __PIDFD_H -#define _GNU_SOURCE#include <errno.h> #include <fcntl.h> #include <sched.h> tools/testing/selftests/pidfd/pidfd_fdinfo_test.c +0
-2@@ -1,6 +1,4 @@// SPDX-License-Identifier: GPL-2.0 - -#define _GNU_SOURCE#include <assert.h> #include <errno.h> #include <fcntl.h> tools/testing/selftests/pidfd/pidfd_getfd_test.c +0
-2@@ -1,6 +1,4 @@// SPDX-License-Identifier: GPL-2.0 - -#define _GNU_SOURCE#include <errno.h> #include <fcntl.h> #include <limits.h> tools/testing/selftests/pidfd/pidfd_open_test.c +0
-2@@ -1,6 +1,4 @@// SPDX-License-Identifier: GPL-2.0 - -#define _GNU_SOURCE#include <errno.h> #include <fcntl.h> #include <inttypes.h> tools/testing/selftests/pidfd/pidfd_poll_test.c +0
-2@@ -1,6 +1,4 @@// SPDX-License-Identifier: GPL-2.0 - -#define _GNU_SOURCE#include <errno.h> #include <linux/types.h> #include <poll.h> tools/testing/selftests/pidfd/pidfd_setns_test.c +0
-2@@ -1,6 +1,4 @@// SPDX-License-Identifier: GPL-2.0 - -#define _GNU_SOURCE#include <errno.h> #include <fcntl.h> #include <limits.h> tools/testing/selftests/pidfd/pidfd_test.c +0
-2@@ -1,6 +1,4 @@/* SPDX-License-Identifier: GPL-2.0 */ - -#define _GNU_SOURCE#include <errno.h> #include <fcntl.h> #include <linux/types.h> tools/testing/selftests/pidfd/pidfd_wait.c +0
-2@@ -1,6 +1,4 @@/* SPDX-License-Identifier: GPL-2.0 */ - -#define _GNU_SOURCE#include <errno.h> #include <linux/sched.h> #include <linux/types.h> tools/testing/selftests/ptrace/get_set_sud.c +0
-1@@ -1,5 +1,4 @@// SPDX-License-Identifier: GPL-2.0 -#define _GNU_SOURCE#include "../kselftest_harness.h" #include <stdio.h> #include <string.h> tools/testing/selftests/ptrace/peeksiginfo.c +0
-1@@ -1,5 +1,4 @@// SPDX-License-Identifier: GPL-2.0 -#define _GNU_SOURCE#include <stdio.h> #include <signal.h> #include <unistd.h> tools/testing/selftests/rseq/basic_percpu_ops_test.c +0
-1@@ -1,5 +1,4 @@// SPDX-License-Identifier: LGPL-2.1 -#define _GNU_SOURCE#include <assert.h> #include <pthread.h> #include <sched.h> tools/testing/selftests/rseq/basic_test.c +0
-2@@ -2,8 +2,6 @@/* * Basic test coverage for critical regions and rseq_current_cpu(). */ - -#define _GNU_SOURCE#include <assert.h> #include <sched.h> #include <signal.h> tools/testing/selftests/rseq/param_test.c +0
-1@@ -1,5 +1,4 @@// SPDX-License-Identifier: LGPL-2.1 -#define _GNU_SOURCE#include <assert.h> #include <linux/membarrier.h> #include <pthread.h> tools/testing/selftests/rseq/rseq.c +0
-2@@ -14,8 +14,6 @@* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. */ - -#define _GNU_SOURCE#include <errno.h> #include <sched.h> #include <stdio.h> tools/testing/selftests/seccomp/seccomp_benchmark.c +0
-1@@ -2,7 +2,6 @@* Strictly speaking, this is not a test. But it can report during test * runs so relative performace can be measured. */ -#define _GNU_SOURCE#include <assert.h> #include <err.h> #include <limits.h> tools/testing/selftests/seccomp/seccomp_bpf.c +0
-2@@ -4,8 +4,6 @@* * Test code for seccomp bpf. */ - -#define _GNU_SOURCE#include <sys/types.h> /* tools/testing/selftests/user_events/abi_test.c +0
-2@@ -4,8 +4,6 @@* * Copyright (c) 2022 Beau Belgrave <[email protected]> */ - -#define _GNU_SOURCE#include <sched.h> #include <errno.h> tools/testing/selftests/x86/amx.c +0
-2@@ -1,6 +1,4 @@// SPDX-License-Identifier: GPL-2.0 - -#define _GNU_SOURCE#include <err.h> #include <errno.h> #include <pthread.h> tools/testing/selftests/x86/check_initial_reg_state.c +0
-3@@ -3,9 +3,6 @@* check_initial_reg_state.c - check that execve sets the correct state * Copyright (c) 2014-2016 Andrew Lutomirski */ - -#define _GNU_SOURCE -#include <stdio.h> unsigned long ax, bx, cx, dx, si, di, bp, sp, flags;tools/testing/selftests/x86/corrupt_xstate_header.c +0
-3@@ -4,9 +4,6 @@* * Based on analysis and a test case from Thomas Gleixner. */ - -#define _GNU_SOURCE -#include <stdlib.h> #include <stdio.h> #include <string.h> tools/testing/selftests/x86/entry_from_vm86.c +0
-3@@ -5,9 +5,6 @@* * This exercises a few paths that need to special-case vm86 mode. */ - -#define _GNU_SOURCE -#include <assert.h> #include <stdlib.h> #include <sys/syscall.h> tools/testing/selftests/x86/fsgsbase.c +0
-2@@ -3,8 +3,6 @@* fsgsbase.c, an fsgsbase test * Copyright (c) 2014-2016 Andy Lutomirski */ - -#define _GNU_SOURCE#include <stdio.h> #include <stdlib.h> #include <stdbool.h> tools/testing/selftests/x86/fsgsbase_restore.c +0
-2@@ -12,8 +12,6 @@* * This is not part of fsgsbase.c, because that test is 64-bit only. */ - -#define _GNU_SOURCE#include <stdio.h> #include <stdlib.h> #include <stdbool.h> tools/testing/selftests/x86/ioperm.c +0
-2@@ -3,8 +3,6 @@* ioperm.c - Test case for ioperm(2) * Copyright (c) 2015 Andrew Lutomirski */ - -#define _GNU_SOURCE#include <err.h> #include <stdio.h> #include <stdint.h> tools/testing/selftests/x86/iopl.c +0
-2@@ -3,8 +3,6 @@* iopl.c - Test case for a Linux on Xen 64-bit bug * Copyright (c) 2015 Andrew Lutomirski */ - -#define _GNU_SOURCE#include <err.h> #include <stdio.h> #include <stdint.h> tools/testing/selftests/x86/lam.c +0
-1@@ -1,5 +1,4 @@// SPDX-License-Identifier: GPL-2.0 -#define _GNU_SOURCE#include <stdio.h> #include <stdlib.h> #include <string.h> tools/testing/selftests/x86/ldt_gdt.c +0
-2@@ -3,8 +3,6 @@* ldt_gdt.c - Test cases for LDT and GDT access * Copyright (c) 2015 Andrew Lutomirski */ - -#define _GNU_SOURCE#include <err.h> #include <stdio.h> #include <stdint.h> tools/testing/selftests/x86/mov_ss_trap.c +0
-2@@ -19,8 +19,6 @@* * This should mostly cover CVE-2018-1087 and CVE-2018-8897. */ -#define _GNU_SOURCE -#include <stdlib.h> #include <sys/ptrace.h> #include <sys/types.h> tools/testing/selftests/x86/nx_stack.c +0
-2@@ -23,8 +23,6 @@* Regular stack is completely overwritten before testing. * Test doesn't exit SIGSEGV handler after first fault at INT3. */ -#undef _GNU_SOURCE -#define _GNU_SOURCE#undef NDEBUG#include <assert.h> #include <signal.h> tools/testing/selftests/x86/ptrace_syscall.c +0
-2@@ -1,6 +1,4 @@// SPDX-License-Identifier: GPL-2.0 -#define _GNU_SOURCE -#include <sys/ptrace.h> #include <sys/types.h> #include <sys/wait.h> tools/testing/selftests/x86/sigaltstack.c +0
-2@@ -1,6 +1,4 @@// SPDX-License-Identifier: GPL-2.0-only - -#define _GNU_SOURCE#include <signal.h> #include <stdio.h> #include <stdbool.h> tools/testing/selftests/x86/sigreturn.c +0
-3@@ -24,9 +24,6 @@* * Do not run on outdated, unpatched kernels at risk of nasty crashes. */ - -#define _GNU_SOURCE -#include <sys/time.h> #include <time.h> #include <stdlib.h> tools/testing/selftests/x86/single_step_syscall.c +0
-3@@ -9,9 +9,6 @@* immediately issues #DB from CPL 0. This requires special handling in * the kernel. */ - -#define _GNU_SOURCE -#include <sys/time.h> #include <time.h> #include <stdlib.h> tools/testing/selftests/x86/syscall_arg_fault.c +0
-3@@ -3,9 +3,6 @@* syscall_arg_fault.c - tests faults 32-bit fast syscall stack args * Copyright (c) 2015 Andrew Lutomirski */ - -#define _GNU_SOURCE -#include <stdlib.h> #include <stdio.h> #include <string.h> tools/testing/selftests/x86/syscall_numbering.c +0
-3@@ -5,9 +5,6 @@* * Copyright (c) 2018 Andrew Lutomirski */ - -#define _GNU_SOURCE -#include <stdlib.h> #include <stdio.h> #include <stdbool.h> tools/testing/selftests/x86/sysret_rip.c +0
-3@@ -3,9 +3,6 @@* sigreturn.c - tests that x86 avoids Intel SYSRET pitfalls * Copyright (c) 2014-2016 Andrew Lutomirski */ - -#define _GNU_SOURCE -#include <stdlib.h> #include <unistd.h> #include <stdio.h> tools/testing/selftests/x86/sysret_ss_attrs.c +0
-3@@ -7,9 +7,6 @@* the hidden attributes set to an unusable state. Make sure the kernel * doesn't let this happen. */ - -#define _GNU_SOURCE -#include <stdlib.h> #include <unistd.h> #include <stdio.h> tools/testing/selftests/x86/test_FCMOV.c +0
-4@@ -1,8 +1,4 @@// SPDX-License-Identifier: GPL-2.0 -#undef _GNU_SOURCE -#define _GNU_SOURCE 1 -#undef __USE_GNU -#define __USE_GNU 1#include <unistd.h> #include <stdlib.h> #include <string.h> tools/testing/selftests/x86/test_FCOMI.c +0
-4@@ -1,8 +1,4 @@// SPDX-License-Identifier: GPL-2.0 -#undef _GNU_SOURCE -#define _GNU_SOURCE 1 -#undef __USE_GNU -#define __USE_GNU 1#include <unistd.h> #include <stdlib.h> #include <string.h> tools/testing/selftests/x86/test_FISTTP.c +0
-4@@ -1,8 +1,4 @@// SPDX-License-Identifier: GPL-2.0 -#undef _GNU_SOURCE -#define _GNU_SOURCE 1 -#undef __USE_GNU -#define __USE_GNU 1#include <unistd.h> #include <stdlib.h> #include <string.h> tools/testing/selftests/x86/test_mremap_vdso.c +0
-1@@ -9,7 +9,6 @@* Can be built statically: * gcc -Os -Wall -static -m32 test_mremap_vdso.c */ -#define _GNU_SOURCE#include <stdio.h> #include <errno.h> #include <unistd.h> tools/testing/selftests/x86/test_shadow_stack.c +0
-3@@ -7,9 +7,6 @@* special glibc shadow stack support (longjmp(), swapcontext(), etc). Just * stick to the basics and hope the compiler doesn't do anything strange. */ - -#define _GNU_SOURCE -#include <sys/syscall.h> #include <asm/mman.h> #include <sys/mman.h> tools/testing/selftests/x86/test_syscall_vdso.c +0
-4@@ -8,10 +8,6 @@* Can be built statically: * gcc -Os -Wall -static -m32 test_syscall_vdso.c thunks_32.S */ -#undef _GNU_SOURCE -#define _GNU_SOURCE 1 -#undef __USE_GNU -#define __USE_GNU 1#include <unistd.h> #include <stdlib.h> #include <string.h> tools/testing/selftests/x86/test_vsyscall.c +0
-3@@ -1,7 +1,4 @@/* SPDX-License-Identifier: GPL-2.0 */ - -#define _GNU_SOURCE -#include <stdio.h> #include <sys/time.h> #include <time.h> tools/testing/selftests/x86/unwind_vdso.c +0
-3@@ -5,9 +5,6 @@* * This tests __kernel_vsyscall's unwind info. */ - -#define _GNU_SOURCE -#include <features.h> #include <stdio.h> tools/testing/selftests/x86/vdso_restorer.c +0
-3@@ -10,9 +10,6 @@* 64-bit userspace has never supported sa_restorer == NULL, so this is * 32-bit only. */ - -#define _GNU_SOURCE -#include <err.h> #include <stdio.h> #include <dlfcn.h>
PATCH v2 5/5 selftests: Drop duplicate -D_GNU_SOURCE
In reply to Edward Liaw-D_GNU_SOURCE can be de-duplicated here, as it is added by KHDR_INCLUDES.
--- tools/testing/selftests/futex/functional/Makefile | 2 +- tools/testing/selftests/iommu/Makefile | 2 -- tools/testing/selftests/net/tcp_ao/Makefile | 2 +- tools/testing/selftests/resctrl/Makefile | 2 +- 4 files changed, 3 insertions(+), 5 deletions(-)
tools/testing/selftests/futex/functional/Makefile +1 -1
@@ -1,6 +1,6 @@ # SPDX-License-Identifier: GPL-2.0 INCLUDES := -I../include -I../../ $(KHDR_INCLUDES) -CFLAGS := $(CFLAGS) -g -O2 -Wall -D_GNU_SOURCE -pthread $(INCLUDES) $(KHDR_INCLUDES) +CFLAGS := $(CFLAGS) -g -O2 -Wall -pthread $(INCLUDES) $(KHDR_INCLUDES) LDLIBS := -lpthread -lrt LOCAL_HDRS := \
tools/testing/selftests/iommu/Makefile +0 -2
@@ -2,8 +2,6 @@ CFLAGS += -Wall -O2 -Wno-unused-function CFLAGS += $(KHDR_INCLUDES) -CFLAGS += -D_GNU_SOURCE - TEST_GEN_PROGS := TEST_GEN_PROGS += iommufd TEST_GEN_PROGS += iommufd_fail_nth
tools/testing/selftests/net/tcp_ao/Makefile +1 -1
@@ -26,7 +26,7 @@ LIB := $(LIBDIR)/libaotst.a LDLIBS += $(LIB) -pthread LIBDEPS := lib/aolib.h Makefile -CFLAGS := -Wall -O2 -g -D_GNU_SOURCE -fno-strict-aliasing +CFLAGS := -Wall -O2 -g -fno-strict-aliasing CFLAGS += $(KHDR_INCLUDES) CFLAGS += -iquote ./lib/ -I ../../../../include/
tools/testing/selftests/resctrl/Makefile +1 -1
@@ -1,6 +1,6 @@ # SPDX-License-Identifier: GPL-2.0 -CFLAGS = -g -Wall -O2 -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE +CFLAGS = -g -Wall -O2 -D_FORTIFY_SOURCE=2 CFLAGS += $(KHDR_INCLUDES) TEST_GEN_PROGS := resctrl_tests
Signature · 1 line
2.45.0.rc1.225.g2a3ae87e7f-goog
Re: [PATCH v2 5/5] selftests: Drop duplicate -D_GNU_SOURCE
Quoted 4 lines · Edward Liaw
-D_GNU_SOURCE can be de-duplicated here, as it is added by
KHDR_INCLUDES.Signed-off-by Edward Liaw <[email protected]>
Quoted 57 lines
--- tools/testing/selftests/futex/functional/Makefile | 2 +- tools/testing/selftests/iommu/Makefile | 2 -- tools/testing/selftests/net/tcp_ao/Makefile | 2 +- tools/testing/selftests/resctrl/Makefile | 2 +- 4 files changed, 3 insertions(+), 5 deletions(-)tools/testing/selftests/futex/functional/Makefile +1
-1@@ -1,6 +1,6 @@ # SPDX-License-Identifier: GPL-2.0 INCLUDES := -I../include -I../../ $(KHDR_INCLUDES) -CFLAGS := $(CFLAGS) -g -O2 -Wall -D_GNU_SOURCE -pthread $(INCLUDES) $(KHDR_INCLUDES) +CFLAGS := $(CFLAGS) -g -O2 -Wall -pthread $(INCLUDES) $(KHDR_INCLUDES) LDLIBS := -lpthread -lrt LOCAL_HDRS := \tools/testing/selftests/iommu/Makefile +0
-2@@ -2,8 +2,6 @@ CFLAGS += -Wall -O2 -Wno-unused-function CFLAGS += $(KHDR_INCLUDES) -CFLAGS += -D_GNU_SOURCE - TEST_GEN_PROGS := TEST_GEN_PROGS += iommufd TEST_GEN_PROGS += iommufd_fail_nthtools/testing/selftests/net/tcp_ao/Makefile +1
-1@@ -26,7 +26,7 @@ LIB := $(LIBDIR)/libaotst.a LDLIBS += $(LIB) -pthread LIBDEPS := lib/aolib.h Makefile -CFLAGS := -Wall -O2 -g -D_GNU_SOURCE -fno-strict-aliasing +CFLAGS := -Wall -O2 -g -fno-strict-aliasing CFLAGS += $(KHDR_INCLUDES) CFLAGS += -iquote ./lib/ -I ../../../../include/tools/testing/selftests/resctrl/Makefile +1
-1@@ -1,6 +1,6 @@ # SPDX-License-Identifier: GPL-2.0 -CFLAGS = -g -Wall -O2 -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE +CFLAGS = -g -Wall -O2 -D_FORTIFY_SOURCE=2 CFLAGS += $(KHDR_INCLUDES) TEST_GEN_PROGS := resctrl_tests
Signature · 2 lines
BR, Muhammad Usama Anjum
Re: [PATCH v2 5/5] selftests: Drop duplicate -D_GNU_SOURCE
In reply to Edward LiawQuoted 5 lines · Edward Liaw
-D_GNU_SOURCE can be de-duplicated here, as it is added by
KHDR_INCLUDES.Signed-off-by Edward Liaw <[email protected]>---
Most of the churn in these Makefiles can be avoided if it is possible to take my recommendation on patch 3/5 [1].
However, as it is, it is correct, so if the above does not happen, please feel free to add:
[1] https://lore.kernel.org/all/ec8ab737-a841-4cd5-8ec1-e0a777744262 at nvidia.com/
thanks,
Signature · 2 lines
John Hubbard NVIDIA
Quoted 56 lines
tools/testing/selftests/futex/functional/Makefile | 2 +- tools/testing/selftests/iommu/Makefile | 2 -- tools/testing/selftests/net/tcp_ao/Makefile | 2 +- tools/testing/selftests/resctrl/Makefile | 2 +- 4 files changed, 3 insertions(+), 5 deletions(-)tools/testing/selftests/futex/functional/Makefile +1
-1@@ -1,6 +1,6 @@ # SPDX-License-Identifier: GPL-2.0 INCLUDES := -I../include -I../../ $(KHDR_INCLUDES) -CFLAGS := $(CFLAGS) -g -O2 -Wall -D_GNU_SOURCE -pthread $(INCLUDES) $(KHDR_INCLUDES) +CFLAGS := $(CFLAGS) -g -O2 -Wall -pthread $(INCLUDES) $(KHDR_INCLUDES) LDLIBS := -lpthread -lrt LOCAL_HDRS := \tools/testing/selftests/iommu/Makefile +0
-2@@ -2,8 +2,6 @@ CFLAGS += -Wall -O2 -Wno-unused-function CFLAGS += $(KHDR_INCLUDES) -CFLAGS += -D_GNU_SOURCE - TEST_GEN_PROGS := TEST_GEN_PROGS += iommufd TEST_GEN_PROGS += iommufd_fail_nthtools/testing/selftests/net/tcp_ao/Makefile +1
-1@@ -26,7 +26,7 @@ LIB := $(LIBDIR)/libaotst.a LDLIBS += $(LIB) -pthread LIBDEPS := lib/aolib.h Makefile -CFLAGS := -Wall -O2 -g -D_GNU_SOURCE -fno-strict-aliasing +CFLAGS := -Wall -O2 -g -fno-strict-aliasing CFLAGS += $(KHDR_INCLUDES) CFLAGS += -iquote ./lib/ -I ../../../../include/tools/testing/selftests/resctrl/Makefile +1
-1@@ -1,6 +1,6 @@ # SPDX-License-Identifier: GPL-2.0 -CFLAGS = -g -Wall -O2 -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE +CFLAGS = -g -Wall -O2 -D_FORTIFY_SOURCE=2 CFLAGS += $(KHDR_INCLUDES) TEST_GEN_PROGS := resctrl_tests
Hi Edward,
Thank you for your modifications, that's great!
Our CI did some validations and here is its report:
- KVM Validation: normal: Success! ✅
- KVM Validation: debug: Success! ✅
- KVM Validation: btf (only bpftest_all): Success! ✅
- Task: https://github.com/multipath-tcp/mptcp_net-next/actions/runs/8992857887
Initiator: Patchew Applier
Commits: https://github.com/multipath-tcp/mptcp_net-next/commits/13e61f25eef2
Patchwork: https://patchwork.kernel.org/project/mptcp/list/?series=851355
If there are some issues, you can reproduce them using the same environment as the one used by the CI thanks to a docker image, e.g.:
$ cd [kernel source code]
$ docker run -v "${PWD}:${PWD}:rw" -w "${PWD}" --privileged --rm -it \
--pull always mptcp/mptcp-upstream-virtme-docker:latest \
auto-normalFor more details:
https://github.com/multipath-tcp/mptcp-upstream-virtme-docker
Please note that despite all the efforts that have been already done to have a stable tests suite when executed on a public CI like here, it is possible some reported issues are not due to your modifications. Still, do not hesitate to help us improve that ;-)
Cheers,
MPTCP GH Action bot
Bot operated by Matthieu Baerts (NGI0 Core)
Quoted 10 lines · Edward Liaw
809216233555 ("selftests/harness: remove use of
LINE_MAX") introduced asprintf intokselftest_harness.h, which is a GNU extension and needs_GNU_SOURCEto either be defined prior to including headers or with the -D_GNU_SOURCE flag passed to the compiler.v1: https://lore.kernel.org/linux-kselftest/20240430235057.1351993-1-edliaw at google.com/
v2: add -D_GNU_SOURCE toKHDR_INCLUDESso that it is in a single
location. Remove #define_GNU_SOURCEfrom source code to resolve redefinition warnings.
Quoted 6 lines
Edward Liaw (5):
selftests: Compile kselftest headers with -D_GNU_SOURCE selftests/sgx: IncludeKHDR_INCLUDESinMakefile
selftests: IncludeKHDR_INCLUDESinMakefile
selftests: Drop define_GNU_SOURCE
selftests: Drop duplicate -D_GNU_SOURCE
It's a lot of churn, but I don't see a way to do it differently. :)
Signature · 1 line
Kees Cook
Sean Christopherson
reviewerQuoted 10 lines · Edward Liaw
809216233555 ("selftests/harness: remove use of
LINE_MAX") introduced asprintf intokselftest_harness.h, which is a GNU extension and needs_GNU_SOURCEto either be defined prior to including headers or with the -D_GNU_SOURCE flag passed to the compiler.v1: https://lore.kernel.org/linux-kselftest/20240430235057.1351993-1-edliaw at google.com/
v2: add -D_GNU_SOURCE toKHDR_INCLUDESso that it is in a single
location. Remove #define_GNU_SOURCEfrom source code to resolve redefinition warnings.
Quoted 6 lines
Edward Liaw (5):
selftests: Compile kselftest headers with -D_GNU_SOURCE selftests/sgx: IncludeKHDR_INCLUDESinMakefile
selftests: IncludeKHDR_INCLUDESinMakefile
selftests: Drop define_GNU_SOURCE
selftests: Drop duplicate -D_GNU_SOURCE
Can you rebase this on top of linux-next? I have a conflicting fix[*] for the KVM selftests queued for 6.10, and I would prefer not to drop that commit at this stage as it would require a rebase of a pile of other commits.
And I doubt KVM is the only subsystem that has a targeted fix for the _GNU_SOURCE mess.
If we want/need to get a fix into 6.9, then IMO we should just revert 809216233555 ("selftests/harness: remove use of LINE_MAX"), as that came in quite late in the 6.9 cycle, and I don't think it's feasible to be 100% confident that globally defining _GNU_SOURCE works for all selftests, i.e. we really should have a full cycle for folks to test.
Quoted 19 lines · On Wed, May 8, 2024 at 6:47?AM Sean Christopherson <[email protected]> wrote:
Quoted 10 lines · Edward Liaw
809216233555 ("selftests/harness: remove use of
LINE_MAX") introduced asprintf intokselftest_harness.h, which is a GNU extension and needs_GNU_SOURCEto either be defined prior to including headers or with the -D_GNU_SOURCE flag passed to the compiler.v1: https://lore.kernel.org/linux-kselftest/20240430235057.1351993-1-edliaw at google.com/
v2: add -D_GNU_SOURCE toKHDR_INCLUDESso that it is in a single
location. Remove #define_GNU_SOURCEfrom source code to resolve redefinition warnings.Quoted 6 lines
Edward Liaw (5):
selftests: Compile kselftest headers with -D_GNU_SOURCE selftests/sgx: IncludeKHDR_INCLUDESinMakefile
selftests: IncludeKHDR_INCLUDESinMakefile
selftests: Drop define_GNU_SOURCE
selftests: Drop duplicate -D_GNU_SOURCE
Quoted 3 lines
Can you rebase this on top of linux-next? I have a conflicting fix[*] for the KVM selftests queued for 6.10, and I would prefer not to drop that commit at this stage as it would require a rebase of a pile of other commits.
Ok, I'll do that.
Quoted 9 lines
And I doubt KVM is the only subsystem that has a targeted fix for the
_GNU_SOURCEmess.If we want/need to get a fix into 6.9, then IMO we should just revert 809216233555 ("selftests/harness: remove use of
LINE_MAX"), as that came in quite late in the 6.9 cycle, and I don't think it's feasible to be 100% confident that globally defining_GNU_SOURCEworks for all selftests, i.e. we really should have a full cycle for folks to test.
That sounds reasonable to me. In this thread Tao suggested reverting back to 809216233555 and using a fixed value in place of LINE_MAX to fix 38c957f07038
https://lore.kernel.org/linux-kselftest/20240508070003.2acdf9b4 at kernel.org/
Quoted 2 lines
Shuah Khan
maintainerQuoted 5 lines · Edward Liaw
809216233555 ("selftests/harness: remove use of
LINE_MAX") introduced asprintf intokselftest_harness.h, which is a GNU extension and needs_GNU_SOURCEto either be defined prior to including headers or with the -D_GNU_SOURCE flag passed to the compiler.
Quoted 8 lines
v1: https://lore.kernel.org/linux-kselftest/20240430235057.1351993-1-edliaw at google.com/
v2: add -D_GNU_SOURCE toKHDR_INCLUDESso that it is in a single
location. Remove #define_GNU_SOURCEfrom source code to resolve redefinition warnings.Edward Liaw (5):
selftests: Compile kselftest headers with -D_GNU_SOURCE selftests/sgx: IncludeKHDR_INCLUDESinMakefile
I appled patches 1/5 and 2.5 - The rest need to be split up.
Quoted 4 lines
selftests: Include
KHDR_INCLUDESinMakefile
selftests: Drop define_GNU_SOURCE
selftests: Drop duplicate -D_GNU_SOURCE
Please split these patches pwe test directory. Otherwise it will cause merge conflicts which can be hard to resolve.
Quoted 220 lines
tools/testing/selftests/Makefile | 4 ++-- tools/testing/selftests/alsa/Makefile | 2 +- tools/testing/selftests/arm64/signal/Makefile | 2 +- tools/testing/selftests/cachestat/test_cachestat.c | 2 -- tools/testing/selftests/capabilities/test_execve.c | 2 -- tools/testing/selftests/clone3/clone3.c | 2 -- .../testing/selftests/clone3/clone3_cap_checkpoint_restore.c | 2 -- tools/testing/selftests/clone3/clone3_clear_sighand.c | 2 -- tools/testing/selftests/clone3/clone3_selftests.h | 1 - tools/testing/selftests/clone3/clone3_set_tid.c | 2 -- tools/testing/selftests/core/close_range_test.c | 2 -- tools/testing/selftests/drivers/dma-buf/udmabuf.c | 1 - tools/testing/selftests/exec/Makefile | 2 +- tools/testing/selftests/fchmodat2/fchmodat2_test.c | 2 -- tools/testing/selftests/filesystems/binderfs/binderfs_test.c | 2 -- tools/testing/selftests/filesystems/devpts_pts.c | 1 - tools/testing/selftests/filesystems/dnotify_test.c | 1 - tools/testing/selftests/filesystems/epoll/epoll_wakeup_test.c | 2 -- tools/testing/selftests/filesystems/eventfd/eventfd_test.c | 2 -- tools/testing/selftests/filesystems/fat/rename_exchange.c | 2 -- tools/testing/selftests/filesystems/overlayfs/Makefile | 2 +- tools/testing/selftests/filesystems/overlayfs/dev_in_maps.c | 2 -- .../testing/selftests/filesystems/statmount/statmount_test.c | 3 --- tools/testing/selftests/futex/functional/Makefile | 2 +- tools/testing/selftests/futex/functional/futex_requeue_pi.c | 3 --- tools/testing/selftests/hid/Makefile | 2 +- tools/testing/selftests/iommu/Makefile | 2 -- tools/testing/selftests/ipc/msgque.c | 1 - tools/testing/selftests/kcmp/kcmp_test.c | 2 -- tools/testing/selftests/kselftest_harness.h | 2 +- tools/testing/selftests/kvm/aarch64/arch_timer.c | 2 -- tools/testing/selftests/kvm/aarch64/page_fault_test.c | 1 - tools/testing/selftests/kvm/aarch64/psci_test.c | 3 --- tools/testing/selftests/kvm/aarch64/vgic_init.c | 1 - tools/testing/selftests/kvm/arch_timer.c | 3 --- tools/testing/selftests/kvm/demand_paging_test.c | 3 --- tools/testing/selftests/kvm/dirty_log_test.c | 3 --- tools/testing/selftests/kvm/guest_memfd_test.c | 2 -- tools/testing/selftests/kvm/hardware_disable_test.c | 3 --- tools/testing/selftests/kvm/include/userfaultfd_util.h | 3 --- tools/testing/selftests/kvm/kvm_binary_stats_test.c | 2 -- tools/testing/selftests/kvm/kvm_create_max_vcpus.c | 2 -- tools/testing/selftests/kvm/kvm_page_table_test.c | 3 --- tools/testing/selftests/kvm/lib/assert.c | 3 --- tools/testing/selftests/kvm/lib/kvm_util.c | 2 -- tools/testing/selftests/kvm/lib/memstress.c | 2 -- tools/testing/selftests/kvm/lib/test_util.c | 2 -- tools/testing/selftests/kvm/lib/userfaultfd_util.c | 3 --- tools/testing/selftests/kvm/lib/x86_64/sev.c | 1 - tools/testing/selftests/kvm/max_guest_memory_test.c | 2 -- .../testing/selftests/kvm/memslot_modification_stress_test.c | 3 --- tools/testing/selftests/kvm/riscv/arch_timer.c | 3 --- tools/testing/selftests/kvm/rseq_test.c | 1 - tools/testing/selftests/kvm/s390x/cmma_test.c | 2 -- tools/testing/selftests/kvm/s390x/sync_regs_test.c | 2 -- tools/testing/selftests/kvm/set_memory_region_test.c | 1 - tools/testing/selftests/kvm/steal_time.c | 1 - tools/testing/selftests/kvm/x86_64/amx_test.c | 2 -- .../selftests/kvm/x86_64/exit_on_emulation_failure_test.c | 3 --- tools/testing/selftests/kvm/x86_64/hwcr_msr_test.c | 2 -- tools/testing/selftests/kvm/x86_64/hyperv_cpuid.c | 2 -- tools/testing/selftests/kvm/x86_64/hyperv_evmcs.c | 1 - tools/testing/selftests/kvm/x86_64/hyperv_ipi.c | 2 -- tools/testing/selftests/kvm/x86_64/hyperv_svm_test.c | 1 - tools/testing/selftests/kvm/x86_64/hyperv_tlb_flush.c | 2 -- tools/testing/selftests/kvm/x86_64/nested_exceptions_test.c | 2 -- tools/testing/selftests/kvm/x86_64/nx_huge_pages_test.c | 3 --- tools/testing/selftests/kvm/x86_64/platform_info_test.c | 2 -- tools/testing/selftests/kvm/x86_64/pmu_counters_test.c | 2 -- tools/testing/selftests/kvm/x86_64/pmu_event_filter_test.c | 3 --- .../selftests/kvm/x86_64/private_mem_conversions_test.c | 1 - tools/testing/selftests/kvm/x86_64/set_boot_cpu_id.c | 1 - tools/testing/selftests/kvm/x86_64/set_sregs_test.c | 1 - .../selftests/kvm/x86_64/smaller_maxphyaddr_emulation_test.c | 3 --- tools/testing/selftests/kvm/x86_64/smm_test.c | 1 - tools/testing/selftests/kvm/x86_64/state_test.c | 1 - tools/testing/selftests/kvm/x86_64/sync_regs_test.c | 2 -- tools/testing/selftests/kvm/x86_64/ucna_injection_test.c | 2 -- tools/testing/selftests/kvm/x86_64/userspace_msr_exit_test.c | 2 -- tools/testing/selftests/kvm/x86_64/vmx_dirty_log_test.c | 3 --- tools/testing/selftests/kvm/x86_64/vmx_pmu_caps_test.c | 1 - .../testing/selftests/kvm/x86_64/vmx_preemption_timer_test.c | 1 - tools/testing/selftests/kvm/x86_64/xapic_ipi_test.c | 2 -- tools/testing/selftests/kvm/x86_64/xapic_state_test.c | 1 - tools/testing/selftests/kvm/x86_64/xss_msr_test.c | 2 -- tools/testing/selftests/landlock/base_test.c | 2 -- tools/testing/selftests/landlock/fs_test.c | 2 -- tools/testing/selftests/landlock/net_test.c | 2 -- tools/testing/selftests/landlock/ptrace_test.c | 2 -- tools/testing/selftests/lib.mk | 2 +- tools/testing/selftests/lsm/common.c | 2 -- tools/testing/selftests/lsm/lsm_get_self_attr_test.c | 2 -- tools/testing/selftests/lsm/lsm_list_modules_test.c | 2 -- tools/testing/selftests/lsm/lsm_set_self_attr_test.c | 2 -- tools/testing/selftests/membarrier/membarrier_test_impl.h | 1 - .../selftests/membarrier/membarrier_test_multi_thread.c | 1 - .../selftests/membarrier/membarrier_test_single_thread.c | 1 - tools/testing/selftests/memfd/common.c | 1 - tools/testing/selftests/memfd/fuse_test.c | 2 -- tools/testing/selftests/memfd/memfd_test.c | 1 - tools/testing/selftests/mm/cow.c | 1 - tools/testing/selftests/mm/gup_longterm.c | 1 - tools/testing/selftests/mm/hugepage-mmap.c | 1 - tools/testing/selftests/mm/hugepage-mremap.c | 2 -- tools/testing/selftests/mm/hugetlb-madvise.c | 2 -- tools/testing/selftests/mm/hugetlb-read-hwpoison.c | 2 -- tools/testing/selftests/mm/khugepaged.c | 1 - tools/testing/selftests/mm/ksm_functional_tests.c | 1 - tools/testing/selftests/mm/madv_populate.c | 1 - tools/testing/selftests/mm/map_populate.c | 2 -- tools/testing/selftests/mm/mdwe_test.c | 1 - tools/testing/selftests/mm/memfd_secret.c | 2 -- tools/testing/selftests/mm/mlock2-tests.c | 1 - tools/testing/selftests/mm/mrelease_test.c | 1 - tools/testing/selftests/mm/mremap_dontunmap.c | 1 - tools/testing/selftests/mm/mremap_test.c | 2 -- tools/testing/selftests/mm/pagemap_ioctl.c | 1 - tools/testing/selftests/mm/pkey-helpers.h | 1 - tools/testing/selftests/mm/protection_keys.c | 1 - tools/testing/selftests/mm/split_huge_page_test.c | 2 -- tools/testing/selftests/mm/thuge-gen.c | 2 -- tools/testing/selftests/mm/uffd-common.h | 1 - tools/testing/selftests/mount_setattr/mount_setattr_test.c | 1 - .../move_mount_set_group/move_mount_set_group_test.c | 1 - tools/testing/selftests/nci/Makefile | 2 +- tools/testing/selftests/net/af_unix/diag_uid.c | 2 -- tools/testing/selftests/net/af_unix/scm_pidfd.c | 1 - tools/testing/selftests/net/af_unix/unix_connect.c | 2 -- tools/testing/selftests/net/csum.c | 3 --- tools/testing/selftests/net/gro.c | 3 --- tools/testing/selftests/net/ip_defrag.c | 3 --- tools/testing/selftests/net/ipsec.c | 3 --- tools/testing/selftests/net/ipv6_flowlabel.c | 3 --- tools/testing/selftests/net/ipv6_flowlabel_mgr.c | 3 --- tools/testing/selftests/net/mptcp/mptcp_connect.c | 3 --- tools/testing/selftests/net/mptcp/mptcp_inq.c | 3 --- tools/testing/selftests/net/mptcp/mptcp_sockopt.c | 3 --- tools/testing/selftests/net/msg_zerocopy.c | 3 --- tools/testing/selftests/net/nettest.c | 2 -- tools/testing/selftests/net/psock_fanout.c | 3 --- tools/testing/selftests/net/psock_snd.c | 3 --- tools/testing/selftests/net/reuseport_addr_any.c | 3 --- tools/testing/selftests/net/reuseport_bpf_cpu.c | 3 --- tools/testing/selftests/net/reuseport_bpf_numa.c | 3 --- tools/testing/selftests/net/reuseport_dualstack.c | 3 --- tools/testing/selftests/net/so_incoming_cpu.c | 1 - tools/testing/selftests/net/so_netns_cookie.c | 1 - tools/testing/selftests/net/so_txtime.c | 3 --- tools/testing/selftests/net/tap.c | 3 --- tools/testing/selftests/net/tcp_ao/Makefile | 2 +- tools/testing/selftests/net/tcp_fastopen_backup_key.c | 1 - tools/testing/selftests/net/tcp_inq.c | 2 -- tools/testing/selftests/net/tcp_mmap.c | 1 - tools/testing/selftests/net/tls.c | 3 --- tools/testing/selftests/net/toeplitz.c | 3 --- tools/testing/selftests/net/tun.c | 3 --- tools/testing/selftests/net/txring_overwrite.c | 3 --- tools/testing/selftests/net/txtimestamp.c | 3 --- tools/testing/selftests/net/udpgso.c | 3 --- tools/testing/selftests/net/udpgso_bench_rx.c | 3 --- tools/testing/selftests/net/udpgso_bench_tx.c | 3 --- tools/testing/selftests/perf_events/remove_on_exec.c | 2 -- tools/testing/selftests/perf_events/sigtrap_threads.c | 2 -- tools/testing/selftests/pid_namespace/regression_enomem.c | 1 - tools/testing/selftests/pidfd/pidfd.h | 1 - tools/testing/selftests/pidfd/pidfd_fdinfo_test.c | 2 -- tools/testing/selftests/pidfd/pidfd_getfd_test.c | 2 -- tools/testing/selftests/pidfd/pidfd_open_test.c | 2 -- tools/testing/selftests/pidfd/pidfd_poll_test.c | 2 -- tools/testing/selftests/pidfd/pidfd_setns_test.c | 2 -- tools/testing/selftests/pidfd/pidfd_test.c | 2 -- tools/testing/selftests/pidfd/pidfd_wait.c | 2 -- tools/testing/selftests/prctl/Makefile | 2 ++ tools/testing/selftests/proc/Makefile | 2 +- tools/testing/selftests/ptrace/get_set_sud.c | 1 - tools/testing/selftests/ptrace/peeksiginfo.c | 1 - tools/testing/selftests/resctrl/Makefile | 2 +- tools/testing/selftests/riscv/mm/Makefile | 2 +- tools/testing/selftests/rseq/basic_percpu_ops_test.c | 1 - tools/testing/selftests/rseq/basic_test.c | 2 -- tools/testing/selftests/rseq/param_test.c | 1 - tools/testing/selftests/rseq/rseq.c | 2 -- tools/testing/selftests/rtc/Makefile | 2 +- tools/testing/selftests/seccomp/seccomp_benchmark.c | 1 - tools/testing/selftests/seccomp/seccomp_bpf.c | 2 -- tools/testing/selftests/sgx/Makefile | 2 +- tools/testing/selftests/sgx/sigstruct.c | 1 - tools/testing/selftests/tmpfs/Makefile | 2 +- tools/testing/selftests/user_events/abi_test.c | 2 -- tools/testing/selftests/x86/amx.c | 2 -- tools/testing/selftests/x86/check_initial_reg_state.c | 3 --- tools/testing/selftests/x86/corrupt_xstate_header.c | 3 --- tools/testing/selftests/x86/entry_from_vm86.c | 3 --- tools/testing/selftests/x86/fsgsbase.c | 2 -- tools/testing/selftests/x86/fsgsbase_restore.c | 2 -- tools/testing/selftests/x86/ioperm.c | 2 -- tools/testing/selftests/x86/iopl.c | 2 -- tools/testing/selftests/x86/lam.c | 1 - tools/testing/selftests/x86/ldt_gdt.c | 2 -- tools/testing/selftests/x86/mov_ss_trap.c | 2 -- tools/testing/selftests/x86/nx_stack.c | 2 -- tools/testing/selftests/x86/ptrace_syscall.c | 2 -- tools/testing/selftests/x86/sigaltstack.c | 2 -- tools/testing/selftests/x86/sigreturn.c | 3 --- tools/testing/selftests/x86/single_step_syscall.c | 3 --- tools/testing/selftests/x86/syscall_arg_fault.c | 3 --- tools/testing/selftests/x86/syscall_numbering.c | 3 --- tools/testing/selftests/x86/sysret_rip.c | 3 --- tools/testing/selftests/x86/sysret_ss_attrs.c | 3 --- tools/testing/selftests/x86/test_FCMOV.c | 4 ---- tools/testing/selftests/x86/test_FCOMI.c | 4 ---- tools/testing/selftests/x86/test_FISTTP.c | 4 ---- tools/testing/selftests/x86/test_mremap_vdso.c | 1 - tools/testing/selftests/x86/test_shadow_stack.c | 3 --- tools/testing/selftests/x86/test_syscall_vdso.c | 4 ---- tools/testing/selftests/x86/test_vsyscall.c | 3 --- tools/testing/selftests/x86/unwind_vdso.c | 3 --- tools/testing/selftests/x86/vdso_restorer.c | 3 --- 218 files changed, 20 insertions(+), 426 deletions(-)
Quoted 4 lines
--
2.45.0.rc1.225.g2a3ae87e7f-goog
thanks,
-- Shuah
Quoted 18 lines · On Wed, May 8, 2024 at 4:10?PM Shuah Khan <[email protected]> wrote:
Quoted 5 lines · Edward Liaw
809216233555 ("selftests/harness: remove use of
LINE_MAX") introduced asprintf intokselftest_harness.h, which is a GNU extension and needs_GNU_SOURCEto either be defined prior to including headers or with the -D_GNU_SOURCE flag passed to the compiler.Quoted 8 lines
v1: https://lore.kernel.org/linux-kselftest/20240430235057.1351993-1-edliaw at google.com/
v2: add -D_GNU_SOURCE toKHDR_INCLUDESso that it is in a single
location. Remove #define_GNU_SOURCEfrom source code to resolve redefinition warnings.Edward Liaw (5):
selftests: Compile kselftest headers with -D_GNU_SOURCE selftests/sgx: IncludeKHDR_INCLUDESinMakefileI appled patches 1/5 and 2.5 - The rest need to be split up.
Quoted 7 lines
Quoted 4 lines
selftests: Include
KHDR_INCLUDESinMakefile
selftests: Drop define_GNU_SOURCE
selftests: Drop duplicate -D_GNU_SOURCEPlease split these patches pwe test directory. Otherwise it will cause merge conflicts which can be hard to resolve.
Hi Shuah,
Sean asked that I rebase the patches on linux-next, and I will need to remove additional _GNU_SOURCE defines. Should I send an unsplit v3 to be reviewed, then split it afterwards? I'm concerned that it will be difficult to review with ~70 patches once split.
Shuah Khan
maintainerQuoted 24 lines · Edward Liaw
Quoted 23 lines · On Wed, May 8, 2024 at 4:10?PM Shuah Khan <[email protected]> wrote:
Quoted 5 lines · Edward Liaw
809216233555 ("selftests/harness: remove use of
LINE_MAX") introduced asprintf intokselftest_harness.h, which is a GNU extension and needs_GNU_SOURCEto either be defined prior to including headers or with the -D_GNU_SOURCE flag passed to the compiler.Quoted 8 lines
v1: https://lore.kernel.org/linux-kselftest/20240430235057.1351993-1-edliaw at google.com/
v2: add -D_GNU_SOURCE toKHDR_INCLUDESso that it is in a single
location. Remove #define_GNU_SOURCEfrom source code to resolve redefinition warnings.Edward Liaw (5):
selftests: Compile kselftest headers with -D_GNU_SOURCE selftests/sgx: IncludeKHDR_INCLUDESinMakefileI appled patches 1/5 and 2.5 - The rest need to be split up.
Quoted 4 lines
selftests: Include
KHDR_INCLUDESinMakefile
selftests: Drop define_GNU_SOURCE
selftests: Drop duplicate -D_GNU_SOURCE
Quoted 8 lines
Quoted 2 lines
Please split these patches pwe test directory. Otherwise it will cause merge conflicts which can be hard to resolve.
Hi Shuah,
Sean asked that I rebase the patches on linux-next, and I will need to remove additional_GNU_SOURCEdefines. Should I send an unsplit v3 to be reviewed, then split it afterwards? I'm concerned that it will be difficult to review with ~70 patches once split.
Please send them split - it will be easier to review and apply. You might as well wait until the merge window is done. I don't think anybody would have time to review now since merge window starts next week.
thanks,
-- Shuah
Quoted 35 lines · On Thu, May 9, 2024 at 7:37?AM Shuah Khan <[email protected]> wrote:
Quoted 24 lines · Edward Liaw
Quoted 23 lines · On Wed, May 8, 2024 at 4:10?PM Shuah Khan <[email protected]> wrote:
Quoted 5 lines · Edward Liaw
809216233555 ("selftests/harness: remove use of
LINE_MAX") introduced asprintf intokselftest_harness.h, which is a GNU extension and needs_GNU_SOURCEto either be defined prior to including headers or with the -D_GNU_SOURCE flag passed to the compiler.Quoted 8 lines
v1: https://lore.kernel.org/linux-kselftest/20240430235057.1351993-1-edliaw at google.com/
v2: add -D_GNU_SOURCE toKHDR_INCLUDESso that it is in a single
location. Remove #define_GNU_SOURCEfrom source code to resolve redefinition warnings.Edward Liaw (5):
selftests: Compile kselftest headers with -D_GNU_SOURCE selftests/sgx: IncludeKHDR_INCLUDESinMakefileI appled patches 1/5 and 2.5 - The rest need to be split up.
Quoted 4 lines
selftests: Include
KHDR_INCLUDESinMakefile
selftests: Drop define_GNU_SOURCE
selftests: Drop duplicate -D_GNU_SOURCEQuoted 8 lines
Quoted 2 lines
Please split these patches pwe test directory. Otherwise it will cause merge conflicts which can be hard to resolve.
Hi Shuah,
Sean asked that I rebase the patches on linux-next, and I will need to remove additional_GNU_SOURCEdefines. Should I send an unsplit v3 to be reviewed, then split it afterwards? I'm concerned that it will be difficult to review with ~70 patches once split.
Quoted 4 lines
Please send them split - it will be easier to review and apply. You might as well wait until the merge window is done. I don't think anybody would have time to review now since merge window starts next week.
Sorry, I have them split already; is it ok if I send them now? I will be on leave soon and may not be able to get back to it in a while.
Thanks,
Edward
Quoted 4 lines
thanks,
-- Shuah
Quoted 36 lines · Edward Liaw
Quoted 35 lines · Shuah Khan
Quoted 32 lines · Edward Liaw
Quoted 18 lines · Shuah Khan
Quoted 5 lines · Edward Liaw
809216233555 ("selftests/harness: remove use of
LINE_MAX") introduced asprintf intokselftest_harness.h, which is a GNU extension and needs_GNU_SOURCEto either be defined prior to including headers or with the -D_GNU_SOURCE flag passed to the compiler.Quoted 8 lines
v1: https://lore.kernel.org/linux-kselftest/[email protected]/
v2: add -D_GNU_SOURCE toKHDR_INCLUDESso that it is in a single location. Remove #define_GNU_SOURCEfrom source code to resolve redefinition warnings.Edward Liaw (5):
selftests: Compile kselftest headers with -D_GNU_SOURCE selftests/sgx: IncludeKHDR_INCLUDESinMakefileI appled patches 1/5 and 2.5 - The rest need to be split up.
Quoted 7 lines
Quoted 4 lines
selftests: Include
KHDR_INCLUDESinMakefile
selftests: Drop define_GNU_SOURCE
selftests: Drop duplicate -D_GNU_SOURCEPlease split these patches pwe test directory. Otherwise it will cause merge conflicts which can be hard to resolve.
Hi Shuah,
Sean asked that I rebase the patches on linux-next, and I will need to remove additional_GNU_SOURCEdefines. Should I send an unsplit v3 to be reviewed, then split it afterwards? I'm concerned that it will be difficult to review with ~70 patches once split.
Quoted 7 lines
Quoted 4 lines
Please send them split - it will be easier to review and apply. You might as well wait until the merge window is done. I don't think anybody would have time to review now since merge window starts next week.
Sorry, I have them split already; is it ok if I send them now? I will be on leave soon and may not be able to get back to it in a while.
Feel free to send the patches. There is no restriction on that.
Quoted 9 lines
Thanks,
EdwardQuoted 4 lines
thanks,
-- Shuah
Signature · 2 lines
BR, Muhammad Usama Anjum