Lines Matching +full:vcore +full:- +full:supply

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 --------------------------
269 the VCPU file descriptor can be mmap-ed, including:
271 - if KVM_CAP_COALESCED_MMIO is available, a page at
276 - if KVM_CAP_DIRTY_LOG_RING is available, a number of pages at
282 -------------------------
288 :Returns: 0 on success, -1 on error
294 -------------------
300 :Returns: vcpu fd on success, -1 on error
306 the KVM_CHECK_EXTENSION ioctl() at run-time.
308 KVM_CAP_MAX_VCPUS of the KVM_CHECK_EXTENSION ioctl() at run-time.
316 KVM_CAP_MAX_VCPU_ID of the KVM_CHECK_EXTENSION ioctl() at run-time.
325 of vcpus per virtual core (vcore). The vcore id is obtained by
326 dividing the vcpu id by the number of vcpus per vcore. The vcpus in a
327 given vcore will always be in the same physical core as each other
331 single-threaded guest vcpus, it should make all vcpu ids be a multiple
332 of the number of vcpus per vcore.
341 --------------------------------
347 :Returns: 0 on success, -1 on error
366 If KVM_CAP_MULTI_ADDRESS_SPACE is available, bits 16-31 of slot field specifies
375 ------------------------
381 :Returns: 0 (success), -1 (error)
387 ------------
393 :Returns: 0 on success, -1 on error
414 -----------------
420 :Returns: 0 on success, -1 on error
447 -----------------
453 :Returns: 0 on success, -1 on error
461 ------------------
467 :Returns: 0 on success, -1 on error
484 /* ppc -- see arch/powerpc/include/uapi/asm/kvm.h */
492 ------------------
498 :Returns: 0 on success, -1 on error
505 ------------------
511 :Returns: 0 on success, -1 on error
532 ------------------
557 -EEXIST if an interrupt is already enqueued
558 -EINVAL the irq number is invalid
559 -ENXIO if the PIC is in the kernel
560 -EFAULT if the pointer is invalid
564 ioctl is useful if the in-kernel PIC is not used.
606 --------------------
612 :Returns: -1 on error
618 -----------------
625 -1 on error
628 Reads the values of MSR-based features that are available for the VM. This
630 The list of msr-based features can be obtained using KVM_GET_MSR_FEATURE_INDEX_LIST
634 Reads model-specific registers from the vcpu. Supported msr indices can
658 -----------------
664 :Returns: number of msrs successfully set (see below), -1 on error
666 Writes model-specific registers to the vcpu. See KVM_GET_MSRS for the
680 ------------------
686 :Returns: 0 on success, -1 on error
692 - If this IOCTL fails, KVM gives no guarantees that previous valid CPUID
695 - Using KVM_SET_CPUID{,2} after KVM_RUN, i.e. changing the guest vCPU model
697 - Using heterogeneous CPUID configurations, modulo APIC IDs, topology, etc...
720 ------------------------
726 :Returns: 0 on success, -1 on error
731 their traditional behaviour) will cause KVM_RUN to return with -EINTR.
746 ----------------
752 :Returns: 0 on success, -1 on error
775 ----------------
781 :Returns: 0 on success, -1 on error
804 -----------------------
810 :Returns: 0 on success, -1 on error
814 future vcpus to have a local APIC. IRQ routing for GSIs 0-15 is set to both
815 PIC and IOAPIC; GSI 16-23 only go to the IOAPIC.
826 -----------------
832 :Returns: 0 on success, -1 on error
836 been previously created with KVM_CREATE_IRQCHIP. Note that edge-triggered
839 On real hardware, interrupt pins can be active-low or active-high. This
844 (active-low/active-high) for level-triggered interrupts, and KVM used
846 active-low interrupts, the above convention is now valid on x86 too.
848 should not present interrupts to the guest as active-low unless this
849 capability is present (or unless it is not using the in-kernel irqchip,
854 in-kernel irqchip (GIC), and for in-kernel irqchip can tell the GIC to
863 - irq_type[0]:
864 out-of-kernel GIC: irq_id 0 is IRQ, irq_id 1 is FIQ
865 - irq_type[1]:
866 in-kernel GIC: SPI, irq_id between 32 and 1019 (incl.)
868 - irq_type[2]:
869 in-kernel GIC: PPI, irq_id between 16 and 31 (incl.)
880 injection of interrupts for the in-kernel irqchip. KVM_IRQ_LINE can always
895 --------------------
901 :Returns: 0 on success, -1 on error
920 --------------------
926 :Returns: 0 on success, -1 on error
945 -----------------------
951 :Returns: 0 on success, -1 on error
956 page of a blob (32- or 64-bit, depending on the vcpu mode) to guest
981 ------------------
987 :Returns: 0 on success, -1 on error
1014 ------------------
1020 :Returns: 0 on success, -1 on error
1036 ------------------------
1043 :Returns: 0 on success, -1 on error
1088 - KVM_VCPUEVENT_VALID_SHADOW may be set to signal that
1091 - KVM_VCPUEVENT_VALID_SMM may be set to signal that smi contains a
1094 - KVM_VCPUEVENT_VALID_PAYLOAD may be set to signal that the
1114 guest-visible registers. It is not possible to 'cancel' an SError that has been
1117 A device being emulated in user-space may also wish to generate an SError. To do
1118 this the events structure can be populated by user-space. The current state
1127 always have a non-zero value when read, and the agent making an SError pending
1129 the system supports KVM_CAP_ARM_INJECT_SERROR_ESR, but user-space sets the events
1133 -EINVAL. Setting anything other than the lower 24bits of exception.serror_esr
1134 will return -EINVAL.
1155 ------------------------
1162 :Returns: 0 on success, -1 on error
1175 suppress overwriting the current in-kernel state. The bits are:
1180 KVM_VCPUEVENT_VALID_SMM transfer the smi sub-struct.
1218 ----------------------
1224 :Returns: 0 on success, -1 on error
1240 ----------------------
1246 :Returns: 0 on success, -1 on error
1255 -------------------------------
1261 :Returns: 0 on success, -1 on error
1278 memory slot. Bits 0-15 of "slot" specify the slot id and this value
1283 If KVM_CAP_MULTI_ADDRESS_SPACE is available, bits 16-31 of "slot"
1310 to make a new slot read-only. In this case, writes to this memory will be
1324 ---------------------
1330 :Returns: 0 on success, -1 on error
1332 This ioctl defines the physical address of a three-page region in the guest
1338 This ioctl is required on Intel-based hosts. This is needed on Intel hardware
1344 -------------------
1350 :Returns: 0 on success; -1 on error
1356 :Returns: 0 on success; -1 on error
1395 The vcpu ioctl should be used for vcpu-specific capabilities, the vm ioctl
1396 for vm-wide capabilities.
1399 ---------------------
1405 :Returns: 0 on success; -1 on error
1437 in-kernel irqchip, the multiprocessing state must be maintained by userspace on
1447 ---------------------
1453 :Returns: 0 on success; -1 on error
1459 in-kernel irqchip, the multiprocessing state must be maintained by userspace on
1469 ------------------------------
1475 :Returns: 0 on success, -1 on error
1477 This ioctl defines the physical address of a one-page region in the guest
1486 This ioctl is required on Intel-based hosts. This is needed on Intel hardware
1493 ------------------------
1499 :Returns: 0 on success, -1 on error
1508 ------------------
1514 :Returns: 0 on success, -1 on error
1527 ------------------
1533 :Returns: 0 on success, -1 on error
1546 -----------------
1552 :Returns: 0 on success, -1 on error
1573 -----------------
1579 :Returns: 0 on success, -1 on error
1600 ----------------------------
1606 :Returns: 0 on success, -1 on error
1645 with the 'nent' field indicating the number of entries in the variable-size
1685 -----------------------
1715 ------------------------
1721 :Returns: 0 on success, -1 on error
1727 - GSI routing does not apply to KVM_IRQ_LINE but only to KVM_IRQFD.
1763 - KVM_MSI_VALID_DEVID: used along with KVM_IRQ_ROUTING_MSI routing entry
1764 type, specifies that the devid field contains a valid value. The per-VM
1768 - zero otherwise
1793 address_hi bits 31-8 provide bits 31-8 of the destination id. Bits 7-0 of
1813 --------------------
1819 :Returns: 0 on success, -1 on error
1826 --------------------
1832 :Returns: virtual tsc-khz on success, negative value on error
1835 KHz. If the host has unstable tsc this ioctl returns -EIO instead as an
1840 ------------------
1846 :Returns: 0 on success, -1 on error
1861 the APIC_ID register (bytes 32-35). xAPIC only allows an 8-bit APIC ID
1862 which is stored in bits 31-24 of the APIC register, or equivalently in
1871 ------------------
1877 :Returns: 0 on success, -1 on error
1889 The format of the APIC ID register (bytes 32-35 of struct kvm_lapic_state's
1895 ------------------
1918 For the special case of virtio-ccw devices on s390, the ioevent is matched
1932 For virtio-ccw devices, addr contains the subchannel id and datamatch the
1941 ------------------
1947 :Returns: 0 on success, -1 on error
1967 The array is little-endian: the bit 0 is the least significant bit of the
1977 -------------------------
1986 is an IOMMU for PAPR-style virtual I/O. It is used to translate
2000 which this TCE table will translate - the table will contain one 64
2010 the entries written by kernel-handled H_PUT_TCE calls, and also lets
2016 ---------------------
2025 time by the kernel. An RMA is a physically-contiguous, aligned region
2027 will be accessed by real-mode (MMU off) accesses in a KVM guest.
2052 ------------
2058 :Returns: 0 on success, -1 on error
2068 - pause the vcpu
2069 - read the local APIC's state (KVM_GET_LAPIC)
2070 - check whether changing LINT1 will queue an NMI (see the LVT entry for LINT1)
2071 - if so, issue KVM_NMI
2072 - resume the vcpu
2079 ----------------------
2101 ------------------------
2123 ------------------------
2141 --------------------
2379 ARM 32-bit CP15 registers have the following id bit patterns::
2383 ARM 64-bit CP15 registers have the following id bit patterns::
2391 ARM 32-bit VFP control registers have the following id bit patterns::
2395 ARM 64-bit FP registers have the following id bit patterns::
2399 ARM firmware pseudo-registers have the following bit pattern::
2407 arm64 core/FP-SIMD registers have the following id bit patterns. Note
2441 .. [1] These encodings are not accepted for SVE-enabled vcpus. See
2466 arm64 firmware pseudo-registers have the following bit pattern::
2475 0x6060 0000 0015 ffff KVM_REG_ARM64_SVE_VLS pseudo-register
2478 ENOENT. max_vq is the vcpu's maximum supported vector length in 128-bit
2489 KVM_REG_ARM64_SVE_VLS is a pseudo-register that allows the set of vector
2499 ((vector_lengths[(vq - KVM_ARM64_SVE_VQ_MIN) / 64] >>
2500 ((vq - KVM_ARM64_SVE_VQ_MIN) % 64)) & 1))
2522 is hardware-dependent and may not be available. Attempting to configure
2538 patterns depending on whether they're 32-bit or 64-bit registers::
2540 0x7020 0000 0001 00 <reg:5> <sel:3> (32-bit)
2541 0x7030 0000 0001 00 <reg:5> <sel:3> (64-bit)
2566 0x7020 0000 0003 00 <0:3> <reg:5> (32-bit FPU registers)
2567 0x7030 0000 0003 00 <0:3> <reg:5> (64-bit FPU registers)
2568 0x7040 0000 0003 00 <0:3> <reg:5> (128-bit MSA vector registers)
2582 --------------------
2612 ----------------------
2618 :Returns: 0 on success, -1 on error
2629 load-link/store-conditional, or equivalent must be used. There are two cases
2636 -------------------
2642 :Returns: >0 on delivery, 0 if guest blocked the MSI, and -1 on error
2644 Directly inject a MSI message. Only valid with in-kernel irqchip that handles
2659 KVM_MSI_VALID_DEVID: devid contains a valid value. The per-VM
2670 address_hi bits 31-8 provide bits 31-8 of the destination id. Bits 7-0 of
2675 --------------------
2681 :Returns: 0 on success, -1 on error
2683 Creates an in-kernel device model for the i8254 PIT. This call is only valid
2684 after enabling in-kernel irqchip support via KVM_CREATE_IRQCHIP. The following
2696 PIT timer interrupts may use a per-VM kernel thread for injection. If it
2699 kvm-pit/<owner-process-pid>
2708 -----------------
2714 :Returns: 0 on success, -1 on error
2716 Retrieves the state of the in-kernel PIT model. Only valid after
2734 -----------------
2740 :Returns: 0 on success, -1 on error
2742 Sets the state of the in-kernel PIT model. Only valid after KVM_CREATE_PIT2.
2749 --------------------------
2755 :Returns: 0 on success, -1 on error
2760 device-tree properties for the guest operating system.
2774 - KVM_PPC_PAGE_SIZES_REAL:
2779 - KVM_PPC_1T_SEGMENTS
2783 - KVM_PPC_NO_HASH
2824 --------------
2830 :Returns: 0 on success, -1 on error
2840 With KVM_CAP_IRQFD_RESAMPLE, KVM_IRQFD supports a de-assert and notify
2841 mechanism allowing emulation of level-triggered, irqfd-based
2846 as from an EOI, the gsi is de-asserted and the user is notified via
2847 kvm_irqfd.resamplefd. It is the user's responsibility to re-queue
2855 - in case no routing entry is associated to this gsi, injection fails
2856 - in case the gsi is associated to an irqchip routing entry,
2858 - in case the gsi is associated to an MSI routing entry, the MSI
2860 to GICv3 ITS in-kernel emulation).
2863 --------------------------
2869 :Returns: 0 on success, -1 on error
2881 The parameter is a pointer to a 32-bit unsigned integer variable
2888 default-sized hash table (16 MB).
2896 real-mode area (VRMA) facility, the kernel will re-create the VMRA
2900 -----------------------
2906 :Returns: 0 on success, -1 on error
2922 - sigp stop; optional flags in parm
2924 - program check; code in parm
2926 - sigp set prefix; prefix address in parm
2928 - restart
2930 - clock comparator interrupt
2932 - CPU timer interrupt
2934 - virtio external interrupt; external interrupt
2937 - sclp external interrupt; sclp parameter in parm
2939 - sigp emergency; source cpu in parm
2941 - sigp external call; source cpu in parm
2943 - compound value to indicate an
2944 I/O interrupt (ai - adapter interrupt; cssid,ssid,schid - subchannel);
2948 - machine check interrupt; cr 14 bits in parm, machine check interrupt
2955 ------------------------
2961 :Returns: file descriptor number (>= 0) on success, -1 on error
2984 Reads on the fd will initially supply information about all
3010 ----------------------
3015 :Returns: 0 on success, -1 on error
3048 --------------------------------------------
3054 :Returns: 0 on success, -1 on error
3062 (e.g. read-only attribute, or attribute that only makes
3069 semantics are device-specific. See individual device documentation in
3077 __u32 group; /* device-defined */
3078 __u64 attr; /* group-defined */
3083 ------------------------
3089 :Returns: 0 on success, -1 on error
3104 ----------------------
3110 :Returns: 0 on success; -1 on error
3125 - Processor state:
3130 - General Purpose registers, including PC and SP: set to 0
3131 - FPSIMD/NEON registers: set to 0
3132 - SVE registers: set to 0
3133 - System registers: Reset to their architecturally defined
3146 - KVM_ARM_VCPU_POWER_OFF: Starts the CPU in a power-off state.
3149 - KVM_ARM_VCPU_EL1_32BIT: Starts the CPU in a 32bit mode.
3151 - KVM_ARM_VCPU_PSCI_0_2: Emulate PSCI v0.2 (or a future revision
3154 - KVM_ARM_VCPU_PMU_V3: Emulate PMUv3 for the CPU.
3157 - KVM_ARM_VCPU_PTRAUTH_ADDRESS: Enables Address Pointer authentication
3165 - KVM_ARM_VCPU_PTRAUTH_GENERIC: Enables Generic Pointer authentication
3173 - KVM_ARM_VCPU_SVE: Enables SVE for the CPU (arm64 only).
3179 - KVM_REG_ARM64_SVE_VLS may be read using KVM_GET_ONE_REG: the
3180 initial value of this pseudo-register indicates the best set of
3185 - KVM_RUN and KVM_GET_REG_LIST are not available;
3187 - KVM_GET_ONE_REG and KVM_SET_ONE_REG cannot be used to access
3192 - KVM_REG_ARM64_SVE_VLS may optionally be written using
3198 - the KVM_REG_ARM64_SVE_VLS pseudo-register is immutable, and can
3202 -----------------------------
3208 :Returns: 0 on success; -1 on error
3221 kvm_vcpu_init->features bitmap returned will have feature bits set if
3231 ---------------------
3237 :Returns: 0 on success; -1 on error
3258 -----------------------------------------
3264 :Returns: 0 on success, -1 on error
3294 ARM/arm64 currently only require this when using the in-kernel GIC
3300 base addresses will return -EEXIST.
3307 ------------------------------
3313 :Returns: 0 on success, -1 on error
3318 of a service that has a kernel-side implementation. If the token
3319 value is non-zero, it will be associated with that service, and
3327 ------------------------
3333 :Returns: 0 on success; -1 on error
3348 - KVM_GUESTDBG_ENABLE: guest debugging is enabled
3349 - KVM_GUESTDBG_SINGLESTEP: the next run should single-step
3354 - KVM_GUESTDBG_USE_SW_BP: using software breakpoints [x86, arm64]
3355 - KVM_GUESTDBG_USE_HW_BP: using hardware breakpoints [x86, s390]
3356 - KVM_GUESTDBG_USE_HW: using hardware debug events [arm64]
3357 - KVM_GUESTDBG_INJECT_DB: inject DB type exception [x86]
3358 - KVM_GUESTDBG_INJECT_BP: inject BP type exception [x86]
3359 - KVM_GUESTDBG_EXIT_PENDING: trigger an immediate guest exit [s390]
3360 - KVM_GUESTDBG_BLOCKIRQ: avoid injecting interrupts/NMI/SMI [x86]
3378 the single-step debug event (KVM_GUESTDBG_SINGLESTEP) is supported.
3388 ---------------------------
3394 :Returns: 0 on success, -1 on error
3429 the variable-size array 'entries'. If the number of entries is too low
3463 --------------------
3470 < 0 on generic error (e.g. -EFAULT or -ENOMEM),
3512 -----------------------
3538 will cause the ioctl to return -EINVAL.
3544 -----------------------
3562 will cause the ioctl to return -EINVAL.
3569 the ioctl will return -EINVAL.
3572 -----------------
3578 :Returns: 0 on success, -1 on error
3619 - KVM_S390_SIGP_STOP - sigp stop; parameter in .stop
3620 - KVM_S390_PROGRAM_INT - program check; parameters in .pgm
3621 - KVM_S390_SIGP_SET_PREFIX - sigp set prefix; parameters in .prefix
3622 - KVM_S390_RESTART - restart; no parameters
3623 - KVM_S390_INT_CLOCK_COMP - clock comparator interrupt; no parameters
3624 - KVM_S390_INT_CPU_TIMER - CPU timer interrupt; no parameters
3625 - KVM_S390_INT_EMERGENCY - sigp emergency; parameters in .emerg
3626 - KVM_S390_INT_EXTERNAL_CALL - sigp external call; parameters in .extcall
3627 - KVM_S390_MCHK - machine check interrupt; parameters in .mchk
3632 ---------------------------
3639 -EINVAL if buffer size is 0,
3640 -ENOBUFS if buffer size is too small to fit all pending interrupts,
3641 -EFAULT if the buffer address was invalid
3659 the kernel never checked for flags == 0 and QEMU never pre-zeroed flags and
3663 If -ENOBUFS is returned the buffer provided was too small and userspace
3667 ---------------------------
3674 -EFAULT if the buffer address was invalid,
3675 -EINVAL for an invalid buffer length (see below),
3676 -EBUSY if there were already interrupts pending,
3680 This ioctl allows userspace to set the complete state of all cpu-local
3702 which is the maximum number of possibly pending cpu-local interrupts.
3705 ------------
3711 :Returns: 0 on success, -1 on error
3716 ----------------------------
3783 default KVM in-kernel emulation behavior is fully preserved.
3816 ----------------------------
3849 -------------------------
3856 -EFAULT if struct kvm_reinject_control cannot be read,
3857 -ENXIO if KVM_CREATE_PIT or KVM_CREATE_PIT2 didn't succeed earlier.
3876 ------------------------------
3883 -EFAULT if struct kvm_ppc_mmuv3_cfg cannot be read,
3884 -EINVAL if the configuration is invalid
3910 ---------------------------
3917 -EFAULT if struct kvm_ppc_rmmu_info cannot be written,
3918 -EINVAL if no useful information can be returned
3947 --------------------------------
3956 -EFAULT if struct kvm_reinject_control cannot be read,
3957 -EINVAL if the supplied shift or flags are invalid,
3958 -ENOMEM if unable to allocate the new HPT,
3991 returns 0 (i.e. cancels any in-progress preparation).
3994 flags will result in an -EINVAL.
4001 -------------------------------
4008 -EFAULT if struct kvm_reinject_control cannot be read,
4009 -EINVAL if the supplied shift or flags are invalid,
4010 -ENXIO is there is no pending HPT, or the pending HPT doesn't
4012 -EBUSY if the pending HPT is not fully prepared,
4013 -ENOSPC if there was a hash collision when moving existing
4015 -EIO on other error conditions
4032 KVM_PPC_RESIZE_HPT_COMMIT will return an error (usually -ENXIO or
4033 -EBUSY, though others may be possible if the preparation was started,
4046 -----------------------------------
4052 :Returns: 0 on success, -1 on error
4059 -----------------------
4066 -EFAULT if u64 mcg_cap cannot be read,
4067 -EINVAL if the requested number of banks is invalid,
4068 -EINVAL if requested MCE capability is not supported.
4073 supported number of error-reporting banks can be retrieved when
4078 ---------------------
4085 -EFAULT if struct kvm_x86_mce cannot be read,
4086 -EINVAL if the bank number is invalid,
4087 -EINVAL if VAL bit is not set in status field.
4112 ----------------------------
4123 - During live migration to save the CMMA values. Live migration needs
4125 - To non-destructively peek at the CMMA values, with the flag
4156 KVM_S390_SKEYS_MAX. KVM_S390_SKEYS_MAX is re-used for consistency with
4200 This ioctl can fail with -ENOMEM if not enough memory can be allocated to
4201 complete the task, with -ENXIO if CMMA is not enabled, with -EINVAL if
4203 -EFAULT if the userspace address is invalid or if no page table is
4207 ----------------------------
4246 This ioctl can fail with -ENOMEM if not enough memory can be allocated to
4247 complete the task, with -ENXIO if CMMA is not enabled, with -EINVAL if
4249 if the flags field was not 0, with -EFAULT if the userspace address is
4255 --------------------------
4262 -EFAULT if struct kvm_ppc_cpu_char cannot be written
4267 CVE-2017-5715, CVE-2017-5753 and CVE-2017-5754). The information is
4284 with preventing inadvertent information disclosure - specifically,
4285 whether there is an instruction to flash-invalidate the L1 data cache
4302 ---------------------------
4308 :Returns: 0 on success; -1 on error
4311 for issuing platform-specific memory encryption commands to manage those
4316 Documentation/virt/kvm/amd-memory-encryption.rst.
4319 -----------------------------------
4325 :Returns: 0 on success; -1 on error
4330 It is used in the SEV-enabled guest. When encryption is enabled, a guest
4343 -------------------------------------
4349 :Returns: 0 on success; -1 on error
4355 ------------------------
4363 the specified Hyper-V connection id through the SIGNAL_EVENT hypercall, without
4364 causing a user exit. SIGNAL_EVENT hypercall with non-zero event flag number
4365 (bits 24-31) still triggers a KVM_EXIT_HYPERV_HCALL user exit.
4385 -EINVAL if conn_id or flags is outside the allowed range,
4386 -ENOENT on deassign if the conn_id isn't registered,
4387 -EEXIST on assign if the conn_id is already registered
4390 --------------------------
4396 :Returns: 0 on success, -1 on error
4464 --------------------------
4470 :Returns: 0 on success, -1 on error
4476 -------------------------------------
4505 ------------------------------------
4511 :Returns: 0 on success, -1 on error
4533 in KVM's dirty bitmap, and dirty tracking is re-enabled for that page
4534 (for example via write-protection, or by clearing the dirty bit in
4537 If KVM_CAP_MULTI_ADDRESS_SPACE is available, bits 16-31 of slot field specifies
4547 --------------------------------
4553 :Returns: 0 on success, -1 on error
4574 This ioctl returns x86 cpuid features leaves related to Hyper-V emulation in
4576 cpuid information presented to guests consuming Hyper-V enlightenments (e.g.
4577 Windows or Hyper-V guests).
4579 CPUID feature leaves returned by this ioctl are defined by Hyper-V Top Level
4586 - HYPERV_CPUID_VENDOR_AND_MAX_FUNCTIONS
4587 - HYPERV_CPUID_INTERFACE
4588 - HYPERV_CPUID_VERSION
4589 - HYPERV_CPUID_FEATURES
4590 - HYPERV_CPUID_ENLIGHTMENT_INFO
4591 - HYPERV_CPUID_IMPLEMENT_LIMITS
4592 - HYPERV_CPUID_NESTED_FEATURES
4593 - HYPERV_CPUID_SYNDBG_VENDOR_AND_MAX_FUNCTIONS
4594 - HYPERV_CPUID_SYNDBG_INTERFACE
4595 - HYPERV_CPUID_SYNDBG_PLATFORM_CAPABILITIES
4598 with the 'nent' field indicating the number of entries in the variable-size
4599 array 'entries'. If the number of entries is too low to describe all Hyper-V
4601 to the number of Hyper-V feature leaves, the 'nent' field is adjusted to the
4611 - HYPERV_CPUID_NESTED_FEATURES leaf and HV_X64_ENLIGHTENED_VMCS_RECOMMENDED
4614 - HV_STIMER_DIRECT_MODE_AVAILABLE bit is only exposed with in-kernel LAPIC.
4618 ---------------------------
4623 :Returns: 0 on success, -1 on error
4649 that should be performaned and how to do it are feature-dependent.
4653 -EPERM unless the feature has already been finalized by means of a
4660 ------------------------------
4666 :Returns: 0 on success, -1 on error
4694 ---------------------
4718 ---------------------------
4730 ----------------------------
4743 --------------------------
4757 -------------------------
4795 again. All registered VCPUs are converted back to non-protected
4810 ----------------------------
4877 default KVM in-kernel emulation behavior is fully preserved.
4912 --------------------------
4938 Sets the ABI mode of the VM to 32-bit or 64-bit (long mode). This
4955 --------------------------
4967 ---------------------------
5023 other four times. The state field must be set to -1, or to a valid
5029 ---------------------------
5044 ---------------------------
5050 :Returns: number of bytes copied, < 0 on error (-EINVAL for incorrect
5051 arguments, -EFAULT if memory cannot be accessed).
5081 --------------------
5087 :Returns: 0 on success, -1 on error
5114 --------------------
5120 :Returns: 0 on success, -1 on error
5127 ----------------------
5146 +-------------+
5148 +-------------+
5150 +-------------+
5152 +-------------+
5154 +-------------+
5243 Bits 0-3 of ``flags`` encode the type:
5265 is [``hist_param``*(N-1), ``hist_param``*N), while the range of the last
5266 bucket is [``hist_param``*(``size``-1), +INF). (+INF means positive infinity
5271 [0, 1), while the range of the last bucket is [pow(2, ``size``-2), +INF).
5273 [pow(2, N-2), pow(2, N-1)). The bucket value indicates how many samples fell
5276 Bits 4-7 of ``flags`` encode the unit:
5290 Bits 8-11 of ``flags``, together with ``exponent``, encode the scale of the
5295 CPU clock cycles. For example, an exponent of -9 can be used with
5317 The Stats Data block contains an array of 64-bit values in the same order
5342 This field is polled once when KVM_RUN starts; if non-zero, KVM_RUN
5343 exits immediately, returning -EINTR. In the common scenario where a
5347 a signal handler that sets run->immediate_exit to a non-zero value.
5373 The value of the current interrupt flag. Only valid if in-kernel
5380 More architecture-specific flags detailing state of the VCPU that may
5393 The value of the cr8 register. Only valid if in-kernel local APIC is
5400 The value of the APIC BASE msr. Only valid if in-kernel local
5412 reasons. Further architecture-specific information is available in
5424 to unknown reasons. Further architecture-specific information is
5477 executed a memory-mapped I/O instruction which could not be satisfied
5490 has re-entered the kernel with KVM_RUN. The kernel side will first finish
5495 completed before performing a live migration. Userspace can re-enter the
5577 Deprecated - was used for 440 KVM.
5603 This is used on 64-bit PowerPC when emulating a pSeries partition,
5607 the arguments (from the guest R4 - R12). Userspace should put the
5664 a system-level event using some architecture specific mechanism (hypercall
5667 the system-level event type. The 'flags' field describes architecture
5668 specific flags for the system-level event.
5672 - KVM_SYSTEM_EVENT_SHUTDOWN -- the guest has requested a shutdown of the
5676 - KVM_SYSTEM_EVENT_RESET -- the guest has requested a reset of the VM.
5679 - KVM_SYSTEM_EVENT_CRASH -- the guest crash occurred and the guest
5691 Indicates that the VCPU's in-kernel local APIC received an EOI for a
5692 level-triggered IOAPIC interrupt. This exit only triggers when the
5734 related to Hyper-V emulation.
5738 - KVM_EXIT_HYPERV_SYNIC -- synchronously notify user-space about
5740 Hyper-V SynIC state change. Notification is used to remap SynIC
5744 - KVM_EXIT_HYPERV_SYNDBG -- synchronously notify user-space about
5746 Hyper-V Synthetic debugger state change. Notification is used to either update
5765 the VM. KVM assumed that if the guest accessed non-memslot memory, it was
5789 __u8 error; /* user -> kernel */
5791 __u32 reason; /* kernel -> user */
5792 __u32 index; /* kernel -> user */
5793 __u64 data; /* kernel <-> user */
5805 KVM_MSR_EXIT_REASON_UNKNOWN - access to MSR that is unknown to KVM
5806 KVM_MSR_EXIT_REASON_INVAL - access to invalid MSRs or reserved bits
5807 KVM_MSR_EXIT_REASON_FILTER - access blocked by KVM_X86_SET_MSR_FILTER
5847 - KVM_EXIT_XEN_HCALL -- synchronously notify user-space about Xen hypercall.
5904 whether this is a per-vcpu or per-vm capability.
5915 -------------------
5920 :Returns: 0 on success; -1 on error
5924 were invented by Mac-on-Linux to have a standardized communication mechanism
5931 --------------------
5936 :Returns: 0 on success; -1 on error
5952 ------------------
5957 :Returns: 0 on success; -1 on error
5970 addresses of mmu-type-specific data structures. The "array_len" field is an
5986 - The "params" field is of type "struct kvm_book3e_206_tlb_params".
5987 - The "array" field points to an array of type "struct
5989 - The array consists of all entries in the first TLB, followed by all
5991 - Within a TLB, entries are ordered first by increasing set number. Within a
5993 - The hash for determining set number in TLB0 is: (MAS2 >> 12) & (num_sets - 1)
5995 - The tsize field of mas1 shall be set to 4K on TLB0, even though the
5999 ----------------------------
6004 :Returns: 0 on success; -1 on error
6009 handled in-kernel, while the other I/O instructions are passed to userspace.
6014 Note that even though this capability is enabled per-vcpu, the complete
6018 -------------------
6023 :Returns: 0 on success; -1 on error
6037 --------------------
6043 This capability connects the vcpu to an in-kernel MPIC device.
6046 --------------------
6053 This capability connects the vcpu to an in-kernel XICS device.
6056 ------------------------
6062 This capability enables the in-kernel irqchip for s390. Please refer to
6066 --------------------
6080 ---------------------
6093 ----------------------
6098 :Returns: x86: KVM_CHECK_EXTENSION returns a bit-array indicating which register
6114 - the register sets to be copied out to kvm_run are selectable
6116 - vcpu_events are available in addition to regs and sregs.
6119 function as an input bit-array field set by userspace to indicate the
6139 -------------------------
6146 This capability connects the vcpu to an in-kernel XIVE device.
6171 ----------------------------
6175 args[1] is 0 to disable, 1 to enable in-kernel handling
6178 get handled by the kernel or not. Enabling or disabling in-kernel
6180 initial set of hcalls are enabled for in-kernel handling, which
6181 consists of those hcalls for which in-kernel handlers were implemented
6188 If the hcall number specified is not one that has an in-kernel
6193 --------------------------
6202 - SENSE
6203 - SENSE RUNNING
6204 - EXTERNAL CALL
6205 - EMERGENCY SIGNAL
6206 - CONDITIONAL EMERGENCY SIGNAL
6215 ---------------------------------
6223 return -EINVAL if the machine does not support vectors.
6226 --------------------------
6231 This capability allows post-handlers for the STSI instruction. After
6236 vcpu->run::
6247 @addr - guest address of STSI SYSIB
6248 @fc - function code
6249 @sel1 - selector 1
6250 @sel2 - selector 2
6251 @ar - access register number
6253 KVM handlers should exit to userspace with rc = -EREMOTE.
6256 -------------------------
6259 :Parameters: args[0] - number of routes reserved for userspace IOAPICs
6260 :Returns: 0 on success, -1 on error
6277 -------------------
6282 Allows use of runtime-instrumentation introduced with zEC12 processor.
6283 Will return -EINVAL if the machine does not support runtime-instrumentation.
6284 Will return -EBUSY if a VCPU has already been created.
6287 ----------------------
6290 :Parameters: args[0] - features that should be enabled
6291 :Returns: 0 on success, -EINVAL when args[0] contains invalid features
6300 allowing the use of 32-bit APIC IDs. See KVM_CAP_X2APIC_API in their
6307 where 0xff represents CPUs 0-7 in cluster 0.
6310 ----------------------------
6317 mechanism e.g. to realize 2-byte software breakpoints. The kernel will
6325 -------------------
6329 :Returns: 0 on success; -EINVAL if the machine does not support
6330 guarded storage; -EBUSY if a VCPU has already been created.
6335 ---------------------
6340 Allow use of adapter-interruption suppression.
6341 :Returns: 0 on success; -EBUSY if a VCPU has already been created.
6344 --------------------
6362 ----------------------
6374 ------------------------------
6378 :Returns: 0 on success, -EINVAL when args[0] contains invalid exits
6397 --------------------------
6401 :Returns: 0 on success, -EINVAL if hpage module parameter was not set
6409 hpage module parameter is not set to 1, -EINVAL is returned.
6415 ------------------------------
6425 --------------------------
6429 :Returns: 0 on success, -EINVAL when the implementation doesn't support
6430 nested-HV virtualization.
6432 HV-KVM on POWER9 and later systems allows for "nested-HV"
6434 can run using the CPU's supervisor mode (privileged non-hypervisor
6437 kvm-hv module parameter.
6440 ------------------------------
6446 emulated VM-exit when L1 intercepts a #PF exception that occurs in
6447 L2. Similarly, for kvm-intel only, DR6 will not be modified prior to
6448 the emulated VM-exit when L1 intercepts a #DB exception that occurs in
6454 exception.has_payload and to put the faulting address - or the new DR6
6455 bits\ [#]_ - in the exception_payload field.
6476 automatically clear and write-protect all pages that are returned as dirty.
6482 KVM_CLEAR_DIRTY_LOG ioctl can operate on a 64-page granularity rather
6507 ------------------------------
6524 ----------------------
6529 :Returns: 0 on success; -1 on error
6537 the maximum halt time to specified on a per-VM basis, effectively overriding
6541 -------------------------------
6546 :Returns: 0 on success; -1 on error
6563 -------------------------------
6568 :Returns: 0 on success, -EINVAL when args[0] contains invalid bits
6594 KVM_RUN_BUS_LOCK flag in vcpu-run->flags field and exit to userspace. Concerning
6600 ----------------------
6604 :Returns: 0 on success, -EINVAL when CPU doesn't support 2nd DAWR
6611 -------------------------------------
6621 This is intended to support in-guest workloads scheduled by the host. This
6622 allows the in-guest workload to maintain its own NPTs and keeps the two vms
6627 --------------------------
6632 :Returns: 0 on success, -EINVAL if the file handle is invalid or if a requested
6650 -------------------------------
6661 IBM pSeries (sPAPR) guest starts using it if "hcall-rpt-invalidate" is
6662 present in the "ibm,hypertas-functions" device-tree property.
6668 --------------------------------------
6686 --------------------
6703 not-shareable (no MAP_SHARED), attempts to create a memslot with a
6704 MAP_SHARED mmap will result in an -EINVAL return.
6716 ---------------------
6722 H_RANDOM hypercall backed by a hardware random-number generator.
6727 ------------------------
6733 Hyper-V Synthetic interrupt controller(SynIC). Hyper-V SynIC is
6734 used to support Windows Hyper-V based guest paravirt drivers(VMBus).
6739 by the CPU, as it's incompatible with SynIC auto-EOI behavior.
6742 -------------------------
6752 ---------------------------
6759 the POWER9 processor), including in-memory segment tables.
6762 -------------------
6792 -------------------
6806 ----------------------
6820 Both registers and addresses are 32-bits wide.
6821 It will only be possible to run 32-bit guest code.
6823 1 MIPS64 or microMIPS64 with access only to 32-bit compatibility segments.
6824 Registers are 64-bits wide, but addresses are 32-bits wide.
6825 64-bit guest code may run but cannot access MIPS64 memory segments.
6826 It will also be possible to run 32-bit guest code.
6829 Both registers and addresses are 64-bits wide.
6830 It will be possible to run 64-bit or 32-bit guest code.
6834 ------------------------
6839 that if userspace creates a VM without an in-kernel interrupt controller, it
6840 will be notified of changes to the output level of in-kernel emulated devices,
6843 updates the vcpu's run->s.regs.device_irq_level field to represent the actual
6849 userspace can always sample the device output level and re-compute the state of
6851 of run->s.regs.device_irq_level on every kvm exit.
6852 The value in run->s.regs.device_irq_level can represent both level and edge
6854 signals will exit to userspace with the bit in run->s.regs.device_irq_level
6857 The field run->s.regs.device_irq_level is available independent of
6858 run->kvm_valid_regs or run->kvm_dirty_regs bits.
6862 and thereby which bits in run->s.regs.device_irq_level can signal values.
6868 KVM_ARM_DEV_EL1_VTIMER - EL1 virtual timer
6869 KVM_ARM_DEV_EL1_PTIMER - EL1 physical timer
6870 KVM_ARM_DEV_PMU - ARM PMU overflow interrupt signal
6877 -----------------------------
6887 --------------------------
6891 This capability enables a newer version of Hyper-V Synthetic interrupt
6897 ----------------------------
6907 -------------------------------
6917 ---------------------
6924 ----------------------
6933 ---------------------
6938 use copy-on-write semantics as well as dirty pages tracking via read-only page
6942 ---------------------
6951 ----------------------------
6955 This capability indicates that KVM supports paravirtualized Hyper-V TLB Flush
6961 ----------------------------------
6976 ----------------------------
6980 This capability indicates that KVM supports paravirtualized Hyper-V IPI send
6985 -----------------------------------
6989 This capability indicates that KVM running on top of Hyper-V hypervisor
6991 hypercalls are handled by Level 0 hypervisor (Hyper-V) bypassing KVM.
6992 Due to the different ABI for hypercall parameters between Hyper-V and
6995 flush hypercalls by Hyper-V) so userspace should disable KVM identification
6996 in CPUID and only exposes Hyper-V identification. In this case, guest
6997 thinks it's running on Hyper-V and only use Hyper-V hypercalls.
7000 -----------------------------
7008 ---------------------------
7019 -----------------------
7025 architecture-specific interfaces. This capability and the architecture-
7032 -------------------------
7042 an 8-byte value consisting of a one-byte Control Program Name Code (CPNC) and
7043 a 7-byte Control Program Version Code (CPVC). The CPNC determines what
7052 -------------------------------
7063 ---------------------------
7077 -----------------------------
7087 ---------------------------
7090 :Parameters: args[0] - size of the dirty log ring
7130 00 -----------> 01 -------------> 1X -------+
7133 +------------------------------------------+
7170 machine will switch to ring-buffer dirty page tracking and further
7174 --------------------
7200 The KVM_XEN_HVM_CONFIG_RUNSTATE flag indicates that the runstate-related
7205 -------------------------
7220 IBM pSeries (sPAPR) guest starts using them if "hcall-multi-tce" is
7221 present in the "ibm,hypertas-functions" device-tree property.
7231 --------------------
7240 ---------------------------------
7244 When enabled, KVM will disable emulated Hyper-V features provided to the
7245 guest according to the bits Hyper-V CPUID feature leaves. Otherwise, all
7246 currently implmented Hyper-V features are provided unconditionally when
7247 Hyper-V identification is set in the HYPERV_CPUID_INTERFACE (0x40000001)
7251 ---------------------------