Commit 730cfa45 authored by Sean Christopherson's avatar Sean Christopherson

KVM: selftests: Define _GNU_SOURCE for all selftests code

Define _GNU_SOURCE is the base CFLAGS instead of relying on selftests to
manually #define _GNU_SOURCE, which is repetitive and error prone.  E.g.
kselftest_harness.h requires _GNU_SOURCE for asprintf(), but if a selftest
includes kvm_test_harness.h after stdio.h, the include guards result in
the effective version of stdio.h consumed by kvm_test_harness.h not
defining asprintf():

  In file included from x86_64/fix_hypercall_test.c:12:
  In file included from include/kvm_test_harness.h:11:
 ../kselftest_harness.h:1169:2: error: call to undeclared function
  'asprintf'; ISO C99 and later do not support implicit function declarations
  [-Wimplicit-function-declaration]
   1169 |         asprintf(&test_name, "%s%s%s.%s", f->name,
        |         ^

When including the rseq selftest's "library" code, #undef _GNU_SOURCE so
that rseq.c controls whether or not it wants to build with _GNU_SOURCE.
Reported-by: default avatarMuhammad Usama Anjum <usama.anjum@collabora.com>
Acked-by: default avatarClaudio Imbrenda <imbrenda@linux.ibm.com>
Acked-by: default avatarOliver Upton <oliver.upton@linux.dev>
Acked-by: default avatarAnup Patel <anup@brainfault.org>
Reviewed-by: default avatarMuhammad Usama Anjum <usama.anjum@collabora.com>
Link: https://lore.kernel.org/r/20240423190308.2883084-1-seanjc@google.comSigned-off-by: default avatarSean Christopherson <seanjc@google.com>
parent a96cb3bf
...@@ -226,8 +226,8 @@ LINUX_TOOL_ARCH_INCLUDE = $(top_srcdir)/tools/arch/$(ARCH)/include ...@@ -226,8 +226,8 @@ LINUX_TOOL_ARCH_INCLUDE = $(top_srcdir)/tools/arch/$(ARCH)/include
endif endif
CFLAGS += -Wall -Wstrict-prototypes -Wuninitialized -O2 -g -std=gnu99 \ CFLAGS += -Wall -Wstrict-prototypes -Wuninitialized -O2 -g -std=gnu99 \
-Wno-gnu-variable-sized-type-not-at-end -MD -MP -DCONFIG_64BIT \ -Wno-gnu-variable-sized-type-not-at-end -MD -MP -DCONFIG_64BIT \
-fno-builtin-memcmp -fno-builtin-memcpy -fno-builtin-memset \ -D_GNU_SOURCE -fno-builtin-memcmp -fno-builtin-memcpy \
-fno-builtin-strnlen \ -fno-builtin-memset -fno-builtin-strnlen \
-fno-stack-protector -fno-PIE -I$(LINUX_TOOL_INCLUDE) \ -fno-stack-protector -fno-PIE -I$(LINUX_TOOL_INCLUDE) \
-I$(LINUX_TOOL_ARCH_INCLUDE) -I$(LINUX_HDR_PATH) -Iinclude \ -I$(LINUX_TOOL_ARCH_INCLUDE) -I$(LINUX_HDR_PATH) -Iinclude \
-I$(<D) -Iinclude/$(ARCH_DIR) -I ../rseq -I.. $(EXTRA_CFLAGS) \ -I$(<D) -Iinclude/$(ARCH_DIR) -I ../rseq -I.. $(EXTRA_CFLAGS) \
......
...@@ -5,8 +5,6 @@ ...@@ -5,8 +5,6 @@
* *
* Copyright (c) 2021, Google LLC. * Copyright (c) 2021, Google LLC.
*/ */
#define _GNU_SOURCE
#include "arch_timer.h" #include "arch_timer.h"
#include "delay.h" #include "delay.h"
#include "gic.h" #include "gic.h"
......
...@@ -7,7 +7,6 @@ ...@@ -7,7 +7,6 @@
* hugetlbfs with a hole). It checks that the expected handling method is * 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). * called (e.g., uffd faults with the right address and write/read flag).
*/ */
#define _GNU_SOURCE
#include <linux/bitmap.h> #include <linux/bitmap.h>
#include <fcntl.h> #include <fcntl.h>
#include <test_util.h> #include <test_util.h>
......
...@@ -10,9 +10,6 @@ ...@@ -10,9 +10,6 @@
* - A test for KVM's handling of PSCI SYSTEM_SUSPEND and the associated * - A test for KVM's handling of PSCI SYSTEM_SUSPEND and the associated
* KVM_SYSTEM_EVENT_SUSPEND UAPI. * KVM_SYSTEM_EVENT_SUSPEND UAPI.
*/ */
#define _GNU_SOURCE
#include <linux/psci.h> #include <linux/psci.h>
#include "kvm_util.h" #include "kvm_util.h"
......
...@@ -4,7 +4,6 @@ ...@@ -4,7 +4,6 @@
* *
* Copyright (C) 2020, Red Hat, Inc. * Copyright (C) 2020, Red Hat, Inc.
*/ */
#define _GNU_SOURCE
#include <linux/kernel.h> #include <linux/kernel.h>
#include <sys/syscall.h> #include <sys/syscall.h>
#include <asm/kvm.h> #include <asm/kvm.h>
......
...@@ -19,9 +19,6 @@ ...@@ -19,9 +19,6 @@
* *
* Copyright (c) 2021, Google LLC. * Copyright (c) 2021, Google LLC.
*/ */
#define _GNU_SOURCE
#include <stdlib.h> #include <stdlib.h>
#include <pthread.h> #include <pthread.h>
#include <linux/sizes.h> #include <linux/sizes.h>
......
...@@ -6,9 +6,6 @@ ...@@ -6,9 +6,6 @@
* Copyright (C) 2018, Red Hat, Inc. * Copyright (C) 2018, Red Hat, Inc.
* Copyright (C) 2019, Google, Inc. * Copyright (C) 2019, Google, Inc.
*/ */
#define _GNU_SOURCE /* for pipe2 */
#include <inttypes.h> #include <inttypes.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
......
...@@ -4,9 +4,6 @@ ...@@ -4,9 +4,6 @@
* *
* Copyright (C) 2018, Red Hat, Inc. * Copyright (C) 2018, Red Hat, Inc.
*/ */
#define _GNU_SOURCE /* for program_invocation_name */
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <pthread.h> #include <pthread.h>
......
...@@ -4,8 +4,6 @@ ...@@ -4,8 +4,6 @@
* *
* Author: Chao Peng <chao.p.peng@linux.intel.com> * Author: Chao Peng <chao.p.peng@linux.intel.com>
*/ */
#define _GNU_SOURCE
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <unistd.h> #include <unistd.h>
......
...@@ -4,9 +4,6 @@ ...@@ -4,9 +4,6 @@
* kvm_arch_hardware_disable is called and it attempts to unregister the user * kvm_arch_hardware_disable is called and it attempts to unregister the user
* return notifiers. * return notifiers.
*/ */
#define _GNU_SOURCE
#include <fcntl.h> #include <fcntl.h>
#include <pthread.h> #include <pthread.h>
#include <semaphore.h> #include <semaphore.h>
......
...@@ -27,12 +27,12 @@ ...@@ -27,12 +27,12 @@
/* /*
* Provide a version of static_assert() that is guaranteed to have an optional * Provide a version of static_assert() that is guaranteed to have an optional
* message param. If _ISOC11_SOURCE is defined, glibc (/usr/include/assert.h) * message param. _GNU_SOURCE is defined for all KVM selftests, _GNU_SOURCE
* #undefs and #defines static_assert() as a direct alias to _Static_assert(), * implies _ISOC11_SOURCE, and if _ISOC11_SOURCE is defined, glibc #undefs and
* i.e. effectively makes the message mandatory. Many KVM selftests #define * #defines static_assert() as a direct alias to _Static_assert() (see
* _GNU_SOURCE for various reasons, and _GNU_SOURCE implies _ISOC11_SOURCE. As * usr/include/assert.h). Define a custom macro instead of redefining
* a result, static_assert() behavior is non-deterministic and may or may not * static_assert() to avoid creating non-deterministic behavior that is
* require a message depending on #include order. * dependent on include order.
*/ */
#define __kvm_static_assert(expr, msg, ...) _Static_assert(expr, msg) #define __kvm_static_assert(expr, msg, ...) _Static_assert(expr, msg)
#define kvm_static_assert(expr, ...) __kvm_static_assert(expr, ##__VA_ARGS__, #expr) #define kvm_static_assert(expr, ...) __kvm_static_assert(expr, ##__VA_ARGS__, #expr)
......
...@@ -5,9 +5,6 @@ ...@@ -5,9 +5,6 @@
* Copyright (C) 2018, Red Hat, Inc. * Copyright (C) 2018, Red Hat, Inc.
* Copyright (C) 2019-2022 Google LLC * Copyright (C) 2019-2022 Google LLC
*/ */
#define _GNU_SOURCE /* for pipe2 */
#include <inttypes.h> #include <inttypes.h>
#include <time.h> #include <time.h>
#include <pthread.h> #include <pthread.h>
......
...@@ -6,8 +6,6 @@ ...@@ -6,8 +6,6 @@
* *
* Test the fd-based interface for KVM statistics. * Test the fd-based interface for KVM statistics.
*/ */
#define _GNU_SOURCE /* for program_invocation_short_name */
#include <fcntl.h> #include <fcntl.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
......
...@@ -6,8 +6,6 @@ ...@@ -6,8 +6,6 @@
* *
* Test for KVM_CAP_MAX_VCPUS and KVM_CAP_MAX_VCPU_ID. * Test for KVM_CAP_MAX_VCPUS and KVM_CAP_MAX_VCPU_ID.
*/ */
#define _GNU_SOURCE /* for program_invocation_short_name */
#include <fcntl.h> #include <fcntl.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
......
...@@ -8,9 +8,6 @@ ...@@ -8,9 +8,6 @@
* page size have been pre-allocated on your system, if you are planning to * page size have been pre-allocated on your system, if you are planning to
* use hugepages to back the guest memory for testing. * use hugepages to back the guest memory for testing.
*/ */
#define _GNU_SOURCE /* for program_invocation_name */
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <time.h> #include <time.h>
......
...@@ -4,9 +4,6 @@ ...@@ -4,9 +4,6 @@
* *
* Copyright (C) 2018, Google LLC. * Copyright (C) 2018, Google LLC.
*/ */
#define _GNU_SOURCE /* for getline(3) and strchrnul(3)*/
#include "test_util.h" #include "test_util.h"
#include <execinfo.h> #include <execinfo.h>
......
...@@ -4,8 +4,6 @@ ...@@ -4,8 +4,6 @@
* *
* Copyright (C) 2018, Google LLC. * Copyright (C) 2018, Google LLC.
*/ */
#define _GNU_SOURCE /* for program_invocation_name */
#include "test_util.h" #include "test_util.h"
#include "kvm_util.h" #include "kvm_util.h"
#include "processor.h" #include "processor.h"
......
...@@ -2,8 +2,6 @@ ...@@ -2,8 +2,6 @@
/* /*
* Copyright (C) 2020, Google LLC. * Copyright (C) 2020, Google LLC.
*/ */
#define _GNU_SOURCE
#include <inttypes.h> #include <inttypes.h>
#include <linux/bitmap.h> #include <linux/bitmap.h>
......
...@@ -4,8 +4,6 @@ ...@@ -4,8 +4,6 @@
* *
* Copyright (C) 2020, Google LLC. * Copyright (C) 2020, Google LLC.
*/ */
#define _GNU_SOURCE
#include <stdio.h> #include <stdio.h>
#include <stdarg.h> #include <stdarg.h>
#include <assert.h> #include <assert.h>
......
...@@ -6,9 +6,6 @@ ...@@ -6,9 +6,6 @@
* Copyright (C) 2018, Red Hat, Inc. * Copyright (C) 2018, Red Hat, Inc.
* Copyright (C) 2019-2022 Google LLC * Copyright (C) 2019-2022 Google LLC
*/ */
#define _GNU_SOURCE /* for pipe2 */
#include <inttypes.h> #include <inttypes.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
......
// SPDX-License-Identifier: GPL-2.0-only // SPDX-License-Identifier: GPL-2.0-only
#define _GNU_SOURCE /* for program_invocation_short_name */
#include <stdint.h> #include <stdint.h>
#include <stdbool.h> #include <stdbool.h>
......
// SPDX-License-Identifier: GPL-2.0 // SPDX-License-Identifier: GPL-2.0
#define _GNU_SOURCE
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <pthread.h> #include <pthread.h>
......
...@@ -6,9 +6,6 @@ ...@@ -6,9 +6,6 @@
* Copyright (C) 2018, Red Hat, Inc. * Copyright (C) 2018, Red Hat, Inc.
* Copyright (C) 2020, Google, Inc. * Copyright (C) 2020, Google, Inc.
*/ */
#define _GNU_SOURCE /* for program_invocation_name */
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <sys/syscall.h> #include <sys/syscall.h>
......
...@@ -7,9 +7,6 @@ ...@@ -7,9 +7,6 @@
* *
* Copyright (c) 2024, Intel Corporation. * Copyright (c) 2024, Intel Corporation.
*/ */
#define _GNU_SOURCE
#include "arch_timer.h" #include "arch_timer.h"
#include "kvm_util.h" #include "kvm_util.h"
#include "processor.h" #include "processor.h"
......
// SPDX-License-Identifier: GPL-2.0-only // SPDX-License-Identifier: GPL-2.0-only
#define _GNU_SOURCE /* for program_invocation_short_name */
/*
* Include rseq.c without _GNU_SOURCE defined, before including any headers, so
* that rseq.c is compiled with its configuration, not KVM selftests' config.
*/
#undef _GNU_SOURCE
#include "../rseq/rseq.c"
#define _GNU_SOURCE
#include <errno.h> #include <errno.h>
#include <fcntl.h> #include <fcntl.h>
#include <pthread.h> #include <pthread.h>
...@@ -20,8 +28,6 @@ ...@@ -20,8 +28,6 @@
#include "processor.h" #include "processor.h"
#include "test_util.h" #include "test_util.h"
#include "../rseq/rseq.c"
/* /*
* Any bug related to task migration is likely to be timing-dependent; perform * Any bug related to task migration is likely to be timing-dependent; perform
* a large number of migrations to reduce the odds of a false negative. * a large number of migrations to reduce the odds of a false negative.
......
...@@ -7,8 +7,6 @@ ...@@ -7,8 +7,6 @@
* Authors: * Authors:
* Nico Boehr <nrb@linux.ibm.com> * Nico Boehr <nrb@linux.ibm.com>
*/ */
#define _GNU_SOURCE /* for program_invocation_short_name */
#include <fcntl.h> #include <fcntl.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
......
...@@ -10,8 +10,6 @@ ...@@ -10,8 +10,6 @@
* *
* Test expected behavior of the KVM_CAP_SYNC_REGS functionality. * Test expected behavior of the KVM_CAP_SYNC_REGS functionality.
*/ */
#define _GNU_SOURCE /* for program_invocation_short_name */
#include <fcntl.h> #include <fcntl.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
......
// SPDX-License-Identifier: GPL-2.0 // SPDX-License-Identifier: GPL-2.0
#define _GNU_SOURCE /* for program_invocation_short_name */
#include <fcntl.h> #include <fcntl.h>
#include <pthread.h> #include <pthread.h>
#include <sched.h> #include <sched.h>
......
...@@ -4,7 +4,6 @@ ...@@ -4,7 +4,6 @@
* *
* Copyright (C) 2020, Red Hat, Inc. * Copyright (C) 2020, Red Hat, Inc.
*/ */
#define _GNU_SOURCE
#include <stdio.h> #include <stdio.h>
#include <time.h> #include <time.h>
#include <sched.h> #include <sched.h>
......
...@@ -6,8 +6,6 @@ ...@@ -6,8 +6,6 @@
* *
* Tests for amx #NM exception and save/restore. * Tests for amx #NM exception and save/restore.
*/ */
#define _GNU_SOURCE /* for program_invocation_short_name */
#include <fcntl.h> #include <fcntl.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
......
...@@ -4,9 +4,6 @@ ...@@ -4,9 +4,6 @@
* *
* Test for KVM_CAP_EXIT_ON_EMULATION_FAILURE. * Test for KVM_CAP_EXIT_ON_EMULATION_FAILURE.
*/ */
#define _GNU_SOURCE /* for program_invocation_short_name */
#include "flds_emulation.h" #include "flds_emulation.h"
#include "test_util.h" #include "test_util.h"
......
...@@ -2,8 +2,6 @@ ...@@ -2,8 +2,6 @@
/* /*
* Copyright (C) 2023, Google LLC. * Copyright (C) 2023, Google LLC.
*/ */
#define _GNU_SOURCE /* for program_invocation_short_name */
#include <sys/ioctl.h> #include <sys/ioctl.h>
#include "test_util.h" #include "test_util.h"
......
...@@ -7,8 +7,6 @@ ...@@ -7,8 +7,6 @@
* This work is licensed under the terms of the GNU GPL, version 2. * 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 <fcntl.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
......
...@@ -4,7 +4,6 @@ ...@@ -4,7 +4,6 @@
* *
* Tests for Enlightened VMCS, including nested guest state. * Tests for Enlightened VMCS, including nested guest state.
*/ */
#define _GNU_SOURCE /* for program_invocation_short_name */
#include <fcntl.h> #include <fcntl.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
......
...@@ -5,8 +5,6 @@ ...@@ -5,8 +5,6 @@
* Copyright (C) 2022, Red Hat, Inc. * Copyright (C) 2022, Red Hat, Inc.
* *
*/ */
#define _GNU_SOURCE /* for program_invocation_short_name */
#include <pthread.h> #include <pthread.h>
#include <inttypes.h> #include <inttypes.h>
......
...@@ -4,7 +4,6 @@ ...@@ -4,7 +4,6 @@
* *
* Tests for Hyper-V extensions to SVM. * Tests for Hyper-V extensions to SVM.
*/ */
#define _GNU_SOURCE /* for program_invocation_short_name */
#include <fcntl.h> #include <fcntl.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
......
...@@ -5,8 +5,6 @@ ...@@ -5,8 +5,6 @@
* Copyright (C) 2022, Red Hat, Inc. * Copyright (C) 2022, Red Hat, Inc.
* *
*/ */
#define _GNU_SOURCE /* for program_invocation_short_name */
#include <asm/barrier.h> #include <asm/barrier.h>
#include <pthread.h> #include <pthread.h>
#include <inttypes.h> #include <inttypes.h>
......
// SPDX-License-Identifier: GPL-2.0-only // SPDX-License-Identifier: GPL-2.0-only
#define _GNU_SOURCE /* for program_invocation_short_name */
#include "test_util.h" #include "test_util.h"
#include "kvm_util.h" #include "kvm_util.h"
#include "processor.h" #include "processor.h"
......
...@@ -5,9 +5,6 @@ ...@@ -5,9 +5,6 @@
* *
* Copyright (C) 2022, Google LLC. * Copyright (C) 2022, Google LLC.
*/ */
#define _GNU_SOURCE
#include <fcntl.h> #include <fcntl.h>
#include <stdint.h> #include <stdint.h>
#include <time.h> #include <time.h>
......
...@@ -9,8 +9,6 @@ ...@@ -9,8 +9,6 @@
* Verifies expected behavior of controlling guest access to * Verifies expected behavior of controlling guest access to
* MSR_PLATFORM_INFO. * MSR_PLATFORM_INFO.
*/ */
#define _GNU_SOURCE /* for program_invocation_short_name */
#include <fcntl.h> #include <fcntl.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
......
...@@ -2,8 +2,6 @@ ...@@ -2,8 +2,6 @@
/* /*
* Copyright (C) 2023, Tencent, Inc. * Copyright (C) 2023, Tencent, Inc.
*/ */
#define _GNU_SOURCE /* for program_invocation_short_name */
#include <x86intrin.h> #include <x86intrin.h>
#include "pmu.h" #include "pmu.h"
......
...@@ -9,9 +9,6 @@ ...@@ -9,9 +9,6 @@
* Verifies the expected behavior of allow lists and deny lists for * Verifies the expected behavior of allow lists and deny lists for
* virtual PMU events. * virtual PMU events.
*/ */
#define _GNU_SOURCE /* for program_invocation_short_name */
#include "kvm_util.h" #include "kvm_util.h"
#include "pmu.h" #include "pmu.h"
#include "processor.h" #include "processor.h"
......
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
/* /*
* Copyright (C) 2022, Google LLC. * Copyright (C) 2022, Google LLC.
*/ */
#define _GNU_SOURCE /* for program_invocation_short_name */
#include <fcntl.h> #include <fcntl.h>
#include <limits.h> #include <limits.h>
#include <pthread.h> #include <pthread.h>
......
...@@ -4,7 +4,6 @@ ...@@ -4,7 +4,6 @@
* *
* Copyright (C) 2020, Red Hat, Inc. * Copyright (C) 2020, Red Hat, Inc.
*/ */
#define _GNU_SOURCE /* for program_invocation_name */
#include <fcntl.h> #include <fcntl.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
......
...@@ -10,7 +10,6 @@ ...@@ -10,7 +10,6 @@
* That bug allowed a user-mode program that called the KVM_SET_SREGS * 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. * ioctl to put a VCPU's local APIC into an invalid state.
*/ */
#define _GNU_SOURCE /* for program_invocation_short_name */
#include <fcntl.h> #include <fcntl.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
......
...@@ -5,9 +5,6 @@ ...@@ -5,9 +5,6 @@
* Test that KVM emulates instructions in response to EPT violations when * Test that KVM emulates instructions in response to EPT violations when
* allow_smaller_maxphyaddr is enabled and guest.MAXPHYADDR < host.MAXPHYADDR. * allow_smaller_maxphyaddr is enabled and guest.MAXPHYADDR < host.MAXPHYADDR.
*/ */
#define _GNU_SOURCE /* for program_invocation_short_name */
#include "flds_emulation.h" #include "flds_emulation.h"
#include "test_util.h" #include "test_util.h"
......
...@@ -4,7 +4,6 @@ ...@@ -4,7 +4,6 @@
* *
* Tests for SMM. * Tests for SMM.
*/ */
#define _GNU_SOURCE /* for program_invocation_short_name */
#include <fcntl.h> #include <fcntl.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
......
...@@ -6,7 +6,6 @@ ...@@ -6,7 +6,6 @@
* *
* Tests for vCPU state save/restore, including nested guest state. * Tests for vCPU state save/restore, including nested guest state.
*/ */
#define _GNU_SOURCE /* for program_invocation_short_name */
#include <fcntl.h> #include <fcntl.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
......
...@@ -8,8 +8,6 @@ ...@@ -8,8 +8,6 @@
* including requesting an invalid register set, updates to/from values * 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. * 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 <fcntl.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
......
...@@ -17,8 +17,6 @@ ...@@ -17,8 +17,6 @@
* delivered into the guest or not. * delivered into the guest or not.
* *
*/ */
#define _GNU_SOURCE /* for program_invocation_short_name */
#include <pthread.h> #include <pthread.h>
#include <inttypes.h> #include <inttypes.h>
#include <string.h> #include <string.h>
......
...@@ -4,8 +4,6 @@ ...@@ -4,8 +4,6 @@
* *
* Tests for exiting into userspace on registered MSRs * Tests for exiting into userspace on registered MSRs
*/ */
#define _GNU_SOURCE /* for program_invocation_short_name */
#include <sys/ioctl.h> #include <sys/ioctl.h>
#include "kvm_test_harness.h" #include "kvm_test_harness.h"
......
...@@ -4,9 +4,6 @@ ...@@ -4,9 +4,6 @@
* *
* Copyright (C) 2018, Red Hat, Inc. * Copyright (C) 2018, Red Hat, Inc.
*/ */
#define _GNU_SOURCE /* for program_invocation_name */
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <linux/bitmap.h> #include <linux/bitmap.h>
......
...@@ -10,7 +10,6 @@ ...@@ -10,7 +10,6 @@
* and check it can be retrieved with KVM_GET_MSR, also test * and check it can be retrieved with KVM_GET_MSR, also test
* the invalid LBR formats are rejected. * the invalid LBR formats are rejected.
*/ */
#define _GNU_SOURCE /* for program_invocation_short_name */
#include <sys/ioctl.h> #include <sys/ioctl.h>
#include <linux/bitmap.h> #include <linux/bitmap.h>
......
...@@ -9,7 +9,6 @@ ...@@ -9,7 +9,6 @@
* value instead of partially decayed timer value * value instead of partially decayed timer value
* *
*/ */
#define _GNU_SOURCE /* for program_invocation_short_name */
#include <fcntl.h> #include <fcntl.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
......
...@@ -19,8 +19,6 @@ ...@@ -19,8 +19,6 @@
* Migration is a command line option. When used on non-numa machines will * 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. * 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 <getopt.h>
#include <pthread.h> #include <pthread.h>
#include <inttypes.h> #include <inttypes.h>
......
// SPDX-License-Identifier: GPL-2.0-only // SPDX-License-Identifier: GPL-2.0-only
#define _GNU_SOURCE /* for program_invocation_short_name */
#include <fcntl.h> #include <fcntl.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
......
...@@ -4,8 +4,6 @@ ...@@ -4,8 +4,6 @@
* *
* Tests for the IA32_XSS MSR. * Tests for the IA32_XSS MSR.
*/ */
#define _GNU_SOURCE /* for program_invocation_short_name */
#include <sys/ioctl.h> #include <sys/ioctl.h>
#include "test_util.h" #include "test_util.h"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment