aboutsummaryrefslogtreecommitdiffstats
path: root/sys/linux/dev_kvm.txt
diff options
context:
space:
mode:
authorAlexander Potapenko <glider@google.com>2024-08-07 16:07:27 +0200
committerAlexander Potapenko <glider@google.com>2024-08-07 16:00:37 +0000
commitb92bfae57e0bcabedd26d3382121a2754c9af3c0 (patch)
tree7c74233f3e98d6a2e7e4b17d736983c198ba88b3 /sys/linux/dev_kvm.txt
parentf89fe08c7227fc4fa4bc40ab8d0e1eacca6c20f0 (diff)
sys/linux: refactor syzos_api_call
As suggested by Dmitry, use a template to avoid duplication in various syzos types. Also adjust the existing tests.
Diffstat (limited to 'sys/linux/dev_kvm.txt')
-rw-r--r--sys/linux/dev_kvm.txt26
1 files changed, 10 insertions, 16 deletions
diff --git a/sys/linux/dev_kvm.txt b/sys/linux/dev_kvm.txt
index 4b702ed29..b5c019ec7 100644
--- a/sys/linux/dev_kvm.txt
+++ b/sys/linux/dev_kvm.txt
@@ -248,22 +248,12 @@ kvm_text_arm64 {
size bytesize[text, int64]
}
-syzos_api_uexit {
- call const[0, int64]
- size bytesize[parent, int64]
- exit_code intptr
-}
-
syzos_api_code {
- call const[1, int64]
- size bytesize[parent, int64]
insns text[arm64]
ret const[0xd65f03c0, int32]
} [packed]
syzos_api_msr {
- call const[2, int64]
- size bytesize[parent, int64]
arg_reg flags[kvm_regs_arm64_sys, int64]
arg_value int64
}
@@ -278,17 +268,21 @@ syzos_api_msr {
kvm_smc_id = 0x80000000, 0x40000000, 0x1000000, 0x2000000, 0x3000000, 0x4000000, 0x30000000, 0x31000000, 0x32000000, 0x3f000000, 0x0, 0x1, 0x2, 0x4, 0x8, 0x10, 0x20, 0x40, 0x80, 0x100, 0x200, 0x400, 0x800, 0x1000, 0x2000, 0x4000, 0x8000, 0xffff
syzos_api_smc {
- call const[3, int64]
- size bytesize[parent, int64]
arg_id flags[kvm_smc_id, int32]
arg_params array[int64, 5]
}
+type syzos_api[NUM, PAYLOAD] {
+ call const[NUM, int64]
+ size bytesize[parent, int64]
+ payload PAYLOAD
+}
+
syzos_api_call [
- uexit syzos_api_uexit
- code syzos_api_code
- msr syzos_api_msr
- smc syzos_api_smc
+ uexit syzos_api[0, intptr]
+ code syzos_api[1, syzos_api_code]
+ msr syzos_api[2, syzos_api_msr]
+ smc syzos_api[3, syzos_api_smc]
] [varlen]
kvm_text_ppc64 {