diff options
| author | Alexander Potapenko <glider@google.com> | 2025-10-23 16:32:28 +0200 |
|---|---|---|
| committer | Alexander Potapenko <glider@google.com> | 2025-10-27 09:00:11 +0000 |
| commit | 7dc1cb33ae76d43d894dd96c2c4435a6a26b963d (patch) | |
| tree | 54b6dfb76baf44ea8aff75832ce41f72fc9e0605 /executor | |
| parent | c0460fcde7051a8d07612ec2a17718d3c3019bb0 (diff) | |
executor: add include guards to KVM headers
Not having these results in three copies of every KVM-related #define
in each reproducer.
Diffstat (limited to 'executor')
| -rw-r--r-- | executor/common_kvm.h | 5 | ||||
| -rw-r--r-- | executor/common_kvm_386.h | 5 | ||||
| -rw-r--r-- | executor/common_kvm_amd64.h | 5 | ||||
| -rw-r--r-- | executor/common_kvm_amd64_syzos.h | 5 | ||||
| -rw-r--r-- | executor/common_kvm_arm64.h | 5 | ||||
| -rw-r--r-- | executor/common_kvm_arm64_syzos.h | 5 | ||||
| -rw-r--r-- | executor/common_kvm_ppc64.h | 5 | ||||
| -rw-r--r-- | executor/common_kvm_syzos.h | 5 | ||||
| -rw-r--r-- | executor/kvm.h | 5 |
9 files changed, 45 insertions, 0 deletions
diff --git a/executor/common_kvm.h b/executor/common_kvm.h index 68c5559d8..03e297d25 100644 --- a/executor/common_kvm.h +++ b/executor/common_kvm.h @@ -1,6 +1,9 @@ // Copyright 2025 syzkaller project authors. All rights reserved. // Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file. +#ifndef EXECUTOR_COMMON_KVM_H +#define EXECUTOR_COMMON_KVM_H + // This file is shared between executor and csource package. // Common KVM-related definitions. @@ -52,3 +55,5 @@ static long syz_kvm_assert_syzos_kvm_exit(volatile long a0, volatile long a1) return 0; } #endif + +#endif // EXECUTOR_COMMON_KVM_H
\ No newline at end of file diff --git a/executor/common_kvm_386.h b/executor/common_kvm_386.h index f1b634150..5c8498492 100644 --- a/executor/common_kvm_386.h +++ b/executor/common_kvm_386.h @@ -1,6 +1,9 @@ // Copyright 2025 syzkaller project authors. All rights reserved. // Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file. +#ifndef EXECUTOR_COMMON_KVM_386_H +#define EXECUTOR_COMMON_KVM_386_H + // This file is shared between executor and csource package. #if SYZ_EXECUTOR || __NR_syz_kvm_setup_syzos_vm @@ -37,3 +40,5 @@ static volatile long syz_kvm_setup_cpu(volatile long a0, volatile long a1, volat return 0; } #endif + +#endif // EXECUTOR_COMMON_KVM_386_H
\ No newline at end of file diff --git a/executor/common_kvm_amd64.h b/executor/common_kvm_amd64.h index 3c376e017..e4c961962 100644 --- a/executor/common_kvm_amd64.h +++ b/executor/common_kvm_amd64.h @@ -1,6 +1,9 @@ // Copyright 2017 syzkaller project authors. All rights reserved. // Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file. +#ifndef EXECUTOR_COMMON_KVM_AMD64_H +#define EXECUTOR_COMMON_KVM_AMD64_H + // This file is shared between executor and csource package. // Implementation of syz_kvm_setup_cpu pseudo-syscall. @@ -1182,3 +1185,5 @@ static long syz_kvm_assert_syzos_uexit(volatile long a0, volatile long a1) return 0; } #endif + +#endif // EXECUTOR_COMMON_KVM_AMD64_H
\ No newline at end of file diff --git a/executor/common_kvm_amd64_syzos.h b/executor/common_kvm_amd64_syzos.h index e815e087d..fd43b9daa 100644 --- a/executor/common_kvm_amd64_syzos.h +++ b/executor/common_kvm_amd64_syzos.h @@ -1,6 +1,9 @@ // Copyright 2025 syzkaller project authors. All rights reserved. // Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file. +#ifndef EXECUTOR_COMMON_KVM_AMD64_SYZOS_H +#define EXECUTOR_COMMON_KVM_AMD64_SYZOS_H + // This file provides guest code running inside the AMD64 KVM. #include "common_kvm_syzos.h" @@ -394,3 +397,5 @@ GUEST_CODE static noinline void guest_handle_set_irq_handler(struct api_call_2* handler_addr = executor_fn_guest_addr(uexit_irq_handler); set_idt_gate(vector, handler_addr); } + +#endif // EXECUTOR_COMMON_KVM_AMD64_SYZOS_H diff --git a/executor/common_kvm_arm64.h b/executor/common_kvm_arm64.h index 8c02b0745..0663dcd1c 100644 --- a/executor/common_kvm_arm64.h +++ b/executor/common_kvm_arm64.h @@ -1,3 +1,6 @@ +#ifndef EXECUTOR_COMMON_KVM_ARM64_H +#define EXECUTOR_COMMON_KVM_ARM64_H + // Copyright 2017 syzkaller project authors. All rights reserved. // Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file. @@ -395,3 +398,5 @@ static long syz_kvm_assert_reg(volatile long a0, volatile long a1, volatile long return 0; } #endif + +#endif // EXECUTOR_COMMON_KVM_ARM64_H
\ No newline at end of file diff --git a/executor/common_kvm_arm64_syzos.h b/executor/common_kvm_arm64_syzos.h index 0a9e3391f..2ef7819d9 100644 --- a/executor/common_kvm_arm64_syzos.h +++ b/executor/common_kvm_arm64_syzos.h @@ -1,6 +1,9 @@ // Copyright 2024 syzkaller project authors. All rights reserved. // Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file. +#ifndef EXECUTOR_COMMON_KVM_ARM64_SYZOS_H +#define EXECUTOR_COMMON_KVM_ARM64_SYZOS_H + // This file provides guest code running inside the ARM64 KVM. #include "common_kvm_syzos.h" @@ -1348,3 +1351,5 @@ GUEST_CODE static void guest_prepare_its(int nr_cpus, int nr_devices, int nr_eve guest_setup_its_mappings(ARM64_ADDR_ITS_CMDQ_BASE, ARM64_ADDR_ITS_ITT_TABLES, nr_events, nr_devices, nr_cpus); guest_invalidate_all_rdists(ARM64_ADDR_ITS_CMDQ_BASE, nr_cpus); } + +#endif // EXECUTOR_COMMON_KVM_ARM64_SYZOS_H
\ No newline at end of file diff --git a/executor/common_kvm_ppc64.h b/executor/common_kvm_ppc64.h index 687c2bbd0..6d23ef89a 100644 --- a/executor/common_kvm_ppc64.h +++ b/executor/common_kvm_ppc64.h @@ -1,6 +1,9 @@ // Copyright 2020 syzkaller project authors. All rights reserved. // Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file. +#ifndef EXECUTOR_COMMON_KVM_PPC64_H +#define EXECUTOR_COMMON_KVM_PPC64_H + // This file is shared between executor and csource package. // Implementation of syz_kvm_setup_cpu pseudo-syscall. @@ -409,3 +412,5 @@ static volatile long syz_kvm_setup_cpu(volatile long a0, volatile long a1, volat return 0; } + +#endif // EXECUTOR_COMMON_KVM_PPC64_H diff --git a/executor/common_kvm_syzos.h b/executor/common_kvm_syzos.h index be530319e..5fe513ab1 100644 --- a/executor/common_kvm_syzos.h +++ b/executor/common_kvm_syzos.h @@ -1,6 +1,9 @@ // Copyright 2025 syzkaller project authors. All rights reserved. // Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file. +#ifndef EXECUTOR_COMMON_KVM_SYZOS_H +#define EXECUTOR_COMMON_KVM_SYZOS_H + // Common SYZOS definitions. // Prevent function inlining. This attribute is applied to every guest_handle_* function, @@ -37,3 +40,5 @@ // Start/end of the guest section. extern char *__start_guest, *__stop_guest; + +#endif // EXECUTOR_COMMON_KVM_SYZOS_H
\ No newline at end of file diff --git a/executor/kvm.h b/executor/kvm.h index 104bd45fc..fb7b5b49d 100644 --- a/executor/kvm.h +++ b/executor/kvm.h @@ -1,6 +1,9 @@ // Copyright 2017 syzkaller project authors. All rights reserved. // Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file. +#ifndef EXECUTOR_KVM_H +#define EXECUTOR_KVM_H + // x86-specific definitions. #if GOARCH_amd64 #define X86_ADDR_TEXT 0x0000 @@ -209,3 +212,5 @@ #define ARM64_ADDR_ITS_PEND_TABLES (ARM64_ADDR_ITS_PROP_TABLE + SZ_64K) #endif // ARM64 SYZOS definitions + +#endif // EXECUTOR_KVM_H
\ No newline at end of file |
