diff options
| author | 6eanut <jiakaiPeanut@gmail.com> | 2026-02-26 01:20:42 +0000 |
|---|---|---|
| committer | Alexander Potapenko <glider@google.com> | 2026-02-26 09:03:41 +0000 |
| commit | ffa542879cca228b4e5f1bea6ba8de94dfacb90d (patch) | |
| tree | cf69ca46c5e8ab387736516a6f46d75f96a6d3b9 /executor | |
| parent | cd152ea2d27f130f30f3d744e27dc398a8c463ee (diff) | |
executor: move common SYZOS API call descriptors to common_kvm_syzos.h
Diffstat (limited to 'executor')
| -rw-r--r-- | executor/common_kvm_amd64_syzos.h | 25 | ||||
| -rw-r--r-- | executor/common_kvm_arm64_syzos.h | 20 | ||||
| -rw-r--r-- | executor/common_kvm_riscv64_syzos.h | 15 | ||||
| -rw-r--r-- | executor/common_kvm_syzos.h | 26 |
4 files changed, 26 insertions, 60 deletions
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 |
