diff options
| author | Alexander Potapenko <glider@google.com> | 2025-11-18 11:40:02 +0100 |
|---|---|---|
| committer | Alexander Potapenko <glider@google.com> | 2025-11-19 08:59:40 +0000 |
| commit | 3bf489934f218dfcb171b6db6db3ecce818971db (patch) | |
| tree | 08dc0bf59f4dcf56ea688f20dc01c52fea5abd8e /executor/common_kvm_amd64_syzos.h | |
| parent | e5e08fbade9fe503f6dd211ecaf29510f1da05b6 (diff) | |
executor: sys/linux: renumber SYZOS API IDs
Now that we are using volatiles in guest_main(), there is no
particular need to base the numbers on primes (this didn't work well
with Clang anyway).
Instead, group the commands logically and leave some space between the
groups for future updates.
Diffstat (limited to 'executor/common_kvm_amd64_syzos.h')
| -rw-r--r-- | executor/common_kvm_amd64_syzos.h | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/executor/common_kvm_amd64_syzos.h b/executor/common_kvm_amd64_syzos.h index 8a144758f..9f93af017 100644 --- a/executor/common_kvm_amd64_syzos.h +++ b/executor/common_kvm_amd64_syzos.h @@ -11,23 +11,23 @@ #include <linux/kvm.h> #include <stdbool.h> -// Compilers will eagerly try to transform the switch statement in guest_main() -// into a jump table, unless the cases are sparse enough. -// We use prime numbers multiplied by 10 to prevent this behavior. +// There are no particular rules to assign numbers here, but changing them will +// result in losing some existing reproducers. Therefore, we try to leave spaces +// between unrelated IDs. // Remember these constants must match those in sys/linux/dev_kvm_amd64.txt. typedef enum { SYZOS_API_UEXIT = 0, SYZOS_API_CODE = 10, - SYZOS_API_CPUID = 20, - SYZOS_API_WRMSR = 30, - SYZOS_API_RDMSR = 50, - SYZOS_API_WR_CRN = 70, - SYZOS_API_WR_DRN = 110, - SYZOS_API_IN_DX = 130, - SYZOS_API_OUT_DX = 170, - SYZOS_API_SET_IRQ_HANDLER = 190, - SYZOS_API_ENABLE_NESTED = 230, - SYZOS_API_NESTED_CREATE_VM = 290, + SYZOS_API_CPUID = 100, + SYZOS_API_WRMSR = 101, + SYZOS_API_RDMSR = 102, + SYZOS_API_WR_CRN = 103, + SYZOS_API_WR_DRN = 104, + SYZOS_API_IN_DX = 105, + SYZOS_API_OUT_DX = 106, + SYZOS_API_SET_IRQ_HANDLER = 200, + SYZOS_API_ENABLE_NESTED = 300, + SYZOS_API_NESTED_CREATE_VM = 301, SYZOS_API_STOP, // Must be the last one } syzos_api_id; |
