move away from syscall counts towards operation counts
[trinity.git] / ioctls / kvm.c
blobe9aa666caa2b124c407447150a5995c5421a2948
1 #include "config.h"
3 #ifdef USE_KVM
5 #include <linux/ioctl.h>
6 #include <linux/kvm.h>
7 #include "compat.h"
8 #include "ioctls.h"
9 #include "utils.h"
11 static const struct ioctl kvm_ioctls[] = {
12 IOCTL(KVM_SET_MEMORY_REGION),
13 IOCTL(KVM_CREATE_VCPU),
14 IOCTL(KVM_GET_DIRTY_LOG),
15 IOCTL(KVM_SET_NR_MMU_PAGES),
16 IOCTL(KVM_GET_NR_MMU_PAGES),
17 IOCTL(KVM_SET_USER_MEMORY_REGION),
18 IOCTL(KVM_SET_TSS_ADDR),
19 IOCTL(KVM_SET_IDENTITY_MAP_ADDR),
20 IOCTL(KVM_S390_UCAS_MAP),
21 IOCTL(KVM_S390_UCAS_UNMAP),
22 IOCTL(KVM_S390_VCPU_FAULT),
23 IOCTL(KVM_CREATE_IRQCHIP),
24 IOCTL(KVM_IRQ_LINE),
25 IOCTL(KVM_GET_IRQCHIP),
26 IOCTL(KVM_SET_IRQCHIP),
27 IOCTL(KVM_CREATE_PIT),
28 IOCTL(KVM_IRQ_LINE_STATUS),
29 IOCTL(KVM_REGISTER_COALESCED_MMIO),
30 IOCTL(KVM_UNREGISTER_COALESCED_MMIO),
31 IOCTL(KVM_ASSIGN_PCI_DEVICE),
32 IOCTL(KVM_ASSIGN_IRQ),
33 IOCTL(KVM_ASSIGN_DEV_IRQ),
34 IOCTL(KVM_REINJECT_CONTROL),
35 IOCTL(KVM_DEASSIGN_PCI_DEVICE),
36 IOCTL(KVM_ASSIGN_SET_MSIX_NR),
37 IOCTL(KVM_ASSIGN_SET_MSIX_ENTRY),
38 IOCTL(KVM_DEASSIGN_DEV_IRQ),
39 IOCTL(KVM_IRQFD),
40 IOCTL(KVM_CREATE_PIT2),
41 IOCTL(KVM_SET_BOOT_CPU_ID),
42 IOCTL(KVM_IOEVENTFD),
43 IOCTL(KVM_SET_CLOCK),
44 IOCTL(KVM_GET_CLOCK),
45 IOCTL(KVM_PPC_GET_PVINFO),
46 IOCTL(KVM_SET_TSC_KHZ),
47 IOCTL(KVM_GET_TSC_KHZ),
48 IOCTL(KVM_ASSIGN_SET_INTX_MASK),
49 IOCTL(KVM_SIGNAL_MSI),
50 #ifdef X86
51 IOCTL(KVM_SET_MEMORY_ALIAS),
52 IOCTL(KVM_GET_PIT),
53 IOCTL(KVM_SET_PIT),
54 IOCTL(KVM_GET_PIT2),
55 IOCTL(KVM_SET_PIT2),
56 IOCTL(KVM_SET_GSI_ROUTING),
57 IOCTL(KVM_XEN_HVM_CONFIG),
58 IOCTL(KVM_GET_MSRS),
59 IOCTL(KVM_SET_MSRS),
60 IOCTL(KVM_SET_CPUID),
61 IOCTL(KVM_GET_LAPIC),
62 IOCTL(KVM_SET_LAPIC),
63 IOCTL(KVM_SET_CPUID2),
64 IOCTL(KVM_GET_CPUID2),
65 IOCTL(KVM_X86_SET_MCE),
66 IOCTL(KVM_GET_VCPU_EVENTS),
67 IOCTL(KVM_SET_VCPU_EVENTS),
68 IOCTL(KVM_GET_DEBUGREGS),
69 IOCTL(KVM_SET_DEBUGREGS),
70 IOCTL(KVM_GET_XSAVE),
71 IOCTL(KVM_SET_XSAVE),
72 IOCTL(KVM_GET_XCRS),
73 IOCTL(KVM_SET_XCRS),
74 #endif
75 #if defined(__powerpc__)
76 IOCTL(KVM_PPC_GET_SMMU_INFO),
77 IOCTL(KVM_PPC_ALLOCATE_HTAB),
78 IOCTL(KVM_CREATE_SPAPR_TCE),
79 IOCTL(KVM_ALLOCATE_RMA),
80 IOCTL(KVM_PPC_GET_HTAB_FD),
81 #endif
82 #if defined(__arm__) || defined(__aarch64__)
83 IOCTL(KVM_ARM_SET_DEVICE_ADDR),
84 IOCTL(KVM_ARM_VCPU_INIT),
85 #endif
86 IOCTL(KVM_RUN),
87 IOCTL(KVM_GET_REGS),
88 IOCTL(KVM_SET_REGS),
89 IOCTL(KVM_GET_SREGS),
90 IOCTL(KVM_SET_SREGS),
91 IOCTL(KVM_TRANSLATE),
92 IOCTL(KVM_INTERRUPT),
93 IOCTL(KVM_DEBUG_GUEST),
94 IOCTL(KVM_SET_SIGNAL_MASK),
95 IOCTL(KVM_GET_FPU),
96 IOCTL(KVM_SET_FPU),
97 IOCTL(KVM_TPR_ACCESS_REPORTING),
98 IOCTL(KVM_SET_VAPIC_ADDR),
99 #if defined(__s390__)
100 IOCTL(KVM_S390_INTERRUPT),
101 IOCTL(KVM_S390_STORE_STATUS),
102 IOCTL(KVM_S390_SET_INITIAL_PSW),
103 IOCTL(KVM_S390_INITIAL_RESET),
104 #endif
105 IOCTL(KVM_GET_MP_STATE),
106 IOCTL(KVM_SET_MP_STATE),
107 IOCTL(KVM_NMI),
108 IOCTL(KVM_SET_GUEST_DEBUG),
109 IOCTL(KVM_X86_SETUP_MCE),
110 IOCTL(KVM_X86_GET_MCE_CAP_SUPPORTED),
111 IOCTL(KVM_IA64_VCPU_GET_STACK),
112 IOCTL(KVM_IA64_VCPU_SET_STACK),
113 IOCTL(KVM_ENABLE_CAP),
114 IOCTL(KVM_DIRTY_TLB),
115 IOCTL(KVM_GET_ONE_REG),
116 IOCTL(KVM_SET_ONE_REG),
117 IOCTL(KVM_KVMCLOCK_CTRL),
118 IOCTL(KVM_GET_REG_LIST),
121 static const char *const kvm_devs[] = {
122 "kvm",
125 static const struct ioctl_group kvm_grp = {
126 .devtype = DEV_MISC,
127 .devs = kvm_devs,
128 .devs_cnt = ARRAY_SIZE(kvm_devs),
129 .sanitise = pick_random_ioctl,
130 .ioctls = kvm_ioctls,
131 .ioctls_cnt = ARRAY_SIZE(kvm_ioctls),
134 REG_IOCTL_GROUP(kvm_grp)
136 #endif /* USE_KVM */