Elliott Hughes | 180edef | 2023-11-02 00:08:05 +0000 | [diff] [blame] | 1 | /* |
| 2 | * This file is auto-generated. Modifications will be lost. |
| 3 | * |
| 4 | * See https://android.googlesource.com/platform/bionic/+/master/libc/kernel/ |
| 5 | * for more information. |
| 6 | */ |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 7 | #ifndef __LINUX_KVM_H |
| 8 | #define __LINUX_KVM_H |
Christopher Ferris | fcc3b4f | 2021-07-01 01:30:21 +0000 | [diff] [blame] | 9 | #include <linux/const.h> |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 10 | #include <linux/types.h> |
| 11 | #include <linux/compiler.h> |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 12 | #include <linux/ioctl.h> |
| 13 | #include <asm/kvm.h> |
| 14 | #define KVM_API_VERSION 12 |
Christopher Ferris | 7f4c837 | 2024-06-03 14:22:19 -0700 | [diff] [blame] | 15 | #define __KVM_HAVE_GUEST_DEBUG |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 16 | struct kvm_userspace_memory_region { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 17 | __u32 slot; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 18 | __u32 flags; |
| 19 | __u64 guest_phys_addr; |
| 20 | __u64 memory_size; |
| 21 | __u64 userspace_addr; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 22 | }; |
Christopher Ferris | b830ddf | 2024-03-28 11:48:08 -0700 | [diff] [blame] | 23 | struct kvm_userspace_memory_region2 { |
| 24 | __u32 slot; |
| 25 | __u32 flags; |
| 26 | __u64 guest_phys_addr; |
| 27 | __u64 memory_size; |
| 28 | __u64 userspace_addr; |
| 29 | __u64 guest_memfd_offset; |
| 30 | __u32 guest_memfd; |
| 31 | __u32 pad1; |
| 32 | __u64 pad2[14]; |
| 33 | }; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 34 | #define KVM_MEM_LOG_DIRTY_PAGES (1UL << 0) |
| 35 | #define KVM_MEM_READONLY (1UL << 1) |
Christopher Ferris | b830ddf | 2024-03-28 11:48:08 -0700 | [diff] [blame] | 36 | #define KVM_MEM_GUEST_MEMFD (1UL << 2) |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 37 | struct kvm_irq_level { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 38 | union { |
| 39 | __u32 irq; |
| 40 | __s32 status; |
| 41 | }; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 42 | __u32 level; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 43 | }; |
| 44 | struct kvm_irqchip { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 45 | __u32 chip_id; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 46 | __u32 pad; |
| 47 | union { |
| 48 | char dummy[512]; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 49 | #ifdef __KVM_HAVE_PIT |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 50 | struct kvm_pic_state pic; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 51 | #endif |
| 52 | #ifdef __KVM_HAVE_IOAPIC |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 53 | struct kvm_ioapic_state ioapic; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 54 | #endif |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 55 | } chip; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 56 | }; |
| 57 | struct kvm_pit_config { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 58 | __u32 flags; |
| 59 | __u32 pad[15]; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 60 | }; |
| 61 | #define KVM_PIT_SPEAKER_DUMMY 1 |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 62 | struct kvm_hyperv_exit { |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 63 | #define KVM_EXIT_HYPERV_SYNIC 1 |
| 64 | #define KVM_EXIT_HYPERV_HCALL 2 |
Christopher Ferris | 8177cdf | 2020-08-03 11:53:55 -0700 | [diff] [blame] | 65 | #define KVM_EXIT_HYPERV_SYNDBG 3 |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 66 | __u32 type; |
Christopher Ferris | 8177cdf | 2020-08-03 11:53:55 -0700 | [diff] [blame] | 67 | __u32 pad1; |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 68 | union { |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 69 | struct { |
| 70 | __u32 msr; |
Christopher Ferris | 8177cdf | 2020-08-03 11:53:55 -0700 | [diff] [blame] | 71 | __u32 pad2; |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 72 | __u64 control; |
| 73 | __u64 evt_page; |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 74 | __u64 msg_page; |
| 75 | } synic; |
| 76 | struct { |
| 77 | __u64 input; |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 78 | __u64 result; |
| 79 | __u64 params[2]; |
| 80 | } hcall; |
Christopher Ferris | 8177cdf | 2020-08-03 11:53:55 -0700 | [diff] [blame] | 81 | struct { |
| 82 | __u32 msr; |
| 83 | __u32 pad2; |
| 84 | __u64 control; |
| 85 | __u64 status; |
| 86 | __u64 send_page; |
| 87 | __u64 recv_page; |
| 88 | __u64 pending_page; |
| 89 | } syndbg; |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 90 | } u; |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 91 | }; |
Christopher Ferris | a9750ed | 2021-05-03 14:02:49 -0700 | [diff] [blame] | 92 | struct kvm_xen_exit { |
| 93 | #define KVM_EXIT_XEN_HCALL 1 |
| 94 | __u32 type; |
| 95 | union { |
| 96 | struct { |
| 97 | __u32 longmode; |
| 98 | __u32 cpl; |
| 99 | __u64 input; |
| 100 | __u64 result; |
| 101 | __u64 params[6]; |
| 102 | } hcall; |
| 103 | } u; |
| 104 | }; |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 105 | #define KVM_S390_GET_SKEYS_NONE 1 |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 106 | #define KVM_S390_SKEYS_MAX 1048576 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 107 | #define KVM_EXIT_UNKNOWN 0 |
| 108 | #define KVM_EXIT_EXCEPTION 1 |
| 109 | #define KVM_EXIT_IO 2 |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 110 | #define KVM_EXIT_HYPERCALL 3 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 111 | #define KVM_EXIT_DEBUG 4 |
| 112 | #define KVM_EXIT_HLT 5 |
| 113 | #define KVM_EXIT_MMIO 6 |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 114 | #define KVM_EXIT_IRQ_WINDOW_OPEN 7 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 115 | #define KVM_EXIT_SHUTDOWN 8 |
| 116 | #define KVM_EXIT_FAIL_ENTRY 9 |
| 117 | #define KVM_EXIT_INTR 10 |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 118 | #define KVM_EXIT_SET_TPR 11 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 119 | #define KVM_EXIT_TPR_ACCESS 12 |
| 120 | #define KVM_EXIT_S390_SIEIC 13 |
| 121 | #define KVM_EXIT_S390_RESET 14 |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 122 | #define KVM_EXIT_DCR 15 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 123 | #define KVM_EXIT_NMI 16 |
| 124 | #define KVM_EXIT_INTERNAL_ERROR 17 |
| 125 | #define KVM_EXIT_OSI 18 |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 126 | #define KVM_EXIT_PAPR_HCALL 19 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 127 | #define KVM_EXIT_S390_UCONTROL 20 |
| 128 | #define KVM_EXIT_WATCHDOG 21 |
| 129 | #define KVM_EXIT_S390_TSCH 22 |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 130 | #define KVM_EXIT_EPR 23 |
Christopher Ferris | ba8d4f4 | 2014-09-03 19:56:49 -0700 | [diff] [blame] | 131 | #define KVM_EXIT_SYSTEM_EVENT 24 |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 132 | #define KVM_EXIT_S390_STSI 25 |
| 133 | #define KVM_EXIT_IOAPIC_EOI 26 |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 134 | #define KVM_EXIT_HYPERV 27 |
Christopher Ferris | d32ca14 | 2020-02-04 16:16:51 -0800 | [diff] [blame] | 135 | #define KVM_EXIT_ARM_NISV 28 |
Christopher Ferris | 32ff3f8 | 2020-12-14 13:10:04 -0800 | [diff] [blame] | 136 | #define KVM_EXIT_X86_RDMSR 29 |
| 137 | #define KVM_EXIT_X86_WRMSR 30 |
Christopher Ferris | 05667cd | 2021-02-16 16:01:34 -0800 | [diff] [blame] | 138 | #define KVM_EXIT_DIRTY_RING_FULL 31 |
| 139 | #define KVM_EXIT_AP_RESET_HOLD 32 |
Christopher Ferris | a9750ed | 2021-05-03 14:02:49 -0700 | [diff] [blame] | 140 | #define KVM_EXIT_X86_BUS_LOCK 33 |
| 141 | #define KVM_EXIT_XEN 34 |
Christopher Ferris | a479261 | 2022-01-10 13:51:15 -0800 | [diff] [blame] | 142 | #define KVM_EXIT_RISCV_SBI 35 |
Christopher Ferris | 7447a1c | 2022-10-04 18:24:44 -0700 | [diff] [blame] | 143 | #define KVM_EXIT_RISCV_CSR 36 |
| 144 | #define KVM_EXIT_NOTIFY 37 |
Christopher Ferris | 0f79521 | 2024-01-17 14:17:28 -0800 | [diff] [blame] | 145 | #define KVM_EXIT_LOONGARCH_IOCSR 38 |
Christopher Ferris | b830ddf | 2024-03-28 11:48:08 -0700 | [diff] [blame] | 146 | #define KVM_EXIT_MEMORY_FAULT 39 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 147 | #define KVM_INTERNAL_ERROR_EMULATION 1 |
| 148 | #define KVM_INTERNAL_ERROR_SIMUL_EX 2 |
| 149 | #define KVM_INTERNAL_ERROR_DELIVERY_EV 3 |
Christopher Ferris | 9584fa4 | 2019-12-09 15:36:13 -0800 | [diff] [blame] | 150 | #define KVM_INTERNAL_ERROR_UNEXPECTED_EXIT_REASON 4 |
Christopher Ferris | 3a39c0b | 2021-09-02 00:03:38 +0000 | [diff] [blame] | 151 | #define KVM_INTERNAL_ERROR_EMULATION_FLAG_INSTRUCTION_BYTES (1ULL << 0) |
Christopher Ferris | ba8d4f4 | 2014-09-03 19:56:49 -0700 | [diff] [blame] | 152 | struct kvm_run { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 153 | __u8 request_interrupt_window; |
Priyanka Advani (xWF) | a805034 | 2024-09-25 19:07:32 +0000 | [diff] [blame^] | 154 | __u8 immediate_exit; |
Christopher Ferris | 525ce91 | 2017-07-26 13:12:53 -0700 | [diff] [blame] | 155 | __u8 padding1[6]; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 156 | __u32 exit_reason; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 157 | __u8 ready_for_interrupt_injection; |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 158 | __u8 if_flag; |
| 159 | __u16 flags; |
| 160 | __u64 cr8; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 161 | __u64 apic_base; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 162 | #ifdef __KVM_S390 |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 163 | __u64 psw_mask; |
| 164 | __u64 psw_addr; |
Christopher Ferris | ba8d4f4 | 2014-09-03 19:56:49 -0700 | [diff] [blame] | 165 | #endif |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 166 | union { |
| 167 | struct { |
| 168 | __u64 hardware_exit_reason; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 169 | } hw; |
| 170 | struct { |
| 171 | __u64 hardware_entry_failure_reason; |
Christopher Ferris | 25c18d4 | 2020-10-14 17:42:58 -0700 | [diff] [blame] | 172 | __u32 cpu; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 173 | } fail_entry; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 174 | struct { |
| 175 | __u32 exception; |
| 176 | __u32 error_code; |
| 177 | } ex; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 178 | struct { |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 179 | #define KVM_EXIT_IO_IN 0 |
| 180 | #define KVM_EXIT_IO_OUT 1 |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 181 | __u8 direction; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 182 | __u8 size; |
| 183 | __u16 port; |
| 184 | __u32 count; |
| 185 | __u64 data_offset; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 186 | } io; |
| 187 | struct { |
| 188 | struct kvm_debug_exit_arch arch; |
| 189 | } debug; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 190 | struct { |
| 191 | __u64 phys_addr; |
| 192 | __u8 data[8]; |
| 193 | __u32 len; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 194 | __u8 is_write; |
| 195 | } mmio; |
| 196 | struct { |
Christopher Ferris | 0f79521 | 2024-01-17 14:17:28 -0800 | [diff] [blame] | 197 | __u64 phys_addr; |
| 198 | __u8 data[8]; |
| 199 | __u32 len; |
| 200 | __u8 is_write; |
| 201 | } iocsr_io; |
| 202 | struct { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 203 | __u64 nr; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 204 | __u64 args[6]; |
| 205 | __u64 ret; |
Christopher Ferris | 37c3f3c | 2023-07-10 10:59:05 -0700 | [diff] [blame] | 206 | union { |
| 207 | __u32 longmode; |
| 208 | __u64 flags; |
| 209 | }; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 210 | } hypercall; |
| 211 | struct { |
| 212 | __u64 rip; |
| 213 | __u32 is_write; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 214 | __u32 pad; |
| 215 | } tpr_access; |
| 216 | struct { |
| 217 | __u8 icptcode; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 218 | __u16 ipa; |
| 219 | __u32 ipb; |
| 220 | } s390_sieic; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 221 | __u64 s390_reset_flags; |
| 222 | struct { |
| 223 | __u64 trans_exc_code; |
| 224 | __u32 pgm_code; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 225 | } s390_ucontrol; |
| 226 | struct { |
| 227 | __u32 dcrn; |
| 228 | __u32 data; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 229 | __u8 is_write; |
| 230 | } dcr; |
| 231 | struct { |
| 232 | __u32 suberror; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 233 | __u32 ndata; |
| 234 | __u64 data[16]; |
| 235 | } internal; |
| 236 | struct { |
Christopher Ferris | 3a39c0b | 2021-09-02 00:03:38 +0000 | [diff] [blame] | 237 | __u32 suberror; |
| 238 | __u32 ndata; |
| 239 | __u64 flags; |
Christopher Ferris | a479261 | 2022-01-10 13:51:15 -0800 | [diff] [blame] | 240 | union { |
| 241 | struct { |
| 242 | __u8 insn_size; |
| 243 | __u8 insn_bytes[15]; |
| 244 | }; |
| 245 | }; |
Christopher Ferris | 3a39c0b | 2021-09-02 00:03:38 +0000 | [diff] [blame] | 246 | } emulation_failure; |
| 247 | struct { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 248 | __u64 gprs[32]; |
| 249 | } osi; |
| 250 | struct { |
| 251 | __u64 nr; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 252 | __u64 ret; |
| 253 | __u64 args[9]; |
| 254 | } papr_hcall; |
| 255 | struct { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 256 | __u16 subchannel_id; |
| 257 | __u16 subchannel_nr; |
| 258 | __u32 io_int_parm; |
| 259 | __u32 io_int_word; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 260 | __u32 ipb; |
| 261 | __u8 dequeued; |
| 262 | } s390_tsch; |
| 263 | struct { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 264 | __u32 epr; |
| 265 | } epr; |
| 266 | struct { |
Christopher Ferris | ba8d4f4 | 2014-09-03 19:56:49 -0700 | [diff] [blame] | 267 | #define KVM_SYSTEM_EVENT_SHUTDOWN 1 |
Christopher Ferris | ba8d4f4 | 2014-09-03 19:56:49 -0700 | [diff] [blame] | 268 | #define KVM_SYSTEM_EVENT_RESET 2 |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 269 | #define KVM_SYSTEM_EVENT_CRASH 3 |
Christopher Ferris | 80ae69d | 2022-08-02 16:32:21 -0700 | [diff] [blame] | 270 | #define KVM_SYSTEM_EVENT_WAKEUP 4 |
| 271 | #define KVM_SYSTEM_EVENT_SUSPEND 5 |
| 272 | #define KVM_SYSTEM_EVENT_SEV_TERM 6 |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 273 | __u32 type; |
Christopher Ferris | 10a76e6 | 2022-06-08 13:31:52 -0700 | [diff] [blame] | 274 | __u32 ndata; |
| 275 | union { |
| 276 | __u64 flags; |
| 277 | __u64 data[16]; |
| 278 | }; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 279 | } system_event; |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 280 | struct { |
| 281 | __u64 addr; |
| 282 | __u8 ar; |
| 283 | __u8 reserved; |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 284 | __u8 fc; |
| 285 | __u8 sel1; |
| 286 | __u16 sel2; |
| 287 | } s390_stsi; |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 288 | struct { |
| 289 | __u8 vector; |
| 290 | } eoi; |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 291 | struct kvm_hyperv_exit hyperv; |
Christopher Ferris | d32ca14 | 2020-02-04 16:16:51 -0800 | [diff] [blame] | 292 | struct { |
| 293 | __u64 esr_iss; |
| 294 | __u64 fault_ipa; |
| 295 | } arm_nisv; |
Christopher Ferris | 32ff3f8 | 2020-12-14 13:10:04 -0800 | [diff] [blame] | 296 | struct { |
| 297 | __u8 error; |
| 298 | __u8 pad[7]; |
| 299 | #define KVM_MSR_EXIT_REASON_INVAL (1 << 0) |
| 300 | #define KVM_MSR_EXIT_REASON_UNKNOWN (1 << 1) |
| 301 | #define KVM_MSR_EXIT_REASON_FILTER (1 << 2) |
Christopher Ferris | 8b7fdc9 | 2023-02-21 13:36:32 -0800 | [diff] [blame] | 302 | #define KVM_MSR_EXIT_REASON_VALID_MASK (KVM_MSR_EXIT_REASON_INVAL | KVM_MSR_EXIT_REASON_UNKNOWN | KVM_MSR_EXIT_REASON_FILTER) |
Christopher Ferris | 32ff3f8 | 2020-12-14 13:10:04 -0800 | [diff] [blame] | 303 | __u32 reason; |
| 304 | __u32 index; |
| 305 | __u64 data; |
| 306 | } msr; |
Christopher Ferris | a9750ed | 2021-05-03 14:02:49 -0700 | [diff] [blame] | 307 | struct kvm_xen_exit xen; |
Christopher Ferris | a479261 | 2022-01-10 13:51:15 -0800 | [diff] [blame] | 308 | struct { |
| 309 | unsigned long extension_id; |
| 310 | unsigned long function_id; |
| 311 | unsigned long args[6]; |
| 312 | unsigned long ret[2]; |
| 313 | } riscv_sbi; |
Christopher Ferris | 7447a1c | 2022-10-04 18:24:44 -0700 | [diff] [blame] | 314 | struct { |
| 315 | unsigned long csr_num; |
| 316 | unsigned long new_value; |
| 317 | unsigned long write_mask; |
| 318 | unsigned long ret_value; |
| 319 | } riscv_csr; |
| 320 | struct { |
| 321 | #define KVM_NOTIFY_CONTEXT_INVALID (1 << 0) |
| 322 | __u32 flags; |
| 323 | } notify; |
Christopher Ferris | b830ddf | 2024-03-28 11:48:08 -0700 | [diff] [blame] | 324 | struct { |
| 325 | #define KVM_MEMORY_EXIT_FLAG_PRIVATE (1ULL << 3) |
| 326 | __u64 flags; |
| 327 | __u64 gpa; |
| 328 | __u64 size; |
| 329 | } memory_fault; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 330 | char padding[256]; |
| 331 | }; |
Christopher Ferris | 76a1d45 | 2018-06-27 14:12:29 -0700 | [diff] [blame] | 332 | #define SYNC_REGS_SIZE_BYTES 2048 |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 333 | __u64 kvm_valid_regs; |
| 334 | __u64 kvm_dirty_regs; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 335 | union { |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 336 | struct kvm_sync_regs regs; |
Christopher Ferris | 76a1d45 | 2018-06-27 14:12:29 -0700 | [diff] [blame] | 337 | char padding[SYNC_REGS_SIZE_BYTES]; |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 338 | } s; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 339 | }; |
| 340 | struct kvm_coalesced_mmio_zone { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 341 | __u64 addr; |
| 342 | __u32 size; |
Christopher Ferris | 86a4837 | 2019-01-10 14:14:59 -0800 | [diff] [blame] | 343 | union { |
| 344 | __u32 pad; |
| 345 | __u32 pio; |
| 346 | }; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 347 | }; |
| 348 | struct kvm_coalesced_mmio { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 349 | __u64 phys_addr; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 350 | __u32 len; |
Christopher Ferris | 86a4837 | 2019-01-10 14:14:59 -0800 | [diff] [blame] | 351 | union { |
| 352 | __u32 pad; |
| 353 | __u32 pio; |
| 354 | }; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 355 | __u8 data[8]; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 356 | }; |
| 357 | struct kvm_coalesced_mmio_ring { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 358 | __u32 first, last; |
Christopher Ferris | 7447a1c | 2022-10-04 18:24:44 -0700 | [diff] [blame] | 359 | struct kvm_coalesced_mmio coalesced_mmio[]; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 360 | }; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 361 | #define KVM_COALESCED_MMIO_MAX ((PAGE_SIZE - sizeof(struct kvm_coalesced_mmio_ring)) / sizeof(struct kvm_coalesced_mmio)) |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 362 | struct kvm_translation { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 363 | __u64 linear_address; |
| 364 | __u64 physical_address; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 365 | __u8 valid; |
| 366 | __u8 writeable; |
| 367 | __u8 usermode; |
| 368 | __u8 pad[5]; |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 369 | }; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 370 | struct kvm_interrupt { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 371 | __u32 irq; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 372 | }; |
| 373 | struct kvm_dirty_log { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 374 | __u32 slot; |
| 375 | __u32 padding1; |
| 376 | union { |
Elliott Hughes | 0f0c18f | 2023-03-29 15:53:31 -0700 | [diff] [blame] | 377 | void * dirty_bitmap; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 378 | __u64 padding2; |
| 379 | }; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 380 | }; |
Christopher Ferris | d842e43 | 2019-03-07 10:21:59 -0800 | [diff] [blame] | 381 | struct kvm_clear_dirty_log { |
| 382 | __u32 slot; |
| 383 | __u32 num_pages; |
| 384 | __u64 first_page; |
| 385 | union { |
Elliott Hughes | 0f0c18f | 2023-03-29 15:53:31 -0700 | [diff] [blame] | 386 | void * dirty_bitmap; |
Christopher Ferris | d842e43 | 2019-03-07 10:21:59 -0800 | [diff] [blame] | 387 | __u64 padding2; |
| 388 | }; |
| 389 | }; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 390 | struct kvm_signal_mask { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 391 | __u32 len; |
Christopher Ferris | 7447a1c | 2022-10-04 18:24:44 -0700 | [diff] [blame] | 392 | __u8 sigset[]; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 393 | }; |
| 394 | struct kvm_tpr_access_ctl { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 395 | __u32 enabled; |
| 396 | __u32 flags; |
| 397 | __u32 reserved[8]; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 398 | }; |
| 399 | struct kvm_vapic_addr { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 400 | __u64 vapic_addr; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 401 | }; |
| 402 | #define KVM_MP_STATE_RUNNABLE 0 |
| 403 | #define KVM_MP_STATE_UNINITIALIZED 1 |
| 404 | #define KVM_MP_STATE_INIT_RECEIVED 2 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 405 | #define KVM_MP_STATE_HALTED 3 |
| 406 | #define KVM_MP_STATE_SIPI_RECEIVED 4 |
Christopher Ferris | 82d7504 | 2015-01-26 10:57:07 -0800 | [diff] [blame] | 407 | #define KVM_MP_STATE_STOPPED 5 |
| 408 | #define KVM_MP_STATE_CHECK_STOP 6 |
| 409 | #define KVM_MP_STATE_OPERATING 7 |
Christopher Ferris | 82d7504 | 2015-01-26 10:57:07 -0800 | [diff] [blame] | 410 | #define KVM_MP_STATE_LOAD 8 |
Christopher Ferris | 05667cd | 2021-02-16 16:01:34 -0800 | [diff] [blame] | 411 | #define KVM_MP_STATE_AP_RESET_HOLD 9 |
Christopher Ferris | 80ae69d | 2022-08-02 16:32:21 -0700 | [diff] [blame] | 412 | #define KVM_MP_STATE_SUSPENDED 10 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 413 | struct kvm_mp_state { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 414 | __u32 mp_state; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 415 | }; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 416 | #define KVM_GUESTDBG_ENABLE 0x00000001 |
| 417 | #define KVM_GUESTDBG_SINGLESTEP 0x00000002 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 418 | struct kvm_guest_debug { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 419 | __u32 control; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 420 | __u32 pad; |
| 421 | struct kvm_guest_debug_arch arch; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 422 | }; |
| 423 | enum { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 424 | kvm_ioeventfd_flag_nr_datamatch, |
| 425 | kvm_ioeventfd_flag_nr_pio, |
| 426 | kvm_ioeventfd_flag_nr_deassign, |
| 427 | kvm_ioeventfd_flag_nr_virtio_ccw_notify, |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 428 | kvm_ioeventfd_flag_nr_fast_mmio, |
| 429 | kvm_ioeventfd_flag_nr_max, |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 430 | }; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 431 | #define KVM_IOEVENTFD_FLAG_DATAMATCH (1 << kvm_ioeventfd_flag_nr_datamatch) |
| 432 | #define KVM_IOEVENTFD_FLAG_PIO (1 << kvm_ioeventfd_flag_nr_pio) |
| 433 | #define KVM_IOEVENTFD_FLAG_DEASSIGN (1 << kvm_ioeventfd_flag_nr_deassign) |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 434 | #define KVM_IOEVENTFD_FLAG_VIRTIO_CCW_NOTIFY (1 << kvm_ioeventfd_flag_nr_virtio_ccw_notify) |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 435 | #define KVM_IOEVENTFD_VALID_FLAG_MASK ((1 << kvm_ioeventfd_flag_nr_max) - 1) |
| 436 | struct kvm_ioeventfd { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 437 | __u64 datamatch; |
| 438 | __u64 addr; |
| 439 | __u32 len; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 440 | __s32 fd; |
| 441 | __u32 flags; |
| 442 | __u8 pad[36]; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 443 | }; |
Christopher Ferris | 76a1d45 | 2018-06-27 14:12:29 -0700 | [diff] [blame] | 444 | #define KVM_X86_DISABLE_EXITS_MWAIT (1 << 0) |
| 445 | #define KVM_X86_DISABLE_EXITS_HLT (1 << 1) |
| 446 | #define KVM_X86_DISABLE_EXITS_PAUSE (1 << 2) |
Christopher Ferris | b8a95e2 | 2019-10-02 18:29:20 -0700 | [diff] [blame] | 447 | #define KVM_X86_DISABLE_EXITS_CSTATE (1 << 3) |
| 448 | #define KVM_X86_DISABLE_VALID_EXITS (KVM_X86_DISABLE_EXITS_MWAIT | KVM_X86_DISABLE_EXITS_HLT | KVM_X86_DISABLE_EXITS_PAUSE | KVM_X86_DISABLE_EXITS_CSTATE) |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 449 | struct kvm_enable_cap { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 450 | __u32 cap; |
| 451 | __u32 flags; |
| 452 | __u64 args[4]; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 453 | __u8 pad[64]; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 454 | }; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 455 | #define KVMIO 0xAE |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 456 | #define KVM_VM_S390_UCONTROL 1 |
Christopher Ferris | 38062f9 | 2014-07-09 15:33:25 -0700 | [diff] [blame] | 457 | #define KVM_VM_PPC_HV 1 |
| 458 | #define KVM_VM_PPC_PR 2 |
Christopher Ferris | 25c18d4 | 2020-10-14 17:42:58 -0700 | [diff] [blame] | 459 | #define KVM_VM_MIPS_AUTO 0 |
Christopher Ferris | 525ce91 | 2017-07-26 13:12:53 -0700 | [diff] [blame] | 460 | #define KVM_VM_MIPS_VZ 1 |
Christopher Ferris | 25c18d4 | 2020-10-14 17:42:58 -0700 | [diff] [blame] | 461 | #define KVM_VM_MIPS_TE 2 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 462 | #define KVM_S390_SIE_PAGE_OFFSET 1 |
Christopher Ferris | 86a4837 | 2019-01-10 14:14:59 -0800 | [diff] [blame] | 463 | #define KVM_VM_TYPE_ARM_IPA_SIZE_MASK 0xffULL |
| 464 | #define KVM_VM_TYPE_ARM_IPA_SIZE(x) ((x) & KVM_VM_TYPE_ARM_IPA_SIZE_MASK) |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 465 | #define KVM_GET_API_VERSION _IO(KVMIO, 0x00) |
| 466 | #define KVM_CREATE_VM _IO(KVMIO, 0x01) |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 467 | #define KVM_GET_MSR_INDEX_LIST _IOWR(KVMIO, 0x02, struct kvm_msr_list) |
| 468 | #define KVM_S390_ENABLE_SIE _IO(KVMIO, 0x06) |
| 469 | #define KVM_CHECK_EXTENSION _IO(KVMIO, 0x03) |
| 470 | #define KVM_GET_VCPU_MMAP_SIZE _IO(KVMIO, 0x04) |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 471 | #define KVM_GET_SUPPORTED_CPUID _IOWR(KVMIO, 0x05, struct kvm_cpuid2) |
Christopher Ferris | 38062f9 | 2014-07-09 15:33:25 -0700 | [diff] [blame] | 472 | #define KVM_GET_EMULATED_CPUID _IOWR(KVMIO, 0x09, struct kvm_cpuid2) |
Christopher Ferris | 76a1d45 | 2018-06-27 14:12:29 -0700 | [diff] [blame] | 473 | #define KVM_GET_MSR_FEATURE_INDEX_LIST _IOWR(KVMIO, 0x0a, struct kvm_msr_list) |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 474 | #define KVM_CAP_IRQCHIP 0 |
| 475 | #define KVM_CAP_HLT 1 |
| 476 | #define KVM_CAP_MMU_SHADOW_CACHE_CONTROL 2 |
| 477 | #define KVM_CAP_USER_MEMORY 3 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 478 | #define KVM_CAP_SET_TSS_ADDR 4 |
| 479 | #define KVM_CAP_VAPIC 6 |
| 480 | #define KVM_CAP_EXT_CPUID 7 |
| 481 | #define KVM_CAP_CLOCKSOURCE 8 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 482 | #define KVM_CAP_NR_VCPUS 9 |
| 483 | #define KVM_CAP_NR_MEMSLOTS 10 |
| 484 | #define KVM_CAP_PIT 11 |
| 485 | #define KVM_CAP_NOP_IO_DELAY 12 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 486 | #define KVM_CAP_PV_MMU 13 |
| 487 | #define KVM_CAP_MP_STATE 14 |
| 488 | #define KVM_CAP_COALESCED_MMIO 15 |
| 489 | #define KVM_CAP_SYNC_MMU 16 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 490 | #define KVM_CAP_IOMMU 18 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 491 | #define KVM_CAP_DESTROY_MEMORY_REGION_WORKS 21 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 492 | #define KVM_CAP_USER_NMI 22 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 493 | #define KVM_CAP_SET_GUEST_DEBUG 23 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 494 | #ifdef __KVM_HAVE_PIT |
| 495 | #define KVM_CAP_REINJECT_CONTROL 24 |
| 496 | #endif |
| 497 | #define KVM_CAP_IRQ_ROUTING 25 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 498 | #define KVM_CAP_IRQ_INJECT_STATUS 26 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 499 | #define KVM_CAP_ASSIGN_DEV_IRQ 29 |
| 500 | #define KVM_CAP_JOIN_MEMORY_REGIONS_WORKS 30 |
| 501 | #ifdef __KVM_HAVE_MCE |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 502 | #define KVM_CAP_MCE 31 |
| 503 | #endif |
| 504 | #define KVM_CAP_IRQFD 32 |
| 505 | #ifdef __KVM_HAVE_PIT |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 506 | #define KVM_CAP_PIT2 33 |
| 507 | #endif |
| 508 | #define KVM_CAP_SET_BOOT_CPU_ID 34 |
| 509 | #ifdef __KVM_HAVE_PIT_STATE2 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 510 | #define KVM_CAP_PIT_STATE2 35 |
| 511 | #endif |
| 512 | #define KVM_CAP_IOEVENTFD 36 |
| 513 | #define KVM_CAP_SET_IDENTITY_MAP_ADDR 37 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 514 | #ifdef __KVM_HAVE_XEN_HVM |
| 515 | #define KVM_CAP_XEN_HVM 38 |
| 516 | #endif |
| 517 | #define KVM_CAP_ADJUST_CLOCK 39 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 518 | #define KVM_CAP_INTERNAL_ERROR_DATA 40 |
| 519 | #ifdef __KVM_HAVE_VCPU_EVENTS |
| 520 | #define KVM_CAP_VCPU_EVENTS 41 |
| 521 | #endif |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 522 | #define KVM_CAP_S390_PSW 42 |
| 523 | #define KVM_CAP_PPC_SEGSTATE 43 |
| 524 | #define KVM_CAP_HYPERV 44 |
| 525 | #define KVM_CAP_HYPERV_VAPIC 45 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 526 | #define KVM_CAP_HYPERV_SPIN 46 |
| 527 | #define KVM_CAP_PCI_SEGMENT 47 |
| 528 | #define KVM_CAP_PPC_PAIRED_SINGLES 48 |
| 529 | #define KVM_CAP_INTR_SHADOW 49 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 530 | #ifdef __KVM_HAVE_DEBUGREGS |
| 531 | #define KVM_CAP_DEBUGREGS 50 |
| 532 | #endif |
| 533 | #define KVM_CAP_X86_ROBUST_SINGLESTEP 51 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 534 | #define KVM_CAP_PPC_OSI 52 |
| 535 | #define KVM_CAP_PPC_UNSET_IRQ 53 |
| 536 | #define KVM_CAP_ENABLE_CAP 54 |
| 537 | #ifdef __KVM_HAVE_XSAVE |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 538 | #define KVM_CAP_XSAVE 55 |
| 539 | #endif |
| 540 | #ifdef __KVM_HAVE_XCRS |
| 541 | #define KVM_CAP_XCRS 56 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 542 | #endif |
| 543 | #define KVM_CAP_PPC_GET_PVINFO 57 |
| 544 | #define KVM_CAP_PPC_IRQ_LEVEL 58 |
| 545 | #define KVM_CAP_ASYNC_PF 59 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 546 | #define KVM_CAP_TSC_CONTROL 60 |
| 547 | #define KVM_CAP_GET_TSC_KHZ 61 |
| 548 | #define KVM_CAP_PPC_BOOKE_SREGS 62 |
| 549 | #define KVM_CAP_SPAPR_TCE 63 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 550 | #define KVM_CAP_PPC_SMT 64 |
| 551 | #define KVM_CAP_PPC_RMA 65 |
| 552 | #define KVM_CAP_MAX_VCPUS 66 |
| 553 | #define KVM_CAP_PPC_HIOR 67 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 554 | #define KVM_CAP_PPC_PAPR 68 |
| 555 | #define KVM_CAP_SW_TLB 69 |
| 556 | #define KVM_CAP_ONE_REG 70 |
| 557 | #define KVM_CAP_S390_GMAP 71 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 558 | #define KVM_CAP_TSC_DEADLINE_TIMER 72 |
| 559 | #define KVM_CAP_S390_UCONTROL 73 |
| 560 | #define KVM_CAP_SYNC_REGS 74 |
| 561 | #define KVM_CAP_PCI_2_3 75 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 562 | #define KVM_CAP_KVMCLOCK_CTRL 76 |
| 563 | #define KVM_CAP_SIGNAL_MSI 77 |
| 564 | #define KVM_CAP_PPC_GET_SMMU_INFO 78 |
| 565 | #define KVM_CAP_S390_COW 79 |
Christopher Ferris | 82d7504 | 2015-01-26 10:57:07 -0800 | [diff] [blame] | 566 | #define KVM_CAP_PPC_ALLOC_HTAB 80 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 567 | #define KVM_CAP_READONLY_MEM 81 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 568 | #define KVM_CAP_IRQFD_RESAMPLE 82 |
| 569 | #define KVM_CAP_PPC_BOOKE_WATCHDOG 83 |
| 570 | #define KVM_CAP_PPC_HTAB_FD 84 |
| 571 | #define KVM_CAP_S390_CSS_SUPPORT 85 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 572 | #define KVM_CAP_PPC_EPR 86 |
| 573 | #define KVM_CAP_ARM_PSCI 87 |
| 574 | #define KVM_CAP_ARM_SET_DEVICE_ADDR 88 |
| 575 | #define KVM_CAP_DEVICE_CTRL 89 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 576 | #define KVM_CAP_IRQ_MPIC 90 |
| 577 | #define KVM_CAP_PPC_RTAS 91 |
| 578 | #define KVM_CAP_IRQ_XICS 92 |
Christopher Ferris | 38062f9 | 2014-07-09 15:33:25 -0700 | [diff] [blame] | 579 | #define KVM_CAP_ARM_EL1_32BIT 93 |
| 580 | #define KVM_CAP_SPAPR_MULTITCE 94 |
Christopher Ferris | 38062f9 | 2014-07-09 15:33:25 -0700 | [diff] [blame] | 581 | #define KVM_CAP_EXT_EMUL_CPUID 95 |
| 582 | #define KVM_CAP_HYPERV_TIME 96 |
Christopher Ferris | ba8d4f4 | 2014-09-03 19:56:49 -0700 | [diff] [blame] | 583 | #define KVM_CAP_IOAPIC_POLARITY_IGNORED 97 |
| 584 | #define KVM_CAP_ENABLE_CAP_VM 98 |
| 585 | #define KVM_CAP_S390_IRQCHIP 99 |
Christopher Ferris | ba8d4f4 | 2014-09-03 19:56:49 -0700 | [diff] [blame] | 586 | #define KVM_CAP_IOEVENTFD_NO_LENGTH 100 |
| 587 | #define KVM_CAP_VM_ATTRIBUTES 101 |
| 588 | #define KVM_CAP_ARM_PSCI_0_2 102 |
| 589 | #define KVM_CAP_PPC_FIXUP_HCALL 103 |
Christopher Ferris | 82d7504 | 2015-01-26 10:57:07 -0800 | [diff] [blame] | 590 | #define KVM_CAP_PPC_ENABLE_HCALL 104 |
| 591 | #define KVM_CAP_CHECK_EXTENSION_VM 105 |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 592 | #define KVM_CAP_S390_USER_SIGP 106 |
| 593 | #define KVM_CAP_S390_VECTOR_REGISTERS 107 |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 594 | #define KVM_CAP_S390_MEM_OP 108 |
| 595 | #define KVM_CAP_S390_USER_STSI 109 |
| 596 | #define KVM_CAP_S390_SKEYS 110 |
| 597 | #define KVM_CAP_MIPS_FPU 111 |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 598 | #define KVM_CAP_MIPS_MSA 112 |
| 599 | #define KVM_CAP_S390_INJECT_IRQ 113 |
| 600 | #define KVM_CAP_S390_IRQ_STATE 114 |
| 601 | #define KVM_CAP_PPC_HWRNG 115 |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 602 | #define KVM_CAP_DISABLE_QUIRKS 116 |
| 603 | #define KVM_CAP_X86_SMM 117 |
| 604 | #define KVM_CAP_MULTI_ADDRESS_SPACE 118 |
| 605 | #define KVM_CAP_GUEST_DEBUG_HW_BPS 119 |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 606 | #define KVM_CAP_GUEST_DEBUG_HW_WPS 120 |
| 607 | #define KVM_CAP_SPLIT_IRQCHIP 121 |
| 608 | #define KVM_CAP_IOEVENTFD_ANY_LENGTH 122 |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 609 | #define KVM_CAP_HYPERV_SYNIC 123 |
| 610 | #define KVM_CAP_S390_RI 124 |
| 611 | #define KVM_CAP_SPAPR_TCE_64 125 |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 612 | #define KVM_CAP_ARM_PMU_V3 126 |
| 613 | #define KVM_CAP_VCPU_ATTRIBUTES 127 |
| 614 | #define KVM_CAP_MAX_VCPU_ID 128 |
Christopher Ferris | 49f525c | 2016-12-12 14:55:36 -0800 | [diff] [blame] | 615 | #define KVM_CAP_X2APIC_API 129 |
Christopher Ferris | 49f525c | 2016-12-12 14:55:36 -0800 | [diff] [blame] | 616 | #define KVM_CAP_S390_USER_INSTR0 130 |
| 617 | #define KVM_CAP_MSI_DEVID 131 |
| 618 | #define KVM_CAP_PPC_HTM 132 |
Christopher Ferris | 525ce91 | 2017-07-26 13:12:53 -0700 | [diff] [blame] | 619 | #define KVM_CAP_SPAPR_RESIZE_HPT 133 |
| 620 | #define KVM_CAP_PPC_MMU_RADIX 134 |
| 621 | #define KVM_CAP_PPC_MMU_HASH_V3 135 |
| 622 | #define KVM_CAP_IMMEDIATE_EXIT 136 |
| 623 | #define KVM_CAP_MIPS_VZ 137 |
| 624 | #define KVM_CAP_MIPS_TE 138 |
| 625 | #define KVM_CAP_MIPS_64BIT 139 |
| 626 | #define KVM_CAP_S390_GS 140 |
| 627 | #define KVM_CAP_S390_AIS 141 |
| 628 | #define KVM_CAP_SPAPR_TCE_VFIO 142 |
Christopher Ferris | 76a1d45 | 2018-06-27 14:12:29 -0700 | [diff] [blame] | 629 | #define KVM_CAP_X86_DISABLE_EXITS 143 |
Christopher Ferris | 525ce91 | 2017-07-26 13:12:53 -0700 | [diff] [blame] | 630 | #define KVM_CAP_ARM_USER_IRQ 144 |
Christopher Ferris | 1308ad3 | 2017-11-14 17:32:13 -0800 | [diff] [blame] | 631 | #define KVM_CAP_S390_CMMA_MIGRATION 145 |
| 632 | #define KVM_CAP_PPC_FWNMI 146 |
| 633 | #define KVM_CAP_PPC_SMT_POSSIBLE 147 |
| 634 | #define KVM_CAP_HYPERV_SYNIC2 148 |
| 635 | #define KVM_CAP_HYPERV_VP_INDEX 149 |
Christopher Ferris | 934ec94 | 2018-01-31 15:29:16 -0800 | [diff] [blame] | 636 | #define KVM_CAP_S390_AIS_MIGRATION 150 |
| 637 | #define KVM_CAP_PPC_GET_CPU_CHAR 151 |
| 638 | #define KVM_CAP_S390_BPB 152 |
Christopher Ferris | 76a1d45 | 2018-06-27 14:12:29 -0700 | [diff] [blame] | 639 | #define KVM_CAP_GET_MSR_FEATURES 153 |
| 640 | #define KVM_CAP_HYPERV_EVENTFD 154 |
Christopher Ferris | 9ce2884 | 2018-10-25 12:11:39 -0700 | [diff] [blame] | 641 | #define KVM_CAP_HYPERV_TLBFLUSH 155 |
| 642 | #define KVM_CAP_S390_HPAGE_1M 156 |
| 643 | #define KVM_CAP_NESTED_STATE 157 |
| 644 | #define KVM_CAP_ARM_INJECT_SERROR_ESR 158 |
| 645 | #define KVM_CAP_MSR_PLATFORM_INFO 159 |
Christopher Ferris | 86a4837 | 2019-01-10 14:14:59 -0800 | [diff] [blame] | 646 | #define KVM_CAP_PPC_NESTED_HV 160 |
| 647 | #define KVM_CAP_HYPERV_SEND_IPI 161 |
| 648 | #define KVM_CAP_COALESCED_PIO 162 |
| 649 | #define KVM_CAP_HYPERV_ENLIGHTENED_VMCS 163 |
| 650 | #define KVM_CAP_EXCEPTION_PAYLOAD 164 |
| 651 | #define KVM_CAP_ARM_VM_IPA_SIZE 165 |
Christopher Ferris | d842e43 | 2019-03-07 10:21:59 -0800 | [diff] [blame] | 652 | #define KVM_CAP_MANUAL_DIRTY_LOG_PROTECT 166 |
| 653 | #define KVM_CAP_HYPERV_CPUID 167 |
Christopher Ferris | aeddbcf | 2019-07-08 12:45:46 -0700 | [diff] [blame] | 654 | #define KVM_CAP_MANUAL_DIRTY_LOG_PROTECT2 168 |
| 655 | #define KVM_CAP_PPC_IRQ_XIVE 169 |
| 656 | #define KVM_CAP_ARM_SVE 170 |
| 657 | #define KVM_CAP_ARM_PTRAUTH_ADDRESS 171 |
| 658 | #define KVM_CAP_ARM_PTRAUTH_GENERIC 172 |
Christopher Ferris | b8a95e2 | 2019-10-02 18:29:20 -0700 | [diff] [blame] | 659 | #define KVM_CAP_PMU_EVENT_FILTER 173 |
Christopher Ferris | 9584fa4 | 2019-12-09 15:36:13 -0800 | [diff] [blame] | 660 | #define KVM_CAP_ARM_IRQ_LINE_LAYOUT_2 174 |
| 661 | #define KVM_CAP_HYPERV_DIRECT_TLBFLUSH 175 |
Christopher Ferris | d32ca14 | 2020-02-04 16:16:51 -0800 | [diff] [blame] | 662 | #define KVM_CAP_PPC_GUEST_DEBUG_SSTEP 176 |
| 663 | #define KVM_CAP_ARM_NISV_TO_USER 177 |
| 664 | #define KVM_CAP_ARM_INJECT_EXT_DABT 178 |
Christopher Ferris | bb9fcb4 | 2020-04-06 11:38:04 -0700 | [diff] [blame] | 665 | #define KVM_CAP_S390_VCPU_RESETS 179 |
Christopher Ferris | af09c70 | 2020-06-01 20:29:29 -0700 | [diff] [blame] | 666 | #define KVM_CAP_S390_PROTECTED 180 |
| 667 | #define KVM_CAP_PPC_SECURE_GUEST 181 |
Christopher Ferris | 8177cdf | 2020-08-03 11:53:55 -0700 | [diff] [blame] | 668 | #define KVM_CAP_HALT_POLL 182 |
| 669 | #define KVM_CAP_ASYNC_PF_INT 183 |
Christopher Ferris | 25c18d4 | 2020-10-14 17:42:58 -0700 | [diff] [blame] | 670 | #define KVM_CAP_LAST_CPU 184 |
| 671 | #define KVM_CAP_SMALLER_MAXPHYADDR 185 |
| 672 | #define KVM_CAP_S390_DIAG318 186 |
| 673 | #define KVM_CAP_STEAL_TIME 187 |
Christopher Ferris | 32ff3f8 | 2020-12-14 13:10:04 -0800 | [diff] [blame] | 674 | #define KVM_CAP_X86_USER_SPACE_MSR 188 |
| 675 | #define KVM_CAP_X86_MSR_FILTER 189 |
| 676 | #define KVM_CAP_ENFORCE_PV_FEATURE_CPUID 190 |
Christopher Ferris | 05667cd | 2021-02-16 16:01:34 -0800 | [diff] [blame] | 677 | #define KVM_CAP_SYS_HYPERV_CPUID 191 |
| 678 | #define KVM_CAP_DIRTY_LOG_RING 192 |
Christopher Ferris | a9750ed | 2021-05-03 14:02:49 -0700 | [diff] [blame] | 679 | #define KVM_CAP_X86_BUS_LOCK_EXIT 193 |
| 680 | #define KVM_CAP_PPC_DAWR1 194 |
Christopher Ferris | fcc3b4f | 2021-07-01 01:30:21 +0000 | [diff] [blame] | 681 | #define KVM_CAP_SET_GUEST_DEBUG2 195 |
| 682 | #define KVM_CAP_SGX_ATTRIBUTE 196 |
| 683 | #define KVM_CAP_VM_COPY_ENC_CONTEXT_FROM 197 |
| 684 | #define KVM_CAP_PTP_KVM 198 |
Christopher Ferris | 3a39c0b | 2021-09-02 00:03:38 +0000 | [diff] [blame] | 685 | #define KVM_CAP_HYPERV_ENFORCE_CPUID 199 |
| 686 | #define KVM_CAP_SREGS2 200 |
| 687 | #define KVM_CAP_EXIT_HYPERCALL 201 |
| 688 | #define KVM_CAP_PPC_RPT_INVALIDATE 202 |
| 689 | #define KVM_CAP_BINARY_STATS_FD 203 |
| 690 | #define KVM_CAP_EXIT_ON_EMULATION_FAILURE 204 |
| 691 | #define KVM_CAP_ARM_MTE 205 |
Christopher Ferris | a479261 | 2022-01-10 13:51:15 -0800 | [diff] [blame] | 692 | #define KVM_CAP_VM_MOVE_ENC_CONTEXT_FROM 206 |
Christopher Ferris | 1ed5534 | 2022-03-22 16:06:25 -0700 | [diff] [blame] | 693 | #define KVM_CAP_VM_GPA_BITS 207 |
| 694 | #define KVM_CAP_XSAVE2 208 |
| 695 | #define KVM_CAP_SYS_ATTRIBUTES 209 |
| 696 | #define KVM_CAP_PPC_AIL_MODE_3 210 |
Christopher Ferris | 10a76e6 | 2022-06-08 13:31:52 -0700 | [diff] [blame] | 697 | #define KVM_CAP_S390_MEM_OP_EXTENSION 211 |
| 698 | #define KVM_CAP_PMU_CAPABILITY 212 |
| 699 | #define KVM_CAP_DISABLE_QUIRKS2 213 |
Christopher Ferris | 80ae69d | 2022-08-02 16:32:21 -0700 | [diff] [blame] | 700 | #define KVM_CAP_VM_TSC_CONTROL 214 |
Christopher Ferris | 10a76e6 | 2022-06-08 13:31:52 -0700 | [diff] [blame] | 701 | #define KVM_CAP_SYSTEM_EVENT_DATA 215 |
Christopher Ferris | 80ae69d | 2022-08-02 16:32:21 -0700 | [diff] [blame] | 702 | #define KVM_CAP_ARM_SYSTEM_SUSPEND 216 |
Christopher Ferris | 7447a1c | 2022-10-04 18:24:44 -0700 | [diff] [blame] | 703 | #define KVM_CAP_S390_PROTECTED_DUMP 217 |
| 704 | #define KVM_CAP_X86_TRIPLE_FAULT_EVENT 218 |
| 705 | #define KVM_CAP_X86_NOTIFY_VMEXIT 219 |
| 706 | #define KVM_CAP_VM_DISABLE_NX_HUGE_PAGES 220 |
| 707 | #define KVM_CAP_S390_ZPCI_OP 221 |
| 708 | #define KVM_CAP_S390_CPU_TOPOLOGY 222 |
Christopher Ferris | 6cd53a5 | 2022-12-12 23:39:16 +0000 | [diff] [blame] | 709 | #define KVM_CAP_DIRTY_LOG_RING_ACQ_REL 223 |
Christopher Ferris | 8b7fdc9 | 2023-02-21 13:36:32 -0800 | [diff] [blame] | 710 | #define KVM_CAP_S390_PROTECTED_ASYNC_DISABLE 224 |
| 711 | #define KVM_CAP_DIRTY_LOG_RING_WITH_BITMAP 225 |
Christopher Ferris | b7cef6d | 2023-05-09 19:04:15 +0000 | [diff] [blame] | 712 | #define KVM_CAP_PMU_EVENT_MASKED_EVENTS 226 |
Christopher Ferris | 37c3f3c | 2023-07-10 10:59:05 -0700 | [diff] [blame] | 713 | #define KVM_CAP_COUNTER_OFFSET 227 |
Christopher Ferris | 8666d04 | 2023-09-06 14:55:31 -0700 | [diff] [blame] | 714 | #define KVM_CAP_ARM_EAGER_SPLIT_CHUNK_SIZE 228 |
| 715 | #define KVM_CAP_ARM_SUPPORTED_BLOCK_SIZES 229 |
Christopher Ferris | 0f79521 | 2024-01-17 14:17:28 -0800 | [diff] [blame] | 716 | #define KVM_CAP_ARM_SUPPORTED_REG_MASK_RANGES 230 |
Christopher Ferris | b830ddf | 2024-03-28 11:48:08 -0700 | [diff] [blame] | 717 | #define KVM_CAP_USER_MEMORY2 231 |
| 718 | #define KVM_CAP_MEMORY_FAULT_INFO 232 |
| 719 | #define KVM_CAP_MEMORY_ATTRIBUTES 233 |
| 720 | #define KVM_CAP_GUEST_MEMFD 234 |
| 721 | #define KVM_CAP_VM_TYPES 235 |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 722 | struct kvm_irq_routing_irqchip { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 723 | __u32 irqchip; |
| 724 | __u32 pin; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 725 | }; |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 726 | struct kvm_irq_routing_msi { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 727 | __u32 address_lo; |
| 728 | __u32 address_hi; |
| 729 | __u32 data; |
Christopher Ferris | 49f525c | 2016-12-12 14:55:36 -0800 | [diff] [blame] | 730 | union { |
| 731 | __u32 pad; |
| 732 | __u32 devid; |
| 733 | }; |
Christopher Ferris | ba8d4f4 | 2014-09-03 19:56:49 -0700 | [diff] [blame] | 734 | }; |
| 735 | struct kvm_irq_routing_s390_adapter { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 736 | __u64 ind_addr; |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 737 | __u64 summary_addr; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 738 | __u64 ind_offset; |
| 739 | __u32 summary_offset; |
| 740 | __u32 adapter_id; |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 741 | }; |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 742 | struct kvm_irq_routing_hv_sint { |
| 743 | __u32 vcpu; |
| 744 | __u32 sint; |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 745 | }; |
Christopher Ferris | 1ed5534 | 2022-03-22 16:06:25 -0700 | [diff] [blame] | 746 | struct kvm_irq_routing_xen_evtchn { |
| 747 | __u32 port; |
| 748 | __u32 vcpu; |
| 749 | __u32 priority; |
| 750 | }; |
| 751 | #define KVM_IRQ_ROUTING_XEN_EVTCHN_PRIO_2LEVEL ((__u32) (- 1)) |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 752 | #define KVM_IRQ_ROUTING_IRQCHIP 1 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 753 | #define KVM_IRQ_ROUTING_MSI 2 |
Christopher Ferris | ba8d4f4 | 2014-09-03 19:56:49 -0700 | [diff] [blame] | 754 | #define KVM_IRQ_ROUTING_S390_ADAPTER 3 |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 755 | #define KVM_IRQ_ROUTING_HV_SINT 4 |
Christopher Ferris | 1ed5534 | 2022-03-22 16:06:25 -0700 | [diff] [blame] | 756 | #define KVM_IRQ_ROUTING_XEN_EVTCHN 5 |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 757 | struct kvm_irq_routing_entry { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 758 | __u32 gsi; |
| 759 | __u32 type; |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 760 | __u32 flags; |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 761 | __u32 pad; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 762 | union { |
| 763 | struct kvm_irq_routing_irqchip irqchip; |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 764 | struct kvm_irq_routing_msi msi; |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 765 | struct kvm_irq_routing_s390_adapter adapter; |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 766 | struct kvm_irq_routing_hv_sint hv_sint; |
Christopher Ferris | 1ed5534 | 2022-03-22 16:06:25 -0700 | [diff] [blame] | 767 | struct kvm_irq_routing_xen_evtchn xen_evtchn; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 768 | __u32 pad[8]; |
| 769 | } u; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 770 | }; |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 771 | struct kvm_irq_routing { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 772 | __u32 nr; |
| 773 | __u32 flags; |
Christopher Ferris | 7447a1c | 2022-10-04 18:24:44 -0700 | [diff] [blame] | 774 | struct kvm_irq_routing_entry entries[]; |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 775 | }; |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 776 | #define KVM_IRQFD_FLAG_DEASSIGN (1 << 0) |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 777 | #define KVM_IRQFD_FLAG_RESAMPLE (1 << 1) |
| 778 | struct kvm_irqfd { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 779 | __u32 fd; |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 780 | __u32 gsi; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 781 | __u32 flags; |
| 782 | __u32 resamplefd; |
| 783 | __u8 pad[16]; |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 784 | }; |
Christopher Ferris | 6a9755d | 2017-01-13 14:09:31 -0800 | [diff] [blame] | 785 | #define KVM_CLOCK_TSC_STABLE 2 |
Christopher Ferris | a479261 | 2022-01-10 13:51:15 -0800 | [diff] [blame] | 786 | #define KVM_CLOCK_REALTIME (1 << 2) |
| 787 | #define KVM_CLOCK_HOST_TSC (1 << 3) |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 788 | struct kvm_clock_data { |
Christopher Ferris | 6a9755d | 2017-01-13 14:09:31 -0800 | [diff] [blame] | 789 | __u64 clock; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 790 | __u32 flags; |
Christopher Ferris | a479261 | 2022-01-10 13:51:15 -0800 | [diff] [blame] | 791 | __u32 pad0; |
| 792 | __u64 realtime; |
| 793 | __u64 host_tsc; |
| 794 | __u32 pad[4]; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 795 | }; |
Christopher Ferris | 6a9755d | 2017-01-13 14:09:31 -0800 | [diff] [blame] | 796 | #define KVM_MMU_FSL_BOOKE_NOHV 0 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 797 | #define KVM_MMU_FSL_BOOKE_HV 1 |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 798 | struct kvm_config_tlb { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 799 | __u64 params; |
Christopher Ferris | 6a9755d | 2017-01-13 14:09:31 -0800 | [diff] [blame] | 800 | __u64 array; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 801 | __u32 mmu_type; |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 802 | __u32 array_len; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 803 | }; |
Christopher Ferris | 6a9755d | 2017-01-13 14:09:31 -0800 | [diff] [blame] | 804 | struct kvm_dirty_tlb { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 805 | __u64 bitmap; |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 806 | __u32 num_dirty; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 807 | }; |
Christopher Ferris | 6a9755d | 2017-01-13 14:09:31 -0800 | [diff] [blame] | 808 | #define KVM_REG_ARCH_MASK 0xff00000000000000ULL |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 809 | #define KVM_REG_GENERIC 0x0000000000000000ULL |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 810 | #define KVM_REG_PPC 0x1000000000000000ULL |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 811 | #define KVM_REG_X86 0x2000000000000000ULL |
Christopher Ferris | 6a9755d | 2017-01-13 14:09:31 -0800 | [diff] [blame] | 812 | #define KVM_REG_IA64 0x3000000000000000ULL |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 813 | #define KVM_REG_ARM 0x4000000000000000ULL |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 814 | #define KVM_REG_S390 0x5000000000000000ULL |
Christopher Ferris | 38062f9 | 2014-07-09 15:33:25 -0700 | [diff] [blame] | 815 | #define KVM_REG_ARM64 0x6000000000000000ULL |
Christopher Ferris | 6a9755d | 2017-01-13 14:09:31 -0800 | [diff] [blame] | 816 | #define KVM_REG_MIPS 0x7000000000000000ULL |
Christopher Ferris | 9584fa4 | 2019-12-09 15:36:13 -0800 | [diff] [blame] | 817 | #define KVM_REG_RISCV 0x8000000000000000ULL |
Christopher Ferris | 0f79521 | 2024-01-17 14:17:28 -0800 | [diff] [blame] | 818 | #define KVM_REG_LOONGARCH 0x9000000000000000ULL |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 819 | #define KVM_REG_SIZE_SHIFT 52 |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 820 | #define KVM_REG_SIZE_MASK 0x00f0000000000000ULL |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 821 | #define KVM_REG_SIZE_U8 0x0000000000000000ULL |
Christopher Ferris | 6a9755d | 2017-01-13 14:09:31 -0800 | [diff] [blame] | 822 | #define KVM_REG_SIZE_U16 0x0010000000000000ULL |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 823 | #define KVM_REG_SIZE_U32 0x0020000000000000ULL |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 824 | #define KVM_REG_SIZE_U64 0x0030000000000000ULL |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 825 | #define KVM_REG_SIZE_U128 0x0040000000000000ULL |
Christopher Ferris | 6a9755d | 2017-01-13 14:09:31 -0800 | [diff] [blame] | 826 | #define KVM_REG_SIZE_U256 0x0050000000000000ULL |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 827 | #define KVM_REG_SIZE_U512 0x0060000000000000ULL |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 828 | #define KVM_REG_SIZE_U1024 0x0070000000000000ULL |
Christopher Ferris | aeddbcf | 2019-07-08 12:45:46 -0700 | [diff] [blame] | 829 | #define KVM_REG_SIZE_U2048 0x0080000000000000ULL |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 830 | struct kvm_reg_list { |
Christopher Ferris | 6a9755d | 2017-01-13 14:09:31 -0800 | [diff] [blame] | 831 | __u64 n; |
Christopher Ferris | 7447a1c | 2022-10-04 18:24:44 -0700 | [diff] [blame] | 832 | __u64 reg[]; |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 833 | }; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 834 | struct kvm_one_reg { |
Christopher Ferris | 6a9755d | 2017-01-13 14:09:31 -0800 | [diff] [blame] | 835 | __u64 id; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 836 | __u64 addr; |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 837 | }; |
Christopher Ferris | 49f525c | 2016-12-12 14:55:36 -0800 | [diff] [blame] | 838 | #define KVM_MSI_VALID_DEVID (1U << 0) |
Christopher Ferris | 6a9755d | 2017-01-13 14:09:31 -0800 | [diff] [blame] | 839 | struct kvm_msi { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 840 | __u32 address_lo; |
| 841 | __u32 address_hi; |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 842 | __u32 data; |
Christopher Ferris | 6a9755d | 2017-01-13 14:09:31 -0800 | [diff] [blame] | 843 | __u32 flags; |
Christopher Ferris | 49f525c | 2016-12-12 14:55:36 -0800 | [diff] [blame] | 844 | __u32 devid; |
| 845 | __u8 pad[12]; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 846 | }; |
Christopher Ferris | 6a9755d | 2017-01-13 14:09:31 -0800 | [diff] [blame] | 847 | struct kvm_arm_device_addr { |
Christopher Ferris | 49f525c | 2016-12-12 14:55:36 -0800 | [diff] [blame] | 848 | __u64 id; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 849 | __u64 addr; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 850 | }; |
Christopher Ferris | 6a9755d | 2017-01-13 14:09:31 -0800 | [diff] [blame] | 851 | #define KVM_CREATE_DEVICE_TEST 1 |
Christopher Ferris | 49f525c | 2016-12-12 14:55:36 -0800 | [diff] [blame] | 852 | struct kvm_create_device { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 853 | __u32 type; |
| 854 | __u32 fd; |
Christopher Ferris | 6a9755d | 2017-01-13 14:09:31 -0800 | [diff] [blame] | 855 | __u32 flags; |
Christopher Ferris | 49f525c | 2016-12-12 14:55:36 -0800 | [diff] [blame] | 856 | }; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 857 | struct kvm_device_attr { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 858 | __u32 flags; |
Christopher Ferris | 6a9755d | 2017-01-13 14:09:31 -0800 | [diff] [blame] | 859 | __u32 group; |
Christopher Ferris | 49f525c | 2016-12-12 14:55:36 -0800 | [diff] [blame] | 860 | __u64 attr; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 861 | __u64 addr; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 862 | }; |
Christopher Ferris | 67d1e5e | 2023-10-31 13:36:37 -0700 | [diff] [blame] | 863 | #define KVM_DEV_VFIO_FILE 1 |
| 864 | #define KVM_DEV_VFIO_FILE_ADD 1 |
| 865 | #define KVM_DEV_VFIO_FILE_DEL 2 |
| 866 | #define KVM_DEV_VFIO_GROUP KVM_DEV_VFIO_FILE |
| 867 | #define KVM_DEV_VFIO_GROUP_ADD KVM_DEV_VFIO_FILE_ADD |
| 868 | #define KVM_DEV_VFIO_GROUP_DEL KVM_DEV_VFIO_FILE_DEL |
Christopher Ferris | 525ce91 | 2017-07-26 13:12:53 -0700 | [diff] [blame] | 869 | #define KVM_DEV_VFIO_GROUP_SET_SPAPR_TCE 3 |
Christopher Ferris | 82d7504 | 2015-01-26 10:57:07 -0800 | [diff] [blame] | 870 | enum kvm_device_type { |
Christopher Ferris | 6a9755d | 2017-01-13 14:09:31 -0800 | [diff] [blame] | 871 | KVM_DEV_TYPE_FSL_MPIC_20 = 1, |
Christopher Ferris | 49f525c | 2016-12-12 14:55:36 -0800 | [diff] [blame] | 872 | #define KVM_DEV_TYPE_FSL_MPIC_20 KVM_DEV_TYPE_FSL_MPIC_20 |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 873 | KVM_DEV_TYPE_FSL_MPIC_42, |
Christopher Ferris | 82d7504 | 2015-01-26 10:57:07 -0800 | [diff] [blame] | 874 | #define KVM_DEV_TYPE_FSL_MPIC_42 KVM_DEV_TYPE_FSL_MPIC_42 |
Christopher Ferris | 6a9755d | 2017-01-13 14:09:31 -0800 | [diff] [blame] | 875 | KVM_DEV_TYPE_XICS, |
Christopher Ferris | 49f525c | 2016-12-12 14:55:36 -0800 | [diff] [blame] | 876 | #define KVM_DEV_TYPE_XICS KVM_DEV_TYPE_XICS |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 877 | KVM_DEV_TYPE_VFIO, |
Christopher Ferris | 82d7504 | 2015-01-26 10:57:07 -0800 | [diff] [blame] | 878 | #define KVM_DEV_TYPE_VFIO KVM_DEV_TYPE_VFIO |
Christopher Ferris | 6a9755d | 2017-01-13 14:09:31 -0800 | [diff] [blame] | 879 | KVM_DEV_TYPE_ARM_VGIC_V2, |
Christopher Ferris | 49f525c | 2016-12-12 14:55:36 -0800 | [diff] [blame] | 880 | #define KVM_DEV_TYPE_ARM_VGIC_V2 KVM_DEV_TYPE_ARM_VGIC_V2 |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 881 | KVM_DEV_TYPE_FLIC, |
Christopher Ferris | 82d7504 | 2015-01-26 10:57:07 -0800 | [diff] [blame] | 882 | #define KVM_DEV_TYPE_FLIC KVM_DEV_TYPE_FLIC |
Christopher Ferris | 6a9755d | 2017-01-13 14:09:31 -0800 | [diff] [blame] | 883 | KVM_DEV_TYPE_ARM_VGIC_V3, |
Christopher Ferris | 49f525c | 2016-12-12 14:55:36 -0800 | [diff] [blame] | 884 | #define KVM_DEV_TYPE_ARM_VGIC_V3 KVM_DEV_TYPE_ARM_VGIC_V3 |
| 885 | KVM_DEV_TYPE_ARM_VGIC_ITS, |
| 886 | #define KVM_DEV_TYPE_ARM_VGIC_ITS KVM_DEV_TYPE_ARM_VGIC_ITS |
Christopher Ferris | aeddbcf | 2019-07-08 12:45:46 -0700 | [diff] [blame] | 887 | KVM_DEV_TYPE_XIVE, |
| 888 | #define KVM_DEV_TYPE_XIVE KVM_DEV_TYPE_XIVE |
Christopher Ferris | d32ca14 | 2020-02-04 16:16:51 -0800 | [diff] [blame] | 889 | KVM_DEV_TYPE_ARM_PV_TIME, |
| 890 | #define KVM_DEV_TYPE_ARM_PV_TIME KVM_DEV_TYPE_ARM_PV_TIME |
Christopher Ferris | 8666d04 | 2023-09-06 14:55:31 -0700 | [diff] [blame] | 891 | KVM_DEV_TYPE_RISCV_AIA, |
| 892 | #define KVM_DEV_TYPE_RISCV_AIA KVM_DEV_TYPE_RISCV_AIA |
Christopher Ferris | 6a9755d | 2017-01-13 14:09:31 -0800 | [diff] [blame] | 893 | KVM_DEV_TYPE_MAX, |
Christopher Ferris | 82d7504 | 2015-01-26 10:57:07 -0800 | [diff] [blame] | 894 | }; |
Christopher Ferris | 525ce91 | 2017-07-26 13:12:53 -0700 | [diff] [blame] | 895 | struct kvm_vfio_spapr_tce { |
| 896 | __s32 groupfd; |
| 897 | __s32 tablefd; |
| 898 | }; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 899 | #define KVM_CREATE_VCPU _IO(KVMIO, 0x41) |
Christopher Ferris | 6a9755d | 2017-01-13 14:09:31 -0800 | [diff] [blame] | 900 | #define KVM_GET_DIRTY_LOG _IOW(KVMIO, 0x42, struct kvm_dirty_log) |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 901 | #define KVM_SET_NR_MMU_PAGES _IO(KVMIO, 0x44) |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 902 | #define KVM_GET_NR_MMU_PAGES _IO(KVMIO, 0x45) |
Christopher Ferris | 6a9755d | 2017-01-13 14:09:31 -0800 | [diff] [blame] | 903 | #define KVM_SET_USER_MEMORY_REGION _IOW(KVMIO, 0x46, struct kvm_userspace_memory_region) |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 904 | #define KVM_SET_TSS_ADDR _IO(KVMIO, 0x47) |
| 905 | #define KVM_SET_IDENTITY_MAP_ADDR _IOW(KVMIO, 0x48, __u64) |
Christopher Ferris | b830ddf | 2024-03-28 11:48:08 -0700 | [diff] [blame] | 906 | #define KVM_SET_USER_MEMORY_REGION2 _IOW(KVMIO, 0x49, struct kvm_userspace_memory_region2) |
Christopher Ferris | 6a9755d | 2017-01-13 14:09:31 -0800 | [diff] [blame] | 907 | #define KVM_S390_UCAS_MAP _IOW(KVMIO, 0x50, struct kvm_s390_ucas_mapping) |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 908 | #define KVM_S390_UCAS_UNMAP _IOW(KVMIO, 0x51, struct kvm_s390_ucas_mapping) |
| 909 | #define KVM_S390_VCPU_FAULT _IOW(KVMIO, 0x52, unsigned long) |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 910 | #define KVM_CREATE_IRQCHIP _IO(KVMIO, 0x60) |
Christopher Ferris | 6a9755d | 2017-01-13 14:09:31 -0800 | [diff] [blame] | 911 | #define KVM_IRQ_LINE _IOW(KVMIO, 0x61, struct kvm_irq_level) |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 912 | #define KVM_GET_IRQCHIP _IOWR(KVMIO, 0x62, struct kvm_irqchip) |
| 913 | #define KVM_SET_IRQCHIP _IOR(KVMIO, 0x63, struct kvm_irqchip) |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 914 | #define KVM_CREATE_PIT _IO(KVMIO, 0x64) |
Christopher Ferris | 6a9755d | 2017-01-13 14:09:31 -0800 | [diff] [blame] | 915 | #define KVM_GET_PIT _IOWR(KVMIO, 0x65, struct kvm_pit_state) |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 916 | #define KVM_SET_PIT _IOR(KVMIO, 0x66, struct kvm_pit_state) |
| 917 | #define KVM_IRQ_LINE_STATUS _IOWR(KVMIO, 0x67, struct kvm_irq_level) |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 918 | #define KVM_REGISTER_COALESCED_MMIO _IOW(KVMIO, 0x67, struct kvm_coalesced_mmio_zone) |
Christopher Ferris | 6a9755d | 2017-01-13 14:09:31 -0800 | [diff] [blame] | 919 | #define KVM_UNREGISTER_COALESCED_MMIO _IOW(KVMIO, 0x68, struct kvm_coalesced_mmio_zone) |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 920 | #define KVM_SET_GSI_ROUTING _IOW(KVMIO, 0x6a, struct kvm_irq_routing) |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 921 | #define KVM_REINJECT_CONTROL _IO(KVMIO, 0x71) |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 922 | #define KVM_IRQFD _IOW(KVMIO, 0x76, struct kvm_irqfd) |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 923 | #define KVM_CREATE_PIT2 _IOW(KVMIO, 0x77, struct kvm_pit_config) |
Christopher Ferris | 6a9755d | 2017-01-13 14:09:31 -0800 | [diff] [blame] | 924 | #define KVM_SET_BOOT_CPU_ID _IO(KVMIO, 0x78) |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 925 | #define KVM_IOEVENTFD _IOW(KVMIO, 0x79, struct kvm_ioeventfd) |
| 926 | #define KVM_XEN_HVM_CONFIG _IOW(KVMIO, 0x7a, struct kvm_xen_hvm_config) |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 927 | #define KVM_SET_CLOCK _IOW(KVMIO, 0x7b, struct kvm_clock_data) |
Christopher Ferris | 6a9755d | 2017-01-13 14:09:31 -0800 | [diff] [blame] | 928 | #define KVM_GET_CLOCK _IOR(KVMIO, 0x7c, struct kvm_clock_data) |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 929 | #define KVM_GET_PIT2 _IOR(KVMIO, 0x9f, struct kvm_pit_state2) |
| 930 | #define KVM_SET_PIT2 _IOW(KVMIO, 0xa0, struct kvm_pit_state2) |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 931 | #define KVM_PPC_GET_PVINFO _IOW(KVMIO, 0xa1, struct kvm_ppc_pvinfo) |
Christopher Ferris | 6a9755d | 2017-01-13 14:09:31 -0800 | [diff] [blame] | 932 | #define KVM_SET_TSC_KHZ _IO(KVMIO, 0xa2) |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 933 | #define KVM_GET_TSC_KHZ _IO(KVMIO, 0xa3) |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 934 | #define KVM_SIGNAL_MSI _IOW(KVMIO, 0xa5, struct kvm_msi) |
Christopher Ferris | 6a9755d | 2017-01-13 14:09:31 -0800 | [diff] [blame] | 935 | #define KVM_PPC_GET_SMMU_INFO _IOR(KVMIO, 0xa6, struct kvm_ppc_smmu_info) |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 936 | #define KVM_PPC_ALLOCATE_HTAB _IOWR(KVMIO, 0xa7, __u32) |
| 937 | #define KVM_CREATE_SPAPR_TCE _IOW(KVMIO, 0xa8, struct kvm_create_spapr_tce) |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 938 | #define KVM_CREATE_SPAPR_TCE_64 _IOW(KVMIO, 0xa8, struct kvm_create_spapr_tce_64) |
Christopher Ferris | 6a9755d | 2017-01-13 14:09:31 -0800 | [diff] [blame] | 939 | #define KVM_ALLOCATE_RMA _IOR(KVMIO, 0xa9, struct kvm_allocate_rma) |
Christopher Ferris | 38062f9 | 2014-07-09 15:33:25 -0700 | [diff] [blame] | 940 | #define KVM_PPC_GET_HTAB_FD _IOW(KVMIO, 0xaa, struct kvm_get_htab_fd) |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 941 | #define KVM_ARM_SET_DEVICE_ADDR _IOW(KVMIO, 0xab, struct kvm_arm_device_addr) |
| 942 | #define KVM_PPC_RTAS_DEFINE_TOKEN _IOW(KVMIO, 0xac, struct kvm_rtas_token_args) |
Christopher Ferris | 525ce91 | 2017-07-26 13:12:53 -0700 | [diff] [blame] | 943 | #define KVM_PPC_RESIZE_HPT_PREPARE _IOR(KVMIO, 0xad, struct kvm_ppc_resize_hpt) |
| 944 | #define KVM_PPC_RESIZE_HPT_COMMIT _IOR(KVMIO, 0xae, struct kvm_ppc_resize_hpt) |
| 945 | #define KVM_PPC_CONFIGURE_V3_MMU _IOW(KVMIO, 0xaf, struct kvm_ppc_mmuv3_cfg) |
| 946 | #define KVM_PPC_GET_RMMU_INFO _IOW(KVMIO, 0xb0, struct kvm_ppc_rmmu_info) |
Christopher Ferris | 934ec94 | 2018-01-31 15:29:16 -0800 | [diff] [blame] | 947 | #define KVM_PPC_GET_CPU_CHAR _IOR(KVMIO, 0xb1, struct kvm_ppc_cpu_char) |
Christopher Ferris | b8a95e2 | 2019-10-02 18:29:20 -0700 | [diff] [blame] | 948 | #define KVM_SET_PMU_EVENT_FILTER _IOW(KVMIO, 0xb2, struct kvm_pmu_event_filter) |
Christopher Ferris | d32ca14 | 2020-02-04 16:16:51 -0800 | [diff] [blame] | 949 | #define KVM_PPC_SVM_OFF _IO(KVMIO, 0xb3) |
Christopher Ferris | 3a39c0b | 2021-09-02 00:03:38 +0000 | [diff] [blame] | 950 | #define KVM_ARM_MTE_COPY_TAGS _IOR(KVMIO, 0xb4, struct kvm_arm_copy_mte_tags) |
Christopher Ferris | 37c3f3c | 2023-07-10 10:59:05 -0700 | [diff] [blame] | 951 | #define KVM_ARM_SET_COUNTER_OFFSET _IOW(KVMIO, 0xb5, struct kvm_arm_counter_offset) |
Christopher Ferris | 0f79521 | 2024-01-17 14:17:28 -0800 | [diff] [blame] | 952 | #define KVM_ARM_GET_REG_WRITABLE_MASKS _IOR(KVMIO, 0xb6, struct reg_mask_range) |
Christopher Ferris | 6a9755d | 2017-01-13 14:09:31 -0800 | [diff] [blame] | 953 | #define KVM_CREATE_DEVICE _IOWR(KVMIO, 0xe0, struct kvm_create_device) |
Christopher Ferris | 38062f9 | 2014-07-09 15:33:25 -0700 | [diff] [blame] | 954 | #define KVM_SET_DEVICE_ATTR _IOW(KVMIO, 0xe1, struct kvm_device_attr) |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 955 | #define KVM_GET_DEVICE_ATTR _IOW(KVMIO, 0xe2, struct kvm_device_attr) |
| 956 | #define KVM_HAS_DEVICE_ATTR _IOW(KVMIO, 0xe3, struct kvm_device_attr) |
Christopher Ferris | 6a9755d | 2017-01-13 14:09:31 -0800 | [diff] [blame] | 957 | #define KVM_RUN _IO(KVMIO, 0x80) |
Christopher Ferris | 38062f9 | 2014-07-09 15:33:25 -0700 | [diff] [blame] | 958 | #define KVM_GET_REGS _IOR(KVMIO, 0x81, struct kvm_regs) |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 959 | #define KVM_SET_REGS _IOW(KVMIO, 0x82, struct kvm_regs) |
| 960 | #define KVM_GET_SREGS _IOR(KVMIO, 0x83, struct kvm_sregs) |
Christopher Ferris | 6a9755d | 2017-01-13 14:09:31 -0800 | [diff] [blame] | 961 | #define KVM_SET_SREGS _IOW(KVMIO, 0x84, struct kvm_sregs) |
Christopher Ferris | 38062f9 | 2014-07-09 15:33:25 -0700 | [diff] [blame] | 962 | #define KVM_TRANSLATE _IOWR(KVMIO, 0x85, struct kvm_translation) |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 963 | #define KVM_INTERRUPT _IOW(KVMIO, 0x86, struct kvm_interrupt) |
Christopher Ferris | 6a9755d | 2017-01-13 14:09:31 -0800 | [diff] [blame] | 964 | #define KVM_GET_MSRS _IOWR(KVMIO, 0x88, struct kvm_msrs) |
Christopher Ferris | 38062f9 | 2014-07-09 15:33:25 -0700 | [diff] [blame] | 965 | #define KVM_SET_MSRS _IOW(KVMIO, 0x89, struct kvm_msrs) |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 966 | #define KVM_SET_CPUID _IOW(KVMIO, 0x8a, struct kvm_cpuid) |
| 967 | #define KVM_SET_SIGNAL_MASK _IOW(KVMIO, 0x8b, struct kvm_signal_mask) |
Christopher Ferris | 6a9755d | 2017-01-13 14:09:31 -0800 | [diff] [blame] | 968 | #define KVM_GET_FPU _IOR(KVMIO, 0x8c, struct kvm_fpu) |
Christopher Ferris | 38062f9 | 2014-07-09 15:33:25 -0700 | [diff] [blame] | 969 | #define KVM_SET_FPU _IOW(KVMIO, 0x8d, struct kvm_fpu) |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 970 | #define KVM_GET_LAPIC _IOR(KVMIO, 0x8e, struct kvm_lapic_state) |
| 971 | #define KVM_SET_LAPIC _IOW(KVMIO, 0x8f, struct kvm_lapic_state) |
Christopher Ferris | 6a9755d | 2017-01-13 14:09:31 -0800 | [diff] [blame] | 972 | #define KVM_SET_CPUID2 _IOW(KVMIO, 0x90, struct kvm_cpuid2) |
Christopher Ferris | 38062f9 | 2014-07-09 15:33:25 -0700 | [diff] [blame] | 973 | #define KVM_GET_CPUID2 _IOWR(KVMIO, 0x91, struct kvm_cpuid2) |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 974 | #define KVM_TPR_ACCESS_REPORTING _IOWR(KVMIO, 0x92, struct kvm_tpr_access_ctl) |
| 975 | #define KVM_SET_VAPIC_ADDR _IOW(KVMIO, 0x93, struct kvm_vapic_addr) |
Christopher Ferris | 6a9755d | 2017-01-13 14:09:31 -0800 | [diff] [blame] | 976 | #define KVM_S390_INTERRUPT _IOW(KVMIO, 0x94, struct kvm_s390_interrupt) |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 977 | #define KVM_S390_STORE_STATUS_NOADDR (- 1ul) |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 978 | #define KVM_S390_STORE_STATUS_PREFIXED (- 2ul) |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 979 | #define KVM_S390_STORE_STATUS _IOW(KVMIO, 0x95, unsigned long) |
Christopher Ferris | 6a9755d | 2017-01-13 14:09:31 -0800 | [diff] [blame] | 980 | #define KVM_S390_SET_INITIAL_PSW _IOW(KVMIO, 0x96, struct kvm_s390_psw) |
Christopher Ferris | 38062f9 | 2014-07-09 15:33:25 -0700 | [diff] [blame] | 981 | #define KVM_S390_INITIAL_RESET _IO(KVMIO, 0x97) |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 982 | #define KVM_GET_MP_STATE _IOR(KVMIO, 0x98, struct kvm_mp_state) |
| 983 | #define KVM_SET_MP_STATE _IOW(KVMIO, 0x99, struct kvm_mp_state) |
Christopher Ferris | 6a9755d | 2017-01-13 14:09:31 -0800 | [diff] [blame] | 984 | #define KVM_NMI _IO(KVMIO, 0x9a) |
Christopher Ferris | 38062f9 | 2014-07-09 15:33:25 -0700 | [diff] [blame] | 985 | #define KVM_SET_GUEST_DEBUG _IOW(KVMIO, 0x9b, struct kvm_guest_debug) |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 986 | #define KVM_X86_SETUP_MCE _IOW(KVMIO, 0x9c, __u64) |
| 987 | #define KVM_X86_GET_MCE_CAP_SUPPORTED _IOR(KVMIO, 0x9d, __u64) |
Christopher Ferris | 6a9755d | 2017-01-13 14:09:31 -0800 | [diff] [blame] | 988 | #define KVM_X86_SET_MCE _IOW(KVMIO, 0x9e, struct kvm_x86_mce) |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 989 | #define KVM_GET_VCPU_EVENTS _IOR(KVMIO, 0x9f, struct kvm_vcpu_events) |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 990 | #define KVM_SET_VCPU_EVENTS _IOW(KVMIO, 0xa0, struct kvm_vcpu_events) |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 991 | #define KVM_GET_DEBUGREGS _IOR(KVMIO, 0xa1, struct kvm_debugregs) |
Christopher Ferris | 6a9755d | 2017-01-13 14:09:31 -0800 | [diff] [blame] | 992 | #define KVM_SET_DEBUGREGS _IOW(KVMIO, 0xa2, struct kvm_debugregs) |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 993 | #define KVM_ENABLE_CAP _IOW(KVMIO, 0xa3, struct kvm_enable_cap) |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 994 | #define KVM_GET_XSAVE _IOR(KVMIO, 0xa4, struct kvm_xsave) |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 995 | #define KVM_SET_XSAVE _IOW(KVMIO, 0xa5, struct kvm_xsave) |
Christopher Ferris | 6a9755d | 2017-01-13 14:09:31 -0800 | [diff] [blame] | 996 | #define KVM_GET_XCRS _IOR(KVMIO, 0xa6, struct kvm_xcrs) |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 997 | #define KVM_SET_XCRS _IOW(KVMIO, 0xa7, struct kvm_xcrs) |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 998 | #define KVM_DIRTY_TLB _IOW(KVMIO, 0xaa, struct kvm_dirty_tlb) |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 999 | #define KVM_GET_ONE_REG _IOW(KVMIO, 0xab, struct kvm_one_reg) |
Christopher Ferris | 6a9755d | 2017-01-13 14:09:31 -0800 | [diff] [blame] | 1000 | #define KVM_SET_ONE_REG _IOW(KVMIO, 0xac, struct kvm_one_reg) |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 1001 | #define KVM_KVMCLOCK_CTRL _IO(KVMIO, 0xad) |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 1002 | #define KVM_ARM_VCPU_INIT _IOW(KVMIO, 0xae, struct kvm_vcpu_init) |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 1003 | #define KVM_ARM_PREFERRED_TARGET _IOR(KVMIO, 0xaf, struct kvm_vcpu_init) |
Christopher Ferris | 6a9755d | 2017-01-13 14:09:31 -0800 | [diff] [blame] | 1004 | #define KVM_GET_REG_LIST _IOWR(KVMIO, 0xb0, struct kvm_reg_list) |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 1005 | #define KVM_S390_MEM_OP _IOW(KVMIO, 0xb1, struct kvm_s390_mem_op) |
| 1006 | #define KVM_S390_GET_SKEYS _IOW(KVMIO, 0xb2, struct kvm_s390_skeys) |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 1007 | #define KVM_S390_SET_SKEYS _IOW(KVMIO, 0xb3, struct kvm_s390_skeys) |
Christopher Ferris | 6a9755d | 2017-01-13 14:09:31 -0800 | [diff] [blame] | 1008 | #define KVM_S390_IRQ _IOW(KVMIO, 0xb4, struct kvm_s390_irq) |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 1009 | #define KVM_S390_SET_IRQ_STATE _IOW(KVMIO, 0xb5, struct kvm_s390_irq_state) |
| 1010 | #define KVM_S390_GET_IRQ_STATE _IOW(KVMIO, 0xb6, struct kvm_s390_irq_state) |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 1011 | #define KVM_SMI _IO(KVMIO, 0xb7) |
Christopher Ferris | 1308ad3 | 2017-11-14 17:32:13 -0800 | [diff] [blame] | 1012 | #define KVM_S390_GET_CMMA_BITS _IOWR(KVMIO, 0xb8, struct kvm_s390_cmma_log) |
| 1013 | #define KVM_S390_SET_CMMA_BITS _IOW(KVMIO, 0xb9, struct kvm_s390_cmma_log) |
Christopher Ferris | 76a1d45 | 2018-06-27 14:12:29 -0700 | [diff] [blame] | 1014 | #define KVM_MEMORY_ENCRYPT_OP _IOWR(KVMIO, 0xba, unsigned long) |
| 1015 | struct kvm_enc_region { |
| 1016 | __u64 addr; |
| 1017 | __u64 size; |
| 1018 | }; |
| 1019 | #define KVM_MEMORY_ENCRYPT_REG_REGION _IOR(KVMIO, 0xbb, struct kvm_enc_region) |
| 1020 | #define KVM_MEMORY_ENCRYPT_UNREG_REGION _IOR(KVMIO, 0xbc, struct kvm_enc_region) |
| 1021 | #define KVM_HYPERV_EVENTFD _IOW(KVMIO, 0xbd, struct kvm_hyperv_eventfd) |
Christopher Ferris | 9ce2884 | 2018-10-25 12:11:39 -0700 | [diff] [blame] | 1022 | #define KVM_GET_NESTED_STATE _IOWR(KVMIO, 0xbe, struct kvm_nested_state) |
| 1023 | #define KVM_SET_NESTED_STATE _IOW(KVMIO, 0xbf, struct kvm_nested_state) |
Christopher Ferris | d842e43 | 2019-03-07 10:21:59 -0800 | [diff] [blame] | 1024 | #define KVM_CLEAR_DIRTY_LOG _IOWR(KVMIO, 0xc0, struct kvm_clear_dirty_log) |
| 1025 | #define KVM_GET_SUPPORTED_HV_CPUID _IOWR(KVMIO, 0xc1, struct kvm_cpuid2) |
Christopher Ferris | aeddbcf | 2019-07-08 12:45:46 -0700 | [diff] [blame] | 1026 | #define KVM_ARM_VCPU_FINALIZE _IOW(KVMIO, 0xc2, int) |
Christopher Ferris | bb9fcb4 | 2020-04-06 11:38:04 -0700 | [diff] [blame] | 1027 | #define KVM_S390_NORMAL_RESET _IO(KVMIO, 0xc3) |
| 1028 | #define KVM_S390_CLEAR_RESET _IO(KVMIO, 0xc4) |
Christopher Ferris | af09c70 | 2020-06-01 20:29:29 -0700 | [diff] [blame] | 1029 | #define KVM_S390_PV_COMMAND _IOWR(KVMIO, 0xc5, struct kvm_pv_cmd) |
Christopher Ferris | 32ff3f8 | 2020-12-14 13:10:04 -0800 | [diff] [blame] | 1030 | #define KVM_X86_SET_MSR_FILTER _IOW(KVMIO, 0xc6, struct kvm_msr_filter) |
Christopher Ferris | 05667cd | 2021-02-16 16:01:34 -0800 | [diff] [blame] | 1031 | #define KVM_RESET_DIRTY_RINGS _IO(KVMIO, 0xc7) |
Christopher Ferris | a9750ed | 2021-05-03 14:02:49 -0700 | [diff] [blame] | 1032 | #define KVM_XEN_HVM_GET_ATTR _IOWR(KVMIO, 0xc8, struct kvm_xen_hvm_attr) |
| 1033 | #define KVM_XEN_HVM_SET_ATTR _IOW(KVMIO, 0xc9, struct kvm_xen_hvm_attr) |
Christopher Ferris | a9750ed | 2021-05-03 14:02:49 -0700 | [diff] [blame] | 1034 | #define KVM_XEN_VCPU_GET_ATTR _IOWR(KVMIO, 0xca, struct kvm_xen_vcpu_attr) |
| 1035 | #define KVM_XEN_VCPU_SET_ATTR _IOW(KVMIO, 0xcb, struct kvm_xen_vcpu_attr) |
Christopher Ferris | 80ae69d | 2022-08-02 16:32:21 -0700 | [diff] [blame] | 1036 | #define KVM_XEN_HVM_EVTCHN_SEND _IOW(KVMIO, 0xd0, struct kvm_irq_routing_xen_evtchn) |
Christopher Ferris | 3a39c0b | 2021-09-02 00:03:38 +0000 | [diff] [blame] | 1037 | #define KVM_GET_SREGS2 _IOR(KVMIO, 0xcc, struct kvm_sregs2) |
| 1038 | #define KVM_SET_SREGS2 _IOW(KVMIO, 0xcd, struct kvm_sregs2) |
Christopher Ferris | af09c70 | 2020-06-01 20:29:29 -0700 | [diff] [blame] | 1039 | #define KVM_DIRTY_LOG_MANUAL_PROTECT_ENABLE (1 << 0) |
| 1040 | #define KVM_DIRTY_LOG_INITIALLY_SET (1 << 1) |
Christopher Ferris | 05667cd | 2021-02-16 16:01:34 -0800 | [diff] [blame] | 1041 | #ifndef KVM_DIRTY_LOG_PAGE_OFFSET |
| 1042 | #define KVM_DIRTY_LOG_PAGE_OFFSET 0 |
| 1043 | #endif |
Christopher Ferris | fcc3b4f | 2021-07-01 01:30:21 +0000 | [diff] [blame] | 1044 | #define KVM_DIRTY_GFN_F_DIRTY _BITUL(0) |
| 1045 | #define KVM_DIRTY_GFN_F_RESET _BITUL(1) |
Christopher Ferris | 05667cd | 2021-02-16 16:01:34 -0800 | [diff] [blame] | 1046 | #define KVM_DIRTY_GFN_F_MASK 0x3 |
| 1047 | struct kvm_dirty_gfn { |
| 1048 | __u32 flags; |
| 1049 | __u32 slot; |
| 1050 | __u64 offset; |
| 1051 | }; |
Christopher Ferris | a9750ed | 2021-05-03 14:02:49 -0700 | [diff] [blame] | 1052 | #define KVM_BUS_LOCK_DETECTION_OFF (1 << 0) |
| 1053 | #define KVM_BUS_LOCK_DETECTION_EXIT (1 << 1) |
Christopher Ferris | 10a76e6 | 2022-06-08 13:31:52 -0700 | [diff] [blame] | 1054 | #define KVM_PMU_CAP_DISABLE (1 << 0) |
Christopher Ferris | 3a39c0b | 2021-09-02 00:03:38 +0000 | [diff] [blame] | 1055 | struct kvm_stats_header { |
| 1056 | __u32 flags; |
| 1057 | __u32 name_size; |
| 1058 | __u32 num_desc; |
| 1059 | __u32 id_offset; |
| 1060 | __u32 desc_offset; |
| 1061 | __u32 data_offset; |
| 1062 | }; |
| 1063 | #define KVM_STATS_TYPE_SHIFT 0 |
| 1064 | #define KVM_STATS_TYPE_MASK (0xF << KVM_STATS_TYPE_SHIFT) |
| 1065 | #define KVM_STATS_TYPE_CUMULATIVE (0x0 << KVM_STATS_TYPE_SHIFT) |
| 1066 | #define KVM_STATS_TYPE_INSTANT (0x1 << KVM_STATS_TYPE_SHIFT) |
| 1067 | #define KVM_STATS_TYPE_PEAK (0x2 << KVM_STATS_TYPE_SHIFT) |
Christopher Ferris | 2abfa9e | 2021-11-01 16:26:06 -0700 | [diff] [blame] | 1068 | #define KVM_STATS_TYPE_LINEAR_HIST (0x3 << KVM_STATS_TYPE_SHIFT) |
| 1069 | #define KVM_STATS_TYPE_LOG_HIST (0x4 << KVM_STATS_TYPE_SHIFT) |
| 1070 | #define KVM_STATS_TYPE_MAX KVM_STATS_TYPE_LOG_HIST |
Christopher Ferris | 3a39c0b | 2021-09-02 00:03:38 +0000 | [diff] [blame] | 1071 | #define KVM_STATS_UNIT_SHIFT 4 |
| 1072 | #define KVM_STATS_UNIT_MASK (0xF << KVM_STATS_UNIT_SHIFT) |
| 1073 | #define KVM_STATS_UNIT_NONE (0x0 << KVM_STATS_UNIT_SHIFT) |
| 1074 | #define KVM_STATS_UNIT_BYTES (0x1 << KVM_STATS_UNIT_SHIFT) |
| 1075 | #define KVM_STATS_UNIT_SECONDS (0x2 << KVM_STATS_UNIT_SHIFT) |
| 1076 | #define KVM_STATS_UNIT_CYCLES (0x3 << KVM_STATS_UNIT_SHIFT) |
Christopher Ferris | 80ae69d | 2022-08-02 16:32:21 -0700 | [diff] [blame] | 1077 | #define KVM_STATS_UNIT_BOOLEAN (0x4 << KVM_STATS_UNIT_SHIFT) |
| 1078 | #define KVM_STATS_UNIT_MAX KVM_STATS_UNIT_BOOLEAN |
Christopher Ferris | 3a39c0b | 2021-09-02 00:03:38 +0000 | [diff] [blame] | 1079 | #define KVM_STATS_BASE_SHIFT 8 |
| 1080 | #define KVM_STATS_BASE_MASK (0xF << KVM_STATS_BASE_SHIFT) |
| 1081 | #define KVM_STATS_BASE_POW10 (0x0 << KVM_STATS_BASE_SHIFT) |
| 1082 | #define KVM_STATS_BASE_POW2 (0x1 << KVM_STATS_BASE_SHIFT) |
| 1083 | #define KVM_STATS_BASE_MAX KVM_STATS_BASE_POW2 |
| 1084 | struct kvm_stats_desc { |
| 1085 | __u32 flags; |
| 1086 | __s16 exponent; |
| 1087 | __u16 size; |
| 1088 | __u32 offset; |
Christopher Ferris | 2abfa9e | 2021-11-01 16:26:06 -0700 | [diff] [blame] | 1089 | __u32 bucket_size; |
Christopher Ferris | 3a39c0b | 2021-09-02 00:03:38 +0000 | [diff] [blame] | 1090 | char name[]; |
| 1091 | }; |
| 1092 | #define KVM_GET_STATS_FD _IO(KVMIO, 0xce) |
Christopher Ferris | 1ed5534 | 2022-03-22 16:06:25 -0700 | [diff] [blame] | 1093 | #define KVM_GET_XSAVE2 _IOR(KVMIO, 0xcf, struct kvm_xsave) |
Christopher Ferris | 7447a1c | 2022-10-04 18:24:44 -0700 | [diff] [blame] | 1094 | #define KVM_S390_PV_CPU_COMMAND _IOWR(KVMIO, 0xd0, struct kvm_pv_cmd) |
| 1095 | #define KVM_X86_NOTIFY_VMEXIT_ENABLED (1ULL << 0) |
| 1096 | #define KVM_X86_NOTIFY_VMEXIT_USER (1ULL << 1) |
| 1097 | #define KVM_S390_ZPCI_OP _IOW(KVMIO, 0xd1, struct kvm_s390_zpci_op) |
Christopher Ferris | b830ddf | 2024-03-28 11:48:08 -0700 | [diff] [blame] | 1098 | #define KVM_SET_MEMORY_ATTRIBUTES _IOW(KVMIO, 0xd2, struct kvm_memory_attributes) |
| 1099 | struct kvm_memory_attributes { |
| 1100 | __u64 address; |
| 1101 | __u64 size; |
| 1102 | __u64 attributes; |
| 1103 | __u64 flags; |
| 1104 | }; |
| 1105 | #define KVM_MEMORY_ATTRIBUTE_PRIVATE (1ULL << 3) |
| 1106 | #define KVM_CREATE_GUEST_MEMFD _IOWR(KVMIO, 0xd4, struct kvm_create_guest_memfd) |
| 1107 | struct kvm_create_guest_memfd { |
| 1108 | __u64 size; |
| 1109 | __u64 flags; |
| 1110 | __u64 reserved[6]; |
| 1111 | }; |
Christopher Ferris | 6a9755d | 2017-01-13 14:09:31 -0800 | [diff] [blame] | 1112 | #endif |