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

     1  # Copyright 2015 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  meta arches["386", "amd64", "arm64", "mips64le", "ppc64le", "s390x"]
     5  
     6  include <linux/kvm.h>
     7  include <linux/kvm_host.h>
     8  include <uapi/linux/fcntl.h>
     9  include <asm/kvm.h>
    10  include <asm/mce.h>
    11  
    12  resource fd_kvm[fd]
    13  resource fd_kvmvm[fd]
    14  resource fd_kvmcpu[fd]
    15  resource fd_kvmdev[fd]
    16  resource fd_sgx_provision[fd]
    17  
    18  openat$kvm(fd const[AT_FDCWD], file ptr[in, string["/dev/kvm"]], flags flags[open_flags], mode const[0]) fd_kvm
    19  openat$sgx_provision(fd const[AT_FDCWD], file ptr[in, string["/dev/sgx_provision"]], flags flags[open_flags], mode const[0]) fd_sgx_provision
    20  
    21  ioctl$KVM_CREATE_VM(fd fd_kvm, cmd const[KVM_CREATE_VM], type const[0]) fd_kvmvm
    22  ioctl$KVM_GET_MSR_INDEX_LIST(fd fd_kvm, cmd const[KVM_GET_MSR_INDEX_LIST], arg ptr[in, kvm_msr_list])
    23  ioctl$KVM_CHECK_EXTENSION(fd fd_kvm, cmd const[KVM_CHECK_EXTENSION], arg intptr)
    24  ioctl$KVM_GET_VCPU_MMAP_SIZE(fd fd_kvm, cmd const[KVM_GET_VCPU_MMAP_SIZE])
    25  ioctl$KVM_GET_SUPPORTED_CPUID(fd fd_kvm, cmd const[KVM_GET_SUPPORTED_CPUID], arg buffer[out])
    26  ioctl$KVM_GET_EMULATED_CPUID(fd fd_kvmvm, cmd const[KVM_GET_EMULATED_CPUID], arg buffer[out])
    27  ioctl$KVM_X86_GET_MCE_CAP_SUPPORTED(fd fd_kvmvm, cmd const[KVM_X86_GET_MCE_CAP_SUPPORTED], arg buffer[out])
    28  
    29  ioctl$KVM_GET_API_VERSION(fd fd_kvm, cmd const[KVM_GET_API_VERSION], type const[0])
    30  ioctl$KVM_CREATE_VCPU(fd fd_kvmvm, cmd const[KVM_CREATE_VCPU], id intptr[0:2]) fd_kvmcpu
    31  ioctl$KVM_CHECK_EXTENSION_VM(fd fd_kvmvm, cmd const[KVM_CHECK_EXTENSION], arg intptr)
    32  ioctl$KVM_GET_DIRTY_LOG(fd fd_kvmvm, cmd const[KVM_GET_DIRTY_LOG], arg ptr[in, kvm_dirty_log])
    33  ioctl$KVM_CREATE_IRQCHIP(fd fd_kvmvm, cmd const[KVM_CREATE_IRQCHIP])
    34  ioctl$KVM_IRQ_LINE(fd fd_kvmvm, cmd const[KVM_IRQ_LINE], arg ptr[in, kvm_irq_level])
    35  ioctl$KVM_IRQ_LINE_STATUS(fd fd_kvmvm, cmd const[KVM_IRQ_LINE_STATUS], arg ptr[in, kvm_irq_level])
    36  ioctl$KVM_GET_IRQCHIP(fd fd_kvmvm, cmd const[KVM_GET_IRQCHIP], arg ptr[out, kvm_irqchip])
    37  ioctl$KVM_SET_IRQCHIP(fd fd_kvmvm, cmd const[KVM_SET_IRQCHIP], arg ptr[in, kvm_irqchip])
    38  ioctl$KVM_XEN_HVM_CONFIG(fd fd_kvmvm, cmd const[KVM_XEN_HVM_CONFIG], arg ptr[in, kvm_xen_hvm_config])
    39  ioctl$KVM_GET_CLOCK(fd fd_kvmvm, cmd const[KVM_GET_CLOCK], arg ptr[out, kvm_clock_data])
    40  ioctl$KVM_SET_CLOCK(fd fd_kvmvm, cmd const[KVM_SET_CLOCK], arg ptr[in, kvm_clock_data])
    41  ioctl$KVM_SET_USER_MEMORY_REGION(fd fd_kvmvm, cmd const[KVM_SET_USER_MEMORY_REGION], arg ptr[in, kvm_userspace_memory_region])
    42  ioctl$KVM_SET_TSS_ADDR(fd fd_kvmvm, cmd const[KVM_SET_TSS_ADDR], arg flags[kvm_x86_tss_addr])
    43  ioctl$KVM_SET_IDENTITY_MAP_ADDR(fd fd_kvmvm, cmd const[KVM_SET_IDENTITY_MAP_ADDR], arg ptr[in, flags[kvm_guest_addrs, int64]])
    44  ioctl$KVM_SET_BOOT_CPU_ID(fd fd_kvmvm, cmd const[KVM_SET_BOOT_CPU_ID], arg ptr[in, intptr[0:2]])
    45  ioctl$KVM_PPC_GET_PVINFO(fd fd_kvmvm, cmd const[KVM_PPC_GET_PVINFO], arg buffer[out])
    46  ioctl$KVM_SET_GSI_ROUTING(fd fd_kvmvm, cmd const[KVM_SET_GSI_ROUTING], arg ptr[in, kvm_irq_routing])
    47  ioctl$KVM_ASSIGN_SET_MSIX_NR(fd fd_kvmvm, cmd const[KVM_ASSIGN_SET_MSIX_NR], arg ptr[in, kvm_assigned_msix_nr])
    48  ioctl$KVM_ASSIGN_SET_MSIX_ENTRY(fd fd_kvmvm, cmd const[KVM_ASSIGN_SET_MSIX_ENTRY], arg ptr[in, kvm_assigned_msix_entry])
    49  ioctl$KVM_IOEVENTFD(fd fd_kvmvm, cmd const[KVM_IOEVENTFD], arg ptr[in, kvm_ioeventfd])
    50  ioctl$KVM_SIGNAL_MSI(fd fd_kvmvm, cmd const[KVM_SIGNAL_MSI], arg ptr[in, kvm_msi])
    51  ioctl$KVM_CREATE_PIT2(fd fd_kvmvm, cmd const[KVM_CREATE_PIT2], arg ptr[in, kvm_pit_config])
    52  ioctl$KVM_GET_PIT(fd fd_kvmvm, cmd const[KVM_GET_PIT], arg ptr[out, kvm_pit_state2])
    53  ioctl$KVM_SET_PIT(fd fd_kvmvm, cmd const[KVM_SET_PIT], arg ptr[in, kvm_pit_state2])
    54  ioctl$KVM_GET_PIT2(fd fd_kvmvm, cmd const[KVM_GET_PIT2], arg ptr[out, kvm_pit_state2])
    55  ioctl$KVM_SET_PIT2(fd fd_kvmvm, cmd const[KVM_SET_PIT2], arg ptr[in, kvm_pit_state2])
    56  ioctl$KVM_PPC_GET_SMMU_INFO(fd fd_kvmvm, cmd const[KVM_PPC_GET_SMMU_INFO], arg buffer[out])
    57  ioctl$KVM_IRQFD(fd fd_kvmvm, cmd const[KVM_IRQFD], arg ptr[in, kvm_irqfd])
    58  ioctl$KVM_PPC_ALLOCATE_HTAB(fd fd_kvmvm, cmd const[KVM_PPC_ALLOCATE_HTAB], arg ptr[in, int32])
    59  ioctl$KVM_CREATE_DEVICE(fd fd_kvmvm, cmd const[KVM_CREATE_DEVICE], arg ptr[inout, kvm_create_device])
    60  ioctl$KVM_REGISTER_COALESCED_MMIO(fd fd_kvmvm, cmd const[KVM_REGISTER_COALESCED_MMIO], arg ptr[in, kvm_coalesced_mmio_zone])
    61  ioctl$KVM_UNREGISTER_COALESCED_MMIO(fd fd_kvmvm, cmd const[KVM_UNREGISTER_COALESCED_MMIO], arg ptr[in, kvm_coalesced_mmio_zone])
    62  ioctl$KVM_SET_NR_MMU_PAGES(fd fd_kvmvm, cmd const[KVM_SET_NR_MMU_PAGES], arg intptr)
    63  ioctl$KVM_GET_NR_MMU_PAGES(fd fd_kvmvm, cmd const[KVM_GET_NR_MMU_PAGES], arg intptr)
    64  ioctl$KVM_REINJECT_CONTROL(fd fd_kvmvm, cmd const[KVM_REINJECT_CONTROL], arg ptr[in, kvm_reinject_control])
    65  ioctl$KVM_HYPERV_EVENTFD(fd fd_kvmvm, cmd const[KVM_HYPERV_EVENTFD], arg ptr[in, kvm_hyperv_eventfd])
    66  
    67  ioctl$KVM_CAP_MANUAL_DIRTY_LOG_PROTECT2(fd fd_kvmvm, cmd const[KVM_ENABLE_CAP], arg ptr[in, kvm_enable_cap[KVM_CAP_MANUAL_DIRTY_LOG_PROTECT2, flags[kvm_dirty_log_protect, int64]]])
    68  ioctl$KVM_CAP_HALT_POLL(fd fd_kvmvm, cmd const[KVM_ENABLE_CAP], arg ptr[in, kvm_enable_cap[KVM_CAP_HALT_POLL, int64]])
    69  ioctl$KVM_CAP_DIRTY_LOG_RING(fd fd_kvmvm, cmd const[KVM_ENABLE_CAP], arg ptr[in, kvm_enable_cap[KVM_CAP_DIRTY_LOG_RING, flags[kvm_dirty_log_sizes, int64]]])
    70  
    71  # NEED: arch constraints for syscalls. These are amd64/386-specific, but consts are present on all arches, so they are not disabled on other arches.
    72  ioctl$KVM_CAP_DISABLE_QUIRKS(fd fd_kvmvm, cmd const[KVM_ENABLE_CAP], arg ptr[in, kvm_enable_cap[KVM_CAP_DISABLE_QUIRKS, flags[kvm_x86_quirks, int64]]])
    73  ioctl$KVM_CAP_SPLIT_IRQCHIP(fd fd_kvmvm, cmd const[KVM_ENABLE_CAP], arg ptr[in, kvm_enable_cap[KVM_CAP_SPLIT_IRQCHIP, int64[0:KVM_MAX_IRQ_ROUTES]]])
    74  ioctl$KVM_CAP_X2APIC_API(fd fd_kvmvm, cmd const[KVM_ENABLE_CAP], arg ptr[in, kvm_enable_cap[KVM_CAP_X2APIC_API, flags[kvm_x2apic_apis, int64]]])
    75  ioctl$KVM_CAP_X86_DISABLE_EXITS(fd fd_kvmvm, cmd const[KVM_ENABLE_CAP], arg ptr[in, kvm_enable_cap[KVM_CAP_X86_DISABLE_EXITS, flags[kvm_x86_exits, int64]]])
    76  ioctl$KVM_CAP_MSR_PLATFORM_INFO(fd fd_kvmvm, cmd const[KVM_ENABLE_CAP], arg ptr[in, kvm_enable_cap[KVM_CAP_MSR_PLATFORM_INFO, bool64]])
    77  ioctl$KVM_CAP_EXCEPTION_PAYLOAD(fd fd_kvmvm, cmd const[KVM_ENABLE_CAP], arg ptr[in, kvm_enable_cap[KVM_CAP_EXCEPTION_PAYLOAD, bool64]])
    78  ioctl$KVM_CAP_X86_USER_SPACE_MSR(fd fd_kvmvm, cmd const[KVM_ENABLE_CAP], arg ptr[in, kvm_enable_cap[KVM_CAP_X86_USER_SPACE_MSR, flags[kvm_msr_exit_reasons, int64]]])
    79  ioctl$KVM_CAP_X86_BUS_LOCK_EXIT(fd fd_kvmvm, cmd const[KVM_ENABLE_CAP], arg ptr[in, kvm_enable_cap[KVM_CAP_X86_BUS_LOCK_EXIT, flags[kvm_bus_lock_exits, int64]]])
    80  ioctl$KVM_CAP_SGX_ATTRIBUTE(fd fd_kvmvm, cmd const[KVM_ENABLE_CAP], arg ptr[in, kvm_enable_cap[KVM_CAP_SGX_ATTRIBUTE, fd_sgx_provision]])
    81  ioctl$KVM_CAP_VM_COPY_ENC_CONTEXT_FROM(fd fd_kvmvm, cmd const[KVM_ENABLE_CAP], arg ptr[in, kvm_enable_cap[KVM_CAP_VM_COPY_ENC_CONTEXT_FROM, fd_kvmvm]])
    82  ioctl$KVM_CAP_EXIT_HYPERCALL(fd fd_kvmvm, cmd const[KVM_ENABLE_CAP], arg ptr[in, kvm_enable_cap[KVM_CAP_EXIT_HYPERCALL, flags[kvm_hypercall_exits, int64]]])
    83  ioctl$KVM_CAP_EXIT_ON_EMULATION_FAILURE(fd fd_kvmvm, cmd const[KVM_ENABLE_CAP], arg ptr[in, kvm_enable_cap[KVM_CAP_EXIT_ON_EMULATION_FAILURE, bool64]])
    84  
    85  ioctl$KVM_RUN(fd fd_kvmcpu, cmd const[KVM_RUN], arg const[0])
    86  ioctl$KVM_GET_REGS(fd fd_kvmcpu, cmd const[KVM_GET_REGS], arg ptr[out, kvm_regs])
    87  ioctl$KVM_SET_REGS(fd fd_kvmcpu, cmd const[KVM_SET_REGS], arg ptr[in, kvm_regs])
    88  ioctl$KVM_GET_SREGS(fd fd_kvmcpu, cmd const[KVM_GET_SREGS], arg ptr[out, kvm_sregs])
    89  ioctl$KVM_SET_SREGS(fd fd_kvmcpu, cmd const[KVM_SET_SREGS], arg ptr[in, kvm_sregs])
    90  ioctl$KVM_TRANSLATE(fd fd_kvmcpu, cmd const[KVM_TRANSLATE], arg ptr[in, kvm_translation])
    91  ioctl$KVM_INTERRUPT(fd fd_kvmcpu, cmd const[KVM_INTERRUPT], arg ptr[in, int32])
    92  ioctl$KVM_GET_MSRS(fd fd_kvmcpu, cmd const[KVM_GET_MSRS], arg ptr[out, kvm_msrs])
    93  ioctl$KVM_SET_MSRS(fd fd_kvmcpu, cmd const[KVM_SET_MSRS], arg ptr[in, kvm_msrs])
    94  ioctl$KVM_SET_CPUID(fd fd_kvmcpu, cmd const[KVM_SET_CPUID], arg ptr[in, kvm_cpuid])
    95  # NEED: we should be able to read kvm_cpuid2 with KVM_GET_CPUID2, alter few bits and then call KVM_SET_CPUID2 with that object.
    96  ioctl$KVM_GET_CPUID2(fd fd_kvmcpu, cmd const[KVM_GET_CPUID2], arg ptr[out, kvm_cpuid2])
    97  ioctl$KVM_SET_CPUID2(fd fd_kvmcpu, cmd const[KVM_SET_CPUID2], arg ptr[in, kvm_cpuid2])
    98  ioctl$KVM_SET_SIGNAL_MASK(fd fd_kvmcpu, cmd const[KVM_SET_SIGNAL_MASK], arg ptr[in, kvm_signal_mask])
    99  ioctl$KVM_GET_FPU(fd fd_kvmcpu, cmd const[KVM_GET_FPU], arg ptr[out, kvm_fpu])
   100  ioctl$KVM_SET_FPU(fd fd_kvmcpu, cmd const[KVM_SET_FPU], arg ptr[in, kvm_fpu])
   101  ioctl$KVM_GET_VCPU_EVENTS(fd fd_kvmcpu, cmd const[KVM_GET_VCPU_EVENTS], arg ptr[out, kvm_vcpu_events])
   102  ioctl$KVM_SET_VCPU_EVENTS(fd fd_kvmcpu, cmd const[KVM_SET_VCPU_EVENTS], arg ptr[in, kvm_vcpu_events])
   103  ioctl$KVM_GET_DEBUGREGS(fd fd_kvmcpu, cmd const[KVM_GET_DEBUGREGS], arg ptr[out, kvm_debugregs])
   104  ioctl$KVM_SET_DEBUGREGS(fd fd_kvmcpu, cmd const[KVM_SET_DEBUGREGS], arg ptr[in, kvm_debugregs])
   105  ioctl$KVM_GET_MP_STATE(fd fd_kvmcpu, cmd const[KVM_GET_MP_STATE], arg ptr[out, int32])
   106  ioctl$KVM_SET_MP_STATE(fd fd_kvmcpu, cmd const[KVM_SET_MP_STATE], arg ptr[in, flags[kvm_mp_state, int32]])
   107  ioctl$KVM_GET_XSAVE(fd fd_kvmcpu, cmd const[KVM_GET_XSAVE], arg ptr[out, kvm_xsave])
   108  ioctl$KVM_SET_XSAVE(fd fd_kvmcpu, cmd const[KVM_SET_XSAVE], arg ptr[in, kvm_xsave])
   109  ioctl$KVM_GET_XCRS(fd fd_kvmcpu, cmd const[KVM_GET_XCRS], arg ptr[in, kvm_xcrs])
   110  ioctl$KVM_SET_XCRS(fd fd_kvmcpu, cmd const[KVM_SET_XCRS], arg ptr[in, kvm_xcrs])
   111  ioctl$KVM_SET_TSC_KHZ(fd fd_kvmcpu, cmd const[KVM_SET_TSC_KHZ], arg intptr)
   112  ioctl$KVM_GET_TSC_KHZ(fd fd_kvmcpu, cmd const[KVM_GET_TSC_KHZ])
   113  ioctl$KVM_GET_LAPIC(fd fd_kvmcpu, cmd const[KVM_GET_LAPIC], arg ptr[in, kvm_lapic_state])
   114  ioctl$KVM_SET_LAPIC(fd fd_kvmcpu, cmd const[KVM_SET_LAPIC], arg ptr[in, kvm_lapic_state])
   115  ioctl$KVM_DIRTY_TLB(fd fd_kvmcpu, cmd const[KVM_DIRTY_TLB], arg ptr[in, kvm_dirty_tlb])
   116  ioctl$KVM_NMI(fd fd_kvmcpu, cmd const[KVM_NMI])
   117  # NEED: arch constraints for syscalls. These are s390-specific, but consts are present on all arches, so they are not disabled on other arches.
   118  ioctl$KVM_S390_UCAS_MAP(fd fd_kvmcpu, cmd const[KVM_S390_UCAS_MAP], arg ptr[in, kvm_s390_ucas_mapping])
   119  ioctl$KVM_S390_UCAS_UNMAP(fd fd_kvmcpu, cmd const[KVM_S390_UCAS_UNMAP], arg ptr[in, kvm_s390_ucas_mapping])
   120  ioctl$KVM_S390_VCPU_FAULT(fd fd_kvmcpu, cmd const[KVM_S390_VCPU_FAULT], arg ptr[in, int64])
   121  ioctl$KVM_SET_ONE_REG(fd fd_kvmcpu, cmd const[KVM_SET_ONE_REG], arg ptr[in, kvm_one_reg])
   122  ioctl$KVM_GET_ONE_REG(fd fd_kvmcpu, cmd const[KVM_GET_ONE_REG], arg ptr[in, kvm_one_reg])
   123  ioctl$KVM_KVMCLOCK_CTRL(fd fd_kvmcpu, cmd const[KVM_KVMCLOCK_CTRL])
   124  ioctl$KVM_S390_INTERRUPT_CPU(fd fd_kvmcpu, cmd const[KVM_S390_INTERRUPT], arg ptr[in, kvm_s390_interrupt])
   125  ioctl$KVM_GET_REG_LIST(fd fd_kvmcpu, cmd const[KVM_GET_REG_LIST], arg ptr[in, kvm_reg_list])
   126  ioctl$KVM_SET_GUEST_DEBUG(fd fd_kvmcpu, cmd const[KVM_SET_GUEST_DEBUG], arg ptr[in, kvm_guest_debug])
   127  ioctl$KVM_SMI(fd fd_kvmcpu, cmd const[KVM_SMI])
   128  ioctl$KVM_TPR_ACCESS_REPORTING(fd fd_kvmcpu, cmd const[KVM_TPR_ACCESS_REPORTING], arg ptr[in, kvm_tpr_access_ctl])
   129  ioctl$KVM_SET_VAPIC_ADDR(fd fd_kvmcpu, cmd const[KVM_SET_VAPIC_ADDR], arg ptr[in, flags[kvm_guest_addrs, int64]])
   130  ioctl$KVM_X86_SETUP_MCE(fd fd_kvmcpu, cmd const[KVM_X86_SETUP_MCE], arg ptr[in, kvm_mce_cap])
   131  ioctl$KVM_X86_SET_MCE(fd fd_kvmcpu, cmd const[KVM_X86_SET_MCE], arg ptr[in, kvm_x86_mce])
   132  ioctl$KVM_ARM_VCPU_INIT(fd fd_kvmcpu, cmd const[KVM_ARM_VCPU_INIT], arg ptr[in, kvm_vcpu_init])
   133  ioctl$KVM_ARM_SET_DEVICE_ADDR(fd fd_kvmcpu, cmd const[KVM_ARM_SET_DEVICE_ADDR], arg ptr[in, kvm_arm_device_addr])
   134  ioctl$KVM_GET_NESTED_STATE(fd fd_kvmcpu, cmd const[KVM_GET_NESTED_STATE], arg ptr[out, kvm_nested_state_arg])
   135  ioctl$KVM_SET_NESTED_STATE(fd fd_kvmcpu, cmd const[KVM_SET_NESTED_STATE], arg ptr[in, kvm_nested_state_arg])
   136  
   137  # NEED: arch constraints for syscalls. These are amd64/386-specific, but consts are present on all arches, so they are not disabled on other arches.
   138  ioctl$KVM_CAP_HYPERV_SYNIC(fd fd_kvmcpu, cmd const[KVM_ENABLE_CAP], arg ptr[in, kvm_enable_cap[KVM_CAP_HYPERV_SYNIC, void]])
   139  ioctl$KVM_CAP_HYPERV_SYNIC2(fd fd_kvmcpu, cmd const[KVM_ENABLE_CAP], arg ptr[in, kvm_enable_cap[KVM_CAP_HYPERV_SYNIC2, const[0, int64]]])
   140  ioctl$KVM_CAP_HYPERV_ENLIGHTENED_VMCS(fd fd_kvmcpu, cmd const[KVM_ENABLE_CAP], arg ptr[in, kvm_enable_cap[KVM_CAP_HYPERV_ENLIGHTENED_VMCS, ptr[out, int16]]])
   141  ioctl$KVM_CAP_HYPERV_DIRECT_TLBFLUSH(fd fd_kvmcpu, cmd const[KVM_ENABLE_CAP], arg ptr[in, kvm_enable_cap[KVM_CAP_HYPERV_DIRECT_TLBFLUSH, void]])
   142  ioctl$KVM_CAP_HYPERV_ENFORCE_CPUID(fd fd_kvmcpu, cmd const[KVM_ENABLE_CAP], arg ptr[in, kvm_enable_cap[KVM_CAP_HYPERV_ENFORCE_CPUID, bool64]])
   143  ioctl$KVM_CAP_ENFORCE_PV_FEATURE_CPUID(fd fd_kvmcpu, cmd const[KVM_ENABLE_CAP], arg ptr[in, kvm_enable_cap[KVM_CAP_ENFORCE_PV_FEATURE_CPUID, bool64]])
   144  
   145  ioctl$KVM_SET_DEVICE_ATTR(fd fd_kvmdev, cmd const[KVM_SET_DEVICE_ATTR], arg ptr[in, kvm_device_attr])
   146  ioctl$KVM_GET_DEVICE_ATTR(fd fd_kvmdev, cmd const[KVM_GET_DEVICE_ATTR], arg ptr[in, kvm_device_attr])
   147  ioctl$KVM_HAS_DEVICE_ATTR(fd fd_kvmdev, cmd const[KVM_HAS_DEVICE_ATTR], arg ptr[in, kvm_device_attr])
   148  
   149  kvm_mem_region_flags = KVM_MEM_LOG_DIRTY_PAGES, KVM_MEM_READONLY
   150  kvm_mp_state = KVM_MP_STATE_RUNNABLE, KVM_MP_STATE_UNINITIALIZED, KVM_MP_STATE_INIT_RECEIVED, KVM_MP_STATE_HALTED, KVM_MP_STATE_SIPI_RECEIVED, KVM_MP_STATE_STOPPED, KVM_MP_STATE_CHECK_STOP, KVM_MP_STATE_OPERATING, KVM_MP_STATE_LOAD
   151  kvm_irq_routing_entry_type = KVM_IRQ_ROUTING_IRQCHIP, KVM_IRQ_ROUTING_MSI, KVM_IRQ_ROUTING_S390_ADAPTER, KVM_IRQ_ROUTING_HV_SINT
   152  kvm_ioeventfd_flags = KVM_IOEVENTFD_FLAG_DATAMATCH, KVM_IOEVENTFD_FLAG_PIO, KVM_IOEVENTFD_FLAG_DEASSIGN, KVM_IOEVENTFD_FLAG_VIRTIO_CCW_NOTIFY
   153  kvm_ioeventfd_len = 0, 1, 2, 4, 8
   154  kvm_device_type = KVM_DEV_TYPE_FSL_MPIC_20, KVM_DEV_TYPE_FSL_MPIC_42, KVM_DEV_TYPE_XICS, KVM_DEV_TYPE_VFIO, KVM_DEV_TYPE_ARM_VGIC_V2, KVM_DEV_TYPE_FLIC, KVM_DEV_TYPE_ARM_VGIC_V3, KVM_DEV_TYPE_ARM_VGIC_ITS, KVM_DEV_TYPE_XIVE, KVM_DEV_TYPE_ARM_PV_TIME, KVM_DEV_TYPE_RISCV_AIA
   155  kvm_device_flags = 0, KVM_CREATE_DEVICE_TEST
   156  kvm_guest_debug_flags = KVM_GUESTDBG_ENABLE, KVM_GUESTDBG_SINGLESTEP, KVM_GUESTDBG_USE_SW_BP, KVM_GUESTDBG_USE_HW_BP, KVM_GUESTDBG_INJECT_DB, KVM_GUESTDBG_INJECT_BP
   157  kvm_chip_id = KVM_IRQCHIP_PIC_MASTER, KVM_IRQCHIP_PIC_SLAVE, KVM_IRQCHIP_IOAPIC
   158  kvm_cpu_function = 0, 1, 2, 4, 6, 7, 10, 11, 13, KVM_CPUID_SIGNATURE, KVM_CPUID_FEATURES, 0x80000000, 0x80000001, 0x80000007, 0x80000008, 0x80000019, 0xc0000000, 0xc0000001
   159  kvm_guest_selector = 0, 3, 4, 8, 9, 10, 11, 12, 13, 14, 15, 16
   160  kvm_mce_flags = 1, 2, 4
   161  kvm_mcg_status = MCG_STATUS_RIPV, MCG_STATUS_EIPV, MCG_STATUS_MCIP, MCG_STATUS_LMCES
   162  kvm_mce_status = MCI_STATUS_VAL, MCI_STATUS_OVER, MCI_STATUS_UC, MCI_STATUS_EN, MCI_STATUS_MISCV, MCI_STATUS_ADDRV, MCI_STATUS_PCC, MCI_STATUS_S, MCI_STATUS_AR
   163  kvm_cpuid_flags = KVM_CPUID_FLAG_SIGNIFCANT_INDEX, KVM_CPUID_FLAG_STATEFUL_FUNC, KVM_CPUID_FLAG_STATE_READ_NEXT
   164  kvm_vcpu_target = KVM_ARM_TARGET_CORTEX_A53, KVM_ARM_TARGET_AEM_V8, KVM_ARM_TARGET_FOUNDATION_V8, KVM_ARM_TARGET_CORTEX_A57, KVM_ARM_TARGET_XGENE_POTENZA, KVM_ARM_TARGET_GENERIC_V8
   165  kvm_vcpu_features_arm64 = KVM_ARM_VCPU_POWER_OFF, KVM_ARM_VCPU_EL1_32BIT, KVM_ARM_VCPU_PSCI_0_2, KVM_ARM_VCPU_PMU_V3
   166  
   167  kvm_dirty_log_protect = KVM_DIRTY_LOG_MANUAL_PROTECT_ENABLE, KVM_DIRTY_LOG_INITIALLY_SET
   168  kvm_dirty_log_sizes = 4096, 8192, 16384, 32768, 65536
   169  kvm_x86_quirks = KVM_X86_QUIRK_LINT0_REENABLED, KVM_X86_QUIRK_CD_NW_CLEARED, KVM_X86_QUIRK_LAPIC_MMIO_HOLE, KVM_X86_QUIRK_OUT_7E_INC_RIP, KVM_X86_QUIRK_MISC_ENABLE_NO_MWAIT
   170  kvm_x2apic_apis = KVM_X2APIC_API_USE_32BIT_IDS, KVM_X2APIC_API_DISABLE_BROADCAST_QUIRK
   171  kvm_x86_exits = KVM_X86_DISABLE_EXITS_MWAIT, KVM_X86_DISABLE_EXITS_HLT, KVM_X86_DISABLE_EXITS_PAUSE, KVM_X86_DISABLE_EXITS_CSTATE
   172  kvm_msr_exit_reasons = KVM_MSR_EXIT_REASON_INVAL, KVM_MSR_EXIT_REASON_UNKNOWN, KVM_MSR_EXIT_REASON_FILTER
   173  kvm_bus_lock_exits = KVM_BUS_LOCK_DETECTION_OFF, KVM_BUS_LOCK_DETECTION_EXIT
   174  kvm_hypercall_exits = KVM_HC_MAP_GPA_RANGE
   175  
   176  kvm_mem_slots = 0, 1, 2, 3, 4, 5, 509, 510, 511, 10000, 65536, 65537, 65538, 65539, 65540, 66047, 66048, 66049
   177  kvm_guest_addr_size = 0x1000, 0x2000, 0x4000, 0x8000, 0x10000, 0x100000
   178  kvm_x86_tss_addr = 0xd000
   179  kvm_x86_cr0 = 1, 2, 4, 8, 16, 32, 65536, 262144, 536870912, 1073741824, 2147483648
   180  kvm_x86_cr4 = 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 8192, 16384, 65536, 131072, 262144, 1048576, 2097152, 4194304
   181  kvm_x86_efer = 1, 256, 1024, 2048, 4096, 8192, 16384, 32768
   182  kvm_x86_dr7 = 1, 2, 4, 8, 16, 32, 64, 128
   183  kvm_x86_rflags = 1, 2, 4, 16, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768, 65536, 131072, 262144, 524288, 1048576, 2097152
   184  
   185  # Pseudo call that setups VCPU into a reasonable interesting state for execution.
   186  # The interface is designed for extensibility so that addition of new options does not invalidate all existing programs.
   187  syz_kvm_setup_cpu$x86(fd fd_kvmvm, cpufd fd_kvmcpu, usermem vma[24], text ptr[in, array[kvm_text_x86, 1]], ntext len[text], flags flags[kvm_setup_flags], opts ptr[in, array[kvm_setup_opt_x86, 0:2]], nopt len[opts])
   188  syz_kvm_setup_cpu$arm64(fd fd_kvmvm, cpufd fd_kvmcpu, usermem vma[24], text ptr[in, array[kvm_text_arm64, 1]], ntext len[text], flags const[0], opts ptr[in, array[kvm_setup_opt_arm64, 1]], nopt len[opts])
   189  syz_kvm_setup_cpu$ppc64(fd fd_kvmvm, cpufd fd_kvmcpu, usermem vma[24], text ptr[in, array[kvm_text_ppc64, 1]], ntext len[text], flags flags[kvm_setup_flags_ppc64], opts ptr[in, array[kvm_setup_opt_ppc64, 1]], nopt len[opts])
   190  
   191  resource kvm_run_ptr[int64]
   192  define KVM_RUN_SIZE	sizeof(struct kvm_run)
   193  mmap$KVM_VCPU(addr vma, len const[KVM_RUN_SIZE], prot flags[mmap_prot], flags flags[mmap_flags], cpufd fd_kvmcpu, offset const[0]) kvm_run_ptr
   194  _ = __NR_mmap2
   195  
   196  define KVM_EXIT_MMIO_OFFSET	offsetof(struct kvm_run, mmio)
   197  define KVM_EXIT_MMIO_SIZE	sizeof_field(struct kvm_run, mmio)
   198  syz_memcpy_off$KVM_EXIT_MMIO(dst kvm_run_ptr, off const[KVM_EXIT_MMIO_OFFSET], src ptr[in, array[int8, KVM_EXIT_MMIO_SIZE]], src_off const[0], nbytes len[src])
   199  
   200  define KVM_EXIT_HYPERCALL_OFFSET	offsetof(struct kvm_run, hypercall)
   201  define KVM_EXIT_HYPERCALL_SIZE	sizeof_field(struct kvm_run, hypercall)
   202  syz_memcpy_off$KVM_EXIT_HYPERCALL(dst kvm_run_ptr, off const[KVM_EXIT_HYPERCALL_OFFSET], src ptr[in, array[int8, KVM_EXIT_HYPERCALL_SIZE]], src_off const[0], nbytes len[src])
   203  
   204  kvm_text_x86 [
   205  	textreal	kvm_text_x86_real
   206  	text16		kvm_text_x86_16
   207  	text32		kvm_text_x86_32
   208  	text64		kvm_text_x86_64
   209  ]
   210  
   211  kvm_text_x86_real {
   212  	typ	const[8, intptr]
   213  	text	ptr[in, text[x86_real]]
   214  	size	len[text, intptr]
   215  }
   216  
   217  kvm_text_x86_16 {
   218  	typ	const[16, intptr]
   219  	text	ptr[in, text[x86_16]]
   220  	size	len[text, intptr]
   221  }
   222  
   223  kvm_text_x86_32 {
   224  	typ	const[32, intptr]
   225  	text	ptr[in, text[x86_32]]
   226  	size	len[text, intptr]
   227  }
   228  
   229  kvm_text_x86_64 {
   230  	typ	const[64, intptr]
   231  	text	ptr[in, text[x86_64]]
   232  	size	len[text, intptr]
   233  }
   234  
   235  kvm_text_arm64 {
   236  	typ	const[0, intptr]
   237  	text	ptr[in, text[arm64]]
   238  	size	len[text, intptr]
   239  }
   240  
   241  kvm_text_ppc64 {
   242  	typ	const[0, intptr]
   243  	text	ptr[in, text[ppc64]]
   244  	size	len[text, intptr]
   245  }
   246  
   247  kvm_setup_opt_x86 [
   248  	cr0	kvm_setup_opt_cr0
   249  	cr4	kvm_setup_opt_cr4
   250  	efer	kvm_setup_opt_efer
   251  	flags	kvm_setup_opt_flags
   252  	cstype0	kvm_setup_opt_cstype0
   253  	cstype3	kvm_setup_opt_cstype3
   254  	dstype0	kvm_setup_opt_dstype0
   255  	dstype3	kvm_setup_opt_dstype3
   256  	vmwrite	kvm_setup_opt_vmwrite
   257  ]
   258  
   259  kvm_setup_opt_cr0 {
   260  	typ	const[0, int64]
   261  	val	flags[kvm_x86_cr0, int64]
   262  }
   263  
   264  kvm_setup_opt_cr4 {
   265  	typ	const[1, int64]
   266  	val	flags[kvm_x86_cr4, int64]
   267  }
   268  
   269  kvm_setup_opt_efer {
   270  	typ	const[2, int64]
   271  	val	flags[kvm_x86_efer, int64]
   272  }
   273  
   274  kvm_setup_opt_flags {
   275  	typ	const[3, int64]
   276  	val	flags[kvm_x86_rflags, int64]
   277  }
   278  
   279  kvm_setup_opt_cstype0 {
   280  	typ	const[4, int64]
   281  	val	int64[0:15]
   282  }
   283  
   284  kvm_setup_opt_cstype3 {
   285  	typ	const[5, int64]
   286  	val	int64[0:15]
   287  }
   288  
   289  kvm_setup_opt_dstype0 {
   290  	typ	const[6, int64]
   291  	val	int64[0:15]
   292  }
   293  
   294  kvm_setup_opt_dstype3 {
   295  	typ	const[7, int64]
   296  	val	int64[0:15]
   297  }
   298  
   299  kvm_setup_opt_vmwrite {
   300  	typ	const[8, int64]
   301  # Low 16 bits are field index, high 48 bits are value.
   302  	sz	const[0, int64:1]
   303  	fld	int64:5
   304  	pad0	const[0, int64:4]
   305  	ftyp	int64:2
   306  	pad1	const[0, int64:1]
   307  	fsz	int64:2
   308  	pad2	const[0, int64:1]
   309  	val	int64:48
   310  }
   311  
   312  kvm_setup_opt_arm64 [
   313  # unions need at least 2 fields, but we have only 1 now, but we want to have it as union for future extention
   314  	featur1	kvm_setup_opt_feature
   315  	featur2	kvm_setup_opt_feature
   316  ]
   317  
   318  kvm_setup_opt_feature {
   319  	typ	const[1, int64]
   320  	val	flags[kvm_vcpu_features_arm64, int64]
   321  }
   322  
   323  kvm_setup_opt_ppc64 [
   324  # unions need at least 2 fields, but we have only 1 now, but we want to have it as union for future extention
   325  	featur1	kvm_setup_opt_ppc64_feature
   326  	featur2	kvm_setup_opt_ppc64_feature
   327  ]
   328  
   329  kvm_setup_opt_ppc64_feature {
   330  	typ	const[1, int64]
   331  	val	int64
   332  }
   333  
   334  kvm_setup_flags = KVM_SETUP_PAGING, KVM_SETUP_PAE, KVM_SETUP_PROTECTED, KVM_SETUP_CPL3, KVM_SETUP_VIRT86, KVM_SETUP_SMM, KVM_SETUP_VM
   335  
   336  define KVM_SETUP_PAGING	(1<<0)
   337  define KVM_SETUP_PAE	(1<<1)
   338  define KVM_SETUP_PROTECTED	(1<<2)
   339  define KVM_SETUP_CPL3	(1<<3)
   340  define KVM_SETUP_VIRT86	(1<<4)
   341  define KVM_SETUP_SMM	(1<<5)
   342  define KVM_SETUP_VM	(1<<6)
   343  
   344  kvm_setup_flags_ppc64 = KVM_SETUP_PPC64_LE, KVM_SETUP_PPC64_IR, KVM_SETUP_PPC64_DR, KVM_SETUP_PPC64_PR, KVM_SETUP_PPC64_PID1
   345  
   346  # Little endian
   347  define KVM_SETUP_PPC64_LE	(1<<0)
   348  # Paging for instructions
   349  define KVM_SETUP_PPC64_IR	(1<<1)
   350  # Paging for data
   351  define KVM_SETUP_PPC64_DR	(1<<2)
   352  # Run with MSR_PR (==usermode)
   353  define KVM_SETUP_PPC64_PR	(1<<3)
   354  # Set PID=1 i.e. not kernel's PID
   355  define KVM_SETUP_PPC64_PID1	(1<<4)
   356  
   357  kvm_guest_debug {
   358  	ctrl	flags[kvm_guest_debug_flags, int32]
   359  	pad	const[0, int32]
   360  	reg	array[int64, 8]
   361  }
   362  
   363  kvm_arm_device_addr {
   364  	id	int64
   365  	addr	flags[kvm_guest_addrs, int64]
   366  }
   367  
   368  kvm_reg_list {
   369  	n	len[reg, int64]
   370  	reg	array[int64]
   371  }
   372  
   373  kvm_device_attr {
   374  	flags	const[0, int32]
   375  	group	int32
   376  	attr	int64
   377  	addr	ptr64[in, int64]
   378  }
   379  
   380  kvm_create_device {
   381  	type	flags[kvm_device_type, int32]	(in)
   382  	fd	fd_kvmdev	(out)
   383  	flags	flags[kvm_device_flags, int32]	(in)
   384  }
   385  
   386  kvm_s390_interrupt {
   387  	type	int32
   388  	parm	int32
   389  	parm64	int64
   390  }
   391  
   392  kvm_irqfd {
   393  	fd	fd_event
   394  	gsi	int32
   395  	flags	int32
   396  	rfd	fd_event
   397  	pad	array[const[0, int8], 16]
   398  }
   399  
   400  kvm_pit_state2 {
   401  	chans	array[kvm_pit_channel_state, 3]
   402  	flags	int32
   403  	pad	array[const[0, int32], 9]
   404  }
   405  
   406  kvm_pit_channel_state {
   407  	count	int32
   408  	lcount	int16
   409  	latched	int8
   410  	lstatus	int8
   411  	status	int8
   412  	rstate	int8
   413  	wstate	int8
   414  	wlatch	int8
   415  	rw	int8
   416  	mode	int8
   417  	bcd	int8
   418  	gate	int8
   419  	ltime	int64
   420  }
   421  
   422  kvm_pit_config {
   423  	flags	int32
   424  	pad	array[const[0, int32], 15]
   425  }
   426  
   427  kvm_msi {
   428  	addrlo	flags[kvm_guest_addrs, int32]
   429  	addrhi	flags[kvm_guest_addrs, int32]
   430  	data	int32
   431  	flags	int32
   432  	devid	int32
   433  	pad	array[const[0, int8], 12]
   434  }
   435  
   436  kvm_one_reg {
   437  	id	int64
   438  	addr	int64
   439  }
   440  
   441  kvm_s390_ucas_mapping {
   442  	uaddr	int64
   443  	vaddr	int64
   444  	len	int64
   445  }
   446  
   447  kvm_dirty_tlb {
   448  	bitmap	int64
   449  	n	int32
   450  }
   451  
   452  kvm_ioeventfd {
   453  	datam	flags[kvm_guest_addrs, int64]
   454  	addr	ptr64[out, int64]
   455  	len	flags[kvm_ioeventfd_len, int32]
   456  	fd	fd_event
   457  	flags	flags[kvm_ioeventfd_flags, int32]
   458  	pad	array[const[0, int8], 36]
   459  }
   460  
   461  kvm_lapic_state {
   462  	regs	array[int8, 1024]
   463  }
   464  
   465  kvm_assigned_msix_entry {
   466  	devid	int32
   467  	gsi	int32
   468  	entry	int16
   469  	padding	array[const[0, int16], 3]
   470  }
   471  
   472  kvm_assigned_msix_nr {
   473  	devid	int32
   474  	entnr	int16
   475  }
   476  
   477  kvm_irq_routing {
   478  	nr	len[entries, int32]
   479  	flags	const[0, int32]
   480  	entries	array[kvm_irq_routing_entry]
   481  }
   482  
   483  kvm_irq_routing_entry {
   484  	gsi	int32
   485  	type	flags[kvm_irq_routing_entry_type, int32]
   486  	flags	const[0, int32]
   487  	pad	const[0, int32]
   488  	u	kvm_irq_routing_entry_u
   489  }
   490  
   491  kvm_irq_routing_entry_u [
   492  	irqchip	kvm_irq_routing_irqchip
   493  	msi	kvm_irq_routing_msi
   494  	adapter	kvm_irq_routing_s390_adapter
   495  	sint	kvm_irq_routing_hv_sint
   496  ]
   497  
   498  kvm_irq_routing_irqchip {
   499  	irqchip	int32
   500  	pin	int32
   501  }
   502  
   503  kvm_irq_routing_msi {
   504  	address_lo	int32
   505  	address_hi	int32
   506  	data		int32
   507  	devid		int32
   508  }
   509  
   510  kvm_irq_routing_s390_adapter {
   511  	indaddr	int64
   512  	saddr	int64
   513  	indoff	int64
   514  	soff	int32
   515  	aid	int32
   516  }
   517  
   518  kvm_irq_routing_hv_sint {
   519  	vcpu	int32
   520  	sint	int32
   521  }
   522  
   523  kvm_xcr {
   524  	xcr	int32
   525  	reserv	const[0, int32]
   526  	val	int64
   527  }
   528  
   529  kvm_xcrs {
   530  	nr	len[xcrs, int32]
   531  	flags	int32
   532  	xcrs	array[kvm_xcr]
   533  }
   534  
   535  kvm_xsave {
   536  	region	array[int32, 1024]
   537  }
   538  
   539  type kvm_enable_cap[CAP, ARGS] {
   540  	cap	const[CAP, int32]
   541  	flags	const[0, int32]
   542  	args	ARGS
   543  } [align[8], size[KVM_ENABLE_CAP_SIZE]]
   544  
   545  define KVM_ENABLE_CAP_SIZE	sizeof(struct kvm_enable_cap)
   546  
   547  kvm_userspace_memory_region {
   548  	slot	flags[kvm_mem_slots, int32]
   549  	flags	flags[kvm_mem_region_flags, int32]
   550  	paddr	flags[kvm_guest_addrs, int64]
   551  	size	len[addr, int64]
   552  	addr	vma64[1:2]
   553  }
   554  
   555  kvm_vcpu_events {
   556  	exinjec			int8
   557  	exnr			int8
   558  	exhec			int8
   559  	pad1			const[0, int8]
   560  	exec			int32
   561  
   562  	ininjec			int8
   563  	innr			int8
   564  	insoft			int8
   565  	inshad			int8
   566  
   567  	nmiinj			int8
   568  	nmipend			int8
   569  	nmimask			int8
   570  	pad2			const[0, int8]
   571  
   572  	sipi_vector		int32
   573  	flags			int32
   574  
   575  	smismm			int8
   576  	smipend			int8
   577  	smiinsi			int8
   578  	smilatc			int8
   579  
   580  	reserved		array[const[0, int8], 27]
   581  	exception_has_payload	int8
   582  	exception_payload	int64
   583  }
   584  
   585  kvm_clock_data {
   586  	clock		int64
   587  	flags		int32
   588  	pad0		int32
   589  	realtime	int64
   590  	host_tsc	int64
   591  	pad		array[const[0, int32], 4]
   592  }
   593  
   594  kvm_xen_hvm_config {
   595  	flags	int32
   596  	msr	flags[msr_index, int32]
   597  	addr32	ptr64[in, array[int8]]
   598  	addr64	ptr64[in, array[int8]]
   599  	size32	len[addr32, int8]
   600  	size64	len[addr64, int8]
   601  	pad	array[const[0, int8], 30]
   602  }
   603  
   604  kvm_irq_level {
   605  	irq	int32
   606  	level	int32
   607  }
   608  
   609  kvm_signal_mask {
   610  	len	len[sigset, int32]
   611  	sigset	array[int8]
   612  }
   613  
   614  kvm_cpuid_entry {
   615  	func	flags[kvm_cpu_function, int32]
   616  	eax	int32
   617  	ebx	int32
   618  	ecx	int32
   619  	edx	int32
   620  	pad	const[0, int32]
   621  }
   622  
   623  kvm_cpuid {
   624  	n	len[entries, int32]
   625  	pad	const[0, int32]
   626  	entries	array[kvm_cpuid_entry]
   627  }
   628  
   629  kvm_cpuid_entry2 {
   630  	func	flags[kvm_cpu_function, int32]
   631  	index	int32
   632  	flags	flags[kvm_cpuid_flags, int32]
   633  	eax	int32
   634  	ebx	int32
   635  	ecx	int32
   636  	edx	int32
   637  	pad	array[const[0, int32], 3]
   638  }
   639  
   640  kvm_cpuid2 {
   641  	n	len[entries, int32]
   642  	pad	const[0, int32]
   643  	entries	array[kvm_cpuid_entry2]
   644  }
   645  
   646  kvm_translation {
   647  	laddr		flags[kvm_guest_addrs, int64]
   648  	paddr		flags[kvm_guest_addrs, int64]
   649  	valid		int8
   650  	writeable	int8
   651  	usermode	int8
   652  	pad		array[const[0, int8], 5]
   653  }
   654  
   655  kvm_dirty_log {
   656  	slot	flags[kvm_mem_slots, int32]
   657  	pad	const[0, int32]
   658  	bitmap	vma64
   659  }
   660  
   661  kvm_msr_list {
   662  	n	len[indices, int32]
   663  	indices	array[const[0, int32]]
   664  }
   665  
   666  kvm_regs {
   667  	gp	array[int64, 16]
   668  	rip	flags[kvm_guest_addrs, int64]
   669  	rflags	flags[kvm_x86_rflags, int64]
   670  }
   671  
   672  kvm_sregs {
   673  	cs	kvm_segment
   674  	ds	kvm_segment
   675  	es	kvm_segment
   676  	fs	kvm_segment
   677  	gs	kvm_segment
   678  	ss	kvm_segment
   679  	tr	kvm_segment
   680  	ldt	kvm_segment
   681  	gdt	kvm_dtable
   682  	idt	kvm_dtable
   683  	cr0	flags[kvm_x86_cr0, int64]
   684  	cr2	const[0, int64]
   685  # TODO: this should point to page table
   686  	cr3	flags[kvm_guest_addrs, int64]
   687  	cr4	flags[kvm_x86_cr4, int64]
   688  	cr8	int64[0:15]
   689  	efer	flags[kvm_x86_efer, int64]
   690  	apic	flags[kvm_guest_addrs, int64]
   691  	intr	array[int64, 4]
   692  }
   693  
   694  kvm_segment {
   695  	base	flags[kvm_guest_addrs, int64]
   696  	limit	flags[kvm_guest_addrs, int32]
   697  	select	flags[kvm_guest_selector, int16]
   698  	type	int8
   699  	present	int8
   700  	dpl	int8
   701  	db	int8
   702  	s	int8
   703  	l	int8
   704  	g	int8
   705  	avl	int8
   706  	unusabl	int8
   707  	padding	const[0, int8]
   708  }
   709  
   710  kvm_dtable {
   711  	base	flags[kvm_guest_addrs, int64]
   712  	limit	int16
   713  	pad	array[const[0, int16], 3]
   714  }
   715  
   716  kvm_fpu {
   717  	fpr		array[const[0, int64], 16]
   718  	fcw		int16
   719  	fsw		int16
   720  	ftws		int8
   721  	pad1		const[0, int8]
   722  	last_opcode	int16
   723  	last_ip		flags[kvm_guest_addrs, int64]
   724  	last_dp		flags[kvm_guest_addrs, int64]
   725  	xmm		array[const[0, int64], 32]
   726  	mxcsr		int32
   727  	pad2		const[0, int32]
   728  }
   729  
   730  kvm_debugregs {
   731  	db	array[flags[kvm_guest_addrs, int64], 4]
   732  	dr6	int64
   733  	dr7	flags[kvm_x86_dr7, int64]
   734  	flags	int64
   735  	reserv	array[const[0, int64], 9]
   736  }
   737  
   738  kvm_msrs {
   739  	nmsrs	len[entries, int32]
   740  	pad	const[0, int32]
   741  	entries	array[kvm_msr_entry]
   742  } [packed]
   743  
   744  kvm_msr_entry {
   745  	index	flags[msr_index, int32]
   746  	reserv	const[0, int32]
   747  	data	int64
   748  }
   749  
   750  kvm_irqchip {
   751  	chipid	flags[kvm_chip_id, int32]
   752  	pad	const[0, int32]
   753  	chip	kvm_irq_chip
   754  }
   755  
   756  kvm_irq_chip [
   757  	pic	kvm_pic_state
   758  	ioapic	kvm_ioapic_state
   759  ] [size[512]]
   760  
   761  kvm_pic_state {
   762  	lastirr	int8
   763  	irr	int8
   764  	imr	int8
   765  	isr	int8
   766  	padd	int8
   767  	irqbase	int8
   768  	readreg	int8
   769  	poll	int8
   770  	special	int8
   771  	initst	int8
   772  	autoeoi	int8
   773  	rotate	int8
   774  	nestedm	int8
   775  	init4	int8
   776  	elcr	int8
   777  	elcrmas	int8
   778  }
   779  
   780  kvm_ioapic_state {
   781  	base	flags[kvm_guest_addrs, int64]
   782  	ioregs	int32
   783  	id	int32
   784  	irr	int32
   785  	pad	const[0, int32]
   786  	redir	array[kvm_ioapic_redir, 24]
   787  }
   788  
   789  kvm_ioapic_redir {
   790  	vector	int8
   791  	f0	int8
   792  	f1	int8
   793  	reserv	array[const[0, int8], 4]
   794  	destid	int8
   795  }
   796  
   797  kvm_tpr_access_ctl {
   798  	enabled	int32
   799  	flags	int32
   800  	reserv	array[const[0, int32], 8]
   801  }
   802  
   803  kvm_mce_cap {
   804  	banks	int8[0:32]
   805  	flags	flags[kvm_mce_flags, int8]
   806  	count	int8
   807  	pad	const[0, int8]
   808  }
   809  
   810  kvm_x86_mce {
   811  	status	flags[kvm_mce_status, int64]
   812  	addr	flags[kvm_guest_addrs, int64]
   813  	misc	int64
   814  	mcg	flags[kvm_mcg_status, int64]
   815  	bank	int8[0:32]
   816  	pad1	array[const[0, int8], 7]
   817  	pad2	array[const[0, int64], 3]
   818  }
   819  
   820  kvm_reinject_control {
   821  	reinjec	int8
   822  	reserv	array[const[0, int8], 31]
   823  }
   824  
   825  kvm_coalesced_mmio_zone {
   826  	addr	flags[kvm_guest_addrs, int64]
   827  	size	flags[kvm_guest_addr_size, int32]
   828  	pad	const[0, int32]
   829  }
   830  
   831  kvm_vcpu_init {
   832  	target	flags[kvm_vcpu_target, int32]
   833  	feature	flags[kvm_vcpu_features_arm64, int32]
   834  	pad	array[const[0, int32], 6]
   835  }
   836  
   837  kvm_hyperv_eventfd {
   838  	conn_id	int32[0:4]
   839  	fd	fd_event
   840  	flags	bool32
   841  	padding	array[const[0, int32], 3]
   842  }
   843  
   844  kvm_nested_state {
   845  	flags	flags[kvm_nested_state_flags, int16]
   846  	format	const[0, int16]
   847  	size	bytesize[parent, int32]
   848  	hdr	kvm_vmx_nested_state
   849  	data	void
   850  }
   851  
   852  kvm_nested_state_arg {
   853  	state		kvm_nested_state
   854  	current_vmcs	array[int8, VMCS12_SIZE]
   855  	shadow_vmcs	array[int8, VMCS12_SIZE]
   856  }
   857  
   858  kvm_vmx_nested_state {
   859  	vmxon_pa	flags[kvm_guest_addrs, int64]
   860  	vmcs_pa		flags[kvm_guest_addrs, int64]
   861  	smm_flags	flags[kvm_nested_smm_flags, int16]
   862  } [size[120]]
   863  
   864  kvm_nested_state_flags = KVM_STATE_NESTED_GUEST_MODE, KVM_STATE_NESTED_RUN_PENDING
   865  kvm_nested_smm_flags = KVM_STATE_NESTED_SMM_GUEST_MODE, KVM_STATE_NESTED_SMM_VMXON
   866  
   867  # pkg/ifuzz/pseudo.go also knows this list
   868  msr_index = 0x0, 0x1, 0x10, 0x11, 0x12, 0x13, 0x17, 0x1b, 0x20, 0x21, 0x28, 0x29, 0x2a, 0x2c, 0x33, 0x34, 0x3a, 0x3b, 0x40, 0x60, 0x79, 0x88, 0x89, 0x8a, 0x8b, 0x9b, 0x9e, 0xc1, 0xc2, 0xcd, 0xce, 0xe2, 0xe7, 0xe8, 0xfe, 0x116, 0x118, 0x119, 0x11a, 0x11b, 0x11e, 0x174, 0x175, 0x176, 0x179, 0x17a, 0x17b, 0x180, 0x181, 0x182, 0x183, 0x184, 0x185, 0x186, 0x187, 0x188, 0x189, 0x18a, 0x198, 0x199, 0x19a, 0x19b, 0x19c, 0x19d, 0x1a0, 0x1a2, 0x1a6, 0x1a7, 0x1aa, 0x1ad, 0x1ae, 0x1af, 0x1b0, 0x1b1, 0x1b2, 0x1c8, 0x1c9, 0x1d9, 0x1db, 0x1dc, 0x1dd, 0x1de, 0x1e0, 0x1fc, 0x200, 0x201, 0x202, 0x203, 0x204, 0x205, 0x206, 0x207, 0x208, 0x209, 0x20a, 0x20b, 0x20c, 0x20d, 0x20e, 0x20f, 0x210, 0x211, 0x212, 0x213, 0x214, 0x215, 0x216, 0x217, 0x218, 0x219, 0x21a, 0x21b, 0x21c, 0x21d, 0x21e, 0x21f, 0x220, 0x221, 0x222, 0x223, 0x224, 0x225, 0x226, 0x227, 0x228, 0x229, 0x22a, 0x22b, 0x22c, 0x22d, 0x22e, 0x22f, 0x230, 0x231, 0x232, 0x233, 0x234, 0x235, 0x236, 0x237, 0x238, 0x239, 0x23a, 0x23b, 0x23c, 0x23d, 0x23e, 0x23f, 0x240, 0x241, 0x242, 0x243, 0x244, 0x245, 0x246, 0x247, 0x248, 0x249, 0x24a, 0x24b, 0x24c, 0x24d, 0x24e, 0x24f, 0x250, 0x251, 0x252, 0x253, 0x254, 0x255, 0x256, 0x257, 0x258, 0x259, 0x25a, 0x25b, 0x25c, 0x25d, 0x25e, 0x25f, 0x260, 0x261, 0x262, 0x263, 0x264, 0x265, 0x266, 0x267, 0x268, 0x269, 0x26a, 0x26b, 0x26c, 0x26d, 0x26e, 0x26f, 0x270, 0x271, 0x272, 0x273, 0x274, 0x275, 0x276, 0x277, 0x278, 0x279, 0x27a, 0x27b, 0x27c, 0x27d, 0x27e, 0x27f, 0x280, 0x281, 0x282, 0x283, 0x284, 0x285, 0x286, 0x287, 0x288, 0x289, 0x28a, 0x28b, 0x28c, 0x28d, 0x28e, 0x28f, 0x290, 0x291, 0x292, 0x293, 0x294, 0x295, 0x296, 0x297, 0x298, 0x299, 0x29a, 0x29b, 0x29c, 0x29d, 0x29e, 0x29f, 0x2a0, 0x2a1, 0x2a2, 0x2a3, 0x2a4, 0x2a5, 0x2a6, 0x2a7, 0x2a8, 0x2a9, 0x2aa, 0x2ab, 0x2ac, 0x2ad, 0x2ae, 0x2af, 0x2b0, 0x2b1, 0x2b2, 0x2b3, 0x2b4, 0x2b5, 0x2b6, 0x2b7, 0x2b8, 0x2b9, 0x2ba, 0x2bb, 0x2bc, 0x2bd, 0x2be, 0x2bf, 0x2c0, 0x2c1, 0x2c2, 0x2c3, 0x2c4, 0x2c5, 0x2c6, 0x2c7, 0x2c8, 0x2c9, 0x2ca, 0x2cb, 0x2cc, 0x2cd, 0x2ce, 0x2cf, 0x2d0, 0x2d1, 0x2d2, 0x2d3, 0x2d4, 0x2d5, 0x2d6, 0x2d7, 0x2d8, 0x2d9, 0x2da, 0x2db, 0x2dc, 0x2dd, 0x2de, 0x2df, 0x2e0, 0x2e1, 0x2e2, 0x2e3, 0x2e4, 0x2e5, 0x2e6, 0x2e7, 0x2e8, 0x2e9, 0x2ea, 0x2eb, 0x2ec, 0x2ed, 0x2ee, 0x2ef, 0x2f0, 0x2f1, 0x2f2, 0x2f3, 0x2f4, 0x2f5, 0x2f6, 0x2f7, 0x2f8, 0x2f9, 0x2fa, 0x2fb, 0x2fc, 0x2fd, 0x2fe, 0x2ff, 0x300, 0x301, 0x302, 0x303, 0x304, 0x305, 0x306, 0x307, 0x308, 0x309, 0x30a, 0x30b, 0x30c, 0x30d, 0x30e, 0x30f, 0x310, 0x311, 0x312, 0x313, 0x314, 0x315, 0x316, 0x317, 0x318, 0x319, 0x31a, 0x31b, 0x31c, 0x31d, 0x31e, 0x31f, 0x320, 0x321, 0x322, 0x323, 0x324, 0x325, 0x326, 0x327, 0x328, 0x329, 0x32a, 0x32b, 0x32c, 0x32d, 0x32e, 0x32f, 0x330, 0x331, 0x332, 0x333, 0x334, 0x335, 0x336, 0x337, 0x338, 0x339, 0x33a, 0x33b, 0x33c, 0x33d, 0x33e, 0x33f, 0x340, 0x341, 0x342, 0x343, 0x344, 0x345, 0x346, 0x347, 0x348, 0x349, 0x34a, 0x34b, 0x34c, 0x34d, 0x34e, 0x34f, 0x350, 0x351, 0x352, 0x353, 0x354, 0x355, 0x356, 0x357, 0x358, 0x359, 0x35a, 0x35b, 0x35c, 0x35d, 0x35e, 0x35f, 0x360, 0x361, 0x362, 0x363, 0x364, 0x365, 0x366, 0x367, 0x368, 0x369, 0x36a, 0x36b, 0x36c, 0x36d, 0x36e, 0x36f, 0x370, 0x371, 0x372, 0x373, 0x374, 0x375, 0x376, 0x377, 0x378, 0x379, 0x37a, 0x37b, 0x37c, 0x37d, 0x37e, 0x37f, 0x380, 0x381, 0x382, 0x383, 0x384, 0x385, 0x386, 0x387, 0x388, 0x389, 0x38a, 0x38b, 0x38c, 0x38d, 0x38e, 0x38f, 0x390, 0x391, 0x392, 0x393, 0x394, 0x395, 0x396, 0x397, 0x398, 0x399, 0x39a, 0x39b, 0x39c, 0x39d, 0x39e, 0x39f, 0x3a0, 0x3a1, 0x3a2, 0x3a3, 0x3a4, 0x3a5, 0x3a6, 0x3a7, 0x3a8, 0x3a9, 0x3aa, 0x3ab, 0x3ac, 0x3ad, 0x3ae, 0x3af, 0x3b0, 0x3b1, 0x3b2, 0x3b3, 0x3b4, 0x3b5, 0x3b6, 0x3b7, 0x3b8, 0x3b9, 0x3ba, 0x3bb, 0x3bc, 0x3bd, 0x3be, 0x3bf, 0x3c2, 0x3c3, 0x3c4, 0x3c5, 0x3f1, 0x3f2, 0x3f6, 0x3f7, 0x3f8, 0x3f9, 0x3fa, 0x3fc, 0x3fd, 0x3fe, 0x3ff, 0x400, 0x401, 0x402, 0x403, 0x404, 0x405, 0x406, 0x407, 0x408, 0x409, 0x40a, 0x40b, 0x40c, 0x40d, 0x40e, 0x40f, 0x410, 0x411, 0x412, 0x413, 0x480, 0x481, 0x482, 0x483, 0x484, 0x485, 0x486, 0x487, 0x488, 0x489, 0x48a, 0x48b, 0x48c, 0x48d, 0x48e, 0x48f, 0x490, 0x491, 0x4c1, 0x4d0, 0x560, 0x561, 0x570, 0x571, 0x572, 0x580, 0x581, 0x582, 0x583, 0x584, 0x585, 0x586, 0x587, 0x600, 0x606, 0x60a, 0x60b, 0x60c, 0x60d, 0x610, 0x611, 0x613, 0x614, 0x618, 0x619, 0x61b, 0x61c, 0x630, 0x631, 0x632, 0x633, 0x634, 0x635, 0x638, 0x639, 0x63a, 0x63b, 0x640, 0x641, 0x642, 0x648, 0x649, 0x64a, 0x64b, 0x64c, 0x64d, 0x64e, 0x64f, 0x658, 0x659, 0x65a, 0x65b, 0x660, 0x668, 0x669, 0x680, 0x690, 0x6b0, 0x6b1, 0x6c0, 0x6e0, 0x770, 0x771, 0x772, 0x773, 0x774, 0x777, 0x800, 0x801, 0x802, 0x803, 0x804, 0x805, 0x806, 0x807, 0x808, 0x809, 0x80a, 0x80b, 0x80c, 0x80d, 0x80e, 0x80f, 0x810, 0x811, 0x812, 0x813, 0x814, 0x815, 0x816, 0x817, 0x818, 0x819, 0x81a, 0x81b, 0x81c, 0x81d, 0x81e, 0x81f, 0x820, 0x821, 0x822, 0x823, 0x824, 0x825, 0x826, 0x827, 0x828, 0x829, 0x82a, 0x82b, 0x82c, 0x82d, 0x82e, 0x82f, 0x830, 0x831, 0x832, 0x833, 0x834, 0x835, 0x836, 0x837, 0x838, 0x839, 0x83a, 0x83b, 0x83c, 0x83d, 0x83e, 0x83f, 0x840, 0x841, 0x842, 0x843, 0x844, 0x845, 0x846, 0x847, 0x848, 0x849, 0x84a, 0x84b, 0x84c, 0x84d, 0x84e, 0x84f, 0x850, 0x851, 0x852, 0x853, 0x854, 0x855, 0x856, 0x857, 0x858, 0x859, 0x85a, 0x85b, 0x85c, 0x85d, 0x85e, 0x85f, 0x860, 0x861, 0x862, 0x863, 0x864, 0x865, 0x866, 0x867, 0x868, 0x869, 0x86a, 0x86b, 0x86c, 0x86d, 0x86e, 0x86f, 0x870, 0x871, 0x872, 0x873, 0x874, 0x875, 0x876, 0x877, 0x878, 0x879, 0x87a, 0x87b, 0x87c, 0x87d, 0x87e, 0x87f, 0x880, 0x881, 0x882, 0x883, 0x884, 0x885, 0x886, 0x887, 0x888, 0x889, 0x88a, 0x88b, 0x88c, 0x88d, 0x88e, 0x88f, 0x890, 0x891, 0x892, 0x893, 0x894, 0x895, 0x896, 0x897, 0x898, 0x899, 0x89a, 0x89b, 0x89c, 0x89d, 0x89e, 0x89f, 0x8a0, 0x8a1, 0x8a2, 0x8a3, 0x8a4, 0x8a5, 0x8a6, 0x8a7, 0x8a8, 0x8a9, 0x8aa, 0x8ab, 0x8ac, 0x8ad, 0x8ae, 0x8af, 0x8b0, 0x8b1, 0x8b2, 0x8b3, 0x8b4, 0x8b5, 0x8b6, 0x8b7, 0x8b8, 0x8b9, 0x8ba, 0x8bb, 0x8bc, 0x8bd, 0x8be, 0x8bf, 0x8c0, 0x8c1, 0x8c2, 0x8c3, 0x8c4, 0x8c5, 0x8c6, 0x8c7, 0x8c8, 0x8c9, 0x8ca, 0x8cb, 0x8cc, 0x8cd, 0x8ce, 0x8cf, 0x8d0, 0x8d1, 0x8d2, 0x8d3, 0x8d4, 0x8d5, 0x8d6, 0x8d7, 0x8d8, 0x8d9, 0x8da, 0x8db, 0x8dc, 0x8dd, 0x8de, 0x8df, 0x8e0, 0x8e1, 0x8e2, 0x8e3, 0x8e4, 0x8e5, 0x8e6, 0x8e7, 0x8e8, 0x8e9, 0x8ea, 0x8eb, 0x8ec, 0x8ed, 0x8ee, 0x8ef, 0x8f0, 0x8f1, 0x8f2, 0x8f3, 0x8f4, 0x8f5, 0x8f6, 0x8f7, 0x8f8, 0x8f9, 0x8fa, 0x8fb, 0x8fc, 0x8fd, 0x8fe, 0x8ff, 0x900, 0x901, 0x902, 0x903, 0x904, 0x905, 0x906, 0x907, 0x908, 0x909, 0x90a, 0x90b, 0x90c, 0x90d, 0x90e, 0x90f, 0x910, 0x911, 0x912, 0x913, 0x914, 0x915, 0x916, 0x917, 0x918, 0x919, 0x91a, 0x91b, 0x91c, 0x91d, 0x91e, 0x91f, 0x920, 0x921, 0x922, 0x923, 0x924, 0x925, 0x926, 0x927, 0x928, 0x929, 0x92a, 0x92b, 0x92c, 0x92d, 0x92e, 0x92f, 0x930, 0x931, 0x932, 0x933, 0x934, 0x935, 0x936, 0x937, 0x938, 0x939, 0x93a, 0x93b, 0x93c, 0x93d, 0x93e, 0x93f, 0x940, 0x941, 0x942, 0x943, 0x944, 0x945, 0x946, 0x947, 0x948, 0x949, 0x94a, 0x94b, 0x94c, 0x94d, 0x94e, 0x94f, 0x950, 0x951, 0x952, 0x953, 0x954, 0x955, 0x956, 0x957, 0x958, 0x959, 0x95a, 0x95b, 0x95c, 0x95d, 0x95e, 0x95f, 0x960, 0x961, 0x962, 0x963, 0x964, 0x965, 0x966, 0x967, 0x968, 0x969, 0x96a, 0x96b, 0x96c, 0x96d, 0x96e, 0x96f, 0x970, 0x971, 0x972, 0x973, 0x974, 0x975, 0x976, 0x977, 0x978, 0x979, 0x97a, 0x97b, 0x97c, 0x97d, 0x97e, 0x97f, 0x980, 0x981, 0x982, 0x983, 0x984, 0x985, 0x986, 0x987, 0x988, 0x989, 0x98a, 0x98b, 0x98c, 0x98d, 0x98e, 0x98f, 0x990, 0x991, 0x992, 0x993, 0x994, 0x995, 0x996, 0x997, 0x998, 0x999, 0x99a, 0x99b, 0x99c, 0x99d, 0x99e, 0x99f, 0x9a0, 0x9a1, 0x9a2, 0x9a3, 0x9a4, 0x9a5, 0x9a6, 0x9a7, 0x9a8, 0x9a9, 0x9aa, 0x9ab, 0x9ac, 0x9ad, 0x9ae, 0x9af, 0x9b0, 0x9b1, 0x9b2, 0x9b3, 0x9b4, 0x9b5, 0x9b6, 0x9b7, 0x9b8, 0x9b9, 0x9ba, 0x9bb, 0x9bc, 0x9bd, 0x9be, 0x9bf, 0x9c0, 0x9c1, 0x9c2, 0x9c3, 0x9c4, 0x9c5, 0x9c6, 0x9c7, 0x9c8, 0x9c9, 0x9ca, 0x9cb, 0x9cc, 0x9cd, 0x9ce, 0x9cf, 0x9d0, 0x9d1, 0x9d2, 0x9d3, 0x9d4, 0x9d5, 0x9d6, 0x9d7, 0x9d8, 0x9d9, 0x9da, 0x9db, 0x9dc, 0x9dd, 0x9de, 0x9df, 0x9e0, 0x9e1, 0x9e2, 0x9e3, 0x9e4, 0x9e5, 0x9e6, 0x9e7, 0x9e8, 0x9e9, 0x9ea, 0x9eb, 0x9ec, 0x9ed, 0x9ee, 0x9ef, 0x9f0, 0x9f1, 0x9f2, 0x9f3, 0x9f4, 0x9f5, 0x9f6, 0x9f7, 0x9f8, 0x9f9, 0x9fa, 0x9fb, 0x9fc, 0x9fd, 0x9fe, 0x9ff, 0xa00, 0xa01, 0xa02, 0xa03, 0xa04, 0xa05, 0xa06, 0xa07, 0xa08, 0xa09, 0xa0a, 0xa0b, 0xa0c, 0xa0d, 0xa0e, 0xa0f, 0xa10, 0xa11, 0xa12, 0xa13, 0xa14, 0xa15, 0xa16, 0xa17, 0xa18, 0xa19, 0xa1a, 0xa1b, 0xa1c, 0xa1d, 0xa1e, 0xa1f, 0xa20, 0xa21, 0xa22, 0xa23, 0xa24, 0xa25, 0xa26, 0xa27, 0xa28, 0xa29, 0xa2a, 0xa2b, 0xa2c, 0xa2d, 0xa2e, 0xa2f, 0xa30, 0xa31, 0xa32, 0xa33, 0xa34, 0xa35, 0xa36, 0xa37, 0xa38, 0xa39, 0xa3a, 0xa3b, 0xa3c, 0xa3d, 0xa3e, 0xa3f, 0xa40, 0xa41, 0xa42, 0xa43, 0xa44, 0xa45, 0xa46, 0xa47, 0xa48, 0xa49, 0xa4a, 0xa4b, 0xa4c, 0xa4d, 0xa4e, 0xa4f, 0xa50, 0xa51, 0xa52, 0xa53, 0xa54, 0xa55, 0xa56, 0xa57, 0xa58, 0xa59, 0xa5a, 0xa5b, 0xa5c, 0xa5d, 0xa5e, 0xa5f, 0xa60, 0xa61, 0xa62, 0xa63, 0xa64, 0xa65, 0xa66, 0xa67, 0xa68, 0xa69, 0xa6a, 0xa6b, 0xa6c, 0xa6d, 0xa6e, 0xa6f, 0xa70, 0xa71, 0xa72, 0xa73, 0xa74, 0xa75, 0xa76, 0xa77, 0xa78, 0xa79, 0xa7a, 0xa7b, 0xa7c, 0xa7d, 0xa7e, 0xa7f, 0xa80, 0xa81, 0xa82, 0xa83, 0xa84, 0xa85, 0xa86, 0xa87, 0xa88, 0xa89, 0xa8a, 0xa8b, 0xa8c, 0xa8d, 0xa8e, 0xa8f, 0xa90, 0xa91, 0xa92, 0xa93, 0xa94, 0xa95, 0xa96, 0xa97, 0xa98, 0xa99, 0xa9a, 0xa9b, 0xa9c, 0xa9d, 0xa9e, 0xa9f, 0xaa0, 0xaa1, 0xaa2, 0xaa3, 0xaa4, 0xaa5, 0xaa6, 0xaa7, 0xaa8, 0xaa9, 0xaaa, 0xaab, 0xaac, 0xaad, 0xaae, 0xaaf, 0xab0, 0xab1, 0xab2, 0xab3, 0xab4, 0xab5, 0xab6, 0xab7, 0xab8, 0xab9, 0xaba, 0xabb, 0xabc, 0xabd, 0xabe, 0xabf, 0xac0, 0xac1, 0xac2, 0xac3, 0xac4, 0xac5, 0xac6, 0xac7, 0xac8, 0xac9, 0xaca, 0xacb, 0xacc, 0xacd, 0xace, 0xacf, 0xad0, 0xad1, 0xad2, 0xad3, 0xad4, 0xad5, 0xad6, 0xad7, 0xad8, 0xad9, 0xada, 0xadb, 0xadc, 0xadd, 0xade, 0xadf, 0xae0, 0xae1, 0xae2, 0xae3, 0xae4, 0xae5, 0xae6, 0xae7, 0xae8, 0xae9, 0xaea, 0xaeb, 0xaec, 0xaed, 0xaee, 0xaef, 0xaf0, 0xaf1, 0xaf2, 0xaf3, 0xaf4, 0xaf5, 0xaf6, 0xaf7, 0xaf8, 0xaf9, 0xafa, 0xafb, 0xafc, 0xafd, 0xafe, 0xaff, 0xb00, 0xb01, 0xb02, 0xb03, 0xb04, 0xb05, 0xb06, 0xb07, 0xb08, 0xb09, 0xb0a, 0xb0b, 0xb0c, 0xb0d, 0xb0e, 0xb0f, 0xb10, 0xb11, 0xb12, 0xb13, 0xb14, 0xb15, 0xb16, 0xb17, 0xb18, 0xb19, 0xb1a, 0xb1b, 0xb1c, 0xb1d, 0xb1e, 0xb1f, 0xb20, 0xb21, 0xb22, 0xb23, 0xb24, 0xb25, 0xb26, 0xb27, 0xb28, 0xb29, 0xb2a, 0xb2b, 0xb2c, 0xb2d, 0xb2e, 0xb2f, 0xb30, 0xb31, 0xb32, 0xb33, 0xb34, 0xb35, 0xb36, 0xb37, 0xb38, 0xb39, 0xb3a, 0xb3b, 0xb3c, 0xb3d, 0xb3e, 0xb3f, 0xb40, 0xb41, 0xb42, 0xb43, 0xb44, 0xb45, 0xb46, 0xb47, 0xb48, 0xb49, 0xb4a, 0xb4b, 0xb4c, 0xb4d, 0xb4e, 0xb4f, 0xb50, 0xb51, 0xb52, 0xb53, 0xb54, 0xb55, 0xb56, 0xb57, 0xb58, 0xb59, 0xb5a, 0xb5b, 0xb5c, 0xb5d, 0xb5e, 0xb5f, 0xb60, 0xb61, 0xb62, 0xb63, 0xb64, 0xb65, 0xb66, 0xb67, 0xb68, 0xb69, 0xb6a, 0xb6b, 0xb6c, 0xb6d, 0xb6e, 0xb6f, 0xb70, 0xb71, 0xb72, 0xb73, 0xb74, 0xb75, 0xb76, 0xb77, 0xb78, 0xb79, 0xb7a, 0xb7b, 0xb7c, 0xb7d, 0xb7e, 0xb7f, 0xb80, 0xb81, 0xb82, 0xb83, 0xb84, 0xb85, 0xb86, 0xb87, 0xb88, 0xb89, 0xb8a, 0xb8b, 0xb8c, 0xb8d, 0xb8e, 0xb8f, 0xb90, 0xb91, 0xb92, 0xb93, 0xb94, 0xb95, 0xb96, 0xb97, 0xb98, 0xb99, 0xb9a, 0xb9b, 0xb9c, 0xb9d, 0xb9e, 0xb9f, 0xba0, 0xba1, 0xba2, 0xba3, 0xba4, 0xba5, 0xba6, 0xba7, 0xba8, 0xba9, 0xbaa, 0xbab, 0xbac, 0xbad, 0xbae, 0xbaf, 0xbb0, 0xbb1, 0xbb2, 0xbb3, 0xbb4, 0xbb5, 0xbb6, 0xbb7, 0xbb8, 0xbb9, 0xbba, 0xbbb, 0xbbc, 0xbbd, 0xbbe, 0xbbf, 0xbc0, 0xbc1, 0xbc2, 0xbc3, 0xbc4, 0xbc5, 0xbc6, 0xbc7, 0xbc8, 0xbc9, 0xbca, 0xbcb, 0xbcc, 0xbcd, 0xbce, 0xbcf, 0xbd0, 0xbd1, 0xbd2, 0xbd3, 0xbd4, 0xbd5, 0xbd6, 0xbd7, 0xbd8, 0xbd9, 0xbda, 0xbdb, 0xbdc, 0xbdd, 0xbde, 0xbdf, 0xbe0, 0xbe1, 0xbe2, 0xbe3, 0xbe4, 0xbe5, 0xbe6, 0xbe7, 0xbe8, 0xbe9, 0xbea, 0xbeb, 0xbec, 0xbed, 0xbee, 0xbef, 0xbf0, 0xbf1, 0xbf2, 0xbf3, 0xbf4, 0xbf5, 0xbf6, 0xbf7, 0xbf8, 0xbf9, 0xbfa, 0xbfb, 0xbfc, 0xbfd, 0xbfe, 0xbff, 0xd90, 0xda0, 0xdc0, 0xdc1, 0xdc2, 0xdc3, 0xdc4, 0xdc5, 0xdc6, 0xdc7, 0x40000000, 0x40000001, 0x40000002, 0x40000003, 0x40000010, 0x40000020, 0x40000022, 0x40000023, 0x40000070, 0x40000071, 0x40000072, 0x40000073, 0x40000080, 0x40000081, 0x40000082, 0x40000083, 0x40000084, 0x40000090, 0x40000091, 0x40000092, 0x40000093, 0x40000094, 0x40000095, 0x40000096, 0x40000097, 0x40000098, 0x40000099, 0x4000009a, 0x4000009b, 0x4000009c, 0x4000009d, 0x4000009e, 0x4000009f, 0x400000b0, 0x400000b1, 0x400000b2, 0x400000b3, 0x400000b4, 0x400000b5, 0x400000b6, 0x400000b7, 0x40000100, 0x40000101, 0x40000102, 0x40000103, 0x40000104, 0x40000105, 0x4b564d00, 0x4b564d01, 0x4b564d02, 0x4b564d03, 0x4b564d04, 0xc0000080, 0xc0000081, 0xc0000082, 0xc0000083, 0xc0000084, 0xc0000100, 0xc0000101, 0xc0000102, 0xc0000103, 0xc0000104, 0xc001001f, 0xc0010020, 0xc0010044, 0xc0010062, 0xc0010063, 0xc0010064, 0xc0010114, 0xc0010115, 0xc0010117, 0xc0010140, 0xc0010141, 0xc0011020, 0xc0011022, 0xc001102a, 0xc0011030, 0xc0011031, 0xc0011032, 0xc0011033, 0xc0011034, 0xc0011035, 0xc0011036, 0xc0011037, 0xc0011038, 0xc0011039, 0xc001103a, 0xc001103b, 0xc001103d
   869  
   870  define VMCS12_SIZE	0x1000
   871  
   872  # Deprecated consts.
   873  # These were removed in a5d3df8ae13.
   874  
   875  define KVM_ASSIGN_DEV_IRQ	0x4040AE70
   876  define KVM_ASSIGN_PCI_DEVICE	0x8040AE69
   877  define KVM_ASSIGN_SET_INTX_MASK	0x4040AEA4
   878  define KVM_ASSIGN_SET_MSIX_ENTRY	0x4010AE74
   879  define KVM_ASSIGN_SET_MSIX_NR	0x4008AE73
   880  define KVM_DEASSIGN_DEV_IRQ	0x4040AE75
   881  define KVM_DEASSIGN_PCI_DEVICE	0x4040AE72