1 // Copyright 2017 The Chromium OS Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 use kvm_sys::*; 6 7 /// A capability the kernel's KVM interface can possibly expose. 8 #[derive(Clone, Copy, Debug, PartialEq)] 9 #[repr(u32)] 10 pub enum Cap { 11 Irqchip = KVM_CAP_IRQCHIP, 12 Hlt = KVM_CAP_HLT, 13 MmuShadowCacheControl = KVM_CAP_MMU_SHADOW_CACHE_CONTROL, 14 UserMemory = KVM_CAP_USER_MEMORY, 15 SetTssAddr = KVM_CAP_SET_TSS_ADDR, 16 Vapic = KVM_CAP_VAPIC, 17 ExtCpuid = KVM_CAP_EXT_CPUID, 18 Clocksource = KVM_CAP_CLOCKSOURCE, 19 NrVcpus = KVM_CAP_NR_VCPUS, 20 NrMemslots = KVM_CAP_NR_MEMSLOTS, 21 Pit = KVM_CAP_PIT, 22 NopIoDelay = KVM_CAP_NOP_IO_DELAY, 23 PvMmu = KVM_CAP_PV_MMU, 24 MpState = KVM_CAP_MP_STATE, 25 CoalescedMmio = KVM_CAP_COALESCED_MMIO, 26 SyncMmu = KVM_CAP_SYNC_MMU, 27 Iommu = KVM_CAP_IOMMU, 28 DestroyMemoryRegionWorks = KVM_CAP_DESTROY_MEMORY_REGION_WORKS, 29 UserNmi = KVM_CAP_USER_NMI, 30 SetGuestDebug = KVM_CAP_SET_GUEST_DEBUG, 31 #[cfg(any(target_arch = "x86", target_arch = "x86_64"))] 32 ReinjectControl = KVM_CAP_REINJECT_CONTROL, 33 IrqRouting = KVM_CAP_IRQ_ROUTING, 34 IrqInjectStatus = KVM_CAP_IRQ_INJECT_STATUS, 35 AssignDevIrq = KVM_CAP_ASSIGN_DEV_IRQ, 36 JoinMemoryRegionsWorks = KVM_CAP_JOIN_MEMORY_REGIONS_WORKS, 37 #[cfg(any(target_arch = "x86", target_arch = "x86_64"))] 38 Mce = KVM_CAP_MCE, 39 Irqfd = KVM_CAP_IRQFD, 40 #[cfg(any(target_arch = "x86", target_arch = "x86_64"))] 41 Pit2 = KVM_CAP_PIT2, 42 SetBootCpuId = KVM_CAP_SET_BOOT_CPU_ID, 43 #[cfg(any(target_arch = "x86", target_arch = "x86_64"))] 44 PitState2 = KVM_CAP_PIT_STATE2, 45 Ioeventfd = KVM_CAP_IOEVENTFD, 46 SetIdentityMapAddr = KVM_CAP_SET_IDENTITY_MAP_ADDR, 47 #[cfg(any(target_arch = "x86", target_arch = "x86_64"))] 48 XenHvm = KVM_CAP_XEN_HVM, 49 AdjustClock = KVM_CAP_ADJUST_CLOCK, 50 InternalErrorData = KVM_CAP_INTERNAL_ERROR_DATA, 51 #[cfg(any(target_arch = "x86", target_arch = "x86_64"))] 52 VcpuEvents = KVM_CAP_VCPU_EVENTS, 53 S390Psw = KVM_CAP_S390_PSW, 54 PpcSegstate = KVM_CAP_PPC_SEGSTATE, 55 Hyperv = KVM_CAP_HYPERV, 56 HypervVapic = KVM_CAP_HYPERV_VAPIC, 57 HypervSpin = KVM_CAP_HYPERV_SPIN, 58 PciSegment = KVM_CAP_PCI_SEGMENT, 59 PpcPairedSingles = KVM_CAP_PPC_PAIRED_SINGLES, 60 IntrShadow = KVM_CAP_INTR_SHADOW, 61 #[cfg(any(target_arch = "x86", target_arch = "x86_64"))] 62 Debugregs = KVM_CAP_DEBUGREGS, 63 X86RobustSinglestep = KVM_CAP_X86_ROBUST_SINGLESTEP, 64 PpcOsi = KVM_CAP_PPC_OSI, 65 PpcUnsetIrq = KVM_CAP_PPC_UNSET_IRQ, 66 EnableCap = KVM_CAP_ENABLE_CAP, 67 #[cfg(any(target_arch = "x86", target_arch = "x86_64"))] 68 Xsave = KVM_CAP_XSAVE, 69 #[cfg(any(target_arch = "x86", target_arch = "x86_64"))] 70 Xcrs = KVM_CAP_XCRS, 71 PpcGetPvinfo = KVM_CAP_PPC_GET_PVINFO, 72 PpcIrqLevel = KVM_CAP_PPC_IRQ_LEVEL, 73 AsyncPf = KVM_CAP_ASYNC_PF, 74 TscControl = KVM_CAP_TSC_CONTROL, 75 GetTscKhz = KVM_CAP_GET_TSC_KHZ, 76 PpcBookeSregs = KVM_CAP_PPC_BOOKE_SREGS, 77 SpaprTce = KVM_CAP_SPAPR_TCE, 78 PpcSmt = KVM_CAP_PPC_SMT, 79 PpcRma = KVM_CAP_PPC_RMA, 80 MaxVcpus = KVM_CAP_MAX_VCPUS, 81 PpcHior = KVM_CAP_PPC_HIOR, 82 PpcPapr = KVM_CAP_PPC_PAPR, 83 SwTlb = KVM_CAP_SW_TLB, 84 OneReg = KVM_CAP_ONE_REG, 85 S390Gmap = KVM_CAP_S390_GMAP, 86 TscDeadlineTimer = KVM_CAP_TSC_DEADLINE_TIMER, 87 S390Ucontrol = KVM_CAP_S390_UCONTROL, 88 SyncRegs = KVM_CAP_SYNC_REGS, 89 Pci23 = KVM_CAP_PCI_2_3, 90 KvmclockCtrl = KVM_CAP_KVMCLOCK_CTRL, 91 SignalMsi = KVM_CAP_SIGNAL_MSI, 92 PpcGetSmmuInfo = KVM_CAP_PPC_GET_SMMU_INFO, 93 S390Cow = KVM_CAP_S390_COW, 94 PpcAllocHtab = KVM_CAP_PPC_ALLOC_HTAB, 95 ReadonlyMem = KVM_CAP_READONLY_MEM, 96 IrqfdResample = KVM_CAP_IRQFD_RESAMPLE, 97 PpcBookeWatchdog = KVM_CAP_PPC_BOOKE_WATCHDOG, 98 PpcHtabFd = KVM_CAP_PPC_HTAB_FD, 99 S390CssSupport = KVM_CAP_S390_CSS_SUPPORT, 100 PpcEpr = KVM_CAP_PPC_EPR, 101 ArmPsci = KVM_CAP_ARM_PSCI, 102 ArmSetDeviceAddr = KVM_CAP_ARM_SET_DEVICE_ADDR, 103 DeviceCtrl = KVM_CAP_DEVICE_CTRL, 104 IrqMpic = KVM_CAP_IRQ_MPIC, 105 PpcRtas = KVM_CAP_PPC_RTAS, 106 IrqXics = KVM_CAP_IRQ_XICS, 107 ArmEl132bit = KVM_CAP_ARM_EL1_32BIT, 108 SpaprMultitce = KVM_CAP_SPAPR_MULTITCE, 109 ExtEmulCpuid = KVM_CAP_EXT_EMUL_CPUID, 110 HypervTime = KVM_CAP_HYPERV_TIME, 111 IoapicPolarityIgnored = KVM_CAP_IOAPIC_POLARITY_IGNORED, 112 EnableCapVm = KVM_CAP_ENABLE_CAP_VM, 113 S390Irqchip = KVM_CAP_S390_IRQCHIP, 114 IoeventfdNoLength = KVM_CAP_IOEVENTFD_NO_LENGTH, 115 VmAttributes = KVM_CAP_VM_ATTRIBUTES, 116 ArmPsci02 = KVM_CAP_ARM_PSCI_0_2, 117 PpcFixupHcall = KVM_CAP_PPC_FIXUP_HCALL, 118 PpcEnableHcall = KVM_CAP_PPC_ENABLE_HCALL, 119 CheckExtensionVm = KVM_CAP_CHECK_EXTENSION_VM, 120 S390UserSigp = KVM_CAP_S390_USER_SIGP, 121 } 122