• Home
  • Raw
  • Download

Lines Matching +full:poll +full:- +full:retry +full:- +full:count

1 .. SPDX-License-Identifier: GPL-2.0
4 The Definitive KVM (Kernel-based Virtual Machine) API Documentation
13 - System ioctls: These query and set global attributes which affect the
17 - VM ioctls: These query and set attributes that affect an entire virtual
24 - vcpu ioctls: These query and set attributes that control the operation
32 - device ioctls: These query and set attributes that control the operation
80 facility that allows backward-compatible extensions to the API to be
104 the ioctl returns -ENOTTY.
122 -----------------------
139 -----------------
165 address used by the VM. The IPA_Bits is encoded in bits[7-0] of the
183 ioctl() at run-time.
195 ----------------------------------------------------------
201 :Returns: 0 on success; -1 on error
237 -----------------------
256 --------------------------
270 -------------------------
276 :Returns: 0 on success, -1 on error
282 -------------------
288 :Returns: vcpu fd on success, -1 on error
294 the KVM_CHECK_EXTENSION ioctl() at run-time.
296 KVM_CAP_MAX_VCPUS of the KVM_CHECK_EXTENSION ioctl() at run-time.
304 KVM_CAP_MAX_VCPU_ID of the KVM_CHECK_EXTENSION ioctl() at run-time.
319 single-threaded guest vcpus, it should make all vcpu ids be a multiple
329 --------------------------------
335 :Returns: 0 on success, -1 on error
354 If KVM_CAP_MULTI_ADDRESS_SPACE is available, bits 16-31 specifies
364 ------------------------
370 :Returns: 0 (success), -1 (error)
376 ------------
382 :Returns: 0 on success, -1 on error
403 -----------------
409 :Returns: 0 on success, -1 on error
436 -----------------
442 :Returns: 0 on success, -1 on error
450 ------------------
456 :Returns: 0 on success, -1 on error
473 /* ppc -- see arch/powerpc/include/uapi/asm/kvm.h */
481 ------------------
487 :Returns: 0 on success, -1 on error
494 ------------------
500 :Returns: 0 on success, -1 on error
521 ------------------
546 -EEXIST if an interrupt is already enqueued
547 -EINVAL the irq number is invalid
548 -ENXIO if the PIC is in the kernel
549 -EFAULT if the pointer is invalid
553 ioctl is useful if the in-kernel PIC is not used.
595 --------------------
601 :Returns: -1 on error
607 -----------------
614 -1 on error
617 Reads the values of MSR-based features that are available for the VM. This
619 The list of msr-based features can be obtained using KVM_GET_MSR_FEATURE_INDEX_LIST
623 Reads model-specific registers from the vcpu. Supported msr indices can
647 -----------------
653 :Returns: number of msrs successfully set (see below), -1 on error
655 Writes model-specific registers to the vcpu. See KVM_GET_MSRS for the
669 ------------------
675 :Returns: 0 on success, -1 on error
704 ------------------------
710 :Returns: 0 on success, -1 on error
715 their traditional behaviour) will cause KVM_RUN to return with -EINTR.
730 ----------------
736 :Returns: 0 on success, -1 on error
759 ----------------
765 :Returns: 0 on success, -1 on error
788 -----------------------
794 :Returns: 0 on success, -1 on error
798 future vcpus to have a local APIC. IRQ routing for GSIs 0-15 is set to both
799 PIC and IOAPIC; GSI 16-23 only go to the IOAPIC.
810 -----------------
816 :Returns: 0 on success, -1 on error
820 been previously created with KVM_CREATE_IRQCHIP. Note that edge-triggered
823 On real hardware, interrupt pins can be active-low or active-high. This
828 (active-low/active-high) for level-triggered interrupts, and KVM used
830 active-low interrupts, the above convention is now valid on x86 too.
832 should not present interrupts to the guest as active-low unless this
833 capability is present (or unless it is not using the in-kernel irqchip,
838 in-kernel irqchip (GIC), and for in-kernel irqchip can tell the GIC to
847 - irq_type[0]:
848 out-of-kernel GIC: irq_id 0 is IRQ, irq_id 1 is FIQ
849 - irq_type[1]:
850 in-kernel GIC: SPI, irq_id between 32 and 1019 (incl.)
852 - irq_type[2]:
853 in-kernel GIC: PPI, irq_id between 16 and 31 (incl.)
864 injection of interrupts for the in-kernel irqchip. KVM_IRQ_LINE can always
879 --------------------
885 :Returns: 0 on success, -1 on error
904 --------------------
910 :Returns: 0 on success, -1 on error
929 -----------------------
935 :Returns: 0 on success, -1 on error
940 page of a blob (32- or 64-bit, depending on the vcpu mode) to guest
957 ------------------
963 :Returns: 0 on success, -1 on error
990 ------------------
996 :Returns: 0 on success, -1 on error
1012 ------------------------
1019 :Returns: 0 on success, -1 on error
1064 - KVM_VCPUEVENT_VALID_SHADOW may be set to signal that
1067 - KVM_VCPUEVENT_VALID_SMM may be set to signal that smi contains a
1070 - KVM_VCPUEVENT_VALID_PAYLOAD may be set to signal that the
1090 guest-visible registers. It is not possible to 'cancel' an SError that has been
1093 A device being emulated in user-space may also wish to generate an SError. To do
1094 this the events structure can be populated by user-space. The current state
1103 always have a non-zero value when read, and the agent making an SError pending
1105 the system supports KVM_CAP_ARM_INJECT_SERROR_ESR, but user-space sets the events
1109 -EINVAL. Setting anything other than the lower 24bits of exception.serror_esr
1110 will return -EINVAL.
1131 ------------------------
1138 :Returns: 0 on success, -1 on error
1151 suppress overwriting the current in-kernel state. The bits are:
1156 KVM_VCPUEVENT_VALID_SMM transfer the smi sub-struct.
1194 ----------------------
1200 :Returns: 0 on success, -1 on error
1216 ----------------------
1222 :Returns: 0 on success, -1 on error
1231 -------------------------------
1237 :Returns: 0 on success, -1 on error
1254 memory slot. Bits 0-15 of "slot" specify the slot id and this value
1259 If KVM_CAP_MULTI_ADDRESS_SPACE is available, bits 16-31 of "slot"
1286 to make a new slot read-only. In this case, writes to this memory will be
1300 ---------------------
1306 :Returns: 0 on success, -1 on error
1308 This ioctl defines the physical address of a three-page region in the guest
1314 This ioctl is required on Intel-based hosts. This is needed on Intel hardware
1320 -------------------
1326 :Returns: 0 on success; -1 on error
1332 :Returns: 0 on success; -1 on error
1371 The vcpu ioctl should be used for vcpu-specific capabilities, the vm ioctl
1372 for vm-wide capabilities.
1375 ---------------------
1381 :Returns: 0 on success; -1 on error
1413 in-kernel irqchip, the multiprocessing state must be maintained by userspace on
1423 ---------------------
1429 :Returns: 0 on success; -1 on error
1435 in-kernel irqchip, the multiprocessing state must be maintained by userspace on
1445 ------------------------------
1451 :Returns: 0 on success, -1 on error
1453 This ioctl defines the physical address of a one-page region in the guest
1462 This ioctl is required on Intel-based hosts. This is needed on Intel hardware
1469 ------------------------
1475 :Returns: 0 on success, -1 on error
1483 ------------------
1489 :Returns: 0 on success, -1 on error
1502 ------------------
1508 :Returns: 0 on success, -1 on error
1521 -----------------
1527 :Returns: 0 on success, -1 on error
1548 -----------------
1554 :Returns: 0 on success, -1 on error
1575 ----------------------------
1581 :Returns: 0 on success, -1 on error
1620 with the 'nent' field indicating the number of entries in the variable-size
1660 -----------------------
1690 ------------------------
1696 :Returns: 0 on success, -1 on error
1702 - GSI routing does not apply to KVM_IRQ_LINE but only to KVM_IRQFD.
1738 - KVM_MSI_VALID_DEVID: used along with KVM_IRQ_ROUTING_MSI routing entry
1739 type, specifies that the devid field contains a valid value. The per-VM
1743 - zero otherwise
1768 address_hi bits 31-8 provide bits 31-8 of the destination id. Bits 7-0 of
1788 --------------------
1794 :Returns: 0 on success, -1 on error
1801 --------------------
1807 :Returns: virtual tsc-khz on success, negative value on error
1810 KHz. If the host has unstable tsc this ioctl returns -EIO instead as an
1815 ------------------
1821 :Returns: 0 on success, -1 on error
1836 the APIC_ID register (bytes 32-35). xAPIC only allows an 8-bit APIC ID
1837 which is stored in bits 31-24 of the APIC register, or equivalently in
1846 ------------------
1852 :Returns: 0 on success, -1 on error
1864 The format of the APIC ID register (bytes 32-35 of struct kvm_lapic_state's
1870 ------------------
1893 For the special case of virtio-ccw devices on s390, the ioevent is matched
1907 For virtio-ccw devices, addr contains the subchannel id and datamatch the
1916 ------------------
1922 :Returns: 0 on success, -1 on error
1942 The array is little-endian: the bit 0 is the least significant bit of the
1952 -------------------------
1961 is an IOMMU for PAPR-style virtual I/O. It is used to translate
1975 which this TCE table will translate - the table will contain one 64
1985 the entries written by kernel-handled H_PUT_TCE calls, and also lets
1991 ---------------------
2000 time by the kernel. An RMA is a physically-contiguous, aligned region
2002 will be accessed by real-mode (MMU off) accesses in a KVM guest.
2027 ------------
2033 :Returns: 0 on success, -1 on error
2043 - pause the vcpu
2044 - read the local APIC's state (KVM_GET_LAPIC)
2045 - check whether changing LINT1 will queue an NMI (see the LVT entry for LINT1)
2046 - if so, issue KVM_NMI
2047 - resume the vcpu
2054 ----------------------
2076 ------------------------
2098 ------------------------
2116 --------------------
2352 ARM 32-bit CP15 registers have the following id bit patterns::
2356 ARM 64-bit CP15 registers have the following id bit patterns::
2364 ARM 32-bit VFP control registers have the following id bit patterns::
2368 ARM 64-bit FP registers have the following id bit patterns::
2372 ARM firmware pseudo-registers have the following bit pattern::
2380 arm64 core/FP-SIMD registers have the following id bit patterns. Note
2414 .. [1] These encodings are not accepted for SVE-enabled vcpus. See
2439 arm64 firmware pseudo-registers have the following bit pattern::
2448 0x6060 0000 0015 ffff KVM_REG_ARM64_SVE_VLS pseudo-register
2451 ENOENT. max_vq is the vcpu's maximum supported vector length in 128-bit
2462 KVM_REG_ARM64_SVE_VLS is a pseudo-register that allows the set of vector
2472 ((vector_lengths[(vq - KVM_ARM64_SVE_VQ_MIN) / 64] >>
2473 ((vq - KVM_ARM64_SVE_VQ_MIN) % 64)) & 1))
2495 is hardware-dependent and may not be available. Attempting to configure
2511 patterns depending on whether they're 32-bit or 64-bit registers::
2513 0x7020 0000 0001 00 <reg:5> <sel:3> (32-bit)
2514 0x7030 0000 0001 00 <reg:5> <sel:3> (64-bit)
2539 0x7020 0000 0003 00 <0:3> <reg:5> (32-bit FPU registers)
2540 0x7030 0000 0003 00 <0:3> <reg:5> (64-bit FPU registers)
2541 0x7040 0000 0003 00 <0:3> <reg:5> (128-bit MSA vector registers)
2555 --------------------
2585 ----------------------
2591 :Returns: 0 on success, -1 on error
2602 load-link/store-conditional, or equivalent must be used. There are two cases
2609 -------------------
2615 :Returns: >0 on delivery, 0 if guest blocked the MSI, and -1 on error
2617 Directly inject a MSI message. Only valid with in-kernel irqchip that handles
2632 KVM_MSI_VALID_DEVID: devid contains a valid value. The per-VM
2643 address_hi bits 31-8 provide bits 31-8 of the destination id. Bits 7-0 of
2648 --------------------
2654 :Returns: 0 on success, -1 on error
2656 Creates an in-kernel device model for the i8254 PIT. This call is only valid
2657 after enabling in-kernel irqchip support via KVM_CREATE_IRQCHIP. The following
2669 PIT timer interrupts may use a per-VM kernel thread for injection. If it
2672 kvm-pit/<owner-process-pid>
2681 -----------------
2687 :Returns: 0 on success, -1 on error
2689 Retrieves the state of the in-kernel PIT model. Only valid after
2707 -----------------
2713 :Returns: 0 on success, -1 on error
2715 Sets the state of the in-kernel PIT model. Only valid after KVM_CREATE_PIT2.
2722 --------------------------
2728 :Returns: 0 on success, -1 on error
2733 device-tree properties for the guest operating system.
2747 - KVM_PPC_PAGE_SIZES_REAL:
2752 - KVM_PPC_1T_SEGMENTS
2756 - KVM_PPC_NO_HASH
2797 --------------
2803 :Returns: 0 on success, -1 on error
2813 With KVM_CAP_IRQFD_RESAMPLE, KVM_IRQFD supports a de-assert and notify
2814 mechanism allowing emulation of level-triggered, irqfd-based
2819 as from an EOI, the gsi is de-asserted and the user is notified via
2820 kvm_irqfd.resamplefd. It is the user's responsibility to re-queue
2828 - in case no routing entry is associated to this gsi, injection fails
2829 - in case the gsi is associated to an irqchip routing entry,
2831 - in case the gsi is associated to an MSI routing entry, the MSI
2833 to GICv3 ITS in-kernel emulation).
2836 --------------------------
2842 :Returns: 0 on success, -1 on error
2854 The parameter is a pointer to a 32-bit unsigned integer variable
2861 default-sized hash table (16 MB).
2869 real-mode area (VRMA) facility, the kernel will re-create the VMRA
2873 -----------------------
2879 :Returns: 0 on success, -1 on error
2895 - sigp stop; optional flags in parm
2897 - program check; code in parm
2899 - sigp set prefix; prefix address in parm
2901 - restart
2903 - clock comparator interrupt
2905 - CPU timer interrupt
2907 - virtio external interrupt; external interrupt
2910 - sclp external interrupt; sclp parameter in parm
2912 - sigp emergency; source cpu in parm
2914 - sigp external call; source cpu in parm
2916 - compound value to indicate an
2917 I/O interrupt (ai - adapter interrupt; cssid,ssid,schid - subchannel);
2921 - machine check interrupt; cr 14 bits in parm, machine check interrupt
2928 ------------------------
2934 :Returns: file descriptor number (>= 0) on success, -1 on error
2983 ----------------------
2988 :Returns: 0 on success, -1 on error
3021 --------------------------------------------
3027 :Returns: 0 on success, -1 on error
3035 (e.g. read-only attribute, or attribute that only makes
3042 semantics are device-specific. See individual device documentation in
3050 __u32 group; /* device-defined */
3051 __u64 attr; /* group-defined */
3056 ------------------------
3062 :Returns: 0 on success, -1 on error
3077 ----------------------
3083 :Returns: 0 on success; -1 on error
3107 - KVM_ARM_VCPU_POWER_OFF: Starts the CPU in a power-off state.
3110 - KVM_ARM_VCPU_EL1_32BIT: Starts the CPU in a 32bit mode.
3112 - KVM_ARM_VCPU_PSCI_0_2: Emulate PSCI v0.2 (or a future revision
3115 - KVM_ARM_VCPU_PMU_V3: Emulate PMUv3 for the CPU.
3118 - KVM_ARM_VCPU_PTRAUTH_ADDRESS: Enables Address Pointer authentication
3126 - KVM_ARM_VCPU_PTRAUTH_GENERIC: Enables Generic Pointer authentication
3134 - KVM_ARM_VCPU_SVE: Enables SVE for the CPU (arm64 only).
3140 - KVM_REG_ARM64_SVE_VLS may be read using KVM_GET_ONE_REG: the
3141 initial value of this pseudo-register indicates the best set of
3146 - KVM_RUN and KVM_GET_REG_LIST are not available;
3148 - KVM_GET_ONE_REG and KVM_SET_ONE_REG cannot be used to access
3153 - KVM_REG_ARM64_SVE_VLS may optionally be written using
3159 - the KVM_REG_ARM64_SVE_VLS pseudo-register is immutable, and can
3163 -----------------------------
3169 :Returns: 0 on success; -1 on error
3182 kvm_vcpu_init->features bitmap returned will have feature bits set if
3192 ---------------------
3198 :Returns: 0 on success; -1 on error
3219 -----------------------------------------
3225 :Returns: 0 on success, -1 on error
3255 ARM/arm64 currently only require this when using the in-kernel GIC
3261 base addresses will return -EEXIST.
3268 ------------------------------
3274 :Returns: 0 on success, -1 on error
3279 of a service that has a kernel-side implementation. If the token
3280 value is non-zero, it will be associated with that service, and
3288 ------------------------
3294 :Returns: 0 on success; -1 on error
3309 - KVM_GUESTDBG_ENABLE: guest debugging is enabled
3310 - KVM_GUESTDBG_SINGLESTEP: the next run should single-step
3315 - KVM_GUESTDBG_USE_SW_BP: using software breakpoints [x86, arm64]
3316 - KVM_GUESTDBG_USE_HW_BP: using hardware breakpoints [x86, s390, arm64]
3317 - KVM_GUESTDBG_INJECT_DB: inject DB type exception [x86]
3318 - KVM_GUESTDBG_INJECT_BP: inject BP type exception [x86]
3319 - KVM_GUESTDBG_EXIT_PENDING: trigger an immediate guest exit [s390]
3337 the single-step debug event (KVM_GUESTDBG_SINGLESTEP) is supported.
3344 ---------------------------
3350 :Returns: 0 on success, -1 on error
3385 the variable-size array 'entries'. If the number of entries is too low
3419 --------------------
3426 < 0 on generic error (e.g. -EFAULT or -ENOMEM),
3468 -----------------------
3482 __u64 count;
3491 The count field is the number of consecutive frames (starting from start_gfn)
3492 whose storage keys to get. The count field must be at least 1 and the maximum
3494 will cause the ioctl to return -EINVAL.
3496 The skeydata_addr field is the address to a buffer large enough to hold count
3500 -----------------------
3515 The count field is the number of consecutive frames (starting from start_gfn)
3516 whose storage keys to get. The count field must be at least 1 and the maximum
3518 will cause the ioctl to return -EINVAL.
3520 The skeydata_addr field is the address to a buffer containing count bytes of
3522 single frame starting at start_gfn for count frames.
3525 the ioctl will return -EINVAL.
3528 -----------------
3534 :Returns: 0 on success, -1 on error
3575 - KVM_S390_SIGP_STOP - sigp stop; parameter in .stop
3576 - KVM_S390_PROGRAM_INT - program check; parameters in .pgm
3577 - KVM_S390_SIGP_SET_PREFIX - sigp set prefix; parameters in .prefix
3578 - KVM_S390_RESTART - restart; no parameters
3579 - KVM_S390_INT_CLOCK_COMP - clock comparator interrupt; no parameters
3580 - KVM_S390_INT_CPU_TIMER - CPU timer interrupt; no parameters
3581 - KVM_S390_INT_EMERGENCY - sigp emergency; parameters in .emerg
3582 - KVM_S390_INT_EXTERNAL_CALL - sigp external call; parameters in .extcall
3583 - KVM_S390_MCHK - machine check interrupt; parameters in .mchk
3588 ---------------------------
3595 -EINVAL if buffer size is 0,
3596 -ENOBUFS if buffer size is too small to fit all pending interrupts,
3597 -EFAULT if the buffer address was invalid
3615 the kernel never checked for flags == 0 and QEMU never pre-zeroed flags and
3619 If -ENOBUFS is returned the buffer provided was too small and userspace
3620 may retry with a bigger buffer.
3623 ---------------------------
3630 -EFAULT if the buffer address was invalid,
3631 -EINVAL for an invalid buffer length (see below),
3632 -EBUSY if there were already interrupts pending,
3636 This ioctl allows userspace to set the complete state of all cpu-local
3658 which is the maximum number of possibly pending cpu-local interrupts.
3661 ------------
3667 :Returns: 0 on success, -1 on error
3672 -------------------------
3687 IBM pSeries (sPAPR) guest starts using them if "hcall-multi-tce" is
3688 present in the "ibm,hypertas-functions" device-tree property.
3698 ----------------------------
3731 -------------------------
3738 -EFAULT if struct kvm_reinject_control cannot be read,
3739 -ENXIO if KVM_CREATE_PIT or KVM_CREATE_PIT2 didn't succeed earlier.
3758 ------------------------------
3765 -EFAULT if struct kvm_ppc_mmuv3_cfg cannot be read,
3766 -EINVAL if the configuration is invalid
3792 ---------------------------
3799 -EFAULT if struct kvm_ppc_rmmu_info cannot be written,
3800 -EINVAL if no useful information can be returned
3829 --------------------------------
3838 -EFAULT if struct kvm_reinject_control cannot be read,
3839 -EINVAL if the supplied shift or flags are invalid,
3840 -ENOMEM if unable to allocate the new HPT,
3841 -ENOSPC if there was a hash collision
3865 --------------------------------
3874 -EFAULT if struct kvm_reinject_control cannot be read,
3875 -EINVAL if the supplied shift or flags are invalid,when moving existing
3877 -EIO on other error conditions
3902 returns 0 (i.e. cancels any in-progress preparation).
3905 flags will result in an -EINVAL.
3920 -------------------------------
3927 -EFAULT if struct kvm_reinject_control cannot be read,
3928 -EINVAL if the supplied shift or flags are invalid,
3929 -ENXIO is there is no pending HPT, or the pending HPT doesn't
3931 -EBUSY if the pending HPT is not fully prepared,
3932 -ENOSPC if there was a hash collision when moving existing
3934 -EIO on other error conditions
3943 KVM_PPC_RESIZE_HPT_COMMIT will return an error (usually -ENXIO or
3944 -EBUSY, though others may be possible if the preparation was started,
3965 -----------------------------------
3971 :Returns: 0 on success, -1 on error
3978 -----------------------
3985 -EFAULT if u64 mcg_cap cannot be read,
3986 -EINVAL if the requested number of banks is invalid,
3987 -EINVAL if requested MCE capability is not supported.
3992 supported number of error-reporting banks can be retrieved when
3997 ---------------------
4004 -EFAULT if struct kvm_x86_mce cannot be read,
4005 -EINVAL if the bank number is invalid,
4006 -EINVAL if VAL bit is not set in status field.
4031 ----------------------------
4054 - During live migration to save the CMMA values. Live migration needs
4056 - To non-destructively peek at the CMMA values, with the flag
4070 __u32 count;
4082 count is the length of the buffer in bytes,
4086 If count is greater than KVM_S390_SKEYS_MAX, then it is considered to be
4087 KVM_S390_SKEYS_MAX. KVM_S390_SKEYS_MAX is re-used for consistency with
4101 count will indicate the number of bytes actually written in the buffer.
4119 the output count will be equal to the input count, except if the end of
4132 ----------------------------
4150 __u32 count;
4161 count indicates how many values are to be considered in the buffer,
4171 This ioctl can fail with -ENOMEM if not enough memory can be allocated to
4172 complete the task, with -ENXIO if CMMA is not enabled, with -EINVAL if
4173 the count field is too large (e.g. more than KVM_S390_CMMA_SIZE_MAX) or
4174 if the flags field was not 0, with -EFAULT if the userspace address is
4180 --------------------------
4187 -EFAULT if struct kvm_ppc_cpu_char cannot be written
4192 CVE-2017-5715, CVE-2017-5753 and CVE-2017-5754). The information is
4209 with preventing inadvertent information disclosure - specifically,
4210 whether there is an instruction to flash-invalidate the L1 data cache
4227 ---------------------------
4233 :Returns: 0 on success; -1 on error
4236 for issuing platform-specific memory encryption commands to manage those
4241 Documentation/virt/kvm/amd-memory-encryption.rst.
4244 -----------------------------------
4250 :Returns: 0 on success; -1 on error
4255 It is used in the SEV-enabled guest. When encryption is enabled, a guest
4268 -------------------------------------
4274 :Returns: 0 on success; -1 on error
4280 ------------------------
4288 the specified Hyper-V connection id through the SIGNAL_EVENT hypercall, without
4289 causing a user exit. SIGNAL_EVENT hypercall with non-zero event flag number
4290 (bits 24-31) still triggers a KVM_EXIT_HYPERV_HCALL user exit.
4310 -EINVAL if conn_id or flags is outside the allowed range,
4311 -ENOENT on deassign if the conn_id isn't registered,
4312 -EEXIST on assign if the conn_id is already registered
4315 --------------------------
4321 :Returns: 0 on success, -1 on error
4389 --------------------------
4395 :Returns: 0 on success, -1 on error
4401 -------------------------------------
4430 ------------------------------------
4436 :Returns: 0 on success, -1 on error
4458 in KVM's dirty bitmap, and dirty tracking is re-enabled for that page
4459 (for example via write-protection, or by clearing the dirty bit in
4462 If KVM_CAP_MULTI_ADDRESS_SPACE is available, bits 16-31 specifies
4473 --------------------------------
4479 :Returns: 0 on success, -1 on error
4500 This ioctl returns x86 cpuid features leaves related to Hyper-V emulation in
4502 cpuid information presented to guests consuming Hyper-V enlightenments (e.g.
4503 Windows or Hyper-V guests).
4505 CPUID feature leaves returned by this ioctl are defined by Hyper-V Top Level
4511 - HYPERV_CPUID_VENDOR_AND_MAX_FUNCTIONS
4512 - HYPERV_CPUID_INTERFACE
4513 - HYPERV_CPUID_VERSION
4514 - HYPERV_CPUID_FEATURES
4515 - HYPERV_CPUID_ENLIGHTMENT_INFO
4516 - HYPERV_CPUID_IMPLEMENT_LIMITS
4517 - HYPERV_CPUID_NESTED_FEATURES
4518 - HYPERV_CPUID_SYNDBG_VENDOR_AND_MAX_FUNCTIONS
4519 - HYPERV_CPUID_SYNDBG_INTERFACE
4520 - HYPERV_CPUID_SYNDBG_PLATFORM_CAPABILITIES
4526 with the 'nent' field indicating the number of entries in the variable-size
4527 array 'entries'. If the number of entries is too low to describe all Hyper-V
4529 to the number of Hyper-V feature leaves, the 'nent' field is adjusted to the
4536 ---------------------------
4541 :Returns: 0 on success, -1 on error
4567 that should be performaned and how to do it are feature-dependent.
4571 -EPERM unless the feature has already been finalized by means of a
4578 ------------------------------
4584 :Returns: 0 on success, -1 on error
4612 ---------------------
4636 ---------------------------
4648 ----------------------------
4661 --------------------------
4675 -------------------------
4713 again. All registered VCPUs are converted back to non-protected
4728 ----------------------------
4795 default KVM in-kernel emulation behavior is fully preserved.
4852 This field is polled once when KVM_RUN starts; if non-zero, KVM_RUN
4853 exits immediately, returning -EINTR. In the common scenario where a
4857 a signal handler that sets run->immediate_exit to a non-zero value.
4883 The value of the current interrupt flag. Only valid if in-kernel
4890 More architecture-specific flags detailing state of the VCPU that may
4900 The value of the cr8 register. Only valid if in-kernel local APIC is
4907 The value of the APIC BASE msr. Only valid if in-kernel local
4919 reasons. Further architecture-specific information is available in
4931 to unknown reasons. Further architecture-specific information is
4953 __u32 count;
4984 executed a memory-mapped I/O instruction which could not be satisfied
4997 has re-entered the kernel with KVM_RUN. The kernel side will first finish
4999 can re-enter the guest with an unmasked signal pending to complete
5079 Deprecated - was used for 440 KVM.
5105 This is used on 64-bit PowerPC when emulating a pSeries partition,
5109 the arguments (from the guest R4 - R12). Userspace should put the
5166 a system-level event using some architecture specific mechanism (hypercall
5169 the system-level event type. The 'flags' field describes architecture
5170 specific flags for the system-level event.
5174 - KVM_SYSTEM_EVENT_SHUTDOWN -- the guest has requested a shutdown of the
5178 - KVM_SYSTEM_EVENT_RESET -- the guest has requested a reset of the VM.
5181 - KVM_SYSTEM_EVENT_CRASH -- the guest crash occurred and the guest
5193 Indicates that the VCPU's in-kernel local APIC received an EOI for a
5194 level-triggered IOAPIC interrupt. This exit only triggers when the
5236 related to Hyper-V emulation.
5240 - KVM_EXIT_HYPERV_SYNIC -- synchronously notify user-space about
5242 Hyper-V SynIC state change. Notification is used to remap SynIC
5246 - KVM_EXIT_HYPERV_SYNDBG -- synchronously notify user-space about
5248 Hyper-V Synthetic debugger state change. Notification is used to either update
5267 the VM. KVM assumed that if the guest accessed non-memslot memory, it was
5291 __u8 error; /* user -> kernel */
5293 __u32 reason; /* kernel -> user */
5294 __u32 index; /* kernel -> user */
5295 __u64 data; /* kernel <-> user */
5307 KVM_MSR_EXIT_REASON_UNKNOWN - access to MSR that is unknown to KVM
5308 KVM_MSR_EXIT_REASON_INVAL - access to invalid MSRs or reserved bits
5309 KVM_MSR_EXIT_REASON_FILTER - access blocked by KVM_X86_SET_MSR_FILTER
5378 whether this is a per-vcpu or per-vm capability.
5389 -------------------
5394 :Returns: 0 on success; -1 on error
5398 were invented by Mac-on-Linux to have a standardized communication mechanism
5405 --------------------
5410 :Returns: 0 on success; -1 on error
5426 ------------------
5431 :Returns: 0 on success; -1 on error
5444 addresses of mmu-type-specific data structures. The "array_len" field is an
5460 - The "params" field is of type "struct kvm_book3e_206_tlb_params".
5461 - The "array" field points to an array of type "struct
5463 - The array consists of all entries in the first TLB, followed by all
5465 - Within a TLB, entries are ordered first by increasing set number. Within a
5467 - The hash for determining set number in TLB0 is: (MAS2 >> 12) & (num_sets - 1)
5469 - The tsize field of mas1 shall be set to 4K on TLB0, even though the
5473 ----------------------------
5478 :Returns: 0 on success; -1 on error
5483 handled in-kernel, while the other I/O instructions are passed to userspace.
5488 Note that even though this capability is enabled per-vcpu, the complete
5492 -------------------
5497 :Returns: 0 on success; -1 on error
5511 --------------------
5517 This capability connects the vcpu to an in-kernel MPIC device.
5520 --------------------
5527 This capability connects the vcpu to an in-kernel XICS device.
5530 ------------------------
5536 This capability enables the in-kernel irqchip for s390. Please refer to
5540 --------------------
5554 ---------------------
5567 ----------------------
5572 :Returns: x86: KVM_CHECK_EXTENSION returns a bit-array indicating which register
5588 - the register sets to be copied out to kvm_run are selectable
5590 - vcpu_events are available in addition to regs and sregs.
5593 function as an input bit-array field set by userspace to indicate the
5613 -------------------------
5620 This capability connects the vcpu to an in-kernel XIVE device.
5645 ----------------------------
5649 args[1] is 0 to disable, 1 to enable in-kernel handling
5652 get handled by the kernel or not. Enabling or disabling in-kernel
5654 initial set of hcalls are enabled for in-kernel handling, which
5655 consists of those hcalls for which in-kernel handlers were implemented
5662 If the hcall number specified is not one that has an in-kernel
5667 --------------------------
5676 - SENSE
5677 - SENSE RUNNING
5678 - EXTERNAL CALL
5679 - EMERGENCY SIGNAL
5680 - CONDITIONAL EMERGENCY SIGNAL
5689 ---------------------------------
5697 return -EINVAL if the machine does not support vectors.
5700 --------------------------
5705 This capability allows post-handlers for the STSI instruction. After
5710 vcpu->run::
5721 @addr - guest address of STSI SYSIB
5722 @fc - function code
5723 @sel1 - selector 1
5724 @sel2 - selector 2
5725 @ar - access register number
5727 KVM handlers should exit to userspace with rc = -EREMOTE.
5730 -------------------------
5733 :Parameters: args[0] - number of routes reserved for userspace IOAPICs
5734 :Returns: 0 on success, -1 on error
5751 -------------------
5756 Allows use of runtime-instrumentation introduced with zEC12 processor.
5757 Will return -EINVAL if the machine does not support runtime-instrumentation.
5758 Will return -EBUSY if a VCPU has already been created.
5761 ----------------------
5764 :Parameters: args[0] - features that should be enabled
5765 :Returns: 0 on success, -EINVAL when args[0] contains invalid features
5774 allowing the use of 32-bit APIC IDs. See KVM_CAP_X2APIC_API in their
5781 where 0xff represents CPUs 0-7 in cluster 0.
5784 ----------------------------
5791 mechanism e.g. to realize 2-byte software breakpoints. The kernel will
5799 -------------------
5803 :Returns: 0 on success; -EINVAL if the machine does not support
5804 guarded storage; -EBUSY if a VCPU has already been created.
5809 ---------------------
5814 Allow use of adapter-interruption suppression.
5815 :Returns: 0 on success; -EBUSY if a VCPU has already been created.
5818 --------------------
5836 ----------------------
5848 ------------------------------
5852 :Returns: 0 on success, -EINVAL when args[0] contains invalid exits
5871 --------------------------
5875 :Returns: 0 on success, -EINVAL if hpage module parameter was not set
5883 hpage module parameter is not set to 1, -EINVAL is returned.
5889 ------------------------------
5899 --------------------------
5903 :Returns: 0 on success, -EINVAL when the implementation doesn't support
5904 nested-HV virtualization.
5906 HV-KVM on POWER9 and later systems allows for "nested-HV"
5908 can run using the CPU's supervisor mode (privileged non-hypervisor
5911 kvm-hv module parameter.
5914 ------------------------------
5920 emulated VM-exit when L1 intercepts a #PF exception that occurs in
5921 L2. Similarly, for kvm-intel only, DR6 will not be modified prior to
5922 the emulated VM-exit when L1 intercepts a #DB exception that occurs in
5928 exception.has_payload and to put the faulting address - or the new DR6
5929 bits\ [#]_ - in the exception_payload field.
5950 automatically clear and write-protect all pages that are returned as dirty.
5956 KVM_CLEAR_DIRTY_LOG ioctl can operate on a 64-page granularity rather
5981 ------------------------------
5998 ----------------------
6002 :Parameters: args[0] is the maximum poll time in nanoseconds
6003 :Returns: 0 on success; -1 on error
6008 VCPU polling allows a VCPU to poll for wakeup events instead of immediately
6011 the maximum halt time to specified on a per-VM basis, effectively overriding
6015 -------------------------------
6020 :Returns: 0 on success; -1 on error
6043 ---------------------
6049 H_RANDOM hypercall backed by a hardware random-number generator.
6054 ------------------------
6060 Hyper-V Synthetic interrupt controller(SynIC). Hyper-V SynIC is
6061 used to support Windows Hyper-V based guest paravirt drivers(VMBus).
6066 by the CPU, as it's incompatible with SynIC auto-EOI behavior.
6069 -------------------------
6079 ---------------------------
6086 the POWER9 processor), including in-memory segment tables.
6089 -------------------
6119 -------------------
6133 ----------------------
6147 Both registers and addresses are 32-bits wide.
6148 It will only be possible to run 32-bit guest code.
6150 1 MIPS64 or microMIPS64 with access only to 32-bit compatibility segments.
6151 Registers are 64-bits wide, but addresses are 32-bits wide.
6152 64-bit guest code may run but cannot access MIPS64 memory segments.
6153 It will also be possible to run 32-bit guest code.
6156 Both registers and addresses are 64-bits wide.
6157 It will be possible to run 64-bit or 32-bit guest code.
6161 ------------------------
6166 that if userspace creates a VM without an in-kernel interrupt controller, it
6167 will be notified of changes to the output level of in-kernel emulated devices,
6170 updates the vcpu's run->s.regs.device_irq_level field to represent the actual
6176 userspace can always sample the device output level and re-compute the state of
6178 of run->s.regs.device_irq_level on every kvm exit.
6179 The value in run->s.regs.device_irq_level can represent both level and edge
6181 signals will exit to userspace with the bit in run->s.regs.device_irq_level
6184 The field run->s.regs.device_irq_level is available independent of
6185 run->kvm_valid_regs or run->kvm_dirty_regs bits.
6189 and thereby which bits in run->s.regs.device_irq_level can signal values.
6195 KVM_ARM_DEV_EL1_VTIMER - EL1 virtual timer
6196 KVM_ARM_DEV_EL1_PTIMER - EL1 physical timer
6197 KVM_ARM_DEV_PMU - ARM PMU overflow interrupt signal
6204 -----------------------------
6214 --------------------------
6218 This capability enables a newer version of Hyper-V Synthetic interrupt
6224 ----------------------------
6234 -------------------------------
6244 ---------------------
6251 ----------------------
6260 ---------------------
6265 use copy-on-write semantics as well as dirty pages tracking via read-only page
6269 ---------------------
6278 ----------------------------
6282 This capability indicates that KVM supports paravirtualized Hyper-V TLB Flush
6288 ----------------------------------
6303 ----------------------------
6307 This capability indicates that KVM supports paravirtualized Hyper-V IPI send
6312 -----------------------------------
6316 This capability indicates that KVM running on top of Hyper-V hypervisor
6318 hypercalls are handled by Level 0 hypervisor (Hyper-V) bypassing KVM.
6319 Due to the different ABI for hypercall parameters between Hyper-V and
6322 flush hypercalls by Hyper-V) so userspace should disable KVM identification
6323 in CPUID and only exposes Hyper-V identification. In this case, guest
6324 thinks it's running on Hyper-V and only use Hyper-V hypercalls.
6327 -----------------------------
6335 ---------------------------
6346 -----------------------
6352 architecture-specific interfaces. This capability and the architecture-
6359 -------------------------
6369 an 8-byte value consisting of a one-byte Control Program Name Code (CPNC) and
6370 a 7-byte Control Program Version Code (CPVC). The CPNC determines what
6379 -------------------------------
6390 ---------------------------
6404 -----------------------------
6424 --------
6438 ``KVM_ENABLE_CAP(KVM_CAP_IRQCHIP_SPLIT)`` are used to enable in-kernel emulation of
6445 has enabled in-kernel emulation of the local APIC.