sys/openbsd: add vmm descriptions (#1152)

Most probably limited to input validation for now. In the future, it
could be extended to provide a bootable kernel during vm create (/bsd)
and turn vmid into a proper resource.

The OpenBSD VMs on GCE does support vmm(4).
diff --git a/executor/defs.h b/executor/defs.h
index f183b71..40234bb 100644
--- a/executor/defs.h
+++ b/executor/defs.h
@@ -130,7 +130,7 @@
 
 #if GOARCH_amd64
 #define GOARCH "amd64"
-#define SYZ_REVISION "66d66a3830b5b4fd591a3693f4ba004395ee7fb6"
+#define SYZ_REVISION "216c98ad3498631ce9d36fbfa6fa8f98d1f2c5cb"
 #define SYZ_EXECUTOR_USES_FORK_SERVER 1
 #define SYZ_EXECUTOR_USES_SHMEM 1
 #define SYZ_PAGE_SIZE 4096
diff --git a/executor/syscalls.h b/executor/syscalls.h
index 2f0c0dc..afbc249 100644
--- a/executor/syscalls.h
+++ b/executor/syscalls.h
@@ -15115,6 +15115,14 @@
     {"ioctl$TIOCSTOP", 54},
     {"ioctl$TIOCSTSTAMP", 54},
     {"ioctl$TIOCSWINSZ", 54},
+    {"ioctl$VMM_IOC_CREATE", 54},
+    {"ioctl$VMM_IOC_INFO", 54},
+    {"ioctl$VMM_IOC_INTR", 54},
+    {"ioctl$VMM_IOC_READREGS", 54},
+    {"ioctl$VMM_IOC_RESETCPU", 54},
+    {"ioctl$VMM_IOC_RUN", 54},
+    {"ioctl$VMM_IOC_TERM", 54},
+    {"ioctl$VMM_IOC_WRITEREGS", 54},
     {"ioctl$VT_ACTIVATE", 54},
     {"ioctl$VT_GETACTIVE", 54},
     {"ioctl$VT_GETMODE", 54},
@@ -15184,6 +15192,7 @@
     {"openat$null", 321},
     {"openat$pci", 321},
     {"openat$tty", 321},
+    {"openat$vmm", 321},
     {"openat$wsdisplay", 321},
     {"openat$wskbd", 321},
     {"openat$wsmouse", 321},
diff --git a/pkg/host/host_openbsd.go b/pkg/host/host_openbsd.go
index 4e4a509..bbf373d 100644
--- a/pkg/host/host_openbsd.go
+++ b/pkg/host/host_openbsd.go
@@ -4,10 +4,27 @@
 package host
 
 import (
+	"fmt"
+	"strings"
+	"syscall"
+
 	"github.com/google/syzkaller/prog"
 )
 
 func isSupported(c *prog.Syscall, target *prog.Target, sandbox string) (bool, string) {
+	if strings.HasPrefix(c.CallName, "ioctl$VMM_") {
+		return isSupportedVMM()
+	}
+	return true, ""
+}
+
+func isSupportedVMM() (bool, string) {
+	device := "/dev/vmm"
+	fd, err := syscall.Open(device, syscall.O_RDONLY, 0)
+	if fd == -1 {
+		return false, fmt.Sprintf("open(%v) failed: %v", device, err)
+	}
+	syscall.Close(fd)
 	return true, ""
 }
 
diff --git a/sys/openbsd/dev_vmm.txt b/sys/openbsd/dev_vmm.txt
new file mode 100644
index 0000000..5ef256c
--- /dev/null
+++ b/sys/openbsd/dev_vmm.txt
@@ -0,0 +1,119 @@
+# Copyright 2019 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.
+
+include <sys/param.h>
+include <sys/ioctl.h>
+include <sys/fcntl.h>
+
+include <machine/param.h>
+include <machine/vmmvar.h>
+
+resource fd_vmm[fd]
+
+openat$vmm(fd const[AT_FDCWD], file ptr[in, string["/dev/vmm"]], flags flags[open_flags], mode const[0]) fd_vmm
+
+ioctl$VMM_IOC_CREATE(fd fd_vmm, cmd const[VMM_IOC_CREATE], arg ptr[in, vm_create_params])
+ioctl$VMM_IOC_INFO(fd fd_vmm, cmd const[VMM_IOC_INFO], arg ptr[out, vm_info_params])
+ioctl$VMM_IOC_INTR(fd fd_vmm, cmd const[VMM_IOC_INTR], arg ptr[in, vm_intr_params])
+ioctl$VMM_IOC_READREGS(fd fd_vmm, cmd const[VMM_IOC_READREGS], arg ptr[out, vm_rwregs_params])
+ioctl$VMM_IOC_RESETCPU(fd fd_vmm, cmd const[VMM_IOC_RESETCPU], arg ptr[in, vm_resetcpu_params])
+ioctl$VMM_IOC_RUN(fd fd_vmm, cmd const[VMM_IOC_RUN], arg ptr[in, vm_run_params])
+ioctl$VMM_IOC_TERM(fd fd_vmm, cmd const[VMM_IOC_TERM], arg ptr[in, vm_terminate_params])
+ioctl$VMM_IOC_WRITEREGS(fd fd_vmm, cmd const[VMM_IOC_WRITEREGS], arg ptr[in, vm_rwregs_params])
+
+vcpu_reg_state {
+	vrs_gprs	array[int64, VCPU_REGS_NGPRS]
+	vrs_crs		array[int64, VCPU_REGS_NCRS]
+	vrs_msrs	array[int64, VCPU_REGS_NMSRS]
+	vrs_drs		array[int64, VCPU_REGS_NDRS]
+	vrs_sregs	array[vcpu_segment_info, VCPU_REGS_NSREGS]
+	vrs_gdtr	vcpu_segment_info
+	vrs_idtr	vcpu_segment_info
+}
+
+vcpu_segment_info {
+	vsi_sel		int16
+	vsi_limit	int32
+	vsi_ar		int32
+	vsi_base	int64
+}
+
+vm_create_params {
+	vcp_nmemranges	len[vcp_memranges, int64]
+	vcp_ncpus	int64
+	vcp_ndisks	len[vcp_disks, int64]
+	vcp_nnics	int64
+	vcp_memranges	array[vm_mem_range, VMM_MAX_MEM_RANGES]
+	vcp_disks	array[string[filename, VMM_MAX_PATH_DISK], VMM_MAX_DISKS_PER_VM]
+	vcp_cdrom	string[filename, VMM_MAX_PATH_CDROM]
+	vcp_name	string[filename, VMM_MAX_NAME_LEN]
+	vcp_kernel	string[filename, VMM_MAX_KERNEL_PATH]
+	vcp_macs	array[string[filename, 6], VMM_MAX_NICS_PER_VM]
+# NEED: actual out parameter, syz_vmm_create(arg ptr[in, vm_create_params]) vmid
+	vcp_id		int32
+}
+
+vm_exit {
+	vei	vm_exit_inout
+	vrs	vcpu_reg_state
+}
+
+vm_exit_inout {
+	vei_size	int8
+	vei_dir		int8
+	vei_rep		int8
+	vei_string	int8
+	vei_encoding	int8
+	vei_port	int16
+	vei_data	int32
+}
+
+vm_info_params {
+	vip_size	len[vip_info, int64]
+	vip_info_ct	int64
+	vip_info	buffer[out]
+}
+
+vm_intr_params {
+# NEED: vmid
+	vip_vm_id	int32
+	vip_vcpu_id	int32
+	vip_intr	int16
+}
+
+vm_mem_range {
+	vmr_gpa		vma64
+	vmr_va		vma64
+	vmr_size	int64
+}
+
+vm_resetcpu_params {
+# NEED: vmid
+	vrp_vm_id	int32
+	vrp_vcpu_id	int32
+	vrp_init_state	vcpu_reg_state
+}
+
+vm_run_params {
+# NEED: vmid
+	vrp_vm_id	int32
+	vrp_vcpu_id	int32
+	vrp_continue	int8
+	vrp_irq		int16
+	vrp_exit	ptr[inout, vm_exit]
+	vrp_exit_reason	int16
+	vrp_irqready	int8
+}
+
+vm_rwregs_params {
+# NEED: vmid
+	vrwp_vm_id	int32
+	vrwp_vcpu_id	int32
+	vrwp_mask	int64
+	vrwp_regs	vcpu_reg_state
+}
+
+vm_terminate_params {
+# NEED: vmid
+	vtp_vm_id	int32
+}
diff --git a/sys/openbsd/dev_vmm_amd64.const b/sys/openbsd/dev_vmm_amd64.const
new file mode 100644
index 0000000..127ddfe
--- /dev/null
+++ b/sys/openbsd/dev_vmm_amd64.const
@@ -0,0 +1,24 @@
+# AUTOGENERATED FILE
+AT_FDCWD = 18446744073709551516
+SYS_ioctl = 54
+SYS_openat = 321
+VCPU_REGS_NCRS = 10
+VCPU_REGS_NDRS = 6
+VCPU_REGS_NGPRS = 18
+VCPU_REGS_NMSRS = 7
+VCPU_REGS_NSREGS = 8
+VMM_IOC_CREATE = 3305133569
+VMM_IOC_INFO = 3222820355
+VMM_IOC_INTR = 2148292102
+VMM_IOC_READREGS = 3259520519
+VMM_IOC_RESETCPU = 2185254405
+VMM_IOC_RUN = 3223344642
+VMM_IOC_TERM = 2147767812
+VMM_IOC_WRITEREGS = 2185778696
+VMM_MAX_DISKS_PER_VM = 4
+VMM_MAX_KERNEL_PATH = 128
+VMM_MAX_MEM_RANGES = 16
+VMM_MAX_NAME_LEN = 64
+VMM_MAX_NICS_PER_VM = 4
+VMM_MAX_PATH_CDROM = 128
+VMM_MAX_PATH_DISK = 128
diff --git a/sys/openbsd/gen/amd64.go b/sys/openbsd/gen/amd64.go
index f6fd1d4..fb9797c 100644
--- a/sys/openbsd/gen/amd64.go
+++ b/sys/openbsd/gen/amd64.go
@@ -17,6 +17,7 @@
 	{Name: "fd_kqueue", Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", TypeSize: 4}}}, Kind: []string{"fd", "fd_kqueue"}, Values: []uint64{18446744073709551615, 18446744073709551516}},
 	{Name: "fd_pci", Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", TypeSize: 4}}}, Kind: []string{"fd", "fd_pci"}, Values: []uint64{18446744073709551615, 18446744073709551516}},
 	{Name: "fd_tty", Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", TypeSize: 4}}}, Kind: []string{"fd", "fd_tty"}, Values: []uint64{18446744073709551615, 18446744073709551516}},
+	{Name: "fd_vmm", Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", TypeSize: 4}}}, Kind: []string{"fd", "fd_vmm"}, Values: []uint64{18446744073709551615, 18446744073709551516}},
 	{Name: "fd_wsdisplay", Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", TypeSize: 4}}}, Kind: []string{"fd", "fd_wsdisplay"}, Values: []uint64{18446744073709551615, 18446744073709551516}},
 	{Name: "fd_wskbd", Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", TypeSize: 4}}}, Kind: []string{"fd", "fd_wskbd"}, Values: []uint64{18446744073709551615, 18446744073709551516}},
 	{Name: "fd_wsmouse", Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", TypeSize: 4}}}, Kind: []string{"fd", "fd_wsmouse"}, Values: []uint64{18446744073709551615, 18446744073709551516}},
@@ -480,6 +481,134 @@
 		&ResourceType{TypeCommon: TypeCommon{TypeName: "sock_unix", FldName: "fd0", TypeSize: 4, ArgDir: 1}},
 		&ResourceType{TypeCommon: TypeCommon{TypeName: "sock_unix", FldName: "fd1", TypeSize: 4, ArgDir: 1}},
 	}}},
+	{Key: StructKey{Name: "vcpu_reg_state"}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "vcpu_reg_state", TypeSize: 568}, Fields: []Type{
+		&ArrayType{TypeCommon: TypeCommon{TypeName: "array", FldName: "vrs_gprs", TypeSize: 144}, Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64", TypeSize: 8}}}, Kind: 1, RangeBegin: 18, RangeEnd: 18},
+		&ArrayType{TypeCommon: TypeCommon{TypeName: "array", FldName: "vrs_crs", TypeSize: 80}, Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64", TypeSize: 8}}}, Kind: 1, RangeBegin: 10, RangeEnd: 10},
+		&ArrayType{TypeCommon: TypeCommon{TypeName: "array", FldName: "vrs_msrs", TypeSize: 56}, Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64", TypeSize: 8}}}, Kind: 1, RangeBegin: 7, RangeEnd: 7},
+		&ArrayType{TypeCommon: TypeCommon{TypeName: "array", FldName: "vrs_drs", TypeSize: 48}, Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64", TypeSize: 8}}}, Kind: 1, RangeBegin: 6, RangeEnd: 6},
+		&ArrayType{TypeCommon: TypeCommon{TypeName: "array", FldName: "vrs_sregs", TypeSize: 192}, Type: &StructType{Key: StructKey{Name: "vcpu_segment_info"}}, Kind: 1, RangeBegin: 8, RangeEnd: 8},
+		&StructType{Key: StructKey{Name: "vcpu_segment_info"}, FldName: "vrs_gdtr"},
+		&StructType{Key: StructKey{Name: "vcpu_segment_info"}, FldName: "vrs_idtr"},
+	}}},
+	{Key: StructKey{Name: "vcpu_reg_state", Dir: 1}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "vcpu_reg_state", TypeSize: 568, ArgDir: 1}, Fields: []Type{
+		&ArrayType{TypeCommon: TypeCommon{TypeName: "array", FldName: "vrs_gprs", TypeSize: 144, ArgDir: 1}, Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64", TypeSize: 8, ArgDir: 1}}}, Kind: 1, RangeBegin: 18, RangeEnd: 18},
+		&ArrayType{TypeCommon: TypeCommon{TypeName: "array", FldName: "vrs_crs", TypeSize: 80, ArgDir: 1}, Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64", TypeSize: 8, ArgDir: 1}}}, Kind: 1, RangeBegin: 10, RangeEnd: 10},
+		&ArrayType{TypeCommon: TypeCommon{TypeName: "array", FldName: "vrs_msrs", TypeSize: 56, ArgDir: 1}, Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64", TypeSize: 8, ArgDir: 1}}}, Kind: 1, RangeBegin: 7, RangeEnd: 7},
+		&ArrayType{TypeCommon: TypeCommon{TypeName: "array", FldName: "vrs_drs", TypeSize: 48, ArgDir: 1}, Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64", TypeSize: 8, ArgDir: 1}}}, Kind: 1, RangeBegin: 6, RangeEnd: 6},
+		&ArrayType{TypeCommon: TypeCommon{TypeName: "array", FldName: "vrs_sregs", TypeSize: 192, ArgDir: 1}, Type: &StructType{Key: StructKey{Name: "vcpu_segment_info", Dir: 1}}, Kind: 1, RangeBegin: 8, RangeEnd: 8},
+		&StructType{Key: StructKey{Name: "vcpu_segment_info", Dir: 1}, FldName: "vrs_gdtr"},
+		&StructType{Key: StructKey{Name: "vcpu_segment_info", Dir: 1}, FldName: "vrs_idtr"},
+	}}},
+	{Key: StructKey{Name: "vcpu_reg_state", Dir: 2}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "vcpu_reg_state", TypeSize: 568, ArgDir: 2}, Fields: []Type{
+		&ArrayType{TypeCommon: TypeCommon{TypeName: "array", FldName: "vrs_gprs", TypeSize: 144, ArgDir: 2}, Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64", TypeSize: 8, ArgDir: 2}}}, Kind: 1, RangeBegin: 18, RangeEnd: 18},
+		&ArrayType{TypeCommon: TypeCommon{TypeName: "array", FldName: "vrs_crs", TypeSize: 80, ArgDir: 2}, Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64", TypeSize: 8, ArgDir: 2}}}, Kind: 1, RangeBegin: 10, RangeEnd: 10},
+		&ArrayType{TypeCommon: TypeCommon{TypeName: "array", FldName: "vrs_msrs", TypeSize: 56, ArgDir: 2}, Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64", TypeSize: 8, ArgDir: 2}}}, Kind: 1, RangeBegin: 7, RangeEnd: 7},
+		&ArrayType{TypeCommon: TypeCommon{TypeName: "array", FldName: "vrs_drs", TypeSize: 48, ArgDir: 2}, Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64", TypeSize: 8, ArgDir: 2}}}, Kind: 1, RangeBegin: 6, RangeEnd: 6},
+		&ArrayType{TypeCommon: TypeCommon{TypeName: "array", FldName: "vrs_sregs", TypeSize: 192, ArgDir: 2}, Type: &StructType{Key: StructKey{Name: "vcpu_segment_info", Dir: 2}}, Kind: 1, RangeBegin: 8, RangeEnd: 8},
+		&StructType{Key: StructKey{Name: "vcpu_segment_info", Dir: 2}, FldName: "vrs_gdtr"},
+		&StructType{Key: StructKey{Name: "vcpu_segment_info", Dir: 2}, FldName: "vrs_idtr"},
+	}}},
+	{Key: StructKey{Name: "vcpu_segment_info"}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "vcpu_segment_info", TypeSize: 24}, Fields: []Type{
+		&IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int16", FldName: "vsi_sel", TypeSize: 2}}},
+		&ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "pad", TypeSize: 2}}, IsPad: true},
+		&IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", FldName: "vsi_limit", TypeSize: 4}}},
+		&IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", FldName: "vsi_ar", TypeSize: 4}}},
+		&ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "pad", TypeSize: 4}}, IsPad: true},
+		&IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64", FldName: "vsi_base", TypeSize: 8}}},
+	}}},
+	{Key: StructKey{Name: "vcpu_segment_info", Dir: 1}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "vcpu_segment_info", TypeSize: 24, ArgDir: 1}, Fields: []Type{
+		&IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int16", FldName: "vsi_sel", TypeSize: 2, ArgDir: 1}}},
+		&ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "pad", TypeSize: 2}}, IsPad: true},
+		&IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", FldName: "vsi_limit", TypeSize: 4, ArgDir: 1}}},
+		&IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", FldName: "vsi_ar", TypeSize: 4, ArgDir: 1}}},
+		&ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "pad", TypeSize: 4}}, IsPad: true},
+		&IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64", FldName: "vsi_base", TypeSize: 8, ArgDir: 1}}},
+	}}},
+	{Key: StructKey{Name: "vcpu_segment_info", Dir: 2}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "vcpu_segment_info", TypeSize: 24, ArgDir: 2}, Fields: []Type{
+		&IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int16", FldName: "vsi_sel", TypeSize: 2, ArgDir: 2}}},
+		&ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "pad", TypeSize: 2}}, IsPad: true},
+		&IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", FldName: "vsi_limit", TypeSize: 4, ArgDir: 2}}},
+		&IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", FldName: "vsi_ar", TypeSize: 4, ArgDir: 2}}},
+		&ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "pad", TypeSize: 4}}, IsPad: true},
+		&IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64", FldName: "vsi_base", TypeSize: 8, ArgDir: 2}}},
+	}}},
+	{Key: StructKey{Name: "vm_create_params"}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "vm_create_params", TypeSize: 1280}, Fields: []Type{
+		&LenType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "len", FldName: "vcp_nmemranges", TypeSize: 8}}, Buf: "vcp_memranges"},
+		&IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64", FldName: "vcp_ncpus", TypeSize: 8}}},
+		&LenType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "len", FldName: "vcp_ndisks", TypeSize: 8}}, Buf: "vcp_disks"},
+		&IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64", FldName: "vcp_nnics", TypeSize: 8}}},
+		&ArrayType{TypeCommon: TypeCommon{TypeName: "array", FldName: "vcp_memranges", TypeSize: 384}, Type: &StructType{Key: StructKey{Name: "vm_mem_range"}}, Kind: 1, RangeBegin: 16, RangeEnd: 16},
+		&ArrayType{TypeCommon: TypeCommon{TypeName: "array", FldName: "vcp_disks", TypeSize: 512}, Type: &BufferType{TypeCommon: TypeCommon{TypeName: "filename", TypeSize: 128}, Kind: 3}, Kind: 1, RangeBegin: 4, RangeEnd: 4},
+		&BufferType{TypeCommon: TypeCommon{TypeName: "filename", FldName: "vcp_cdrom", TypeSize: 128}, Kind: 3},
+		&BufferType{TypeCommon: TypeCommon{TypeName: "filename", FldName: "vcp_name", TypeSize: 64}, Kind: 3},
+		&BufferType{TypeCommon: TypeCommon{TypeName: "filename", FldName: "vcp_kernel", TypeSize: 128}, Kind: 3},
+		&ArrayType{TypeCommon: TypeCommon{TypeName: "array", FldName: "vcp_macs", TypeSize: 24}, Type: &BufferType{TypeCommon: TypeCommon{TypeName: "filename", TypeSize: 6}, Kind: 3}, Kind: 1, RangeBegin: 4, RangeEnd: 4},
+		&IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", FldName: "vcp_id", TypeSize: 4}}},
+		&ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "pad", TypeSize: 4}}, IsPad: true},
+	}}},
+	{Key: StructKey{Name: "vm_exit", Dir: 2}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "vm_exit", TypeSize: 584, ArgDir: 2}, Fields: []Type{
+		&StructType{Key: StructKey{Name: "vm_exit_inout", Dir: 2}, FldName: "vei"},
+		&ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "pad", TypeSize: 4}}, IsPad: true},
+		&StructType{Key: StructKey{Name: "vcpu_reg_state", Dir: 2}, FldName: "vrs"},
+	}}},
+	{Key: StructKey{Name: "vm_exit_inout", Dir: 2}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "vm_exit_inout", TypeSize: 12, ArgDir: 2}, Fields: []Type{
+		&IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int8", FldName: "vei_size", TypeSize: 1, ArgDir: 2}}},
+		&IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int8", FldName: "vei_dir", TypeSize: 1, ArgDir: 2}}},
+		&IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int8", FldName: "vei_rep", TypeSize: 1, ArgDir: 2}}},
+		&IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int8", FldName: "vei_string", TypeSize: 1, ArgDir: 2}}},
+		&IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int8", FldName: "vei_encoding", TypeSize: 1, ArgDir: 2}}},
+		&ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "pad", TypeSize: 1}}, IsPad: true},
+		&IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int16", FldName: "vei_port", TypeSize: 2, ArgDir: 2}}},
+		&IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", FldName: "vei_data", TypeSize: 4, ArgDir: 2}}},
+	}}},
+	{Key: StructKey{Name: "vm_info_params", Dir: 1}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "vm_info_params", TypeSize: 24, ArgDir: 1}, Fields: []Type{
+		&LenType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "len", FldName: "vip_size", TypeSize: 8, ArgDir: 1}}, Buf: "vip_info"},
+		&IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64", FldName: "vip_info_ct", TypeSize: 8, ArgDir: 1}}},
+		&PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "vip_info", TypeSize: 8}, Type: &BufferType{TypeCommon: TypeCommon{TypeName: "array", ArgDir: 1, IsVarlen: true}}},
+	}}},
+	{Key: StructKey{Name: "vm_intr_params"}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "vm_intr_params", TypeSize: 12}, Fields: []Type{
+		&IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", FldName: "vip_vm_id", TypeSize: 4}}},
+		&IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", FldName: "vip_vcpu_id", TypeSize: 4}}},
+		&IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int16", FldName: "vip_intr", TypeSize: 2}}},
+		&ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "pad", TypeSize: 2}}, IsPad: true},
+	}}},
+	{Key: StructKey{Name: "vm_mem_range"}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "vm_mem_range", TypeSize: 24}, Fields: []Type{
+		&VmaType{TypeCommon: TypeCommon{TypeName: "vma64", FldName: "vmr_gpa", TypeSize: 8}},
+		&VmaType{TypeCommon: TypeCommon{TypeName: "vma64", FldName: "vmr_va", TypeSize: 8}},
+		&IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64", FldName: "vmr_size", TypeSize: 8}}},
+	}}},
+	{Key: StructKey{Name: "vm_resetcpu_params"}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "vm_resetcpu_params", TypeSize: 576}, Fields: []Type{
+		&IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", FldName: "vrp_vm_id", TypeSize: 4}}},
+		&IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", FldName: "vrp_vcpu_id", TypeSize: 4}}},
+		&StructType{Key: StructKey{Name: "vcpu_reg_state"}, FldName: "vrp_init_state"},
+	}}},
+	{Key: StructKey{Name: "vm_run_params"}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "vm_run_params", TypeSize: 32}, Fields: []Type{
+		&IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", FldName: "vrp_vm_id", TypeSize: 4}}},
+		&IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", FldName: "vrp_vcpu_id", TypeSize: 4}}},
+		&IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int8", FldName: "vrp_continue", TypeSize: 1}}},
+		&ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "pad", TypeSize: 1}}, IsPad: true},
+		&IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int16", FldName: "vrp_irq", TypeSize: 2}}},
+		&ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "pad", TypeSize: 4}}, IsPad: true},
+		&PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "vrp_exit", TypeSize: 8}, Type: &StructType{Key: StructKey{Name: "vm_exit", Dir: 2}}},
+		&IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int16", FldName: "vrp_exit_reason", TypeSize: 2}}},
+		&IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int8", FldName: "vrp_irqready", TypeSize: 1}}},
+		&ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "pad", TypeSize: 5}}, IsPad: true},
+	}}},
+	{Key: StructKey{Name: "vm_rwregs_params"}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "vm_rwregs_params", TypeSize: 584}, Fields: []Type{
+		&IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", FldName: "vrwp_vm_id", TypeSize: 4}}},
+		&IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", FldName: "vrwp_vcpu_id", TypeSize: 4}}},
+		&IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64", FldName: "vrwp_mask", TypeSize: 8}}},
+		&StructType{Key: StructKey{Name: "vcpu_reg_state"}, FldName: "vrwp_regs"},
+	}}},
+	{Key: StructKey{Name: "vm_rwregs_params", Dir: 1}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "vm_rwregs_params", TypeSize: 584, ArgDir: 1}, Fields: []Type{
+		&IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", FldName: "vrwp_vm_id", TypeSize: 4, ArgDir: 1}}},
+		&IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", FldName: "vrwp_vcpu_id", TypeSize: 4, ArgDir: 1}}},
+		&IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64", FldName: "vrwp_mask", TypeSize: 8, ArgDir: 1}}},
+		&StructType{Key: StructKey{Name: "vcpu_reg_state", Dir: 1}, FldName: "vrwp_regs"},
+	}}},
+	{Key: StructKey{Name: "vm_terminate_params"}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "vm_terminate_params", TypeSize: 4}, Fields: []Type{
+		&IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", FldName: "vtp_vm_id", TypeSize: 4}}},
+	}}},
 	{Key: StructKey{Name: "vt_mode"}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "vt_mode", TypeSize: 8}, Fields: []Type{
 		&FlagsType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "vt_mode_flags", FldName: "mode", TypeSize: 1}}, Vals: []uint64{0, 1}, BitMask: true},
 		&IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int8", FldName: "waitv", TypeSize: 1}}},
@@ -1264,6 +1393,46 @@
 		&ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "cmd", TypeSize: 8}}, Val: 2148037735},
 		&PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "arg", TypeSize: 8}, Type: &StructType{Key: StructKey{Name: "winsize"}}},
 	}},
+	{NR: 54, Name: "ioctl$VMM_IOC_CREATE", CallName: "ioctl", Args: []Type{
+		&ResourceType{TypeCommon: TypeCommon{TypeName: "fd_vmm", FldName: "fd", TypeSize: 4}},
+		&ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "cmd", TypeSize: 8}}, Val: 3305133569},
+		&PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "arg", TypeSize: 8}, Type: &StructType{Key: StructKey{Name: "vm_create_params"}}},
+	}},
+	{NR: 54, Name: "ioctl$VMM_IOC_INFO", CallName: "ioctl", Args: []Type{
+		&ResourceType{TypeCommon: TypeCommon{TypeName: "fd_vmm", FldName: "fd", TypeSize: 4}},
+		&ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "cmd", TypeSize: 8}}, Val: 3222820355},
+		&PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "arg", TypeSize: 8}, Type: &StructType{Key: StructKey{Name: "vm_info_params", Dir: 1}}},
+	}},
+	{NR: 54, Name: "ioctl$VMM_IOC_INTR", CallName: "ioctl", Args: []Type{
+		&ResourceType{TypeCommon: TypeCommon{TypeName: "fd_vmm", FldName: "fd", TypeSize: 4}},
+		&ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "cmd", TypeSize: 8}}, Val: 2148292102},
+		&PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "arg", TypeSize: 8}, Type: &StructType{Key: StructKey{Name: "vm_intr_params"}}},
+	}},
+	{NR: 54, Name: "ioctl$VMM_IOC_READREGS", CallName: "ioctl", Args: []Type{
+		&ResourceType{TypeCommon: TypeCommon{TypeName: "fd_vmm", FldName: "fd", TypeSize: 4}},
+		&ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "cmd", TypeSize: 8}}, Val: 3259520519},
+		&PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "arg", TypeSize: 8}, Type: &StructType{Key: StructKey{Name: "vm_rwregs_params", Dir: 1}}},
+	}},
+	{NR: 54, Name: "ioctl$VMM_IOC_RESETCPU", CallName: "ioctl", Args: []Type{
+		&ResourceType{TypeCommon: TypeCommon{TypeName: "fd_vmm", FldName: "fd", TypeSize: 4}},
+		&ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "cmd", TypeSize: 8}}, Val: 2185254405},
+		&PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "arg", TypeSize: 8}, Type: &StructType{Key: StructKey{Name: "vm_resetcpu_params"}}},
+	}},
+	{NR: 54, Name: "ioctl$VMM_IOC_RUN", CallName: "ioctl", Args: []Type{
+		&ResourceType{TypeCommon: TypeCommon{TypeName: "fd_vmm", FldName: "fd", TypeSize: 4}},
+		&ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "cmd", TypeSize: 8}}, Val: 3223344642},
+		&PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "arg", TypeSize: 8}, Type: &StructType{Key: StructKey{Name: "vm_run_params"}}},
+	}},
+	{NR: 54, Name: "ioctl$VMM_IOC_TERM", CallName: "ioctl", Args: []Type{
+		&ResourceType{TypeCommon: TypeCommon{TypeName: "fd_vmm", FldName: "fd", TypeSize: 4}},
+		&ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "cmd", TypeSize: 8}}, Val: 2147767812},
+		&PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "arg", TypeSize: 8}, Type: &StructType{Key: StructKey{Name: "vm_terminate_params"}}},
+	}},
+	{NR: 54, Name: "ioctl$VMM_IOC_WRITEREGS", CallName: "ioctl", Args: []Type{
+		&ResourceType{TypeCommon: TypeCommon{TypeName: "fd_vmm", FldName: "fd", TypeSize: 4}},
+		&ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "cmd", TypeSize: 8}}, Val: 2185778696},
+		&PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "arg", TypeSize: 8}, Type: &StructType{Key: StructKey{Name: "vm_rwregs_params"}}},
+	}},
 	{NR: 54, Name: "ioctl$VT_ACTIVATE", CallName: "ioctl", Args: []Type{
 		&ResourceType{TypeCommon: TypeCommon{TypeName: "fd_wsdisplay", FldName: "fd", TypeSize: 4}},
 		&ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "cmd", TypeSize: 8}}, Val: 536901125},
@@ -1606,6 +1775,12 @@
 		&FlagsType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "open_flags", FldName: "flags", TypeSize: 8}}, Vals: []uint64{0, 1, 2, 8, 512, 1024, 2048, 16, 32, 256, 65536, 128, 128, 128, 32768, 131072, 64}},
 		&ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "mode", TypeSize: 8}}},
 	}, Ret: &ResourceType{TypeCommon: TypeCommon{TypeName: "fd_tty", FldName: "ret", TypeSize: 4, ArgDir: 1}}},
+	{NR: 321, Name: "openat$vmm", CallName: "openat", Args: []Type{
+		&ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "fd", TypeSize: 8}}, Val: 18446744073709551516},
+		&PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "file", TypeSize: 8}, Type: &BufferType{TypeCommon: TypeCommon{TypeName: "string", TypeSize: 9}, Kind: 2, Values: []string{"/dev/vmm\x00"}}},
+		&FlagsType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "open_flags", FldName: "flags", TypeSize: 8}}, Vals: []uint64{0, 1, 2, 8, 512, 1024, 2048, 16, 32, 256, 65536, 128, 128, 128, 32768, 131072, 64}},
+		&ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "mode", TypeSize: 8}}},
+	}, Ret: &ResourceType{TypeCommon: TypeCommon{TypeName: "fd_vmm", FldName: "ret", TypeSize: 4, ArgDir: 1}}},
 	{NR: 321, Name: "openat$wsdisplay", CallName: "openat", Args: []Type{
 		&ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "fd", TypeSize: 8}}, Val: 18446744073709551516},
 		&PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "file", TypeSize: 8}, Type: &BufferType{TypeCommon: TypeCommon{TypeName: "string", TypeSize: 13}, Kind: 2, Values: []string{"/dev/ttyCcfg\x00"}}},
@@ -2552,6 +2727,26 @@
 	{Name: "UF_APPEND", Value: 4},
 	{Name: "UF_IMMUTABLE", Value: 2},
 	{Name: "UF_NODUMP", Value: 1},
+	{Name: "VCPU_REGS_NCRS", Value: 10},
+	{Name: "VCPU_REGS_NDRS", Value: 6},
+	{Name: "VCPU_REGS_NGPRS", Value: 18},
+	{Name: "VCPU_REGS_NMSRS", Value: 7},
+	{Name: "VCPU_REGS_NSREGS", Value: 8},
+	{Name: "VMM_IOC_CREATE", Value: 3305133569},
+	{Name: "VMM_IOC_INFO", Value: 3222820355},
+	{Name: "VMM_IOC_INTR", Value: 2148292102},
+	{Name: "VMM_IOC_READREGS", Value: 3259520519},
+	{Name: "VMM_IOC_RESETCPU", Value: 2185254405},
+	{Name: "VMM_IOC_RUN", Value: 3223344642},
+	{Name: "VMM_IOC_TERM", Value: 2147767812},
+	{Name: "VMM_IOC_WRITEREGS", Value: 2185778696},
+	{Name: "VMM_MAX_DISKS_PER_VM", Value: 4},
+	{Name: "VMM_MAX_KERNEL_PATH", Value: 128},
+	{Name: "VMM_MAX_MEM_RANGES", Value: 16},
+	{Name: "VMM_MAX_NAME_LEN", Value: 64},
+	{Name: "VMM_MAX_NICS_PER_VM", Value: 4},
+	{Name: "VMM_MAX_PATH_CDROM", Value: 128},
+	{Name: "VMM_MAX_PATH_DISK", Value: 128},
 	{Name: "VT_ACKACQ", Value: 2},
 	{Name: "VT_ACTIVATE", Value: 536901125},
 	{Name: "VT_AUTO"},
@@ -2658,4 +2853,4 @@
 	{Name: "__MAP_NOREPLACE", Value: 2048},
 }
 
-const revision_amd64 = "66d66a3830b5b4fd591a3693f4ba004395ee7fb6"
+const revision_amd64 = "216c98ad3498631ce9d36fbfa6fa8f98d1f2c5cb"