From ffa542879cca228b4e5f1bea6ba8de94dfacb90d Mon Sep 17 00:00:00 2001 From: 6eanut Date: Thu, 26 Feb 2026 01:20:42 +0000 Subject: executor: move common SYZOS API call descriptors to common_kvm_syzos.h --- executor/common_kvm_amd64_syzos.h | 25 ------------------------- executor/common_kvm_arm64_syzos.h | 20 -------------------- executor/common_kvm_riscv64_syzos.h | 15 --------------- executor/common_kvm_syzos.h | 26 ++++++++++++++++++++++++++ 4 files changed, 26 insertions(+), 60 deletions(-) (limited to 'executor') diff --git a/executor/common_kvm_amd64_syzos.h b/executor/common_kvm_amd64_syzos.h index 10e4a5e49..05de55849 100644 --- a/executor/common_kvm_amd64_syzos.h +++ b/executor/common_kvm_amd64_syzos.h @@ -45,11 +45,6 @@ typedef enum { SYZOS_API_STOP, // Must be the last one } syzos_api_id; -struct api_call_header { - uint64 call; - uint64 size; -}; - struct api_call_uexit { struct api_call_header header; uint64 exit_code; @@ -79,26 +74,6 @@ struct api_call_cpuid { uint32 ecx; }; -struct api_call_1 { - struct api_call_header header; - uint64 arg; -}; - -struct api_call_2 { - struct api_call_header header; - uint64 args[2]; -}; - -struct api_call_3 { - struct api_call_header header; - uint64 args[3]; -}; - -struct api_call_5 { - struct api_call_header header; - uint64 args[5]; -}; - // This struct must match the push/pop order in nested_vm_exit_handler_intel_asm(). struct l2_guest_regs { uint64 rax, rbx, rcx, rdx, rsi, rdi, rbp; diff --git a/executor/common_kvm_arm64_syzos.h b/executor/common_kvm_arm64_syzos.h index ae4f0530d..b36666725 100644 --- a/executor/common_kvm_arm64_syzos.h +++ b/executor/common_kvm_arm64_syzos.h @@ -32,31 +32,11 @@ typedef enum { SYZOS_API_STOP, // Must be the last one } syzos_api_id; -struct api_call_header { - uint64 call; - uint64 size; -}; - struct api_call_uexit { struct api_call_header header; uint64 exit_code; }; -struct api_call_1 { - struct api_call_header header; - uint64 arg; -}; - -struct api_call_2 { - struct api_call_header header; - uint64 args[2]; -}; - -struct api_call_3 { - struct api_call_header header; - uint64 args[3]; -}; - struct api_call_code { struct api_call_header header; uint32 insns[]; diff --git a/executor/common_kvm_riscv64_syzos.h b/executor/common_kvm_riscv64_syzos.h index 421ca5929..ba9139e0a 100644 --- a/executor/common_kvm_riscv64_syzos.h +++ b/executor/common_kvm_riscv64_syzos.h @@ -20,26 +20,11 @@ typedef enum { SYZOS_API_STOP, // Must be the last one } syzos_api_id; -struct api_call_header { - uint64 call; - uint64 size; -}; - struct api_call_code { struct api_call_header header; uint32 insns[]; }; -struct api_call_1 { - struct api_call_header header; - uint64 arg; -}; - -struct api_call_2 { - struct api_call_header header; - uint64 args[2]; -}; - GUEST_CODE static void guest_uexit(uint64 exit_code); GUEST_CODE static void guest_execute_code(uint32* insns, uint64 size); GUEST_CODE static void guest_handle_csrr(uint32 csr); diff --git a/executor/common_kvm_syzos.h b/executor/common_kvm_syzos.h index 096ff2556..6dc75be36 100644 --- a/executor/common_kvm_syzos.h +++ b/executor/common_kvm_syzos.h @@ -53,4 +53,30 @@ // Start/end of the guest section. extern char *__start_guest, *__stop_guest; +// Common SYZOS API call descriptors. +struct api_call_header { + uint64 call; + uint64 size; +}; + +struct api_call_1 { + struct api_call_header header; + uint64 arg; +}; + +struct api_call_2 { + struct api_call_header header; + uint64 args[2]; +}; + +struct api_call_3 { + struct api_call_header header; + uint64 args[3]; +}; + +struct api_call_5 { + struct api_call_header header; + uint64 args[5]; +}; + #endif // EXECUTOR_COMMON_KVM_SYZOS_H -- cgit mrf-deployment