aboutsummaryrefslogtreecommitdiffstats
path: root/sys/linux/dev_kvm.txt
blob: 73e5edccc46d3738f890ac5247ce0cd9272f9774 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
# Copyright 2015 syzkaller project authors. All rights reserved.
# Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file.

meta arches["386", "amd64", "arm64", "mips64le", "ppc64le", "s390x", "riscv64"]

include <linux/kvm.h>
include <linux/kvm_host.h>
include <uapi/linux/fcntl.h>
include <asm/mce.h>

resource fd_kvm[fd]
resource fd_kvmvm[fd]
resource fd_kvmcpu[fd]
resource fd_kvmdev[fd]
resource fd_kvm_guest_memfd[fd]
resource vcpu_mmap_size[int64]

openat$kvm(fd const[AT_FDCWD], file ptr[in, string["/dev/kvm"]], flags flags[open_flags], mode const[0]) fd_kvm

# On x86, KVM_CREATE_VM accepts types 0 to 3.
# On ARM64 it is either 0 (default size of 40 bits) or the guest address space size in bits, from 32 to the platform limit.
ioctl$KVM_CREATE_VM(fd fd_kvm, cmd const[KVM_CREATE_VM], type intptr[0:64]) fd_kvmvm
ioctl$KVM_CHECK_EXTENSION(fd fd_kvm, cmd const[KVM_CHECK_EXTENSION], arg intptr)
ioctl$KVM_CHECK_EXTENSION_VM(fd fd_kvmvm, cmd const[KVM_CHECK_EXTENSION], arg intptr)
ioctl$KVM_GET_VCPU_MMAP_SIZE(fd fd_kvm, cmd const[KVM_GET_VCPU_MMAP_SIZE]) vcpu_mmap_size

ioctl$KVM_GET_API_VERSION(fd fd_kvm, cmd const[KVM_GET_API_VERSION], type const[0])
ioctl$KVM_CREATE_VCPU(fd fd_kvmvm, cmd const[KVM_CREATE_VCPU], id intptr[0:2]) fd_kvmcpu
ioctl$KVM_GET_DIRTY_LOG(fd fd_kvmvm, cmd const[KVM_GET_DIRTY_LOG], arg ptr[inout, kvm_dirty_log])
ioctl$KVM_CLEAR_DIRTY_LOG(fd fd_kvmvm, cmd const[KVM_CLEAR_DIRTY_LOG], arg ptr[in, kvm_clear_dirty_log])
ioctl$KVM_RESET_DIRTY_RINGS(fd fd_kvmvm, cmd const[KVM_RESET_DIRTY_RINGS])
ioctl$KVM_CREATE_IRQCHIP(fd fd_kvmvm, cmd const[KVM_CREATE_IRQCHIP])
ioctl$KVM_IRQ_LINE(fd fd_kvmvm, cmd const[KVM_IRQ_LINE], arg ptr[in, kvm_irq_level])
ioctl$KVM_IRQ_LINE_STATUS(fd fd_kvmvm, cmd const[KVM_IRQ_LINE_STATUS], arg ptr[inout, kvm_irq_level])
ioctl$KVM_SET_USER_MEMORY_REGION(fd fd_kvmvm, cmd const[KVM_SET_USER_MEMORY_REGION], arg ptr[in, kvm_userspace_memory_region])
ioctl$KVM_SET_USER_MEMORY_REGION2(fd fd_kvmvm, cmd const[KVM_SET_USER_MEMORY_REGION2], arg ptr[in, kvm_userspace_memory_region2])
ioctl$KVM_PPC_GET_PVINFO(fd fd_kvmvm, cmd const[KVM_PPC_GET_PVINFO], arg buffer[out])
ioctl$KVM_SET_GSI_ROUTING(fd fd_kvmvm, cmd const[KVM_SET_GSI_ROUTING], arg ptr[in, kvm_irq_routing]) (no_squash)
ioctl$KVM_ASSIGN_SET_MSIX_NR(fd fd_kvmvm, cmd const[KVM_ASSIGN_SET_MSIX_NR], arg ptr[in, kvm_assigned_msix_nr])
ioctl$KVM_ASSIGN_SET_MSIX_ENTRY(fd fd_kvmvm, cmd const[KVM_ASSIGN_SET_MSIX_ENTRY], arg ptr[in, kvm_assigned_msix_entry])
ioctl$KVM_IOEVENTFD(fd fd_kvmvm, cmd const[KVM_IOEVENTFD], arg ptr[in, kvm_ioeventfd])
ioctl$KVM_SIGNAL_MSI(fd fd_kvmvm, cmd const[KVM_SIGNAL_MSI], arg ptr[in, kvm_msi])
ioctl$KVM_PPC_GET_SMMU_INFO(fd fd_kvmvm, cmd const[KVM_PPC_GET_SMMU_INFO], arg buffer[out])
ioctl$KVM_IRQFD(fd fd_kvmvm, cmd const[KVM_IRQFD], arg ptr[in, kvm_irqfd])
ioctl$KVM_PPC_ALLOCATE_HTAB(fd fd_kvmvm, cmd const[KVM_PPC_ALLOCATE_HTAB], arg ptr[in, int32])
ioctl$KVM_CREATE_DEVICE(fd fd_kvmvm, cmd const[KVM_CREATE_DEVICE], arg ptr[inout, kvm_create_device])
ioctl$KVM_REGISTER_COALESCED_MMIO(fd fd_kvmvm, cmd const[KVM_REGISTER_COALESCED_MMIO], arg ptr[in, kvm_coalesced_mmio_zone])
ioctl$KVM_UNREGISTER_COALESCED_MMIO(fd fd_kvmvm, cmd const[KVM_UNREGISTER_COALESCED_MMIO], arg ptr[in, kvm_coalesced_mmio_zone])
ioctl$KVM_GET_STATS_FD_vm(fd fd_kvmvm, cmd const[KVM_GET_STATS_FD]) fd
ioctl$KVM_GET_STATS_FD_cpu(fd fd_kvmcpu, cmd const[KVM_GET_STATS_FD]) fd

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]]])
ioctl$KVM_CAP_HALT_POLL(fd fd_kvmvm, cmd const[KVM_ENABLE_CAP], arg ptr[in, kvm_enable_cap[KVM_CAP_HALT_POLL, int64]])
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]]])
ioctl$KVM_CAP_DIRTY_LOG_RING_ACQ_REL(fd fd_kvmvm, cmd const[KVM_ENABLE_CAP], arg ptr[in, kvm_enable_cap[KVM_CAP_DIRTY_LOG_RING_ACQ_REL, flags[kvm_dirty_log_sizes, int64]]])

# TODO: need more precise handling for arguments below
ioctl$KVM_CAP_PTP_KVM(fd fd_kvmvm, cmd const[KVM_ENABLE_CAP], arg ptr[in, kvm_enable_cap[KVM_CAP_PTP_KVM, void]])

ioctl$KVM_RUN(fd fd_kvmcpu, cmd const[KVM_RUN], arg const[0])
ioctl$KVM_GET_REGS(fd fd_kvmcpu, cmd const[KVM_GET_REGS], arg ptr[out, kvm_regs])
ioctl$KVM_SET_REGS(fd fd_kvmcpu, cmd const[KVM_SET_REGS], arg ptr[in, kvm_regs])
ioctl$KVM_GET_SREGS(fd fd_kvmcpu, cmd const[KVM_GET_SREGS], arg ptr[out, kvm_sregs])
ioctl$KVM_SET_SREGS(fd fd_kvmcpu, cmd const[KVM_SET_SREGS], arg ptr[in, kvm_sregs])
ioctl$KVM_INTERRUPT(fd fd_kvmcpu, cmd const[KVM_INTERRUPT], arg ptr[in, int32])
ioctl$KVM_SET_SIGNAL_MASK(fd fd_kvmcpu, cmd const[KVM_SET_SIGNAL_MASK], arg ptr[in, kvm_signal_mask]) (no_squash)
ioctl$KVM_GET_VCPU_EVENTS(fd fd_kvmcpu, cmd const[KVM_GET_VCPU_EVENTS], arg ptr[out, kvm_vcpu_events])
ioctl$KVM_SET_VCPU_EVENTS(fd fd_kvmcpu, cmd const[KVM_SET_VCPU_EVENTS], arg ptr[in, kvm_vcpu_events])
ioctl$KVM_GET_MP_STATE(fd fd_kvmcpu, cmd const[KVM_GET_MP_STATE], arg ptr[out, int32])
ioctl$KVM_SET_MP_STATE(fd fd_kvmcpu, cmd const[KVM_SET_MP_STATE], arg ptr[in, flags[kvm_mp_state, int32]])
ioctl$KVM_DIRTY_TLB(fd fd_kvmcpu, cmd const[KVM_DIRTY_TLB], arg ptr[in, kvm_dirty_tlb])
# NEED: arch constraints for syscalls. These are s390-specific, but consts are present on all arches, so they are not disabled on other arches.
ioctl$KVM_S390_UCAS_MAP(fd fd_kvmcpu, cmd const[KVM_S390_UCAS_MAP], arg ptr[in, kvm_s390_ucas_mapping])
ioctl$KVM_S390_UCAS_UNMAP(fd fd_kvmcpu, cmd const[KVM_S390_UCAS_UNMAP], arg ptr[in, kvm_s390_ucas_mapping])
ioctl$KVM_S390_VCPU_FAULT(fd fd_kvmcpu, cmd const[KVM_S390_VCPU_FAULT], arg ptr[in, int64])
ioctl$KVM_SET_ONE_REG(fd fd_kvmcpu, cmd const[KVM_SET_ONE_REG], arg ptr[in, kvm_one_reg])
ioctl$KVM_GET_ONE_REG(fd fd_kvmcpu, cmd const[KVM_GET_ONE_REG], arg ptr[in, kvm_one_reg])
ioctl$KVM_KVMCLOCK_CTRL(fd fd_kvmcpu, cmd const[KVM_KVMCLOCK_CTRL])
ioctl$KVM_S390_INTERRUPT_CPU(fd fd_kvmcpu, cmd const[KVM_S390_INTERRUPT], arg ptr[in, kvm_s390_interrupt])
ioctl$KVM_GET_REG_LIST(fd fd_kvmcpu, cmd const[KVM_GET_REG_LIST], arg ptr[inout, kvm_reg_list])
ioctl$KVM_SET_DEVICE_ATTR(fd fd_kvmdev, cmd const[KVM_SET_DEVICE_ATTR], arg ptr[in, kvm_device_attr])
ioctl$KVM_GET_DEVICE_ATTR(fd fd_kvmdev, cmd const[KVM_GET_DEVICE_ATTR], arg ptr[in, kvm_device_attr])
ioctl$KVM_HAS_DEVICE_ATTR(fd fd_kvmdev, cmd const[KVM_HAS_DEVICE_ATTR], arg ptr[in, kvm_device_attr])

# From https://docs.kernel.org/virt/kvm/devices/vcpu.html:
# The virtual cpu “device” also accepts the ioctls KVM_SET_DEVICE_ATTR, KVM_GET_DEVICE_ATTR, and KVM_HAS_DEVICE_ATTR.
# The interface uses the same struct kvm_device_attr as other devices, but targets VCPU-wide settings and controls.
ioctl$KVM_SET_DEVICE_ATTR_vcpu(fd fd_kvmcpu, cmd const[KVM_SET_DEVICE_ATTR], arg ptr[in, kvm_device_attr_vcpu])
ioctl$KVM_GET_DEVICE_ATTR_vcpu(fd fd_kvmcpu, cmd const[KVM_GET_DEVICE_ATTR], arg ptr[in, kvm_device_attr_vcpu])
ioctl$KVM_HAS_DEVICE_ATTR_vcpu(fd fd_kvmcpu, cmd const[KVM_HAS_DEVICE_ATTR], arg ptr[in, kvm_device_attr_vcpu])

# From https://docs.kernel.org/virt/kvm/devices/vm.html:
# The virtual machine “device” also accepts the ioctls KVM_SET_DEVICE_ATTR, KVM_GET_DEVICE_ATTR, and KVM_HAS_DEVICE_ATTR.
# The interface uses the same struct kvm_device_attr as other devices, but targets VM-wide settings and controls.
ioctl$KVM_SET_DEVICE_ATTR_vm(fd fd_kvmvm, cmd const[KVM_SET_DEVICE_ATTR], arg ptr[in, kvm_device_attr_vm])
ioctl$KVM_GET_DEVICE_ATTR_vm(fd fd_kvmvm, cmd const[KVM_GET_DEVICE_ATTR], arg ptr[in, kvm_device_attr_vm])
ioctl$KVM_HAS_DEVICE_ATTR_vm(fd fd_kvmvm, cmd const[KVM_HAS_DEVICE_ATTR], arg ptr[in, kvm_device_attr_vm])

ioctl$KVM_CREATE_GUEST_MEMFD(fd fd_kvmvm, cmd const[KVM_CREATE_GUEST_MEMFD], arg ptr[in, kvm_create_guest_memfd]) fd_kvm_guest_memfd
ioctl$KVM_PRE_FAULT_MEMORY(fd fd_kvmcpu, cmd const[KVM_PRE_FAULT_MEMORY], arg ptr[inout, kvm_pre_fault_memory])

kvm_mem_region_flags = KVM_MEM_LOG_DIRTY_PAGES, KVM_MEM_READONLY, KVM_MEM_GUEST_MEMFD
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
kvm_irq_routing_entry_type = KVM_IRQ_ROUTING_IRQCHIP, KVM_IRQ_ROUTING_MSI, KVM_IRQ_ROUTING_S390_ADAPTER, KVM_IRQ_ROUTING_HV_SINT, KVM_IRQ_ROUTING_XEN_EVTCHN
kvm_ioeventfd_flags = KVM_IOEVENTFD_FLAG_DATAMATCH, KVM_IOEVENTFD_FLAG_PIO, KVM_IOEVENTFD_FLAG_DEASSIGN, KVM_IOEVENTFD_FLAG_VIRTIO_CCW_NOTIFY
kvm_ioeventfd_len = 0, 1, 2, 4, 8
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
kvm_device_flags = 0, KVM_CREATE_DEVICE_TEST
kvm_guest_debug_flags = KVM_GUESTDBG_ENABLE, KVM_GUESTDBG_SINGLESTEP, KVM_GUESTDBG_USE_SW_BP, KVM_GUESTDBG_USE_HW_BP, KVM_GUESTDBG_USE_HW, KVM_GUESTDBG_INJECT_DB, KVM_GUESTDBG_INJECT_BP, KVM_GUESTDBG_EXIT_PENDING, KVM_GUESTDBG_BLOCKIRQ
kvm_guest_selector = 0, 3, 4, 8, 9, 10, 11, 12, 13, 14, 15, 16
kvm_dirty_log_protect = KVM_DIRTY_LOG_MANUAL_PROTECT_ENABLE, KVM_DIRTY_LOG_INITIALLY_SET
kvm_dirty_log_sizes = 4096, 8192, 16384, 32768, 65536
kvm_mem_slots = 0, 1, 2, 3, 4, 5, 509, 510, 511, 10000, 65536, 65537, 65538, 65539, 65540, 66047, 66048, 66049
kvm_guest_addr_size = 0x1000, 0x2000, 0x4000, 0x8000, 0x10000, 0x100000
kvm_x86_cr0 = 1, 2, 4, 8, 16, 32, 65536, 262144, 536870912, 1073741824, 2147483648
kvm_x86_cr4 = 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 8192, 16384, 65536, 131072, 262144, 1048576, 2097152, 4194304
kvm_x86_efer = 1, 256, 1024, 2048, 4096, 8192, 16384, 32768
kvm_x86_rflags = 1, 2, 4, 16, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768, 65536, 131072, 262144, 524288, 1048576, 2097152

# Pseudo call that setups VCPU into a reasonable interesting state for execution.
# The interface is designed for extensibility so that addition of new options does not invalidate all existing programs.
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])

resource kvm_run_ptr[int64]
define KVM_RUN_SIZE	sizeof(struct kvm_run)
mmap$KVM_VCPU(addr vma, len vcpu_mmap_size, prot flags[mmap_prot], flags flags[mmap_flags], cpufd fd_kvmcpu, offset const[0]) kvm_run_ptr
_ = __NR_mmap2

define KVM_EXIT_MMIO_OFFSET	offsetof(struct kvm_run, mmio)
define KVM_EXIT_MMIO_SIZE	sizeof_field(struct kvm_run, mmio)
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])

define KVM_EXIT_HYPERCALL_OFFSET	offsetof(struct kvm_run, hypercall)
define KVM_EXIT_HYPERCALL_SIZE	sizeof_field(struct kvm_run, hypercall)
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])

kvm_text_ppc64 {
	typ	const[0, intptr]
	text	ptr[in, text[ppc64]]
	size	len[text, intptr]
}

kvm_setup_opt_ppc64 [
# unions need at least 2 fields, but we have only 1 now, but we want to have it as union for future extention
	featur1	kvm_setup_opt_ppc64_feature
	featur2	kvm_setup_opt_ppc64_feature
]

kvm_setup_opt_ppc64_feature {
	typ	const[1, int64]
	val	int64
}

kvm_setup_flags_ppc64 = KVM_SETUP_PPC64_LE, KVM_SETUP_PPC64_IR, KVM_SETUP_PPC64_DR, KVM_SETUP_PPC64_PR, KVM_SETUP_PPC64_PID1

# Little endian
define KVM_SETUP_PPC64_LE	(1<<0)
# Paging for instructions
define KVM_SETUP_PPC64_IR	(1<<1)
# Paging for data
define KVM_SETUP_PPC64_DR	(1<<2)
# Run with MSR_PR (==usermode)
define KVM_SETUP_PPC64_PR	(1<<3)
# Set PID=1 i.e. not kernel's PID
define KVM_SETUP_PPC64_PID1	(1<<4)

type kvm_guest_debug[ARCH] {
	ctrl	flags[kvm_guest_debug_flags, int32]
	pad	const[0, int32]
	arch	ARCH
}

kvm_reg_list {
	n	len[reg, int64]
	reg	array[int64]
}

kvm_device_attr [
	attr_arm64	kvm_device_attr_arm64
	attr_other	kvm_device_attr_generic
]

kvm_device_attr_generic {
	flags	const[0, int32]
	group	int32
	attr	int64
	addr	ptr64[inout, int64]
}

kvm_device_attr_arm64 {
	flags	const[0, int32]
	group	flags[kvm_device_attr_arm64_groups, int32]
	attr	flags[kvm_device_attr_arm64_attrs, int64]
	addr	ptr64[inout, int64]
}

# Assorted device attributes from
# - https://docs.kernel.org/virt/kvm/devices/arm-vgic-its.html,
# - https://docs.kernel.org/virt/kvm/devices/arm-vgic.html,
# - https://docs.kernel.org/virt/kvm/devices/arm-vgic-v3.html
kvm_device_attr_arm64_groups = KVM_DEV_ARM_VGIC_GRP_ADDR, KVM_DEV_ARM_VGIC_GRP_DIST_REGS, KVM_DEV_ARM_VGIC_GRP_CPU_REGS, KVM_DEV_ARM_VGIC_GRP_NR_IRQS, KVM_DEV_ARM_VGIC_GRP_CTRL, KVM_DEV_ARM_VGIC_GRP_REDIST_REGS, KVM_DEV_ARM_VGIC_GRP_CPU_SYSREGS, KVM_DEV_ARM_VGIC_GRP_LEVEL_INFO, KVM_DEV_ARM_VGIC_GRP_ITS_REGS
kvm_device_attr_arm64_attrs = 0, KVM_VGIC_ITS_ADDR_TYPE, KVM_VGIC_V2_ADDR_TYPE_DIST, KVM_VGIC_V2_ADDR_TYPE_CPU, KVM_VGIC_V3_ADDR_TYPE_DIST, KVM_VGIC_V3_ADDR_TYPE_REDIST, KVM_VGIC_V3_ADDR_TYPE_REDIST_REGION, KVM_DEV_ARM_VGIC_CTRL_INIT, KVM_DEV_ARM_ITS_CTRL_RESET, KVM_DEV_ARM_ITS_SAVE_TABLES, KVM_DEV_ARM_ITS_RESTORE_TABLES, KVM_DEV_ARM_VGIC_SAVE_PENDING_TABLES

kvm_device_attr_vm [
	attr_arm64	kvm_device_attr_vm_arm64
	attr_other	kvm_device_attr_generic
]

kvm_device_attr_vcpu [
	attr_pmu_irq	kvm_vcpu_attr_pmu_irq
	attr_pmu_init	kvm_vcpu_attr_pmu_init
	attr_pmu_filter	kvm_vcpu_attr_pmu_filter
	attr_set_pmu	kvm_vcpu_attr_set_pmu
	attr_irq_timer	kvm_vcpu_attr_irq_timer
	attr_pvtime_ipa	kvm_vcpu_attr_pvtime_ipa
	attr_other	kvm_device_attr_generic
]

kvm_vm_attr_group_arm64 = KVM_ARM_VM_SMCCC_CTRL
kvm_vm_attr_attr_arm64 = KVM_ARM_VM_SMCCC_FILTER

# TODO(glider): as of now the only supported argument is kvm_smccc_filter.
# Need to make addr point to a union when this changes.
kvm_device_attr_vm_arm64 {
	flags	const[0, int32]
	group	flags[kvm_vm_attr_group_arm64, int32]
	attr	flags[kvm_vm_attr_attr_arm64, int64]
	addr	ptr64[in, kvm_smccc_filter]
}

kvm_vcpu_attr_pmu_irq {
	flags	const[0, int32]
	group	const[KVM_ARM_VCPU_PMU_V3_CTRL, int32]
	attr	const[KVM_ARM_VCPU_PMU_V3_IRQ, int64]
	addr	ptr64[in, int32]
}

kvm_vcpu_attr_pmu_init {
	flags	const[0, int32]
	group	const[KVM_ARM_VCPU_PMU_V3_CTRL, int32]
	attr	const[KVM_ARM_VCPU_PMU_V3_INIT, int64]
	addr	const[0, int64]
}

kvm_vcpu_attr_pmu_filter {
	flags	const[0, int32]
	group	const[KVM_ARM_VCPU_PMU_V3_CTRL, int32]
	attr	const[KVM_ARM_VCPU_PMU_V3_FILTER, int64]
	addr	ptr64[in, kvm_pmu_event_filter]
}

kvm_vcpu_attr_set_pmu {
	flags	const[0, int32]
	group	const[KVM_ARM_VCPU_PMU_V3_CTRL, int32]
	attr	const[KVM_ARM_VCPU_PMU_V3_SET_PMU, int64]
	addr	ptr64[in, int32]
}

kvm_vcpu_timer_attributes = KVM_ARM_VCPU_TIMER_IRQ_VTIMER, KVM_ARM_VCPU_TIMER_IRQ_PTIMER

kvm_vcpu_attr_irq_timer {
	flags	const[0, int32]
	group	const[KVM_ARM_VCPU_TIMER_CTRL, int32]
	attr	flags[kvm_vcpu_timer_attributes, int64]
	addr	ptr64[in, int32[16:31]]
}

kvm_vcpu_attr_pvtime_ipa {
	flags	const[0, int32]
	group	const[KVM_ARM_VCPU_PVTIME_CTRL, int32]
	attr	const[KVM_ARM_VCPU_PVTIME_IPA, int64]
	addr	int64
}

kvm_pmu_event_filter = KVM_PMU_EVENT_ALLOW, KVM_PMU_EVENT_DENY

kvm_pmu_event_filter {
	base_event	int16
	nevents		int16
	action		flags[kvm_pmu_event_filter, int8]
	pad		array[const[0, int8], 3]
}

kvm_smccc_filter_action = KVM_SMCCC_FILTER_HANDLE, KVM_SMCCC_FILTER_DENY, KVM_SMCCC_FILTER_FWD_TO_USER

kvm_smccc_filter {
	base		int32
	nr_functions	int32
	action		flags[kvm_smccc_filter_action, int8]
	pad		array[const[0, int8], 15]
}

kvm_create_guest_memfd {
	size		int64
	flags		int64
	reserved	array[const[0, int64], 6]
}

kvm_pre_fault_memory {
	gpa	flags[kvm_guest_addrs, int64]
	size	flags[kvm_guest_addr_size, int64]
	flags	const[0, int64]
	pad	array[const[0, int64], 5]
}

kvm_create_device {
	type	flags[kvm_device_type, int32]	(in)
	fd	fd_kvmdev	(out)
	flags	flags[kvm_device_flags, int32]	(in)
}

kvm_s390_interrupt {
	type	int32
	parm	int32
	parm64	int64
}

kvm_irqfd_flags = KVM_IRQFD_FLAG_DEASSIGN, KVM_IRQFD_FLAG_RESAMPLE

kvm_irqfd {
	fd	fd_event
	gsi	int32
	flags	flags[kvm_irqfd_flags, int32]
	rfd	fd_event
	pad	array[const[0, int8], 16]
}

kvm_msi_flags = 0, KVM_MSI_VALID_DEVID

kvm_msi {
	addrlo	flags[kvm_guest_addrs, int32]
	addrhi	flags[kvm_guest_addrs, int32]
	data	int32
	flags	flags[kvm_msi_flags, int32]
	devid	int32
	pad	array[const[0, int8], 12]
}

kvm_one_reg [
# Constants from https://docs.kernel.org/virt/kvm/api.html
	arm64_core	kvm_one_reg_arm64_srange[0x6030000000100000:0x6030000000100050, 2]
	arm64_fp	kvm_one_reg_arm64_range[0x6040000000100054:0x60400000001000d0]
	arm64_fp_extra	kvm_one_reg_arm64_range[0x60200000001000d4:0x60200000001000d5]
# Got 0x602000000011000d from KVM_GET_REG_LIST on QEMU
	arm64_ccsidr	kvm_one_reg_arm64_range[0x6020000000110000:0x602000000011000d]
	arm64_sys	kvm_one_reg_arm64[kvm_regs_arm64_sys]
	arm64_extra	kvm_one_reg_arm64[kvm_regs_arm64_extra]
	arm64_bitmap	kvm_one_reg_arm64_range[0x6030000000160000:0x6030000000160002]
	arm64_fw	kvm_one_reg_arm64_range[0x6030000000140000:0x6030000000140003]
	arm64_sve	kvm_one_reg_arm64_range[0x6080000000150000:0x6080000000150620]
	arm64_sve_vls	kvm_one_reg_arm64_range[0x606000000015ffff]
	other		kvm_one_reg_other
]

type kvm_one_reg_arm64[FTYPE] {
	id	flags[FTYPE, int64]
	addr	ptr64[inout, int64]
}

type kvm_one_reg_arm64_range[RANGE] {
	id	int64[RANGE]
	addr	ptr64[inout, int64]
}

type kvm_one_reg_arm64_srange[RANGE, STEP] {
	id	int64[RANGE, STEP]
	addr	ptr64[inout, int64]
}

kvm_one_reg_other {
	id	int64
	addr	ptr64[inout, int64]
}

kvm_s390_ucas_mapping {
	uaddr	int64
	vaddr	int64
	len	int64
}

kvm_dirty_tlb {
	bitmap	int64
	n	int32
}

kvm_ioeventfd {
	datam	int64
	addr	flags[kvm_guest_addrs, int64]
	len	flags[kvm_ioeventfd_len, int32]
	fd	fd_event
	flags	flags[kvm_ioeventfd_flags, int32]
	pad	array[const[0, int8], 36]
}

kvm_assigned_msix_entry {
	devid	int32
	gsi	int32
	entry	int16
	padding	array[const[0, int16], 3]
}

kvm_assigned_msix_nr {
	devid	int32
	entnr	int16
}

kvm_irq_routing {
	nr	len[entries, int32]
	flags	const[0, int32]
	entries	array[kvm_irq_routing_entry]
}

kvm_irq_routing_entry {
	gsi	int32
	type	flags[kvm_irq_routing_entry_type, int32]
	flags	flags[kvm_msi_flags, int32]
	pad	const[0, int32]
	u	kvm_irq_routing_entry_u
}

kvm_irq_routing_entry_u [
	irqchip	kvm_irq_routing_irqchip
	msi	kvm_irq_routing_msi
	adapter	kvm_irq_routing_s390_adapter
	sint	kvm_irq_routing_hv_sint
]

kvm_irq_routing_irqchip {
	irqchip	int32
	pin	int32
}

kvm_irq_routing_msi {
	address_lo	int32
	address_hi	int32
	data		int32
	devid		int32
}

kvm_irq_routing_s390_adapter {
	indaddr	int64
	saddr	int64
	indoff	int64
	soff	int32
	aid	int32
}

kvm_irq_routing_hv_sint {
	vcpu	int32
	sint	int32
}

type kvm_enable_cap[CAP, ARGS] {
	cap	const[CAP, int32]
	flags	const[0, int32]
	args	ARGS
} [align[8], size[KVM_ENABLE_CAP_SIZE]]

define KVM_ENABLE_CAP_SIZE	sizeof(struct kvm_enable_cap)

kvm_userspace_memory_region {
	slot	flags[kvm_mem_slots, int32]
	flags	flags[kvm_mem_region_flags, int32]
	paddr	flags[kvm_guest_addrs, int64]
	size	len[addr, int64]
	addr	vma64[1:2]
}

kvm_userspace_memory_region2 {
	slot			flags[kvm_mem_slots, int32]
	flags			flags[kvm_mem_region_flags, int32]
	paddr			flags[kvm_guest_addrs, int64]
	size			len[addr, int64]
	addr			vma64[1:2]
	guest_memfd_offset	int64
	guest_memfd		fd_kvm_guest_memfd
	pad1			const[0, int32]
	pad2			array[const[0, int64], 14]
}

# https://docs.kernel.org/virt/kvm/api.html#kvm-get-vcpu-events
kvm_vcpu_events_x86 {
	exinjec			int8
	exnr			int8
	exhec			int8
	pad1			const[0, int8]
	exec			int32

	ininjec			int8
	innr			int8
	insoft			int8
	inshad			int8

	nmiinj			int8
	nmipend			int8
	nmimask			int8
	pad2			const[0, int8]

	sipi_vector		int32
	flags			int32

	smismm			int8
	smipend			int8
	smiinsi			int8
	smilatc			int8

	reserved		array[const[0, int8], 27]
	exception_has_payload	int8
	exception_payload	int64
}

kvm_vcpu_events_arm64 {
	serror_pending		int8
	serror_has_esr		int8
	ext_dabt_pending	int8
	pad			array[const[0, int8], 5]
	serror_esr		int64
	reserved		array[const[0, int32], 12]
}

kvm_vcpu_events [
	x86	kvm_vcpu_events_x86
	arm64	kvm_vcpu_events_arm64
]

kvm_irq_level {
	irq	int32
	level	int32
}

kvm_signal_mask {
	len	len[sigset, int32]
	sigset	array[int8]
}

kvm_dirty_log {
	slot	flags[kvm_mem_slots, int32]
	pad	const[0, int32]
	bitmap	vma64
}

# num_pages and first_page must be multiples of 64,
# see https://docs.kernel.org/virt/kvm/api.html#kvm-clear-dirty-log-vm-ioctl
kvm_clear_dirty_log {
	slot		flags[kvm_mem_slots, int32]
	num_pages	int32[0:1024, 64]
	first_page	int32[0:1024, 64]
# Allocate 1024 bits regardless of num_pages.
	bitmap		ptr[in, array[int64, 128]]
}

kvm_regs {
	gp	array[int64, 16]
	rip	flags[kvm_guest_addrs, int64]
	rflags	flags[kvm_x86_rflags, int64]
}

kvm_sregs {
	cs	kvm_segment
	ds	kvm_segment
	es	kvm_segment
	fs	kvm_segment
	gs	kvm_segment
	ss	kvm_segment
	tr	kvm_segment
	ldt	kvm_segment
	gdt	kvm_dtable
	idt	kvm_dtable
	cr0	flags[kvm_x86_cr0, int64]
	cr2	const[0, int64]
# TODO: this should point to page table
	cr3	flags[kvm_guest_addrs, int64]
	cr4	flags[kvm_x86_cr4, int64]
	cr8	int64[0:15]
	efer	flags[kvm_x86_efer, int64]
	apic	flags[kvm_guest_addrs, int64]
	intr	array[int64, 4]
}

kvm_segment {
	base	flags[kvm_guest_addrs, int64]
	limit	flags[kvm_guest_addrs, int32]
	select	flags[kvm_guest_selector, int16]
	type	int8
	present	int8
	dpl	int8
	db	int8
	s	int8
	l	int8
	g	int8
	avl	int8
	unusabl	int8
	padding	const[0, int8]
}

kvm_dtable {
	base	flags[kvm_guest_addrs, int64]
	limit	int16
	pad	array[const[0, int16], 3]
}

kvm_coalesced_mmio_zone {
	addr		flags[kvm_guest_addrs, int64]
	size		flags[kvm_guest_addr_size, int32]
	pio_or_pad	int32[0:1]
}

# pkg/ifuzz/pseudo.go also knows this list
define VMCS12_SIZE	0x1000

# Deprecated consts.
# These were removed in a5d3df8ae13.

define KVM_ASSIGN_DEV_IRQ	0x4040AE70
define KVM_ASSIGN_PCI_DEVICE	0x8040AE69
define KVM_ASSIGN_SET_INTX_MASK	0x4040AEA4
define KVM_ASSIGN_SET_MSIX_ENTRY	0x4010AE74
define KVM_ASSIGN_SET_MSIX_NR	0x4008AE73
define KVM_DEASSIGN_DEV_IRQ	0x4040AE75
define KVM_DEASSIGN_PCI_DEVICE	0x4040AE72
# Register descriptions generated by tools/arm64/registers.go
kvm_regs_arm64_sys = 0x6030000000138002, 0x6030000000138010, 0x6030000000138012, 0x603000000013801a, 0x6030000000138032, 0x6030000000138004, 0x603000000013800c, 0x6030000000138014, 0x603000000013801c, 0x6030000000138024, 0x603000000013802c, 0x6030000000138034, 0x603000000013803c, 0x6030000000138044, 0x603000000013804c, 0x6030000000138054, 0x603000000013805c, 0x6030000000138064, 0x603000000013806c, 0x6030000000138074, 0x603000000013807c, 0x6030000000138005, 0x603000000013800d, 0x6030000000138015, 0x603000000013801d, 0x6030000000138025, 0x603000000013802d, 0x6030000000138035, 0x603000000013803d, 0x6030000000138045, 0x603000000013804d, 0x6030000000138055, 0x603000000013805d, 0x6030000000138065, 0x603000000013806d, 0x6030000000138075, 0x603000000013807d, 0x6030000000138006, 0x603000000013800e, 0x6030000000138016, 0x603000000013801e, 0x6030000000138026, 0x603000000013802e, 0x6030000000138036, 0x603000000013803e, 0x6030000000138046, 0x603000000013804e, 0x6030000000138056, 0x603000000013805e, 0x6030000000138066, 0x603000000013806e, 0x6030000000138076, 0x603000000013807e, 0x6030000000138007, 0x603000000013800f, 0x6030000000138017, 0x603000000013801f, 0x6030000000138027, 0x603000000013802f, 0x6030000000138037, 0x603000000013803f, 0x6030000000138047, 0x603000000013804f, 0x6030000000138057, 0x603000000013805f, 0x6030000000138067, 0x603000000013806f, 0x6030000000138077, 0x603000000013807f, 0x6030000000138080, 0x6030000000138084, 0x603000000013808c, 0x603000000013809c, 0x60300000001380a4, 0x60300000001383c6, 0x60300000001383ce, 0x60300000001383f6, 0x6030000000139808, 0x6030000000139820, 0x6030000000139828, 0x6030000000139828, 0x603000000013a038, 0x603000000013c000, 0x603000000013c005, 0x603000000013c006, 0x603000000013c008, 0x603000000013c009, 0x603000000013c00a, 0x603000000013c00b, 0x603000000013c00c, 0x603000000013c00d, 0x603000000013c00e, 0x603000000013c00f, 0x603000000013c010, 0x603000000013c011, 0x603000000013c012, 0x603000000013c013, 0x603000000013c014, 0x603000000013c015, 0x603000000013c016, 0x603000000013c017, 0x603000000013c018, 0x603000000013c019, 0x603000000013c01a, 0x603000000013c01c, 0x603000000013c01d, 0x603000000013c01e, 0x603000000013c020, 0x603000000013c021, 0x603000000013c024, 0x603000000013c028, 0x603000000013c029, 0x603000000013c02c, 0x603000000013c02d, 0x603000000013c030, 0x603000000013c031, 0x603000000013c032, 0x603000000013c038, 0x603000000013c039, 0x603000000013c03a, 0x603000000013c080, 0x603000000013c081, 0x603000000013c082, 0x603000000013c085, 0x603000000013c086, 0x603000000013c090, 0x603000000013c091, 0x603000000013c100, 0x603000000013c101, 0x603000000013c102, 0x603000000013c108, 0x603000000013c109, 0x603000000013c10a, 0x603000000013c10b, 0x603000000013c110, 0x603000000013c111, 0x603000000013c112, 0x603000000013c113, 0x603000000013c118, 0x603000000013c119, 0x603000000013c200, 0x603000000013c201, 0x603000000013c208, 0x603000000013c210, 0x6030000000130205, 0x603000000013c212, 0x603000000013c213, 0x6030000000130204, 0x603000000013c214, 0x6030000000130203, 0x603000000013c230, 0x603000000013c288, 0x603000000013c289, 0x603000000013c290, 0x603000000013c298, 0x603000000013c299, 0x603000000013c2a0, 0x603000000013c2a1, 0x603000000013c2a2, 0x603000000013c2a3, 0x603000000013c2a4, 0x603000000013c2a5, 0x603000000013c2a6, 0x603000000013c2a8, 0x603000000013c2a9, 0x603000000013c2aa, 0x603000000013c2ab, 0x603000000013c2b0, 0x603000000013c2b1, 0x603000000013c300, 0x603000000013c3a0, 0x603000000013c4c8, 0x603000000013c4c9, 0x603000000013c4ca, 0x603000000013c4cb, 0x603000000013c4cc, 0x603000000013c4cd, 0x603000000013c4ce, 0x603000000013c4cf, 0x603000000013c4d0, 0x603000000013c4d1, 0x603000000013c4d3, 0x603000000013c4d7, 0x603000000013c4f1, 0x603000000013c4f2, 0x603000000013c4f6, 0x603000000013c510, 0x603000000013c518, 0x603000000013c520, 0x603000000013c521, 0x603000000013c522, 0x603000000013c523, 0x603000000013c524, 0x603000000013c527, 0x603000000013c528, 0x603000000013c529, 0x603000000013c600, 0x603000000013c601, 0x603000000013c602, 0x603000000013c608, 0x603000000013c609, 0x603000000013c640, 0x603000000013c641, 0x603000000013c642, 0x603000000013c643, 0x603000000013c644, 0x603000000013c645, 0x603000000013c646, 0x603000000013c647, 0x603000000013c648, 0x603000000013c649, 0x603000000013c64a, 0x603000000013c64b, 0x603000000013c659, 0x603000000013c65b, 0x603000000013c65d, 0x603000000013c65e, 0x603000000013c65f, 0x603000000013c660, 0x603000000013c661, 0x603000000013c662, 0x603000000013c663, 0x603000000013c664, 0x603000000013c665, 0x603000000013c666, 0x603000000013c667, 0x603000000013c681, 0x603000000013c684, 0x603000000013c685, 0x603000000013c687, 0x603000000013c708, 0x603000000013c800, 0x603000000013c801, 0x603000000013c802, 0x603000000013c804, 0x603000000013c807, 0x603000000013d000, 0x603000000013d801, 0x603000000013d807, 0x603000000013d920, 0x603000000013d921, 0x603000000013da10, 0x603000000013da11, 0x603000000013da15, 0x6030000000131a02, 0x603000000013da16, 0x6030000000131a01, 0x603000000013da17, 0x6030000000131a04, 0x603000000013da20, 0x603000000013da21, 0x603000000013da28, 0x603000000013da29, 0x603000000013dce0, 0x603000000013dce1, 0x603000000013dce2, 0x603000000013dce3, 0x603000000013dce4, 0x603000000013dce5, 0x603000000013dce6, 0x603000000013dce7, 0x603000000013dce8, 0x603000000013dce9, 0x603000000013dcea, 0x603000000013dcf0, 0x603000000013dcf3, 0x603000000013de82, 0x603000000013de83, 0x603000000013de87, 0x603000000013de90, 0x603000000013de91, 0x603000000013de92, 0x603000000013de93, 0x603000000013de94, 0x603000000013de95, 0x603000000013de96, 0x603000000013de98, 0x603000000013de99, 0x603000000013dea0, 0x603000000013dea1, 0x603000000013dea2, 0x603000000013dea3, 0x603000000013dea4, 0x603000000013dea5, 0x603000000013dea6, 0x603000000013dea7, 0x603000000013dea8, 0x603000000013dea9, 0x603000000013deaa, 0x603000000013deab, 0x603000000013deac, 0x603000000013dead, 0x603000000013deae, 0x603000000013deaf, 0x603000000013deb0, 0x603000000013deb1, 0x603000000013deb2, 0x603000000013deb3, 0x603000000013deb4, 0x603000000013deb5, 0x603000000013deb6, 0x603000000013deb7, 0x603000000013deb8, 0x603000000013deb9, 0x603000000013deba, 0x603000000013debb, 0x603000000013debc, 0x603000000013debd, 0x603000000013debe, 0x603000000013debf, 0x603000000013dee0, 0x603000000013dee1, 0x603000000013dee2, 0x603000000013dee3, 0x603000000013dee4, 0x603000000013dee5, 0x603000000013dee6, 0x603000000013dee7, 0x603000000013dee8, 0x603000000013dee9, 0x603000000013deea, 0x603000000013deeb, 0x603000000013deec, 0x603000000013deed, 0x603000000013deee, 0x603000000013deef, 0x603000000013def0, 0x603000000013def1, 0x603000000013def2, 0x603000000013def3, 0x603000000013def4, 0x603000000013def5, 0x603000000013def6, 0x603000000013def7, 0x603000000013def8, 0x603000000013def9, 0x603000000013defa, 0x603000000013defb, 0x603000000013defc, 0x603000000013defd, 0x603000000013defe, 0x603000000013deff, 0x603000000013df00, 0x603000000013df01, 0x603000000013df02, 0x603000000013df05, 0x603000000013df06, 0x603000000013df10, 0x603000000013df11, 0x603000000013df12, 0x603000000013df18, 0x603000000013df19, 0x603000000013df1a, 0x603000000013df40, 0x603000000013df41, 0x603000000013df42, 0x603000000013df43, 0x603000000013df44, 0x603000000013df45, 0x603000000013df46, 0x603000000013df47, 0x603000000013df48, 0x603000000013df49, 0x603000000013df4a, 0x603000000013df4b, 0x603000000013df4c, 0x603000000013df4d, 0x603000000013df4e, 0x603000000013df4f, 0x603000000013df50, 0x603000000013df51, 0x603000000013df52, 0x603000000013df53, 0x603000000013df54, 0x603000000013df55, 0x603000000013df56, 0x603000000013df57, 0x603000000013df58, 0x603000000013df59, 0x603000000013df5a, 0x603000000013df5b, 0x603000000013df5c, 0x603000000013df5d, 0x603000000013df5e, 0x603000000013df5f, 0x603000000013df7f, 0x603000000013df60, 0x603000000013df61, 0x603000000013df62, 0x603000000013df63, 0x603000000013df64, 0x603000000013df65, 0x603000000013df66, 0x603000000013df67, 0x603000000013df68, 0x603000000013df69, 0x603000000013df6a, 0x603000000013df6b, 0x603000000013df6c, 0x603000000013df6d, 0x603000000013df6e, 0x603000000013df6f, 0x603000000013df70, 0x603000000013df71, 0x603000000013df72, 0x603000000013df73, 0x603000000013df74, 0x603000000013df75, 0x603000000013df76, 0x603000000013df77, 0x603000000013df78, 0x603000000013df79, 0x603000000013df7a, 0x603000000013df7b, 0x603000000013df7c, 0x603000000013df7d, 0x603000000013df7e, 0x603000000013df7f, 0x603000000013e000, 0x603000000013e005, 0x603000000013e080, 0x603000000013e081, 0x603000000013e088, 0x603000000013e089, 0x603000000013e08a, 0x603000000013e08b, 0x603000000013e08c, 0x603000000013e08d, 0x603000000013e08e, 0x603000000013e08f, 0x603000000013e090, 0x603000000013e091, 0x603000000013e092, 0x603000000013e099, 0x603000000013e100, 0x603000000013e101, 0x603000000013e102, 0x603000000013e108, 0x603000000013e10a, 0x603000000013e110, 0x603000000013e130, 0x603000000013e132, 0x603000000013e180, 0x603000000013e18c, 0x603000000013e18d, 0x603000000013e18e, 0x603000000013e200, 0x603000000013e201, 0x603000000013e208, 0x603000000013e218, 0x603000000013e219, 0x603000000013e21a, 0x603000000013e21b, 0x603000000013e281, 0x603000000013e288, 0x603000000013e289, 0x603000000013e290, 0x603000000013e293, 0x603000000013e298, 0x603000000013e2b0, 0x603000000013e300, 0x603000000013e304, 0x603000000013e4c8, 0x603000000013e510, 0x603000000013e518, 0x603000000013e520, 0x603000000013e521, 0x603000000013e528, 0x603000000013e530, 0x603000000013e531, 0x603000000013e532, 0x603000000013e533, 0x603000000013e534, 0x603000000013e535, 0x603000000013e536, 0x603000000013e537, 0x603000000013e600, 0x603000000013e601, 0x603000000013e602, 0x603000000013e609, 0x603000000013e640, 0x603000000013e641, 0x603000000013e642, 0x603000000013e643, 0x603000000013e648, 0x603000000013e649, 0x603000000013e64a, 0x603000000013e64b, 0x603000000013e64d, 0x603000000013e658, 0x603000000013e659, 0x603000000013e65a, 0x603000000013e65b, 0x603000000013e65d, 0x603000000013e65f, 0x603000000013e660, 0x603000000013e661, 0x603000000013e662, 0x603000000013e663, 0x603000000013e664, 0x603000000013e665, 0x603000000013e666, 0x603000000013e667, 0x603000000013e668, 0x603000000013e669, 0x603000000013e66a, 0x603000000013e66b, 0x603000000013e66c, 0x603000000013e66d, 0x603000000013e66e, 0x603000000013e66f, 0x603000000013e681, 0x603000000013e682, 0x603000000013e687, 0x603000000013e6c0, 0x603000000013e6c1, 0x603000000013e6c2, 0x603000000013e6c3, 0x603000000013e6c4, 0x603000000013e6c5, 0x603000000013e6c6, 0x603000000013e6c7, 0x603000000013e6c8, 0x603000000013e6c9, 0x603000000013e6ca, 0x603000000013e6cb, 0x603000000013e6cc, 0x603000000013e6cd, 0x603000000013e6ce, 0x603000000013e6cf, 0x603000000013e6d0, 0x603000000013e6d1, 0x603000000013e6d2, 0x603000000013e6d3, 0x603000000013e6d4, 0x603000000013e6d5, 0x603000000013e6d6, 0x603000000013e6d7, 0x603000000013e6d8, 0x603000000013e6d9, 0x603000000013e6da, 0x603000000013e6db, 0x603000000013e6dc, 0x603000000013e6dd, 0x603000000013e6de, 0x603000000013e6df, 0x603000000013e703, 0x603000000013e706, 0x603000000013e708, 0x603000000013e710, 0x603000000013e711, 0x603000000013e712, 0x603000000013e718, 0x603000000013e719, 0x603000000013e71a, 0x603000000013e720, 0x603000000013e721, 0x603000000013e722, 0x603000000013e728, 0x603000000013e729, 0x603000000013e72a, 0x603000000013f080, 0x603000000013f081, 0x603000000013f088, 0x603000000013f089, 0x603000000013f08a, 0x603000000013f090, 0x603000000013f099, 0x603000000013f100, 0x603000000013f102, 0x603000000013f200, 0x603000000013f201, 0x603000000013f208, 0x603000000013f288, 0x603000000013f289, 0x603000000013f290, 0x603000000013f2b0, 0x603000000013f300, 0x603000000013f510, 0x603000000013f518, 0x603000000013f528, 0x603000000013f600, 0x603000000013f601, 0x603000000013f602, 0x603000000013f664, 0x603000000013f665, 0x603000000013f667, 0x603000000013f682, 0x603000000013f687, 0x603000000013ff10, 0x603000000013ff11, 0x603000000013ff12
# Extra registers that KVM_GET_REG_LIST prints on QEMU
kvm_regs_arm64_extra = 0x603000000013c01b, 0x603000000013c01f, 0x603000000013c022, 0x603000000013c023, 0x603000000013c025, 0x603000000013c026, 0x603000000013c027, 0x603000000013c02a, 0x603000000013c02b, 0x603000000013c02e, 0x603000000013c02f, 0x603000000013c033, 0x603000000013c034, 0x603000000013c035, 0x603000000013c036, 0x603000000013c037, 0x603000000013c03b, 0x603000000013c03c, 0x603000000013c03d, 0x603000000013c03e, 0x603000000013c03f, 0x603000000013c103, 0x603000000013c512, 0x603000000013c513
# End of register descriptions generated by tools/arm64/registers.go