diff options
Diffstat (limited to 'Documentation/virtual/kvm/api.txt')
-rw-r--r-- | Documentation/virtual/kvm/api.txt | 281 |
1 files changed, 274 insertions, 7 deletions
diff --git a/Documentation/virtual/kvm/api.txt b/Documentation/virtual/kvm/api.txt index 6386f8c0482..930126698a0 100644 --- a/Documentation/virtual/kvm/api.txt +++ b/Documentation/virtual/kvm/api.txt | |||
@@ -2,6 +2,7 @@ The Definitive KVM (Kernel-based Virtual Machine) API Documentation | |||
2 | =================================================================== | 2 | =================================================================== |
3 | 3 | ||
4 | 1. General description | 4 | 1. General description |
5 | ---------------------- | ||
5 | 6 | ||
6 | The kvm API is a set of ioctls that are issued to control various aspects | 7 | The kvm API is a set of ioctls that are issued to control various aspects |
7 | of a virtual machine. The ioctls belong to three classes | 8 | of a virtual machine. The ioctls belong to three classes |
@@ -23,7 +24,9 @@ of a virtual machine. The ioctls belong to three classes | |||
23 | Only run vcpu ioctls from the same thread that was used to create the | 24 | Only run vcpu ioctls from the same thread that was used to create the |
24 | vcpu. | 25 | vcpu. |
25 | 26 | ||
27 | |||
26 | 2. File descriptors | 28 | 2. File descriptors |
29 | ------------------- | ||
27 | 30 | ||
28 | The kvm API is centered around file descriptors. An initial | 31 | The kvm API is centered around file descriptors. An initial |
29 | open("/dev/kvm") obtains a handle to the kvm subsystem; this handle | 32 | open("/dev/kvm") obtains a handle to the kvm subsystem; this handle |
@@ -41,7 +44,9 @@ not cause harm to the host, their actual behavior is not guaranteed by | |||
41 | the API. The only supported use is one virtual machine per process, | 44 | the API. The only supported use is one virtual machine per process, |
42 | and one vcpu per thread. | 45 | and one vcpu per thread. |
43 | 46 | ||
47 | |||
44 | 3. Extensions | 48 | 3. Extensions |
49 | ------------- | ||
45 | 50 | ||
46 | As of Linux 2.6.22, the KVM ABI has been stabilized: no backward | 51 | As of Linux 2.6.22, the KVM ABI has been stabilized: no backward |
47 | incompatible change are allowed. However, there is an extension | 52 | incompatible change are allowed. However, there is an extension |
@@ -53,7 +58,9 @@ Instead, kvm defines extension identifiers and a facility to query | |||
53 | whether a particular extension identifier is available. If it is, a | 58 | whether a particular extension identifier is available. If it is, a |
54 | set of ioctls is available for application use. | 59 | set of ioctls is available for application use. |
55 | 60 | ||
61 | |||
56 | 4. API description | 62 | 4. API description |
63 | ------------------ | ||
57 | 64 | ||
58 | This section describes ioctls that can be used to control kvm guests. | 65 | This section describes ioctls that can be used to control kvm guests. |
59 | For each ioctl, the following information is provided along with a | 66 | For each ioctl, the following information is provided along with a |
@@ -75,6 +82,7 @@ description: | |||
75 | Returns: the return value. General error numbers (EBADF, ENOMEM, EINVAL) | 82 | Returns: the return value. General error numbers (EBADF, ENOMEM, EINVAL) |
76 | are not detailed, but errors with specific meanings are. | 83 | are not detailed, but errors with specific meanings are. |
77 | 84 | ||
85 | |||
78 | 4.1 KVM_GET_API_VERSION | 86 | 4.1 KVM_GET_API_VERSION |
79 | 87 | ||
80 | Capability: basic | 88 | Capability: basic |
@@ -90,6 +98,7 @@ supported. Applications should refuse to run if KVM_GET_API_VERSION | |||
90 | returns a value other than 12. If this check passes, all ioctls | 98 | returns a value other than 12. If this check passes, all ioctls |
91 | described as 'basic' will be available. | 99 | described as 'basic' will be available. |
92 | 100 | ||
101 | |||
93 | 4.2 KVM_CREATE_VM | 102 | 4.2 KVM_CREATE_VM |
94 | 103 | ||
95 | Capability: basic | 104 | Capability: basic |
@@ -109,6 +118,7 @@ In order to create user controlled virtual machines on S390, check | |||
109 | KVM_CAP_S390_UCONTROL and use the flag KVM_VM_S390_UCONTROL as | 118 | KVM_CAP_S390_UCONTROL and use the flag KVM_VM_S390_UCONTROL as |
110 | privileged user (CAP_SYS_ADMIN). | 119 | privileged user (CAP_SYS_ADMIN). |
111 | 120 | ||
121 | |||
112 | 4.3 KVM_GET_MSR_INDEX_LIST | 122 | 4.3 KVM_GET_MSR_INDEX_LIST |
113 | 123 | ||
114 | Capability: basic | 124 | Capability: basic |
@@ -135,6 +145,7 @@ Note: if kvm indicates supports MCE (KVM_CAP_MCE), then the MCE bank MSRs are | |||
135 | not returned in the MSR list, as different vcpus can have a different number | 145 | not returned in the MSR list, as different vcpus can have a different number |
136 | of banks, as set via the KVM_X86_SETUP_MCE ioctl. | 146 | of banks, as set via the KVM_X86_SETUP_MCE ioctl. |
137 | 147 | ||
148 | |||
138 | 4.4 KVM_CHECK_EXTENSION | 149 | 4.4 KVM_CHECK_EXTENSION |
139 | 150 | ||
140 | Capability: basic | 151 | Capability: basic |
@@ -149,6 +160,7 @@ receives an integer that describes the extension availability. | |||
149 | Generally 0 means no and 1 means yes, but some extensions may report | 160 | Generally 0 means no and 1 means yes, but some extensions may report |
150 | additional information in the integer return value. | 161 | additional information in the integer return value. |
151 | 162 | ||
163 | |||
152 | 4.5 KVM_GET_VCPU_MMAP_SIZE | 164 | 4.5 KVM_GET_VCPU_MMAP_SIZE |
153 | 165 | ||
154 | Capability: basic | 166 | Capability: basic |
@@ -161,6 +173,7 @@ The KVM_RUN ioctl (cf.) communicates with userspace via a shared | |||
161 | memory region. This ioctl returns the size of that region. See the | 173 | memory region. This ioctl returns the size of that region. See the |
162 | KVM_RUN documentation for details. | 174 | KVM_RUN documentation for details. |
163 | 175 | ||
176 | |||
164 | 4.6 KVM_SET_MEMORY_REGION | 177 | 4.6 KVM_SET_MEMORY_REGION |
165 | 178 | ||
166 | Capability: basic | 179 | Capability: basic |
@@ -171,6 +184,7 @@ Returns: 0 on success, -1 on error | |||
171 | 184 | ||
172 | This ioctl is obsolete and has been removed. | 185 | This ioctl is obsolete and has been removed. |
173 | 186 | ||
187 | |||
174 | 4.7 KVM_CREATE_VCPU | 188 | 4.7 KVM_CREATE_VCPU |
175 | 189 | ||
176 | Capability: basic | 190 | Capability: basic |
@@ -223,6 +237,7 @@ machines, the resulting vcpu fd can be memory mapped at page offset | |||
223 | KVM_S390_SIE_PAGE_OFFSET in order to obtain a memory map of the virtual | 237 | KVM_S390_SIE_PAGE_OFFSET in order to obtain a memory map of the virtual |
224 | cpu's hardware control block. | 238 | cpu's hardware control block. |
225 | 239 | ||
240 | |||
226 | 4.8 KVM_GET_DIRTY_LOG (vm ioctl) | 241 | 4.8 KVM_GET_DIRTY_LOG (vm ioctl) |
227 | 242 | ||
228 | Capability: basic | 243 | Capability: basic |
@@ -246,6 +261,7 @@ since the last call to this ioctl. Bit 0 is the first page in the | |||
246 | memory slot. Ensure the entire structure is cleared to avoid padding | 261 | memory slot. Ensure the entire structure is cleared to avoid padding |
247 | issues. | 262 | issues. |
248 | 263 | ||
264 | |||
249 | 4.9 KVM_SET_MEMORY_ALIAS | 265 | 4.9 KVM_SET_MEMORY_ALIAS |
250 | 266 | ||
251 | Capability: basic | 267 | Capability: basic |
@@ -256,6 +272,7 @@ Returns: 0 (success), -1 (error) | |||
256 | 272 | ||
257 | This ioctl is obsolete and has been removed. | 273 | This ioctl is obsolete and has been removed. |
258 | 274 | ||
275 | |||
259 | 4.10 KVM_RUN | 276 | 4.10 KVM_RUN |
260 | 277 | ||
261 | Capability: basic | 278 | Capability: basic |
@@ -272,6 +289,7 @@ obtained by mmap()ing the vcpu fd at offset 0, with the size given by | |||
272 | KVM_GET_VCPU_MMAP_SIZE. The parameter block is formatted as a 'struct | 289 | KVM_GET_VCPU_MMAP_SIZE. The parameter block is formatted as a 'struct |
273 | kvm_run' (see below). | 290 | kvm_run' (see below). |
274 | 291 | ||
292 | |||
275 | 4.11 KVM_GET_REGS | 293 | 4.11 KVM_GET_REGS |
276 | 294 | ||
277 | Capability: basic | 295 | Capability: basic |
@@ -292,6 +310,7 @@ struct kvm_regs { | |||
292 | __u64 rip, rflags; | 310 | __u64 rip, rflags; |
293 | }; | 311 | }; |
294 | 312 | ||
313 | |||
295 | 4.12 KVM_SET_REGS | 314 | 4.12 KVM_SET_REGS |
296 | 315 | ||
297 | Capability: basic | 316 | Capability: basic |
@@ -304,6 +323,7 @@ Writes the general purpose registers into the vcpu. | |||
304 | 323 | ||
305 | See KVM_GET_REGS for the data structure. | 324 | See KVM_GET_REGS for the data structure. |
306 | 325 | ||
326 | |||
307 | 4.13 KVM_GET_SREGS | 327 | 4.13 KVM_GET_SREGS |
308 | 328 | ||
309 | Capability: basic | 329 | Capability: basic |
@@ -331,6 +351,7 @@ interrupt_bitmap is a bitmap of pending external interrupts. At most | |||
331 | one bit may be set. This interrupt has been acknowledged by the APIC | 351 | one bit may be set. This interrupt has been acknowledged by the APIC |
332 | but not yet injected into the cpu core. | 352 | but not yet injected into the cpu core. |
333 | 353 | ||
354 | |||
334 | 4.14 KVM_SET_SREGS | 355 | 4.14 KVM_SET_SREGS |
335 | 356 | ||
336 | Capability: basic | 357 | Capability: basic |
@@ -342,6 +363,7 @@ Returns: 0 on success, -1 on error | |||
342 | Writes special registers into the vcpu. See KVM_GET_SREGS for the | 363 | Writes special registers into the vcpu. See KVM_GET_SREGS for the |
343 | data structures. | 364 | data structures. |
344 | 365 | ||
366 | |||
345 | 4.15 KVM_TRANSLATE | 367 | 4.15 KVM_TRANSLATE |
346 | 368 | ||
347 | Capability: basic | 369 | Capability: basic |
@@ -365,6 +387,7 @@ struct kvm_translation { | |||
365 | __u8 pad[5]; | 387 | __u8 pad[5]; |
366 | }; | 388 | }; |
367 | 389 | ||
390 | |||
368 | 4.16 KVM_INTERRUPT | 391 | 4.16 KVM_INTERRUPT |
369 | 392 | ||
370 | Capability: basic | 393 | Capability: basic |
@@ -413,6 +436,7 @@ c) KVM_INTERRUPT_SET_LEVEL | |||
413 | Note that any value for 'irq' other than the ones stated above is invalid | 436 | Note that any value for 'irq' other than the ones stated above is invalid |
414 | and incurs unexpected behavior. | 437 | and incurs unexpected behavior. |
415 | 438 | ||
439 | |||
416 | 4.17 KVM_DEBUG_GUEST | 440 | 4.17 KVM_DEBUG_GUEST |
417 | 441 | ||
418 | Capability: basic | 442 | Capability: basic |
@@ -423,6 +447,7 @@ Returns: -1 on error | |||
423 | 447 | ||
424 | Support for this has been removed. Use KVM_SET_GUEST_DEBUG instead. | 448 | Support for this has been removed. Use KVM_SET_GUEST_DEBUG instead. |
425 | 449 | ||
450 | |||
426 | 4.18 KVM_GET_MSRS | 451 | 4.18 KVM_GET_MSRS |
427 | 452 | ||
428 | Capability: basic | 453 | Capability: basic |
@@ -451,6 +476,7 @@ Application code should set the 'nmsrs' member (which indicates the | |||
451 | size of the entries array) and the 'index' member of each array entry. | 476 | size of the entries array) and the 'index' member of each array entry. |
452 | kvm will fill in the 'data' member. | 477 | kvm will fill in the 'data' member. |
453 | 478 | ||
479 | |||
454 | 4.19 KVM_SET_MSRS | 480 | 4.19 KVM_SET_MSRS |
455 | 481 | ||
456 | Capability: basic | 482 | Capability: basic |
@@ -466,6 +492,7 @@ Application code should set the 'nmsrs' member (which indicates the | |||
466 | size of the entries array), and the 'index' and 'data' members of each | 492 | size of the entries array), and the 'index' and 'data' members of each |
467 | array entry. | 493 | array entry. |
468 | 494 | ||
495 | |||
469 | 4.20 KVM_SET_CPUID | 496 | 4.20 KVM_SET_CPUID |
470 | 497 | ||
471 | Capability: basic | 498 | Capability: basic |
@@ -494,6 +521,7 @@ struct kvm_cpuid { | |||
494 | struct kvm_cpuid_entry entries[0]; | 521 | struct kvm_cpuid_entry entries[0]; |
495 | }; | 522 | }; |
496 | 523 | ||
524 | |||
497 | 4.21 KVM_SET_SIGNAL_MASK | 525 | 4.21 KVM_SET_SIGNAL_MASK |
498 | 526 | ||
499 | Capability: basic | 527 | Capability: basic |
@@ -516,6 +544,7 @@ struct kvm_signal_mask { | |||
516 | __u8 sigset[0]; | 544 | __u8 sigset[0]; |
517 | }; | 545 | }; |
518 | 546 | ||
547 | |||
519 | 4.22 KVM_GET_FPU | 548 | 4.22 KVM_GET_FPU |
520 | 549 | ||
521 | Capability: basic | 550 | Capability: basic |
@@ -541,6 +570,7 @@ struct kvm_fpu { | |||
541 | __u32 pad2; | 570 | __u32 pad2; |
542 | }; | 571 | }; |
543 | 572 | ||
573 | |||
544 | 4.23 KVM_SET_FPU | 574 | 4.23 KVM_SET_FPU |
545 | 575 | ||
546 | Capability: basic | 576 | Capability: basic |
@@ -566,6 +596,7 @@ struct kvm_fpu { | |||
566 | __u32 pad2; | 596 | __u32 pad2; |
567 | }; | 597 | }; |
568 | 598 | ||
599 | |||
569 | 4.24 KVM_CREATE_IRQCHIP | 600 | 4.24 KVM_CREATE_IRQCHIP |
570 | 601 | ||
571 | Capability: KVM_CAP_IRQCHIP | 602 | Capability: KVM_CAP_IRQCHIP |
@@ -579,6 +610,7 @@ ioapic, a virtual PIC (two PICs, nested), and sets up future vcpus to have a | |||
579 | local APIC. IRQ routing for GSIs 0-15 is set to both PIC and IOAPIC; GSI 16-23 | 610 | local APIC. IRQ routing for GSIs 0-15 is set to both PIC and IOAPIC; GSI 16-23 |
580 | only go to the IOAPIC. On ia64, a IOSAPIC is created. | 611 | only go to the IOAPIC. On ia64, a IOSAPIC is created. |
581 | 612 | ||
613 | |||
582 | 4.25 KVM_IRQ_LINE | 614 | 4.25 KVM_IRQ_LINE |
583 | 615 | ||
584 | Capability: KVM_CAP_IRQCHIP | 616 | Capability: KVM_CAP_IRQCHIP |
@@ -600,6 +632,7 @@ struct kvm_irq_level { | |||
600 | __u32 level; /* 0 or 1 */ | 632 | __u32 level; /* 0 or 1 */ |
601 | }; | 633 | }; |
602 | 634 | ||
635 | |||
603 | 4.26 KVM_GET_IRQCHIP | 636 | 4.26 KVM_GET_IRQCHIP |
604 | 637 | ||
605 | Capability: KVM_CAP_IRQCHIP | 638 | Capability: KVM_CAP_IRQCHIP |
@@ -621,6 +654,7 @@ struct kvm_irqchip { | |||
621 | } chip; | 654 | } chip; |
622 | }; | 655 | }; |
623 | 656 | ||
657 | |||
624 | 4.27 KVM_SET_IRQCHIP | 658 | 4.27 KVM_SET_IRQCHIP |
625 | 659 | ||
626 | Capability: KVM_CAP_IRQCHIP | 660 | Capability: KVM_CAP_IRQCHIP |
@@ -642,6 +676,7 @@ struct kvm_irqchip { | |||
642 | } chip; | 676 | } chip; |
643 | }; | 677 | }; |
644 | 678 | ||
679 | |||
645 | 4.28 KVM_XEN_HVM_CONFIG | 680 | 4.28 KVM_XEN_HVM_CONFIG |
646 | 681 | ||
647 | Capability: KVM_CAP_XEN_HVM | 682 | Capability: KVM_CAP_XEN_HVM |
@@ -666,6 +701,7 @@ struct kvm_xen_hvm_config { | |||
666 | __u8 pad2[30]; | 701 | __u8 pad2[30]; |
667 | }; | 702 | }; |
668 | 703 | ||
704 | |||
669 | 4.29 KVM_GET_CLOCK | 705 | 4.29 KVM_GET_CLOCK |
670 | 706 | ||
671 | Capability: KVM_CAP_ADJUST_CLOCK | 707 | Capability: KVM_CAP_ADJUST_CLOCK |
@@ -684,6 +720,7 @@ struct kvm_clock_data { | |||
684 | __u32 pad[9]; | 720 | __u32 pad[9]; |
685 | }; | 721 | }; |
686 | 722 | ||
723 | |||
687 | 4.30 KVM_SET_CLOCK | 724 | 4.30 KVM_SET_CLOCK |
688 | 725 | ||
689 | Capability: KVM_CAP_ADJUST_CLOCK | 726 | Capability: KVM_CAP_ADJUST_CLOCK |
@@ -702,6 +739,7 @@ struct kvm_clock_data { | |||
702 | __u32 pad[9]; | 739 | __u32 pad[9]; |
703 | }; | 740 | }; |
704 | 741 | ||
742 | |||
705 | 4.31 KVM_GET_VCPU_EVENTS | 743 | 4.31 KVM_GET_VCPU_EVENTS |
706 | 744 | ||
707 | Capability: KVM_CAP_VCPU_EVENTS | 745 | Capability: KVM_CAP_VCPU_EVENTS |
@@ -741,6 +779,7 @@ struct kvm_vcpu_events { | |||
741 | KVM_VCPUEVENT_VALID_SHADOW may be set in the flags field to signal that | 779 | KVM_VCPUEVENT_VALID_SHADOW may be set in the flags field to signal that |
742 | interrupt.shadow contains a valid state. Otherwise, this field is undefined. | 780 | interrupt.shadow contains a valid state. Otherwise, this field is undefined. |
743 | 781 | ||
782 | |||
744 | 4.32 KVM_SET_VCPU_EVENTS | 783 | 4.32 KVM_SET_VCPU_EVENTS |
745 | 784 | ||
746 | Capability: KVM_CAP_VCPU_EVENTS | 785 | Capability: KVM_CAP_VCPU_EVENTS |
@@ -767,6 +806,7 @@ If KVM_CAP_INTR_SHADOW is available, KVM_VCPUEVENT_VALID_SHADOW can be set in | |||
767 | the flags field to signal that interrupt.shadow contains a valid state and | 806 | the flags field to signal that interrupt.shadow contains a valid state and |
768 | shall be written into the VCPU. | 807 | shall be written into the VCPU. |
769 | 808 | ||
809 | |||
770 | 4.33 KVM_GET_DEBUGREGS | 810 | 4.33 KVM_GET_DEBUGREGS |
771 | 811 | ||
772 | Capability: KVM_CAP_DEBUGREGS | 812 | Capability: KVM_CAP_DEBUGREGS |
@@ -785,6 +825,7 @@ struct kvm_debugregs { | |||
785 | __u64 reserved[9]; | 825 | __u64 reserved[9]; |
786 | }; | 826 | }; |
787 | 827 | ||
828 | |||
788 | 4.34 KVM_SET_DEBUGREGS | 829 | 4.34 KVM_SET_DEBUGREGS |
789 | 830 | ||
790 | Capability: KVM_CAP_DEBUGREGS | 831 | Capability: KVM_CAP_DEBUGREGS |
@@ -798,6 +839,7 @@ Writes debug registers into the vcpu. | |||
798 | See KVM_GET_DEBUGREGS for the data structure. The flags field is unused | 839 | See KVM_GET_DEBUGREGS for the data structure. The flags field is unused |
799 | yet and must be cleared on entry. | 840 | yet and must be cleared on entry. |
800 | 841 | ||
842 | |||
801 | 4.35 KVM_SET_USER_MEMORY_REGION | 843 | 4.35 KVM_SET_USER_MEMORY_REGION |
802 | 844 | ||
803 | Capability: KVM_CAP_USER_MEM | 845 | Capability: KVM_CAP_USER_MEM |
@@ -844,6 +886,7 @@ It is recommended to use this API instead of the KVM_SET_MEMORY_REGION ioctl. | |||
844 | The KVM_SET_MEMORY_REGION does not allow fine grained control over memory | 886 | The KVM_SET_MEMORY_REGION does not allow fine grained control over memory |
845 | allocation and is deprecated. | 887 | allocation and is deprecated. |
846 | 888 | ||
889 | |||
847 | 4.36 KVM_SET_TSS_ADDR | 890 | 4.36 KVM_SET_TSS_ADDR |
848 | 891 | ||
849 | Capability: KVM_CAP_SET_TSS_ADDR | 892 | Capability: KVM_CAP_SET_TSS_ADDR |
@@ -862,6 +905,7 @@ This ioctl is required on Intel-based hosts. This is needed on Intel hardware | |||
862 | because of a quirk in the virtualization implementation (see the internals | 905 | because of a quirk in the virtualization implementation (see the internals |
863 | documentation when it pops into existence). | 906 | documentation when it pops into existence). |
864 | 907 | ||
908 | |||
865 | 4.37 KVM_ENABLE_CAP | 909 | 4.37 KVM_ENABLE_CAP |
866 | 910 | ||
867 | Capability: KVM_CAP_ENABLE_CAP | 911 | Capability: KVM_CAP_ENABLE_CAP |
@@ -897,6 +941,7 @@ function properly, this is the place to put them. | |||
897 | __u8 pad[64]; | 941 | __u8 pad[64]; |
898 | }; | 942 | }; |
899 | 943 | ||
944 | |||
900 | 4.38 KVM_GET_MP_STATE | 945 | 4.38 KVM_GET_MP_STATE |
901 | 946 | ||
902 | Capability: KVM_CAP_MP_STATE | 947 | Capability: KVM_CAP_MP_STATE |
@@ -927,6 +972,7 @@ Possible values are: | |||
927 | This ioctl is only useful after KVM_CREATE_IRQCHIP. Without an in-kernel | 972 | This ioctl is only useful after KVM_CREATE_IRQCHIP. Without an in-kernel |
928 | irqchip, the multiprocessing state must be maintained by userspace. | 973 | irqchip, the multiprocessing state must be maintained by userspace. |
929 | 974 | ||
975 | |||
930 | 4.39 KVM_SET_MP_STATE | 976 | 4.39 KVM_SET_MP_STATE |
931 | 977 | ||
932 | Capability: KVM_CAP_MP_STATE | 978 | Capability: KVM_CAP_MP_STATE |
@@ -941,6 +987,7 @@ arguments. | |||
941 | This ioctl is only useful after KVM_CREATE_IRQCHIP. Without an in-kernel | 987 | This ioctl is only useful after KVM_CREATE_IRQCHIP. Without an in-kernel |
942 | irqchip, the multiprocessing state must be maintained by userspace. | 988 | irqchip, the multiprocessing state must be maintained by userspace. |
943 | 989 | ||
990 | |||
944 | 4.40 KVM_SET_IDENTITY_MAP_ADDR | 991 | 4.40 KVM_SET_IDENTITY_MAP_ADDR |
945 | 992 | ||
946 | Capability: KVM_CAP_SET_IDENTITY_MAP_ADDR | 993 | Capability: KVM_CAP_SET_IDENTITY_MAP_ADDR |
@@ -959,6 +1006,7 @@ This ioctl is required on Intel-based hosts. This is needed on Intel hardware | |||
959 | because of a quirk in the virtualization implementation (see the internals | 1006 | because of a quirk in the virtualization implementation (see the internals |
960 | documentation when it pops into existence). | 1007 | documentation when it pops into existence). |
961 | 1008 | ||
1009 | |||
962 | 4.41 KVM_SET_BOOT_CPU_ID | 1010 | 4.41 KVM_SET_BOOT_CPU_ID |
963 | 1011 | ||
964 | Capability: KVM_CAP_SET_BOOT_CPU_ID | 1012 | Capability: KVM_CAP_SET_BOOT_CPU_ID |
@@ -971,6 +1019,7 @@ Define which vcpu is the Bootstrap Processor (BSP). Values are the same | |||
971 | as the vcpu id in KVM_CREATE_VCPU. If this ioctl is not called, the default | 1019 | as the vcpu id in KVM_CREATE_VCPU. If this ioctl is not called, the default |
972 | is vcpu 0. | 1020 | is vcpu 0. |
973 | 1021 | ||
1022 | |||
974 | 4.42 KVM_GET_XSAVE | 1023 | 4.42 KVM_GET_XSAVE |
975 | 1024 | ||
976 | Capability: KVM_CAP_XSAVE | 1025 | Capability: KVM_CAP_XSAVE |
@@ -985,6 +1034,7 @@ struct kvm_xsave { | |||
985 | 1034 | ||
986 | This ioctl would copy current vcpu's xsave struct to the userspace. | 1035 | This ioctl would copy current vcpu's xsave struct to the userspace. |
987 | 1036 | ||
1037 | |||
988 | 4.43 KVM_SET_XSAVE | 1038 | 4.43 KVM_SET_XSAVE |
989 | 1039 | ||
990 | Capability: KVM_CAP_XSAVE | 1040 | Capability: KVM_CAP_XSAVE |
@@ -999,6 +1049,7 @@ struct kvm_xsave { | |||
999 | 1049 | ||
1000 | This ioctl would copy userspace's xsave struct to the kernel. | 1050 | This ioctl would copy userspace's xsave struct to the kernel. |
1001 | 1051 | ||
1052 | |||
1002 | 4.44 KVM_GET_XCRS | 1053 | 4.44 KVM_GET_XCRS |
1003 | 1054 | ||
1004 | Capability: KVM_CAP_XCRS | 1055 | Capability: KVM_CAP_XCRS |
@@ -1022,6 +1073,7 @@ struct kvm_xcrs { | |||
1022 | 1073 | ||
1023 | This ioctl would copy current vcpu's xcrs to the userspace. | 1074 | This ioctl would copy current vcpu's xcrs to the userspace. |
1024 | 1075 | ||
1076 | |||
1025 | 4.45 KVM_SET_XCRS | 1077 | 4.45 KVM_SET_XCRS |
1026 | 1078 | ||
1027 | Capability: KVM_CAP_XCRS | 1079 | Capability: KVM_CAP_XCRS |
@@ -1045,6 +1097,7 @@ struct kvm_xcrs { | |||
1045 | 1097 | ||
1046 | This ioctl would set vcpu's xcr to the value userspace specified. | 1098 | This ioctl would set vcpu's xcr to the value userspace specified. |
1047 | 1099 | ||
1100 | |||
1048 | 4.46 KVM_GET_SUPPORTED_CPUID | 1101 | 4.46 KVM_GET_SUPPORTED_CPUID |
1049 | 1102 | ||
1050 | Capability: KVM_CAP_EXT_CPUID | 1103 | Capability: KVM_CAP_EXT_CPUID |
@@ -1119,6 +1172,7 @@ support. Instead it is reported via | |||
1119 | if that returns true and you use KVM_CREATE_IRQCHIP, or if you emulate the | 1172 | if that returns true and you use KVM_CREATE_IRQCHIP, or if you emulate the |
1120 | feature in userspace, then you can enable the feature for KVM_SET_CPUID2. | 1173 | feature in userspace, then you can enable the feature for KVM_SET_CPUID2. |
1121 | 1174 | ||
1175 | |||
1122 | 4.47 KVM_PPC_GET_PVINFO | 1176 | 4.47 KVM_PPC_GET_PVINFO |
1123 | 1177 | ||
1124 | Capability: KVM_CAP_PPC_GET_PVINFO | 1178 | Capability: KVM_CAP_PPC_GET_PVINFO |
@@ -1142,6 +1196,7 @@ of 4 instructions that make up a hypercall. | |||
1142 | If any additional field gets added to this structure later on, a bit for that | 1196 | If any additional field gets added to this structure later on, a bit for that |
1143 | additional piece of information will be set in the flags bitmap. | 1197 | additional piece of information will be set in the flags bitmap. |
1144 | 1198 | ||
1199 | |||
1145 | 4.48 KVM_ASSIGN_PCI_DEVICE | 1200 | 4.48 KVM_ASSIGN_PCI_DEVICE |
1146 | 1201 | ||
1147 | Capability: KVM_CAP_DEVICE_ASSIGNMENT | 1202 | Capability: KVM_CAP_DEVICE_ASSIGNMENT |
@@ -1185,6 +1240,7 @@ Only PCI header type 0 devices with PCI BAR resources are supported by | |||
1185 | device assignment. The user requesting this ioctl must have read/write | 1240 | device assignment. The user requesting this ioctl must have read/write |
1186 | access to the PCI sysfs resource files associated with the device. | 1241 | access to the PCI sysfs resource files associated with the device. |
1187 | 1242 | ||
1243 | |||
1188 | 4.49 KVM_DEASSIGN_PCI_DEVICE | 1244 | 4.49 KVM_DEASSIGN_PCI_DEVICE |
1189 | 1245 | ||
1190 | Capability: KVM_CAP_DEVICE_DEASSIGNMENT | 1246 | Capability: KVM_CAP_DEVICE_DEASSIGNMENT |
@@ -1198,6 +1254,7 @@ Ends PCI device assignment, releasing all associated resources. | |||
1198 | See KVM_CAP_DEVICE_ASSIGNMENT for the data structure. Only assigned_dev_id is | 1254 | See KVM_CAP_DEVICE_ASSIGNMENT for the data structure. Only assigned_dev_id is |
1199 | used in kvm_assigned_pci_dev to identify the device. | 1255 | used in kvm_assigned_pci_dev to identify the device. |
1200 | 1256 | ||
1257 | |||
1201 | 4.50 KVM_ASSIGN_DEV_IRQ | 1258 | 4.50 KVM_ASSIGN_DEV_IRQ |
1202 | 1259 | ||
1203 | Capability: KVM_CAP_ASSIGN_DEV_IRQ | 1260 | Capability: KVM_CAP_ASSIGN_DEV_IRQ |
@@ -1231,6 +1288,7 @@ The following flags are defined: | |||
1231 | It is not valid to specify multiple types per host or guest IRQ. However, the | 1288 | It is not valid to specify multiple types per host or guest IRQ. However, the |
1232 | IRQ type of host and guest can differ or can even be null. | 1289 | IRQ type of host and guest can differ or can even be null. |
1233 | 1290 | ||
1291 | |||
1234 | 4.51 KVM_DEASSIGN_DEV_IRQ | 1292 | 4.51 KVM_DEASSIGN_DEV_IRQ |
1235 | 1293 | ||
1236 | Capability: KVM_CAP_ASSIGN_DEV_IRQ | 1294 | Capability: KVM_CAP_ASSIGN_DEV_IRQ |
@@ -1245,6 +1303,7 @@ See KVM_ASSIGN_DEV_IRQ for the data structure. The target device is specified | |||
1245 | by assigned_dev_id, flags must correspond to the IRQ type specified on | 1303 | by assigned_dev_id, flags must correspond to the IRQ type specified on |
1246 | KVM_ASSIGN_DEV_IRQ. Partial deassignment of host or guest IRQ is allowed. | 1304 | KVM_ASSIGN_DEV_IRQ. Partial deassignment of host or guest IRQ is allowed. |
1247 | 1305 | ||
1306 | |||
1248 | 4.52 KVM_SET_GSI_ROUTING | 1307 | 4.52 KVM_SET_GSI_ROUTING |
1249 | 1308 | ||
1250 | Capability: KVM_CAP_IRQ_ROUTING | 1309 | Capability: KVM_CAP_IRQ_ROUTING |
@@ -1293,6 +1352,7 @@ struct kvm_irq_routing_msi { | |||
1293 | __u32 pad; | 1352 | __u32 pad; |
1294 | }; | 1353 | }; |
1295 | 1354 | ||
1355 | |||
1296 | 4.53 KVM_ASSIGN_SET_MSIX_NR | 1356 | 4.53 KVM_ASSIGN_SET_MSIX_NR |
1297 | 1357 | ||
1298 | Capability: KVM_CAP_DEVICE_MSIX | 1358 | Capability: KVM_CAP_DEVICE_MSIX |
@@ -1314,6 +1374,7 @@ struct kvm_assigned_msix_nr { | |||
1314 | 1374 | ||
1315 | #define KVM_MAX_MSIX_PER_DEV 256 | 1375 | #define KVM_MAX_MSIX_PER_DEV 256 |
1316 | 1376 | ||
1377 | |||
1317 | 4.54 KVM_ASSIGN_SET_MSIX_ENTRY | 1378 | 4.54 KVM_ASSIGN_SET_MSIX_ENTRY |
1318 | 1379 | ||
1319 | Capability: KVM_CAP_DEVICE_MSIX | 1380 | Capability: KVM_CAP_DEVICE_MSIX |
@@ -1332,7 +1393,8 @@ struct kvm_assigned_msix_entry { | |||
1332 | __u16 padding[3]; | 1393 | __u16 padding[3]; |
1333 | }; | 1394 | }; |
1334 | 1395 | ||
1335 | 4.54 KVM_SET_TSC_KHZ | 1396 | |
1397 | 4.55 KVM_SET_TSC_KHZ | ||
1336 | 1398 | ||
1337 | Capability: KVM_CAP_TSC_CONTROL | 1399 | Capability: KVM_CAP_TSC_CONTROL |
1338 | Architectures: x86 | 1400 | Architectures: x86 |
@@ -1343,7 +1405,8 @@ Returns: 0 on success, -1 on error | |||
1343 | Specifies the tsc frequency for the virtual machine. The unit of the | 1405 | Specifies the tsc frequency for the virtual machine. The unit of the |
1344 | frequency is KHz. | 1406 | frequency is KHz. |
1345 | 1407 | ||
1346 | 4.55 KVM_GET_TSC_KHZ | 1408 | |
1409 | 4.56 KVM_GET_TSC_KHZ | ||
1347 | 1410 | ||
1348 | Capability: KVM_CAP_GET_TSC_KHZ | 1411 | Capability: KVM_CAP_GET_TSC_KHZ |
1349 | Architectures: x86 | 1412 | Architectures: x86 |
@@ -1355,7 +1418,8 @@ Returns the tsc frequency of the guest. The unit of the return value is | |||
1355 | KHz. If the host has unstable tsc this ioctl returns -EIO instead as an | 1418 | KHz. If the host has unstable tsc this ioctl returns -EIO instead as an |
1356 | error. | 1419 | error. |
1357 | 1420 | ||
1358 | 4.56 KVM_GET_LAPIC | 1421 | |
1422 | 4.57 KVM_GET_LAPIC | ||
1359 | 1423 | ||
1360 | Capability: KVM_CAP_IRQCHIP | 1424 | Capability: KVM_CAP_IRQCHIP |
1361 | Architectures: x86 | 1425 | Architectures: x86 |
@@ -1371,7 +1435,8 @@ struct kvm_lapic_state { | |||
1371 | Reads the Local APIC registers and copies them into the input argument. The | 1435 | Reads the Local APIC registers and copies them into the input argument. The |
1372 | data format and layout are the same as documented in the architecture manual. | 1436 | data format and layout are the same as documented in the architecture manual. |
1373 | 1437 | ||
1374 | 4.57 KVM_SET_LAPIC | 1438 | |
1439 | 4.58 KVM_SET_LAPIC | ||
1375 | 1440 | ||
1376 | Capability: KVM_CAP_IRQCHIP | 1441 | Capability: KVM_CAP_IRQCHIP |
1377 | Architectures: x86 | 1442 | Architectures: x86 |
@@ -1387,7 +1452,8 @@ struct kvm_lapic_state { | |||
1387 | Copies the input argument into the the Local APIC registers. The data format | 1452 | Copies the input argument into the the Local APIC registers. The data format |
1388 | and layout are the same as documented in the architecture manual. | 1453 | and layout are the same as documented in the architecture manual. |
1389 | 1454 | ||
1390 | 4.58 KVM_IOEVENTFD | 1455 | |
1456 | 4.59 KVM_IOEVENTFD | ||
1391 | 1457 | ||
1392 | Capability: KVM_CAP_IOEVENTFD | 1458 | Capability: KVM_CAP_IOEVENTFD |
1393 | Architectures: all | 1459 | Architectures: all |
@@ -1417,7 +1483,8 @@ The following flags are defined: | |||
1417 | If datamatch flag is set, the event will be signaled only if the written value | 1483 | If datamatch flag is set, the event will be signaled only if the written value |
1418 | to the registered address is equal to datamatch in struct kvm_ioeventfd. | 1484 | to the registered address is equal to datamatch in struct kvm_ioeventfd. |
1419 | 1485 | ||
1420 | 4.59 KVM_DIRTY_TLB | 1486 | |
1487 | 4.60 KVM_DIRTY_TLB | ||
1421 | 1488 | ||
1422 | Capability: KVM_CAP_SW_TLB | 1489 | Capability: KVM_CAP_SW_TLB |
1423 | Architectures: ppc | 1490 | Architectures: ppc |
@@ -1449,7 +1516,8 @@ The "num_dirty" field is a performance hint for KVM to determine whether it | |||
1449 | should skip processing the bitmap and just invalidate everything. It must | 1516 | should skip processing the bitmap and just invalidate everything. It must |
1450 | be set to the number of set bits in the bitmap. | 1517 | be set to the number of set bits in the bitmap. |
1451 | 1518 | ||
1452 | 4.60 KVM_ASSIGN_SET_INTX_MASK | 1519 | |
1520 | 4.61 KVM_ASSIGN_SET_INTX_MASK | ||
1453 | 1521 | ||
1454 | Capability: KVM_CAP_PCI_2_3 | 1522 | Capability: KVM_CAP_PCI_2_3 |
1455 | Architectures: x86 | 1523 | Architectures: x86 |
@@ -1482,6 +1550,7 @@ See KVM_ASSIGN_DEV_IRQ for the data structure. The target device is specified | |||
1482 | by assigned_dev_id. In the flags field, only KVM_DEV_ASSIGN_MASK_INTX is | 1550 | by assigned_dev_id. In the flags field, only KVM_DEV_ASSIGN_MASK_INTX is |
1483 | evaluated. | 1551 | evaluated. |
1484 | 1552 | ||
1553 | |||
1485 | 4.62 KVM_CREATE_SPAPR_TCE | 1554 | 4.62 KVM_CREATE_SPAPR_TCE |
1486 | 1555 | ||
1487 | Capability: KVM_CAP_SPAPR_TCE | 1556 | Capability: KVM_CAP_SPAPR_TCE |
@@ -1517,6 +1586,7 @@ the entries written by kernel-handled H_PUT_TCE calls, and also lets | |||
1517 | userspace update the TCE table directly which is useful in some | 1586 | userspace update the TCE table directly which is useful in some |
1518 | circumstances. | 1587 | circumstances. |
1519 | 1588 | ||
1589 | |||
1520 | 4.63 KVM_ALLOCATE_RMA | 1590 | 4.63 KVM_ALLOCATE_RMA |
1521 | 1591 | ||
1522 | Capability: KVM_CAP_PPC_RMA | 1592 | Capability: KVM_CAP_PPC_RMA |
@@ -1549,6 +1619,7 @@ is supported; 2 if the processor requires all virtual machines to have | |||
1549 | an RMA, or 1 if the processor can use an RMA but doesn't require it, | 1619 | an RMA, or 1 if the processor can use an RMA but doesn't require it, |
1550 | because it supports the Virtual RMA (VRMA) facility. | 1620 | because it supports the Virtual RMA (VRMA) facility. |
1551 | 1621 | ||
1622 | |||
1552 | 4.64 KVM_NMI | 1623 | 4.64 KVM_NMI |
1553 | 1624 | ||
1554 | Capability: KVM_CAP_USER_NMI | 1625 | Capability: KVM_CAP_USER_NMI |
@@ -1574,6 +1645,7 @@ following algorithm: | |||
1574 | Some guests configure the LINT1 NMI input to cause a panic, aiding in | 1645 | Some guests configure the LINT1 NMI input to cause a panic, aiding in |
1575 | debugging. | 1646 | debugging. |
1576 | 1647 | ||
1648 | |||
1577 | 4.65 KVM_S390_UCAS_MAP | 1649 | 4.65 KVM_S390_UCAS_MAP |
1578 | 1650 | ||
1579 | Capability: KVM_CAP_S390_UCONTROL | 1651 | Capability: KVM_CAP_S390_UCONTROL |
@@ -1593,6 +1665,7 @@ This ioctl maps the memory at "user_addr" with the length "length" to | |||
1593 | the vcpu's address space starting at "vcpu_addr". All parameters need to | 1665 | the vcpu's address space starting at "vcpu_addr". All parameters need to |
1594 | be alligned by 1 megabyte. | 1666 | be alligned by 1 megabyte. |
1595 | 1667 | ||
1668 | |||
1596 | 4.66 KVM_S390_UCAS_UNMAP | 1669 | 4.66 KVM_S390_UCAS_UNMAP |
1597 | 1670 | ||
1598 | Capability: KVM_CAP_S390_UCONTROL | 1671 | Capability: KVM_CAP_S390_UCONTROL |
@@ -1612,6 +1685,7 @@ This ioctl unmaps the memory in the vcpu's address space starting at | |||
1612 | "vcpu_addr" with the length "length". The field "user_addr" is ignored. | 1685 | "vcpu_addr" with the length "length". The field "user_addr" is ignored. |
1613 | All parameters need to be alligned by 1 megabyte. | 1686 | All parameters need to be alligned by 1 megabyte. |
1614 | 1687 | ||
1688 | |||
1615 | 4.67 KVM_S390_VCPU_FAULT | 1689 | 4.67 KVM_S390_VCPU_FAULT |
1616 | 1690 | ||
1617 | Capability: KVM_CAP_S390_UCONTROL | 1691 | Capability: KVM_CAP_S390_UCONTROL |
@@ -1628,6 +1702,7 @@ table upfront. This is useful to handle validity intercepts for user | |||
1628 | controlled virtual machines to fault in the virtual cpu's lowcore pages | 1702 | controlled virtual machines to fault in the virtual cpu's lowcore pages |
1629 | prior to calling the KVM_RUN ioctl. | 1703 | prior to calling the KVM_RUN ioctl. |
1630 | 1704 | ||
1705 | |||
1631 | 4.68 KVM_SET_ONE_REG | 1706 | 4.68 KVM_SET_ONE_REG |
1632 | 1707 | ||
1633 | Capability: KVM_CAP_ONE_REG | 1708 | Capability: KVM_CAP_ONE_REG |
@@ -1653,6 +1728,7 @@ registers, find a list below: | |||
1653 | | | | 1728 | | | |
1654 | PPC | KVM_REG_PPC_HIOR | 64 | 1729 | PPC | KVM_REG_PPC_HIOR | 64 |
1655 | 1730 | ||
1731 | |||
1656 | 4.69 KVM_GET_ONE_REG | 1732 | 4.69 KVM_GET_ONE_REG |
1657 | 1733 | ||
1658 | Capability: KVM_CAP_ONE_REG | 1734 | Capability: KVM_CAP_ONE_REG |
@@ -1669,7 +1745,193 @@ at the memory location pointed to by "addr". | |||
1669 | The list of registers accessible using this interface is identical to the | 1745 | The list of registers accessible using this interface is identical to the |
1670 | list in 4.64. | 1746 | list in 4.64. |
1671 | 1747 | ||
1748 | |||
1749 | 4.70 KVM_KVMCLOCK_CTRL | ||
1750 | |||
1751 | Capability: KVM_CAP_KVMCLOCK_CTRL | ||
1752 | Architectures: Any that implement pvclocks (currently x86 only) | ||
1753 | Type: vcpu ioctl | ||
1754 | Parameters: None | ||
1755 | Returns: 0 on success, -1 on error | ||
1756 | |||
1757 | This signals to the host kernel that the specified guest is being paused by | ||
1758 | userspace. The host will set a flag in the pvclock structure that is checked | ||
1759 | from the soft lockup watchdog. The flag is part of the pvclock structure that | ||
1760 | is shared between guest and host, specifically the second bit of the flags | ||
1761 | field of the pvclock_vcpu_time_info structure. It will be set exclusively by | ||
1762 | the host and read/cleared exclusively by the guest. The guest operation of | ||
1763 | checking and clearing the flag must an atomic operation so | ||
1764 | load-link/store-conditional, or equivalent must be used. There are two cases | ||
1765 | where the guest will clear the flag: when the soft lockup watchdog timer resets | ||
1766 | itself or when a soft lockup is detected. This ioctl can be called any time | ||
1767 | after pausing the vcpu, but before it is resumed. | ||
1768 | |||
1769 | |||
1770 | 4.71 KVM_SIGNAL_MSI | ||
1771 | |||
1772 | Capability: KVM_CAP_SIGNAL_MSI | ||
1773 | Architectures: x86 | ||
1774 | Type: vm ioctl | ||
1775 | Parameters: struct kvm_msi (in) | ||
1776 | Returns: >0 on delivery, 0 if guest blocked the MSI, and -1 on error | ||
1777 | |||
1778 | Directly inject a MSI message. Only valid with in-kernel irqchip that handles | ||
1779 | MSI messages. | ||
1780 | |||
1781 | struct kvm_msi { | ||
1782 | __u32 address_lo; | ||
1783 | __u32 address_hi; | ||
1784 | __u32 data; | ||
1785 | __u32 flags; | ||
1786 | __u8 pad[16]; | ||
1787 | }; | ||
1788 | |||
1789 | No flags are defined so far. The corresponding field must be 0. | ||
1790 | |||
1791 | |||
1792 | 4.71 KVM_CREATE_PIT2 | ||
1793 | |||
1794 | Capability: KVM_CAP_PIT2 | ||
1795 | Architectures: x86 | ||
1796 | Type: vm ioctl | ||
1797 | Parameters: struct kvm_pit_config (in) | ||
1798 | Returns: 0 on success, -1 on error | ||
1799 | |||
1800 | Creates an in-kernel device model for the i8254 PIT. This call is only valid | ||
1801 | after enabling in-kernel irqchip support via KVM_CREATE_IRQCHIP. The following | ||
1802 | parameters have to be passed: | ||
1803 | |||
1804 | struct kvm_pit_config { | ||
1805 | __u32 flags; | ||
1806 | __u32 pad[15]; | ||
1807 | }; | ||
1808 | |||
1809 | Valid flags are: | ||
1810 | |||
1811 | #define KVM_PIT_SPEAKER_DUMMY 1 /* emulate speaker port stub */ | ||
1812 | |||
1813 | PIT timer interrupts may use a per-VM kernel thread for injection. If it | ||
1814 | exists, this thread will have a name of the following pattern: | ||
1815 | |||
1816 | kvm-pit/<owner-process-pid> | ||
1817 | |||
1818 | When running a guest with elevated priorities, the scheduling parameters of | ||
1819 | this thread may have to be adjusted accordingly. | ||
1820 | |||
1821 | This IOCTL replaces the obsolete KVM_CREATE_PIT. | ||
1822 | |||
1823 | |||
1824 | 4.72 KVM_GET_PIT2 | ||
1825 | |||
1826 | Capability: KVM_CAP_PIT_STATE2 | ||
1827 | Architectures: x86 | ||
1828 | Type: vm ioctl | ||
1829 | Parameters: struct kvm_pit_state2 (out) | ||
1830 | Returns: 0 on success, -1 on error | ||
1831 | |||
1832 | Retrieves the state of the in-kernel PIT model. Only valid after | ||
1833 | KVM_CREATE_PIT2. The state is returned in the following structure: | ||
1834 | |||
1835 | struct kvm_pit_state2 { | ||
1836 | struct kvm_pit_channel_state channels[3]; | ||
1837 | __u32 flags; | ||
1838 | __u32 reserved[9]; | ||
1839 | }; | ||
1840 | |||
1841 | Valid flags are: | ||
1842 | |||
1843 | /* disable PIT in HPET legacy mode */ | ||
1844 | #define KVM_PIT_FLAGS_HPET_LEGACY 0x00000001 | ||
1845 | |||
1846 | This IOCTL replaces the obsolete KVM_GET_PIT. | ||
1847 | |||
1848 | |||
1849 | 4.73 KVM_SET_PIT2 | ||
1850 | |||
1851 | Capability: KVM_CAP_PIT_STATE2 | ||
1852 | Architectures: x86 | ||
1853 | Type: vm ioctl | ||
1854 | Parameters: struct kvm_pit_state2 (in) | ||
1855 | Returns: 0 on success, -1 on error | ||
1856 | |||
1857 | Sets the state of the in-kernel PIT model. Only valid after KVM_CREATE_PIT2. | ||
1858 | See KVM_GET_PIT2 for details on struct kvm_pit_state2. | ||
1859 | |||
1860 | This IOCTL replaces the obsolete KVM_SET_PIT. | ||
1861 | |||
1862 | |||
1863 | 4.74 KVM_PPC_GET_SMMU_INFO | ||
1864 | |||
1865 | Capability: KVM_CAP_PPC_GET_SMMU_INFO | ||
1866 | Architectures: powerpc | ||
1867 | Type: vm ioctl | ||
1868 | Parameters: None | ||
1869 | Returns: 0 on success, -1 on error | ||
1870 | |||
1871 | This populates and returns a structure describing the features of | ||
1872 | the "Server" class MMU emulation supported by KVM. | ||
1873 | This can in turn be used by userspace to generate the appropariate | ||
1874 | device-tree properties for the guest operating system. | ||
1875 | |||
1876 | The structure contains some global informations, followed by an | ||
1877 | array of supported segment page sizes: | ||
1878 | |||
1879 | struct kvm_ppc_smmu_info { | ||
1880 | __u64 flags; | ||
1881 | __u32 slb_size; | ||
1882 | __u32 pad; | ||
1883 | struct kvm_ppc_one_seg_page_size sps[KVM_PPC_PAGE_SIZES_MAX_SZ]; | ||
1884 | }; | ||
1885 | |||
1886 | The supported flags are: | ||
1887 | |||
1888 | - KVM_PPC_PAGE_SIZES_REAL: | ||
1889 | When that flag is set, guest page sizes must "fit" the backing | ||
1890 | store page sizes. When not set, any page size in the list can | ||
1891 | be used regardless of how they are backed by userspace. | ||
1892 | |||
1893 | - KVM_PPC_1T_SEGMENTS | ||
1894 | The emulated MMU supports 1T segments in addition to the | ||
1895 | standard 256M ones. | ||
1896 | |||
1897 | The "slb_size" field indicates how many SLB entries are supported | ||
1898 | |||
1899 | The "sps" array contains 8 entries indicating the supported base | ||
1900 | page sizes for a segment in increasing order. Each entry is defined | ||
1901 | as follow: | ||
1902 | |||
1903 | struct kvm_ppc_one_seg_page_size { | ||
1904 | __u32 page_shift; /* Base page shift of segment (or 0) */ | ||
1905 | __u32 slb_enc; /* SLB encoding for BookS */ | ||
1906 | struct kvm_ppc_one_page_size enc[KVM_PPC_PAGE_SIZES_MAX_SZ]; | ||
1907 | }; | ||
1908 | |||
1909 | An entry with a "page_shift" of 0 is unused. Because the array is | ||
1910 | organized in increasing order, a lookup can stop when encoutering | ||
1911 | such an entry. | ||
1912 | |||
1913 | The "slb_enc" field provides the encoding to use in the SLB for the | ||
1914 | page size. The bits are in positions such as the value can directly | ||
1915 | be OR'ed into the "vsid" argument of the slbmte instruction. | ||
1916 | |||
1917 | The "enc" array is a list which for each of those segment base page | ||
1918 | size provides the list of supported actual page sizes (which can be | ||
1919 | only larger or equal to the base page size), along with the | ||
1920 | corresponding encoding in the hash PTE. Similarily, the array is | ||
1921 | 8 entries sorted by increasing sizes and an entry with a "0" shift | ||
1922 | is an empty entry and a terminator: | ||
1923 | |||
1924 | struct kvm_ppc_one_page_size { | ||
1925 | __u32 page_shift; /* Page shift (or 0) */ | ||
1926 | __u32 pte_enc; /* Encoding in the HPTE (>>12) */ | ||
1927 | }; | ||
1928 | |||
1929 | The "pte_enc" field provides a value that can OR'ed into the hash | ||
1930 | PTE's RPN field (ie, it needs to be shifted left by 12 to OR it | ||
1931 | into the hash PTE second double word). | ||
1932 | |||
1672 | 5. The kvm_run structure | 1933 | 5. The kvm_run structure |
1934 | ------------------------ | ||
1673 | 1935 | ||
1674 | Application code obtains a pointer to the kvm_run structure by | 1936 | Application code obtains a pointer to the kvm_run structure by |
1675 | mmap()ing a vcpu fd. From that point, application code can control | 1937 | mmap()ing a vcpu fd. From that point, application code can control |
@@ -1910,7 +2172,9 @@ and usually define the validity of a groups of registers. (e.g. one bit | |||
1910 | 2172 | ||
1911 | }; | 2173 | }; |
1912 | 2174 | ||
2175 | |||
1913 | 6. Capabilities that can be enabled | 2176 | 6. Capabilities that can be enabled |
2177 | ----------------------------------- | ||
1914 | 2178 | ||
1915 | There are certain capabilities that change the behavior of the virtual CPU when | 2179 | There are certain capabilities that change the behavior of the virtual CPU when |
1916 | enabled. To enable them, please see section 4.37. Below you can find a list of | 2180 | enabled. To enable them, please see section 4.37. Below you can find a list of |
@@ -1926,6 +2190,7 @@ The following information is provided along with the description: | |||
1926 | Returns: the return value. General error numbers (EBADF, ENOMEM, EINVAL) | 2190 | Returns: the return value. General error numbers (EBADF, ENOMEM, EINVAL) |
1927 | are not detailed, but errors with specific meanings are. | 2191 | are not detailed, but errors with specific meanings are. |
1928 | 2192 | ||
2193 | |||
1929 | 6.1 KVM_CAP_PPC_OSI | 2194 | 6.1 KVM_CAP_PPC_OSI |
1930 | 2195 | ||
1931 | Architectures: ppc | 2196 | Architectures: ppc |
@@ -1939,6 +2204,7 @@ between the guest and the host. | |||
1939 | 2204 | ||
1940 | When this capability is enabled, KVM_EXIT_OSI can occur. | 2205 | When this capability is enabled, KVM_EXIT_OSI can occur. |
1941 | 2206 | ||
2207 | |||
1942 | 6.2 KVM_CAP_PPC_PAPR | 2208 | 6.2 KVM_CAP_PPC_PAPR |
1943 | 2209 | ||
1944 | Architectures: ppc | 2210 | Architectures: ppc |
@@ -1957,6 +2223,7 @@ HTAB invisible to the guest. | |||
1957 | 2223 | ||
1958 | When this capability is enabled, KVM_EXIT_PAPR_HCALL can occur. | 2224 | When this capability is enabled, KVM_EXIT_PAPR_HCALL can occur. |
1959 | 2225 | ||
2226 | |||
1960 | 6.3 KVM_CAP_SW_TLB | 2227 | 6.3 KVM_CAP_SW_TLB |
1961 | 2228 | ||
1962 | Architectures: ppc | 2229 | Architectures: ppc |