aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/virtual
diff options
context:
space:
mode:
authorJan Kiszka <jan.kiszka@siemens.com>2012-04-24 10:40:15 -0400
committerMarcelo Tosatti <mtosatti@redhat.com>2012-04-27 18:40:28 -0400
commit414fa985f91bdf61fe2baf8111c0ddbdb94808ea (patch)
treeda6a3d6b54295515134fc4a926fe47565e5e5b08 /Documentation/virtual
parent38e8a2ddc9ada5dd1f2def95bebb733bf619bbef (diff)
KVM: Improve readability of KVM API doc
This helps to identify sections and it also fixes the numbering from 4.54 to 4.61. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Diffstat (limited to 'Documentation/virtual')
-rw-r--r--Documentation/virtual/kvm/api.txt99
1 files changed, 92 insertions, 7 deletions
diff --git a/Documentation/virtual/kvm/api.txt b/Documentation/virtual/kvm/api.txt
index a1552210b16d..b48f92786ab3 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
41. General description 41. General description
5----------------------
5 6
6The kvm API is a set of ioctls that are issued to control various aspects 7The kvm API is a set of ioctls that are issued to control various aspects
7of a virtual machine. The ioctls belong to three classes 8of 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
262. File descriptors 282. File descriptors
29-------------------
27 30
28The kvm API is centered around file descriptors. An initial 31The kvm API is centered around file descriptors. An initial
29open("/dev/kvm") obtains a handle to the kvm subsystem; this handle 32open("/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
41the API. The only supported use is one virtual machine per process, 44the API. The only supported use is one virtual machine per process,
42and one vcpu per thread. 45and one vcpu per thread.
43 46
47
443. Extensions 483. Extensions
49-------------
45 50
46As of Linux 2.6.22, the KVM ABI has been stabilized: no backward 51As of Linux 2.6.22, the KVM ABI has been stabilized: no backward
47incompatible change are allowed. However, there is an extension 52incompatible change are allowed. However, there is an extension
@@ -53,7 +58,9 @@ Instead, kvm defines extension identifiers and a facility to query
53whether a particular extension identifier is available. If it is, a 58whether a particular extension identifier is available. If it is, a
54set of ioctls is available for application use. 59set of ioctls is available for application use.
55 60
61
564. API description 624. API description
63------------------
57 64
58This section describes ioctls that can be used to control kvm guests. 65This section describes ioctls that can be used to control kvm guests.
59For each ioctl, the following information is provided along with a 66For 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
784.1 KVM_GET_API_VERSION 864.1 KVM_GET_API_VERSION
79 87
80Capability: basic 88Capability: basic
@@ -90,6 +98,7 @@ supported. Applications should refuse to run if KVM_GET_API_VERSION
90returns a value other than 12. If this check passes, all ioctls 98returns a value other than 12. If this check passes, all ioctls
91described as 'basic' will be available. 99described as 'basic' will be available.
92 100
101
934.2 KVM_CREATE_VM 1024.2 KVM_CREATE_VM
94 103
95Capability: basic 104Capability: basic
@@ -109,6 +118,7 @@ In order to create user controlled virtual machines on S390, check
109KVM_CAP_S390_UCONTROL and use the flag KVM_VM_S390_UCONTROL as 118KVM_CAP_S390_UCONTROL and use the flag KVM_VM_S390_UCONTROL as
110privileged user (CAP_SYS_ADMIN). 119privileged user (CAP_SYS_ADMIN).
111 120
121
1124.3 KVM_GET_MSR_INDEX_LIST 1224.3 KVM_GET_MSR_INDEX_LIST
113 123
114Capability: basic 124Capability: basic
@@ -135,6 +145,7 @@ Note: if kvm indicates supports MCE (KVM_CAP_MCE), then the MCE bank MSRs are
135not returned in the MSR list, as different vcpus can have a different number 145not returned in the MSR list, as different vcpus can have a different number
136of banks, as set via the KVM_X86_SETUP_MCE ioctl. 146of banks, as set via the KVM_X86_SETUP_MCE ioctl.
137 147
148
1384.4 KVM_CHECK_EXTENSION 1494.4 KVM_CHECK_EXTENSION
139 150
140Capability: basic 151Capability: basic
@@ -149,6 +160,7 @@ receives an integer that describes the extension availability.
149Generally 0 means no and 1 means yes, but some extensions may report 160Generally 0 means no and 1 means yes, but some extensions may report
150additional information in the integer return value. 161additional information in the integer return value.
151 162
163
1524.5 KVM_GET_VCPU_MMAP_SIZE 1644.5 KVM_GET_VCPU_MMAP_SIZE
153 165
154Capability: basic 166Capability: basic
@@ -161,6 +173,7 @@ The KVM_RUN ioctl (cf.) communicates with userspace via a shared
161memory region. This ioctl returns the size of that region. See the 173memory region. This ioctl returns the size of that region. See the
162KVM_RUN documentation for details. 174KVM_RUN documentation for details.
163 175
176
1644.6 KVM_SET_MEMORY_REGION 1774.6 KVM_SET_MEMORY_REGION
165 178
166Capability: basic 179Capability: basic
@@ -171,6 +184,7 @@ Returns: 0 on success, -1 on error
171 184
172This ioctl is obsolete and has been removed. 185This ioctl is obsolete and has been removed.
173 186
187
1744.7 KVM_CREATE_VCPU 1884.7 KVM_CREATE_VCPU
175 189
176Capability: basic 190Capability: basic
@@ -223,6 +237,7 @@ machines, the resulting vcpu fd can be memory mapped at page offset
223KVM_S390_SIE_PAGE_OFFSET in order to obtain a memory map of the virtual 237KVM_S390_SIE_PAGE_OFFSET in order to obtain a memory map of the virtual
224cpu's hardware control block. 238cpu's hardware control block.
225 239
240
2264.8 KVM_GET_DIRTY_LOG (vm ioctl) 2414.8 KVM_GET_DIRTY_LOG (vm ioctl)
227 242
228Capability: basic 243Capability: basic
@@ -246,6 +261,7 @@ since the last call to this ioctl. Bit 0 is the first page in the
246memory slot. Ensure the entire structure is cleared to avoid padding 261memory slot. Ensure the entire structure is cleared to avoid padding
247issues. 262issues.
248 263
264
2494.9 KVM_SET_MEMORY_ALIAS 2654.9 KVM_SET_MEMORY_ALIAS
250 266
251Capability: basic 267Capability: basic
@@ -256,6 +272,7 @@ Returns: 0 (success), -1 (error)
256 272
257This ioctl is obsolete and has been removed. 273This ioctl is obsolete and has been removed.
258 274
275
2594.10 KVM_RUN 2764.10 KVM_RUN
260 277
261Capability: basic 278Capability: basic
@@ -272,6 +289,7 @@ obtained by mmap()ing the vcpu fd at offset 0, with the size given by
272KVM_GET_VCPU_MMAP_SIZE. The parameter block is formatted as a 'struct 289KVM_GET_VCPU_MMAP_SIZE. The parameter block is formatted as a 'struct
273kvm_run' (see below). 290kvm_run' (see below).
274 291
292
2754.11 KVM_GET_REGS 2934.11 KVM_GET_REGS
276 294
277Capability: basic 295Capability: basic
@@ -292,6 +310,7 @@ struct kvm_regs {
292 __u64 rip, rflags; 310 __u64 rip, rflags;
293}; 311};
294 312
313
2954.12 KVM_SET_REGS 3144.12 KVM_SET_REGS
296 315
297Capability: basic 316Capability: basic
@@ -304,6 +323,7 @@ Writes the general purpose registers into the vcpu.
304 323
305See KVM_GET_REGS for the data structure. 324See KVM_GET_REGS for the data structure.
306 325
326
3074.13 KVM_GET_SREGS 3274.13 KVM_GET_SREGS
308 328
309Capability: basic 329Capability: basic
@@ -331,6 +351,7 @@ interrupt_bitmap is a bitmap of pending external interrupts. At most
331one bit may be set. This interrupt has been acknowledged by the APIC 351one bit may be set. This interrupt has been acknowledged by the APIC
332but not yet injected into the cpu core. 352but not yet injected into the cpu core.
333 353
354
3344.14 KVM_SET_SREGS 3554.14 KVM_SET_SREGS
335 356
336Capability: basic 357Capability: basic
@@ -342,6 +363,7 @@ Returns: 0 on success, -1 on error
342Writes special registers into the vcpu. See KVM_GET_SREGS for the 363Writes special registers into the vcpu. See KVM_GET_SREGS for the
343data structures. 364data structures.
344 365
366
3454.15 KVM_TRANSLATE 3674.15 KVM_TRANSLATE
346 368
347Capability: basic 369Capability: basic
@@ -365,6 +387,7 @@ struct kvm_translation {
365 __u8 pad[5]; 387 __u8 pad[5];
366}; 388};
367 389
390
3684.16 KVM_INTERRUPT 3914.16 KVM_INTERRUPT
369 392
370Capability: basic 393Capability: basic
@@ -413,6 +436,7 @@ c) KVM_INTERRUPT_SET_LEVEL
413Note that any value for 'irq' other than the ones stated above is invalid 436Note that any value for 'irq' other than the ones stated above is invalid
414and incurs unexpected behavior. 437and incurs unexpected behavior.
415 438
439
4164.17 KVM_DEBUG_GUEST 4404.17 KVM_DEBUG_GUEST
417 441
418Capability: basic 442Capability: basic
@@ -423,6 +447,7 @@ Returns: -1 on error
423 447
424Support for this has been removed. Use KVM_SET_GUEST_DEBUG instead. 448Support for this has been removed. Use KVM_SET_GUEST_DEBUG instead.
425 449
450
4264.18 KVM_GET_MSRS 4514.18 KVM_GET_MSRS
427 452
428Capability: basic 453Capability: basic
@@ -451,6 +476,7 @@ Application code should set the 'nmsrs' member (which indicates the
451size of the entries array) and the 'index' member of each array entry. 476size of the entries array) and the 'index' member of each array entry.
452kvm will fill in the 'data' member. 477kvm will fill in the 'data' member.
453 478
479
4544.19 KVM_SET_MSRS 4804.19 KVM_SET_MSRS
455 481
456Capability: basic 482Capability: basic
@@ -466,6 +492,7 @@ Application code should set the 'nmsrs' member (which indicates the
466size of the entries array), and the 'index' and 'data' members of each 492size of the entries array), and the 'index' and 'data' members of each
467array entry. 493array entry.
468 494
495
4694.20 KVM_SET_CPUID 4964.20 KVM_SET_CPUID
470 497
471Capability: basic 498Capability: 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
4974.21 KVM_SET_SIGNAL_MASK 5254.21 KVM_SET_SIGNAL_MASK
498 526
499Capability: basic 527Capability: basic
@@ -516,6 +544,7 @@ struct kvm_signal_mask {
516 __u8 sigset[0]; 544 __u8 sigset[0];
517}; 545};
518 546
547
5194.22 KVM_GET_FPU 5484.22 KVM_GET_FPU
520 549
521Capability: basic 550Capability: basic
@@ -541,6 +570,7 @@ struct kvm_fpu {
541 __u32 pad2; 570 __u32 pad2;
542}; 571};
543 572
573
5444.23 KVM_SET_FPU 5744.23 KVM_SET_FPU
545 575
546Capability: basic 576Capability: basic
@@ -566,6 +596,7 @@ struct kvm_fpu {
566 __u32 pad2; 596 __u32 pad2;
567}; 597};
568 598
599
5694.24 KVM_CREATE_IRQCHIP 6004.24 KVM_CREATE_IRQCHIP
570 601
571Capability: KVM_CAP_IRQCHIP 602Capability: KVM_CAP_IRQCHIP
@@ -579,6 +610,7 @@ ioapic, a virtual PIC (two PICs, nested), and sets up future vcpus to have a
579local APIC. IRQ routing for GSIs 0-15 is set to both PIC and IOAPIC; GSI 16-23 610local APIC. IRQ routing for GSIs 0-15 is set to both PIC and IOAPIC; GSI 16-23
580only go to the IOAPIC. On ia64, a IOSAPIC is created. 611only go to the IOAPIC. On ia64, a IOSAPIC is created.
581 612
613
5824.25 KVM_IRQ_LINE 6144.25 KVM_IRQ_LINE
583 615
584Capability: KVM_CAP_IRQCHIP 616Capability: 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
6034.26 KVM_GET_IRQCHIP 6364.26 KVM_GET_IRQCHIP
604 637
605Capability: KVM_CAP_IRQCHIP 638Capability: KVM_CAP_IRQCHIP
@@ -621,6 +654,7 @@ struct kvm_irqchip {
621 } chip; 654 } chip;
622}; 655};
623 656
657
6244.27 KVM_SET_IRQCHIP 6584.27 KVM_SET_IRQCHIP
625 659
626Capability: KVM_CAP_IRQCHIP 660Capability: KVM_CAP_IRQCHIP
@@ -642,6 +676,7 @@ struct kvm_irqchip {
642 } chip; 676 } chip;
643}; 677};
644 678
679
6454.28 KVM_XEN_HVM_CONFIG 6804.28 KVM_XEN_HVM_CONFIG
646 681
647Capability: KVM_CAP_XEN_HVM 682Capability: 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
6694.29 KVM_GET_CLOCK 7054.29 KVM_GET_CLOCK
670 706
671Capability: KVM_CAP_ADJUST_CLOCK 707Capability: 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
6874.30 KVM_SET_CLOCK 7244.30 KVM_SET_CLOCK
688 725
689Capability: KVM_CAP_ADJUST_CLOCK 726Capability: 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
7054.31 KVM_GET_VCPU_EVENTS 7434.31 KVM_GET_VCPU_EVENTS
706 744
707Capability: KVM_CAP_VCPU_EVENTS 745Capability: KVM_CAP_VCPU_EVENTS
@@ -741,6 +779,7 @@ struct kvm_vcpu_events {
741KVM_VCPUEVENT_VALID_SHADOW may be set in the flags field to signal that 779KVM_VCPUEVENT_VALID_SHADOW may be set in the flags field to signal that
742interrupt.shadow contains a valid state. Otherwise, this field is undefined. 780interrupt.shadow contains a valid state. Otherwise, this field is undefined.
743 781
782
7444.32 KVM_SET_VCPU_EVENTS 7834.32 KVM_SET_VCPU_EVENTS
745 784
746Capability: KVM_CAP_VCPU_EVENTS 785Capability: KVM_CAP_VCPU_EVENTS
@@ -767,6 +806,7 @@ If KVM_CAP_INTR_SHADOW is available, KVM_VCPUEVENT_VALID_SHADOW can be set in
767the flags field to signal that interrupt.shadow contains a valid state and 806the flags field to signal that interrupt.shadow contains a valid state and
768shall be written into the VCPU. 807shall be written into the VCPU.
769 808
809
7704.33 KVM_GET_DEBUGREGS 8104.33 KVM_GET_DEBUGREGS
771 811
772Capability: KVM_CAP_DEBUGREGS 812Capability: KVM_CAP_DEBUGREGS
@@ -785,6 +825,7 @@ struct kvm_debugregs {
785 __u64 reserved[9]; 825 __u64 reserved[9];
786}; 826};
787 827
828
7884.34 KVM_SET_DEBUGREGS 8294.34 KVM_SET_DEBUGREGS
789 830
790Capability: KVM_CAP_DEBUGREGS 831Capability: KVM_CAP_DEBUGREGS
@@ -798,6 +839,7 @@ Writes debug registers into the vcpu.
798See KVM_GET_DEBUGREGS for the data structure. The flags field is unused 839See KVM_GET_DEBUGREGS for the data structure. The flags field is unused
799yet and must be cleared on entry. 840yet and must be cleared on entry.
800 841
842
8014.35 KVM_SET_USER_MEMORY_REGION 8434.35 KVM_SET_USER_MEMORY_REGION
802 844
803Capability: KVM_CAP_USER_MEM 845Capability: KVM_CAP_USER_MEM
@@ -844,6 +886,7 @@ It is recommended to use this API instead of the KVM_SET_MEMORY_REGION ioctl.
844The KVM_SET_MEMORY_REGION does not allow fine grained control over memory 886The KVM_SET_MEMORY_REGION does not allow fine grained control over memory
845allocation and is deprecated. 887allocation and is deprecated.
846 888
889
8474.36 KVM_SET_TSS_ADDR 8904.36 KVM_SET_TSS_ADDR
848 891
849Capability: KVM_CAP_SET_TSS_ADDR 892Capability: KVM_CAP_SET_TSS_ADDR
@@ -862,6 +905,7 @@ This ioctl is required on Intel-based hosts. This is needed on Intel hardware
862because of a quirk in the virtualization implementation (see the internals 905because of a quirk in the virtualization implementation (see the internals
863documentation when it pops into existence). 906documentation when it pops into existence).
864 907
908
8654.37 KVM_ENABLE_CAP 9094.37 KVM_ENABLE_CAP
866 910
867Capability: KVM_CAP_ENABLE_CAP 911Capability: 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
9004.38 KVM_GET_MP_STATE 9454.38 KVM_GET_MP_STATE
901 946
902Capability: KVM_CAP_MP_STATE 947Capability: KVM_CAP_MP_STATE
@@ -927,6 +972,7 @@ Possible values are:
927This ioctl is only useful after KVM_CREATE_IRQCHIP. Without an in-kernel 972This ioctl is only useful after KVM_CREATE_IRQCHIP. Without an in-kernel
928irqchip, the multiprocessing state must be maintained by userspace. 973irqchip, the multiprocessing state must be maintained by userspace.
929 974
975
9304.39 KVM_SET_MP_STATE 9764.39 KVM_SET_MP_STATE
931 977
932Capability: KVM_CAP_MP_STATE 978Capability: KVM_CAP_MP_STATE
@@ -941,6 +987,7 @@ arguments.
941This ioctl is only useful after KVM_CREATE_IRQCHIP. Without an in-kernel 987This ioctl is only useful after KVM_CREATE_IRQCHIP. Without an in-kernel
942irqchip, the multiprocessing state must be maintained by userspace. 988irqchip, the multiprocessing state must be maintained by userspace.
943 989
990
9444.40 KVM_SET_IDENTITY_MAP_ADDR 9914.40 KVM_SET_IDENTITY_MAP_ADDR
945 992
946Capability: KVM_CAP_SET_IDENTITY_MAP_ADDR 993Capability: KVM_CAP_SET_IDENTITY_MAP_ADDR
@@ -959,6 +1006,7 @@ This ioctl is required on Intel-based hosts. This is needed on Intel hardware
959because of a quirk in the virtualization implementation (see the internals 1006because of a quirk in the virtualization implementation (see the internals
960documentation when it pops into existence). 1007documentation when it pops into existence).
961 1008
1009
9624.41 KVM_SET_BOOT_CPU_ID 10104.41 KVM_SET_BOOT_CPU_ID
963 1011
964Capability: KVM_CAP_SET_BOOT_CPU_ID 1012Capability: KVM_CAP_SET_BOOT_CPU_ID
@@ -971,6 +1019,7 @@ Define which vcpu is the Bootstrap Processor (BSP). Values are the same
971as the vcpu id in KVM_CREATE_VCPU. If this ioctl is not called, the default 1019as the vcpu id in KVM_CREATE_VCPU. If this ioctl is not called, the default
972is vcpu 0. 1020is vcpu 0.
973 1021
1022
9744.42 KVM_GET_XSAVE 10234.42 KVM_GET_XSAVE
975 1024
976Capability: KVM_CAP_XSAVE 1025Capability: KVM_CAP_XSAVE
@@ -985,6 +1034,7 @@ struct kvm_xsave {
985 1034
986This ioctl would copy current vcpu's xsave struct to the userspace. 1035This ioctl would copy current vcpu's xsave struct to the userspace.
987 1036
1037
9884.43 KVM_SET_XSAVE 10384.43 KVM_SET_XSAVE
989 1039
990Capability: KVM_CAP_XSAVE 1040Capability: KVM_CAP_XSAVE
@@ -999,6 +1049,7 @@ struct kvm_xsave {
999 1049
1000This ioctl would copy userspace's xsave struct to the kernel. 1050This ioctl would copy userspace's xsave struct to the kernel.
1001 1051
1052
10024.44 KVM_GET_XCRS 10534.44 KVM_GET_XCRS
1003 1054
1004Capability: KVM_CAP_XCRS 1055Capability: KVM_CAP_XCRS
@@ -1022,6 +1073,7 @@ struct kvm_xcrs {
1022 1073
1023This ioctl would copy current vcpu's xcrs to the userspace. 1074This ioctl would copy current vcpu's xcrs to the userspace.
1024 1075
1076
10254.45 KVM_SET_XCRS 10774.45 KVM_SET_XCRS
1026 1078
1027Capability: KVM_CAP_XCRS 1079Capability: KVM_CAP_XCRS
@@ -1045,6 +1097,7 @@ struct kvm_xcrs {
1045 1097
1046This ioctl would set vcpu's xcr to the value userspace specified. 1098This ioctl would set vcpu's xcr to the value userspace specified.
1047 1099
1100
10484.46 KVM_GET_SUPPORTED_CPUID 11014.46 KVM_GET_SUPPORTED_CPUID
1049 1102
1050Capability: KVM_CAP_EXT_CPUID 1103Capability: KVM_CAP_EXT_CPUID
@@ -1119,6 +1172,7 @@ support. Instead it is reported via
1119if that returns true and you use KVM_CREATE_IRQCHIP, or if you emulate the 1172if that returns true and you use KVM_CREATE_IRQCHIP, or if you emulate the
1120feature in userspace, then you can enable the feature for KVM_SET_CPUID2. 1173feature in userspace, then you can enable the feature for KVM_SET_CPUID2.
1121 1174
1175
11224.47 KVM_PPC_GET_PVINFO 11764.47 KVM_PPC_GET_PVINFO
1123 1177
1124Capability: KVM_CAP_PPC_GET_PVINFO 1178Capability: KVM_CAP_PPC_GET_PVINFO
@@ -1142,6 +1196,7 @@ of 4 instructions that make up a hypercall.
1142If any additional field gets added to this structure later on, a bit for that 1196If any additional field gets added to this structure later on, a bit for that
1143additional piece of information will be set in the flags bitmap. 1197additional piece of information will be set in the flags bitmap.
1144 1198
1199
11454.48 KVM_ASSIGN_PCI_DEVICE 12004.48 KVM_ASSIGN_PCI_DEVICE
1146 1201
1147Capability: KVM_CAP_DEVICE_ASSIGNMENT 1202Capability: KVM_CAP_DEVICE_ASSIGNMENT
@@ -1185,6 +1240,7 @@ Only PCI header type 0 devices with PCI BAR resources are supported by
1185device assignment. The user requesting this ioctl must have read/write 1240device assignment. The user requesting this ioctl must have read/write
1186access to the PCI sysfs resource files associated with the device. 1241access to the PCI sysfs resource files associated with the device.
1187 1242
1243
11884.49 KVM_DEASSIGN_PCI_DEVICE 12444.49 KVM_DEASSIGN_PCI_DEVICE
1189 1245
1190Capability: KVM_CAP_DEVICE_DEASSIGNMENT 1246Capability: KVM_CAP_DEVICE_DEASSIGNMENT
@@ -1198,6 +1254,7 @@ Ends PCI device assignment, releasing all associated resources.
1198See KVM_CAP_DEVICE_ASSIGNMENT for the data structure. Only assigned_dev_id is 1254See KVM_CAP_DEVICE_ASSIGNMENT for the data structure. Only assigned_dev_id is
1199used in kvm_assigned_pci_dev to identify the device. 1255used in kvm_assigned_pci_dev to identify the device.
1200 1256
1257
12014.50 KVM_ASSIGN_DEV_IRQ 12584.50 KVM_ASSIGN_DEV_IRQ
1202 1259
1203Capability: KVM_CAP_ASSIGN_DEV_IRQ 1260Capability: KVM_CAP_ASSIGN_DEV_IRQ
@@ -1231,6 +1288,7 @@ The following flags are defined:
1231It is not valid to specify multiple types per host or guest IRQ. However, the 1288It is not valid to specify multiple types per host or guest IRQ. However, the
1232IRQ type of host and guest can differ or can even be null. 1289IRQ type of host and guest can differ or can even be null.
1233 1290
1291
12344.51 KVM_DEASSIGN_DEV_IRQ 12924.51 KVM_DEASSIGN_DEV_IRQ
1235 1293
1236Capability: KVM_CAP_ASSIGN_DEV_IRQ 1294Capability: KVM_CAP_ASSIGN_DEV_IRQ
@@ -1245,6 +1303,7 @@ See KVM_ASSIGN_DEV_IRQ for the data structure. The target device is specified
1245by assigned_dev_id, flags must correspond to the IRQ type specified on 1303by assigned_dev_id, flags must correspond to the IRQ type specified on
1246KVM_ASSIGN_DEV_IRQ. Partial deassignment of host or guest IRQ is allowed. 1304KVM_ASSIGN_DEV_IRQ. Partial deassignment of host or guest IRQ is allowed.
1247 1305
1306
12484.52 KVM_SET_GSI_ROUTING 13074.52 KVM_SET_GSI_ROUTING
1249 1308
1250Capability: KVM_CAP_IRQ_ROUTING 1309Capability: KVM_CAP_IRQ_ROUTING
@@ -1293,6 +1352,7 @@ struct kvm_irq_routing_msi {
1293 __u32 pad; 1352 __u32 pad;
1294}; 1353};
1295 1354
1355
12964.53 KVM_ASSIGN_SET_MSIX_NR 13564.53 KVM_ASSIGN_SET_MSIX_NR
1297 1357
1298Capability: KVM_CAP_DEVICE_MSIX 1358Capability: 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
13174.54 KVM_ASSIGN_SET_MSIX_ENTRY 13784.54 KVM_ASSIGN_SET_MSIX_ENTRY
1318 1379
1319Capability: KVM_CAP_DEVICE_MSIX 1380Capability: 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
13354.54 KVM_SET_TSC_KHZ 1396
13974.55 KVM_SET_TSC_KHZ
1336 1398
1337Capability: KVM_CAP_TSC_CONTROL 1399Capability: KVM_CAP_TSC_CONTROL
1338Architectures: x86 1400Architectures: x86
@@ -1343,7 +1405,8 @@ Returns: 0 on success, -1 on error
1343Specifies the tsc frequency for the virtual machine. The unit of the 1405Specifies the tsc frequency for the virtual machine. The unit of the
1344frequency is KHz. 1406frequency is KHz.
1345 1407
13464.55 KVM_GET_TSC_KHZ 1408
14094.56 KVM_GET_TSC_KHZ
1347 1410
1348Capability: KVM_CAP_GET_TSC_KHZ 1411Capability: KVM_CAP_GET_TSC_KHZ
1349Architectures: x86 1412Architectures: x86
@@ -1355,7 +1418,8 @@ Returns the tsc frequency of the guest. The unit of the return value is
1355KHz. If the host has unstable tsc this ioctl returns -EIO instead as an 1418KHz. If the host has unstable tsc this ioctl returns -EIO instead as an
1356error. 1419error.
1357 1420
13584.56 KVM_GET_LAPIC 1421
14224.57 KVM_GET_LAPIC
1359 1423
1360Capability: KVM_CAP_IRQCHIP 1424Capability: KVM_CAP_IRQCHIP
1361Architectures: x86 1425Architectures: x86
@@ -1371,7 +1435,8 @@ struct kvm_lapic_state {
1371Reads the Local APIC registers and copies them into the input argument. The 1435Reads the Local APIC registers and copies them into the input argument. The
1372data format and layout are the same as documented in the architecture manual. 1436data format and layout are the same as documented in the architecture manual.
1373 1437
13744.57 KVM_SET_LAPIC 1438
14394.58 KVM_SET_LAPIC
1375 1440
1376Capability: KVM_CAP_IRQCHIP 1441Capability: KVM_CAP_IRQCHIP
1377Architectures: x86 1442Architectures: x86
@@ -1387,7 +1452,8 @@ struct kvm_lapic_state {
1387Copies the input argument into the the Local APIC registers. The data format 1452Copies the input argument into the the Local APIC registers. The data format
1388and layout are the same as documented in the architecture manual. 1453and layout are the same as documented in the architecture manual.
1389 1454
13904.58 KVM_IOEVENTFD 1455
14564.59 KVM_IOEVENTFD
1391 1457
1392Capability: KVM_CAP_IOEVENTFD 1458Capability: KVM_CAP_IOEVENTFD
1393Architectures: all 1459Architectures: all
@@ -1417,7 +1483,8 @@ The following flags are defined:
1417If datamatch flag is set, the event will be signaled only if the written value 1483If datamatch flag is set, the event will be signaled only if the written value
1418to the registered address is equal to datamatch in struct kvm_ioeventfd. 1484to the registered address is equal to datamatch in struct kvm_ioeventfd.
1419 1485
14204.59 KVM_DIRTY_TLB 1486
14874.60 KVM_DIRTY_TLB
1421 1488
1422Capability: KVM_CAP_SW_TLB 1489Capability: KVM_CAP_SW_TLB
1423Architectures: ppc 1490Architectures: ppc
@@ -1449,7 +1516,8 @@ The "num_dirty" field is a performance hint for KVM to determine whether it
1449should skip processing the bitmap and just invalidate everything. It must 1516should skip processing the bitmap and just invalidate everything. It must
1450be set to the number of set bits in the bitmap. 1517be set to the number of set bits in the bitmap.
1451 1518
14524.60 KVM_ASSIGN_SET_INTX_MASK 1519
15204.61 KVM_ASSIGN_SET_INTX_MASK
1453 1521
1454Capability: KVM_CAP_PCI_2_3 1522Capability: KVM_CAP_PCI_2_3
1455Architectures: x86 1523Architectures: x86
@@ -1482,6 +1550,7 @@ See KVM_ASSIGN_DEV_IRQ for the data structure. The target device is specified
1482by assigned_dev_id. In the flags field, only KVM_DEV_ASSIGN_MASK_INTX is 1550by assigned_dev_id. In the flags field, only KVM_DEV_ASSIGN_MASK_INTX is
1483evaluated. 1551evaluated.
1484 1552
1553
14854.62 KVM_CREATE_SPAPR_TCE 15544.62 KVM_CREATE_SPAPR_TCE
1486 1555
1487Capability: KVM_CAP_SPAPR_TCE 1556Capability: KVM_CAP_SPAPR_TCE
@@ -1517,6 +1586,7 @@ the entries written by kernel-handled H_PUT_TCE calls, and also lets
1517userspace update the TCE table directly which is useful in some 1586userspace update the TCE table directly which is useful in some
1518circumstances. 1587circumstances.
1519 1588
1589
15204.63 KVM_ALLOCATE_RMA 15904.63 KVM_ALLOCATE_RMA
1521 1591
1522Capability: KVM_CAP_PPC_RMA 1592Capability: KVM_CAP_PPC_RMA
@@ -1549,6 +1619,7 @@ is supported; 2 if the processor requires all virtual machines to have
1549an RMA, or 1 if the processor can use an RMA but doesn't require it, 1619an RMA, or 1 if the processor can use an RMA but doesn't require it,
1550because it supports the Virtual RMA (VRMA) facility. 1620because it supports the Virtual RMA (VRMA) facility.
1551 1621
1622
15524.64 KVM_NMI 16234.64 KVM_NMI
1553 1624
1554Capability: KVM_CAP_USER_NMI 1625Capability: KVM_CAP_USER_NMI
@@ -1574,6 +1645,7 @@ following algorithm:
1574Some guests configure the LINT1 NMI input to cause a panic, aiding in 1645Some guests configure the LINT1 NMI input to cause a panic, aiding in
1575debugging. 1646debugging.
1576 1647
1648
15774.65 KVM_S390_UCAS_MAP 16494.65 KVM_S390_UCAS_MAP
1578 1650
1579Capability: KVM_CAP_S390_UCONTROL 1651Capability: KVM_CAP_S390_UCONTROL
@@ -1593,6 +1665,7 @@ This ioctl maps the memory at "user_addr" with the length "length" to
1593the vcpu's address space starting at "vcpu_addr". All parameters need to 1665the vcpu's address space starting at "vcpu_addr". All parameters need to
1594be alligned by 1 megabyte. 1666be alligned by 1 megabyte.
1595 1667
1668
15964.66 KVM_S390_UCAS_UNMAP 16694.66 KVM_S390_UCAS_UNMAP
1597 1670
1598Capability: KVM_CAP_S390_UCONTROL 1671Capability: 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.
1613All parameters need to be alligned by 1 megabyte. 1686All parameters need to be alligned by 1 megabyte.
1614 1687
1688
16154.67 KVM_S390_VCPU_FAULT 16894.67 KVM_S390_VCPU_FAULT
1616 1690
1617Capability: KVM_CAP_S390_UCONTROL 1691Capability: KVM_CAP_S390_UCONTROL
@@ -1628,6 +1702,7 @@ table upfront. This is useful to handle validity intercepts for user
1628controlled virtual machines to fault in the virtual cpu's lowcore pages 1702controlled virtual machines to fault in the virtual cpu's lowcore pages
1629prior to calling the KVM_RUN ioctl. 1703prior to calling the KVM_RUN ioctl.
1630 1704
1705
16314.68 KVM_SET_ONE_REG 17064.68 KVM_SET_ONE_REG
1632 1707
1633Capability: KVM_CAP_ONE_REG 1708Capability: 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
16564.69 KVM_GET_ONE_REG 17324.69 KVM_GET_ONE_REG
1657 1733
1658Capability: KVM_CAP_ONE_REG 1734Capability: KVM_CAP_ONE_REG
@@ -1669,6 +1745,7 @@ at the memory location pointed to by "addr".
1669The list of registers accessible using this interface is identical to the 1745The list of registers accessible using this interface is identical to the
1670list in 4.64. 1746list in 4.64.
1671 1747
1748
16724.70 KVM_KVMCLOCK_CTRL 17494.70 KVM_KVMCLOCK_CTRL
1673 1750
1674Capability: KVM_CAP_KVMCLOCK_CTRL 1751Capability: KVM_CAP_KVMCLOCK_CTRL
@@ -1689,6 +1766,7 @@ where the guest will clear the flag: when the soft lockup watchdog timer resets
1689itself or when a soft lockup is detected. This ioctl can be called any time 1766itself or when a soft lockup is detected. This ioctl can be called any time
1690after pausing the vcpu, but before it is resumed. 1767after pausing the vcpu, but before it is resumed.
1691 1768
1769
16924.71 KVM_SIGNAL_MSI 17704.71 KVM_SIGNAL_MSI
1693 1771
1694Capability: KVM_CAP_SIGNAL_MSI 1772Capability: KVM_CAP_SIGNAL_MSI
@@ -1710,7 +1788,9 @@ struct kvm_msi {
1710 1788
1711No flags are defined so far. The corresponding field must be 0. 1789No flags are defined so far. The corresponding field must be 0.
1712 1790
1791
17135. The kvm_run structure 17925. The kvm_run structure
1793------------------------
1714 1794
1715Application code obtains a pointer to the kvm_run structure by 1795Application code obtains a pointer to the kvm_run structure by
1716mmap()ing a vcpu fd. From that point, application code can control 1796mmap()ing a vcpu fd. From that point, application code can control
@@ -1951,7 +2031,9 @@ and usually define the validity of a groups of registers. (e.g. one bit
1951 2031
1952}; 2032};
1953 2033
2034
19546. Capabilities that can be enabled 20356. Capabilities that can be enabled
2036-----------------------------------
1955 2037
1956There are certain capabilities that change the behavior of the virtual CPU when 2038There are certain capabilities that change the behavior of the virtual CPU when
1957enabled. To enable them, please see section 4.37. Below you can find a list of 2039enabled. To enable them, please see section 4.37. Below you can find a list of
@@ -1967,6 +2049,7 @@ The following information is provided along with the description:
1967 Returns: the return value. General error numbers (EBADF, ENOMEM, EINVAL) 2049 Returns: the return value. General error numbers (EBADF, ENOMEM, EINVAL)
1968 are not detailed, but errors with specific meanings are. 2050 are not detailed, but errors with specific meanings are.
1969 2051
2052
19706.1 KVM_CAP_PPC_OSI 20536.1 KVM_CAP_PPC_OSI
1971 2054
1972Architectures: ppc 2055Architectures: ppc
@@ -1980,6 +2063,7 @@ between the guest and the host.
1980 2063
1981When this capability is enabled, KVM_EXIT_OSI can occur. 2064When this capability is enabled, KVM_EXIT_OSI can occur.
1982 2065
2066
19836.2 KVM_CAP_PPC_PAPR 20676.2 KVM_CAP_PPC_PAPR
1984 2068
1985Architectures: ppc 2069Architectures: ppc
@@ -1998,6 +2082,7 @@ HTAB invisible to the guest.
1998 2082
1999When this capability is enabled, KVM_EXIT_PAPR_HCALL can occur. 2083When this capability is enabled, KVM_EXIT_PAPR_HCALL can occur.
2000 2084
2085
20016.3 KVM_CAP_SW_TLB 20866.3 KVM_CAP_SW_TLB
2002 2087
2003Architectures: ppc 2088Architectures: ppc