github.com/google/syzkaller@v0.0.0-20240517125934-c0f1611a36d6/sys/openbsd/dev_vmm.txt (about)

     1  # Copyright 2019 syzkaller project authors. All rights reserved.
     2  # Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file.
     3  
     4  include <sys/param.h>
     5  include <sys/ioctl.h>
     6  include <sys/fcntl.h>
     7  
     8  include <machine/param.h>
     9  include <machine/vmmvar.h>
    10  
    11  include <dev/vmm/vmm.h>
    12  
    13  resource fd_vmm[fd]
    14  
    15  openat$vmm(fd const[AT_FDCWD], file ptr[in, string["/dev/vmm"]], flags flags[open_flags], mode const[0]) fd_vmm
    16  
    17  ioctl$VMM_IOC_CREATE(fd fd_vmm, cmd const[VMM_IOC_CREATE], arg ptr[in, vm_create_params])
    18  ioctl$VMM_IOC_INFO(fd fd_vmm, cmd const[VMM_IOC_INFO], arg ptr[out, vm_info_params])
    19  ioctl$VMM_IOC_INTR(fd fd_vmm, cmd const[VMM_IOC_INTR], arg ptr[in, vm_intr_params])
    20  ioctl$VMM_IOC_READREGS(fd fd_vmm, cmd const[VMM_IOC_READREGS], arg ptr[out, vm_rwregs_params])
    21  ioctl$VMM_IOC_RESETCPU(fd fd_vmm, cmd const[VMM_IOC_RESETCPU], arg ptr[in, vm_resetcpu_params])
    22  ioctl$VMM_IOC_RUN(fd fd_vmm, cmd const[VMM_IOC_RUN], arg ptr[in, vm_run_params])
    23  ioctl$VMM_IOC_TERM(fd fd_vmm, cmd const[VMM_IOC_TERM], arg ptr[in, vm_terminate_params])
    24  ioctl$VMM_IOC_WRITEREGS(fd fd_vmm, cmd const[VMM_IOC_WRITEREGS], arg ptr[in, vm_rwregs_params])
    25  
    26  vcpu_reg_state {
    27  	vrs_gprs	array[int64, VCPU_REGS_NGPRS]
    28  	vrs_crs		array[int64, VCPU_REGS_NCRS]
    29  	vrs_msrs	array[int64, VCPU_REGS_NMSRS]
    30  	vrs_drs		array[int64, VCPU_REGS_NDRS]
    31  	vrs_sregs	array[vcpu_segment_info, VCPU_REGS_NSREGS]
    32  	vrs_gdtr	vcpu_segment_info
    33  	vrs_idtr	vcpu_segment_info
    34  }
    35  
    36  vcpu_segment_info {
    37  	vsi_sel		int16
    38  	vsi_limit	int32
    39  	vsi_ar		int32
    40  	vsi_base	int64
    41  }
    42  
    43  vm_create_params {
    44  	vcp_nmemranges	len[vcp_memranges, int64]
    45  	vcp_ncpus	int64
    46  	vcp_memranges	array[vm_mem_range, VMM_MAX_MEM_RANGES]
    47  	vcp_name	string[filename, VMM_MAX_NAME_LEN]
    48  # NEED: actual out parameter, syz_vmm_create(arg ptr[in, vm_create_params]) vmid
    49  	vcp_id		int32
    50  }
    51  
    52  vm_exit {
    53  	vei	vm_exit_inout
    54  	vrs	vcpu_reg_state
    55  }
    56  
    57  vm_exit_inout {
    58  	vei_size	int8
    59  	vei_dir		int8
    60  	vei_rep		int8
    61  	vei_string	int8
    62  	vei_encoding	int8
    63  	vei_port	int16
    64  	vei_data	int32
    65  }
    66  
    67  vm_info_params {
    68  	vip_size	len[vip_info, int64]
    69  	vip_info_ct	int64
    70  	vip_info	buffer[out]
    71  }
    72  
    73  vm_intr_params {
    74  # NEED: vmid
    75  	vip_vm_id	int32
    76  	vip_vcpu_id	int32
    77  	vip_intr	int16
    78  }
    79  
    80  vm_mem_range {
    81  	vmr_gpa		vma64
    82  	vmr_va		vma64
    83  	vmr_size	int64
    84  }
    85  
    86  vm_resetcpu_params {
    87  # NEED: vmid
    88  	vrp_vm_id	int32
    89  	vrp_vcpu_id	int32
    90  	vrp_init_state	vcpu_reg_state
    91  }
    92  
    93  vm_run_params {
    94  # NEED: vmid
    95  	vrp_vm_id	int32
    96  	vrp_vcpu_id	int32
    97  	vrp_continue	int8
    98  	vrp_irq		int16
    99  	vrp_exit	ptr[inout, vm_exit]
   100  	vrp_exit_reason	int16
   101  	vrp_irqready	int8
   102  }
   103  
   104  vm_rwregs_params {
   105  # NEED: vmid
   106  	vrwp_vm_id	int32
   107  	vrwp_vcpu_id	int32
   108  	vrwp_mask	int64
   109  	vrwp_regs	vcpu_reg_state
   110  }
   111  
   112  vm_terminate_params {
   113  # NEED: vmid
   114  	vtp_vm_id	int32
   115  }