• Home
  • Raw
  • Download

Lines Matching +full:mips +full:- +full:hpt +full:- +full:frequency

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 -----------------
154 To use hardware assisted virtualization on MIPS (VZ ASE) rather than
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
398 -----------------
404 :Returns: 0 on success, -1 on error
420 /* mips */
431 -----------------
437 :Returns: 0 on success, -1 on error
445 ------------------
451 :Returns: 0 on success, -1 on error
468 /* ppc -- see arch/powerpc/include/uapi/asm/kvm.h */
476 ------------------
482 :Returns: 0 on success, -1 on error
489 ------------------
495 :Returns: 0 on success, -1 on error
516 ------------------
519 :Architectures: x86, ppc, mips
541 -EEXIST if an interrupt is already enqueued
542 -EINVAL the irq number is invalid
543 -ENXIO if the PIC is in the kernel
544 -EFAULT if the pointer is invalid
548 ioctl is useful if the in-kernel PIC is not used.
580 MIPS:
590 --------------------
596 :Returns: -1 on error
602 -----------------
609 -1 on error
612 Reads the values of MSR-based features that are available for the VM. This
614 The list of msr-based features can be obtained using KVM_GET_MSR_FEATURE_INDEX_LIST
618 Reads model-specific registers from the vcpu. Supported msr indices can
642 -----------------
648 :Returns: number of msrs successfully set (see below), -1 on error
650 Writes model-specific registers to the vcpu. See KVM_GET_MSRS for the
664 ------------------
670 :Returns: 0 on success, -1 on error
699 ------------------------
705 :Returns: 0 on success, -1 on error
710 their traditional behaviour) will cause KVM_RUN to return with -EINTR.
725 ----------------
731 :Returns: 0 on success, -1 on error
754 ----------------
760 :Returns: 0 on success, -1 on error
783 -----------------------
789 :Returns: 0 on success, -1 on error
793 future vcpus to have a local APIC. IRQ routing for GSIs 0-15 is set to both
794 PIC and IOAPIC; GSI 16-23 only go to the IOAPIC.
805 -----------------
811 :Returns: 0 on success, -1 on error
815 been previously created with KVM_CREATE_IRQCHIP. Note that edge-triggered
818 On real hardware, interrupt pins can be active-low or active-high. This
823 (active-low/active-high) for level-triggered interrupts, and KVM used
825 active-low interrupts, the above convention is now valid on x86 too.
827 should not present interrupts to the guest as active-low unless this
828 capability is present (or unless it is not using the in-kernel irqchip,
833 in-kernel irqchip (GIC), and for in-kernel irqchip can tell the GIC to
842 - irq_type[0]:
843 out-of-kernel GIC: irq_id 0 is IRQ, irq_id 1 is FIQ
844 - irq_type[1]:
845 in-kernel GIC: SPI, irq_id between 32 and 1019 (incl.)
847 - irq_type[2]:
848 in-kernel GIC: PPI, irq_id between 16 and 31 (incl.)
859 injection of interrupts for the in-kernel irqchip. KVM_IRQ_LINE can always
874 --------------------
880 :Returns: 0 on success, -1 on error
899 --------------------
905 :Returns: 0 on success, -1 on error
924 -----------------------
930 :Returns: 0 on success, -1 on error
935 page of a blob (32- or 64-bit, depending on the vcpu mode) to guest
952 ------------------
958 :Returns: 0 on success, -1 on error
985 ------------------
991 :Returns: 0 on success, -1 on error
1007 ------------------------
1014 :Returns: 0 on success, -1 on error
1059 - KVM_VCPUEVENT_VALID_SHADOW may be set to signal that
1062 - KVM_VCPUEVENT_VALID_SMM may be set to signal that smi contains a
1065 - KVM_VCPUEVENT_VALID_PAYLOAD may be set to signal that the
1085 guest-visible registers. It is not possible to 'cancel' an SError that has been
1088 A device being emulated in user-space may also wish to generate an SError. To do
1089 this the events structure can be populated by user-space. The current state
1098 always have a non-zero value when read, and the agent making an SError pending
1100 the system supports KVM_CAP_ARM_INJECT_SERROR_ESR, but user-space sets the events
1104 -EINVAL. Setting anything other than the lower 24bits of exception.serror_esr
1105 will return -EINVAL.
1126 ------------------------
1133 :Returns: 0 on success, -1 on error
1146 suppress overwriting the current in-kernel state. The bits are:
1151 KVM_VCPUEVENT_VALID_SMM transfer the smi sub-struct.
1189 ----------------------
1195 :Returns: 0 on success, -1 on error
1211 ----------------------
1217 :Returns: 0 on success, -1 on error
1226 -------------------------------
1232 :Returns: 0 on success, -1 on error
1249 memory slot. Bits 0-15 of "slot" specify the slot id and this value
1254 If KVM_CAP_MULTI_ADDRESS_SPACE is available, bits 16-31 of "slot"
1281 to make a new slot read-only. In this case, writes to this memory will be
1295 ---------------------
1301 :Returns: 0 on success, -1 on error
1303 This ioctl defines the physical address of a three-page region in the guest
1309 This ioctl is required on Intel-based hosts. This is needed on Intel hardware
1315 -------------------
1318 :Architectures: mips, ppc, s390
1321 :Returns: 0 on success; -1 on error
1327 :Returns: 0 on success; -1 on error
1366 The vcpu ioctl should be used for vcpu-specific capabilities, the vm ioctl
1367 for vm-wide capabilities.
1370 ---------------------
1376 :Returns: 0 on success; -1 on error
1408 in-kernel irqchip, the multiprocessing state must be maintained by userspace on
1418 ---------------------
1424 :Returns: 0 on success; -1 on error
1430 in-kernel irqchip, the multiprocessing state must be maintained by userspace on
1440 ------------------------------
1446 :Returns: 0 on success, -1 on error
1448 This ioctl defines the physical address of a one-page region in the guest
1457 This ioctl is required on Intel-based hosts. This is needed on Intel hardware
1464 ------------------------
1470 :Returns: 0 on success, -1 on error
1478 ------------------
1484 :Returns: 0 on success, -1 on error
1497 ------------------
1503 :Returns: 0 on success, -1 on error
1516 -----------------
1522 :Returns: 0 on success, -1 on error
1543 -----------------
1549 :Returns: 0 on success, -1 on error
1570 ----------------------------
1576 :Returns: 0 on success, -1 on error
1615 with the 'nent' field indicating the number of entries in the variable-size
1655 -----------------------
1685 ------------------------
1691 :Returns: 0 on success, -1 on error
1697 - GSI routing does not apply to KVM_IRQ_LINE but only to KVM_IRQFD.
1733 - KVM_MSI_VALID_DEVID: used along with KVM_IRQ_ROUTING_MSI routing entry
1734 type, specifies that the devid field contains a valid value. The per-VM
1738 - zero otherwise
1763 address_hi bits 31-8 provide bits 31-8 of the destination id. Bits 7-0 of
1783 --------------------
1789 :Returns: 0 on success, -1 on error
1791 Specifies the tsc frequency for the virtual machine. The unit of the
1792 frequency is KHz.
1796 --------------------
1802 :Returns: virtual tsc-khz on success, negative value on error
1804 Returns the tsc frequency of the guest. The unit of the return value is
1805 KHz. If the host has unstable tsc this ioctl returns -EIO instead as an
1810 ------------------
1816 :Returns: 0 on success, -1 on error
1831 the APIC_ID register (bytes 32-35). xAPIC only allows an 8-bit APIC ID
1832 which is stored in bits 31-24 of the APIC register, or equivalently in
1841 ------------------
1847 :Returns: 0 on success, -1 on error
1859 The format of the APIC ID register (bytes 32-35 of struct kvm_lapic_state's
1865 ------------------
1888 For the special case of virtio-ccw devices on s390, the ioevent is matched
1902 For virtio-ccw devices, addr contains the subchannel id and datamatch the
1911 ------------------
1917 :Returns: 0 on success, -1 on error
1937 The array is little-endian: the bit 0 is the least significant bit of the
1947 -------------------------
1956 is an IOMMU for PAPR-style virtual I/O. It is used to translate
1970 which this TCE table will translate - the table will contain one 64
1980 the entries written by kernel-handled H_PUT_TCE calls, and also lets
1986 ---------------------
1995 time by the kernel. An RMA is a physically-contiguous, aligned region
1997 will be accessed by real-mode (MMU off) accesses in a KVM guest.
2022 ------------
2028 :Returns: 0 on success, -1 on error
2038 - pause the vcpu
2039 - read the local APIC's state (KVM_GET_LAPIC)
2040 - check whether changing LINT1 will queue an NMI (see the LVT entry for LINT1)
2041 - if so, issue KVM_NMI
2042 - resume the vcpu
2049 ----------------------
2071 ------------------------
2093 ------------------------
2111 --------------------
2276 MIPS KVM_REG_MIPS_R0 64
2278 MIPS KVM_REG_MIPS_R31 64
2279 MIPS KVM_REG_MIPS_HI 64
2280 MIPS KVM_REG_MIPS_LO 64
2281 MIPS KVM_REG_MIPS_PC 64
2282 MIPS KVM_REG_MIPS_CP0_INDEX 32
2283 MIPS KVM_REG_MIPS_CP0_ENTRYLO0 64
2284 MIPS KVM_REG_MIPS_CP0_ENTRYLO1 64
2285 MIPS KVM_REG_MIPS_CP0_CONTEXT 64
2286 MIPS KVM_REG_MIPS_CP0_CONTEXTCONFIG 32
2287 MIPS KVM_REG_MIPS_CP0_USERLOCAL 64
2288 MIPS KVM_REG_MIPS_CP0_XCONTEXTCONFIG 64
2289 MIPS KVM_REG_MIPS_CP0_PAGEMASK 32
2290 MIPS KVM_REG_MIPS_CP0_PAGEGRAIN 32
2291 MIPS KVM_REG_MIPS_CP0_SEGCTL0 64
2292 MIPS KVM_REG_MIPS_CP0_SEGCTL1 64
2293 MIPS KVM_REG_MIPS_CP0_SEGCTL2 64
2294 MIPS KVM_REG_MIPS_CP0_PWBASE 64
2295 MIPS KVM_REG_MIPS_CP0_PWFIELD 64
2296 MIPS KVM_REG_MIPS_CP0_PWSIZE 64
2297 MIPS KVM_REG_MIPS_CP0_WIRED 32
2298 MIPS KVM_REG_MIPS_CP0_PWCTL 32
2299 MIPS KVM_REG_MIPS_CP0_HWRENA 32
2300 MIPS KVM_REG_MIPS_CP0_BADVADDR 64
2301 MIPS KVM_REG_MIPS_CP0_BADINSTR 32
2302 MIPS KVM_REG_MIPS_CP0_BADINSTRP 32
2303 MIPS KVM_REG_MIPS_CP0_COUNT 32
2304 MIPS KVM_REG_MIPS_CP0_ENTRYHI 64
2305 MIPS KVM_REG_MIPS_CP0_COMPARE 32
2306 MIPS KVM_REG_MIPS_CP0_STATUS 32
2307 MIPS KVM_REG_MIPS_CP0_INTCTL 32
2308 MIPS KVM_REG_MIPS_CP0_CAUSE 32
2309 MIPS KVM_REG_MIPS_CP0_EPC 64
2310 MIPS KVM_REG_MIPS_CP0_PRID 32
2311 MIPS KVM_REG_MIPS_CP0_EBASE 64
2312 MIPS KVM_REG_MIPS_CP0_CONFIG 32
2313 MIPS KVM_REG_MIPS_CP0_CONFIG1 32
2314 MIPS KVM_REG_MIPS_CP0_CONFIG2 32
2315 MIPS KVM_REG_MIPS_CP0_CONFIG3 32
2316 MIPS KVM_REG_MIPS_CP0_CONFIG4 32
2317 MIPS KVM_REG_MIPS_CP0_CONFIG5 32
2318 MIPS KVM_REG_MIPS_CP0_CONFIG7 32
2319 MIPS KVM_REG_MIPS_CP0_XCONTEXT 64
2320 MIPS KVM_REG_MIPS_CP0_ERROREPC 64
2321 MIPS KVM_REG_MIPS_CP0_KSCRATCH1 64
2322 MIPS KVM_REG_MIPS_CP0_KSCRATCH2 64
2323 MIPS KVM_REG_MIPS_CP0_KSCRATCH3 64
2324 MIPS KVM_REG_MIPS_CP0_KSCRATCH4 64
2325 MIPS KVM_REG_MIPS_CP0_KSCRATCH5 64
2326 MIPS KVM_REG_MIPS_CP0_KSCRATCH6 64
2327 MIPS KVM_REG_MIPS_CP0_MAAR(0..63) 64
2328 MIPS KVM_REG_MIPS_COUNT_CTL 64
2329 MIPS KVM_REG_MIPS_COUNT_RESUME 64
2330 MIPS KVM_REG_MIPS_COUNT_HZ 64
2331 MIPS KVM_REG_MIPS_FPR_32(0..31) 32
2332 MIPS KVM_REG_MIPS_FPR_64(0..31) 64
2333 MIPS KVM_REG_MIPS_VEC_128(0..31) 128
2334 MIPS KVM_REG_MIPS_FCR_IR 32
2335 MIPS KVM_REG_MIPS_FCR_CSR 32
2336 MIPS KVM_REG_MIPS_MSA_IR 32
2337 MIPS KVM_REG_MIPS_MSA_CSR 32
2347 ARM 32-bit CP15 registers have the following id bit patterns::
2351 ARM 64-bit CP15 registers have the following id bit patterns::
2359 ARM 32-bit VFP control registers have the following id bit patterns::
2363 ARM 64-bit FP registers have the following id bit patterns::
2367 ARM firmware pseudo-registers have the following bit pattern::
2375 arm64 core/FP-SIMD registers have the following id bit patterns. Note
2409 .. [1] These encodings are not accepted for SVE-enabled vcpus. See
2434 arm64 firmware pseudo-registers have the following bit pattern::
2443 0x6060 0000 0015 ffff KVM_REG_ARM64_SVE_VLS pseudo-register
2446 ENOENT. max_vq is the vcpu's maximum supported vector length in 128-bit
2457 KVM_REG_ARM64_SVE_VLS is a pseudo-register that allows the set of vector
2467 ((vector_lengths[(vq - KVM_ARM64_SVE_VQ_MIN) / 64] >>
2468 ((vq - KVM_ARM64_SVE_VQ_MIN) % 64)) & 1))
2490 is hardware-dependent and may not be available. Attempting to configure
2498 MIPS registers are mapped using the lower 32 bits. The upper 16 of that is
2501 MIPS core registers (see above) have the following id bit patterns::
2505 MIPS CP0 registers (see KVM_REG_MIPS_CP0_* above) have the following id bit
2506 patterns depending on whether they're 32-bit or 64-bit registers::
2508 0x7020 0000 0001 00 <reg:5> <sel:3> (32-bit)
2509 0x7030 0000 0001 00 <reg:5> <sel:3> (64-bit)
2517 MIPS MAARs (see KVM_REG_MIPS_CP0_MAAR(*) above) have the following id bit
2522 MIPS KVM control registers (see above) have the following id bit patterns::
2526 MIPS FPU registers (see KVM_REG_MIPS_FPR_{32,64}() above) have the following
2530 if the guest FPU mode is changed. MIPS SIMD Architecture (MSA) vector
2534 0x7020 0000 0003 00 <0:3> <reg:5> (32-bit FPU registers)
2535 0x7030 0000 0003 00 <0:3> <reg:5> (64-bit FPU registers)
2536 0x7040 0000 0003 00 <0:3> <reg:5> (128-bit MSA vector registers)
2538 MIPS FPU control registers (see KVM_REG_MIPS_FCR_{IR,CSR} above) have the
2543 MIPS MSA control registers (see KVM_REG_MIPS_MSA_{IR,CSR} above) have the
2550 --------------------
2580 ----------------------
2586 :Returns: 0 on success, -1 on error
2597 load-link/store-conditional, or equivalent must be used. There are two cases
2604 -------------------
2610 :Returns: >0 on delivery, 0 if guest blocked the MSI, and -1 on error
2612 Directly inject a MSI message. Only valid with in-kernel irqchip that handles
2627 KVM_MSI_VALID_DEVID: devid contains a valid value. The per-VM
2638 address_hi bits 31-8 provide bits 31-8 of the destination id. Bits 7-0 of
2643 --------------------
2649 :Returns: 0 on success, -1 on error
2651 Creates an in-kernel device model for the i8254 PIT. This call is only valid
2652 after enabling in-kernel irqchip support via KVM_CREATE_IRQCHIP. The following
2664 PIT timer interrupts may use a per-VM kernel thread for injection. If it
2667 kvm-pit/<owner-process-pid>
2676 -----------------
2682 :Returns: 0 on success, -1 on error
2684 Retrieves the state of the in-kernel PIT model. Only valid after
2702 -----------------
2708 :Returns: 0 on success, -1 on error
2710 Sets the state of the in-kernel PIT model. Only valid after KVM_CREATE_PIT2.
2717 --------------------------
2723 :Returns: 0 on success, -1 on error
2728 device-tree properties for the guest operating system.
2742 - KVM_PPC_PAGE_SIZES_REAL:
2747 - KVM_PPC_1T_SEGMENTS
2751 - KVM_PPC_NO_HASH
2752 This flag indicates that HPT guests are not supported by KVM,
2792 --------------
2798 :Returns: 0 on success, -1 on error
2808 With KVM_CAP_IRQFD_RESAMPLE, KVM_IRQFD supports a de-assert and notify
2809 mechanism allowing emulation of level-triggered, irqfd-based
2814 as from an EOI, the gsi is de-asserted and the user is notified via
2815 kvm_irqfd.resamplefd. It is the user's responsibility to re-queue
2823 - in case no routing entry is associated to this gsi, injection fails
2824 - in case the gsi is associated to an irqchip routing entry,
2826 - in case the gsi is associated to an MSI routing entry, the MSI
2828 to GICv3 ITS in-kernel emulation).
2831 --------------------------
2837 :Returns: 0 on success, -1 on error
2849 The parameter is a pointer to a 32-bit unsigned integer variable
2856 default-sized hash table (16 MB).
2864 real-mode area (VRMA) facility, the kernel will re-create the VMRA
2868 -----------------------
2874 :Returns: 0 on success, -1 on error
2890 - sigp stop; optional flags in parm
2892 - program check; code in parm
2894 - sigp set prefix; prefix address in parm
2896 - restart
2898 - clock comparator interrupt
2900 - CPU timer interrupt
2902 - virtio external interrupt; external interrupt
2905 - sclp external interrupt; sclp parameter in parm
2907 - sigp emergency; source cpu in parm
2909 - sigp external call; source cpu in parm
2911 - compound value to indicate an
2912 I/O interrupt (ai - adapter interrupt; cssid,ssid,schid - subchannel);
2916 - machine check interrupt; cr 14 bits in parm, machine check interrupt
2923 ------------------------
2929 :Returns: file descriptor number (>= 0) on success, -1 on error
2932 entries in the guest's hashed page table (HPT), or to write entries to
2933 initialize the HPT. The returned fd can only be written to if the
2949 The 'start_index' field gives the index in the HPT of the entry at
2953 "interesting" HPT entries. Interesting entries are those with the
2955 all entries. When the end of the HPT is reached, the read() will
2957 the beginning of the HPT, but will only return HPT entries that have
2961 series of valid HPT entries (16 bytes) each. The header indicates how
2962 many valid HPT entries there are and how many invalid entries follow
2972 Writes to the fd create HPT entries starting at the index given in the
2978 ----------------------
2983 :Returns: 0 on success, -1 on error
3016 --------------------------------------------
3022 :Returns: 0 on success, -1 on error
3030 (e.g. read-only attribute, or attribute that only makes
3037 semantics are device-specific. See individual device documentation in
3045 __u32 group; /* device-defined */
3046 __u64 attr; /* group-defined */
3051 ------------------------
3057 :Returns: 0 on success, -1 on error
3072 ----------------------
3078 :Returns: 0 on success; -1 on error
3102 - KVM_ARM_VCPU_POWER_OFF: Starts the CPU in a power-off state.
3105 - KVM_ARM_VCPU_EL1_32BIT: Starts the CPU in a 32bit mode.
3107 - KVM_ARM_VCPU_PSCI_0_2: Emulate PSCI v0.2 (or a future revision
3110 - KVM_ARM_VCPU_PMU_V3: Emulate PMUv3 for the CPU.
3113 - KVM_ARM_VCPU_PTRAUTH_ADDRESS: Enables Address Pointer authentication
3121 - KVM_ARM_VCPU_PTRAUTH_GENERIC: Enables Generic Pointer authentication
3129 - KVM_ARM_VCPU_SVE: Enables SVE for the CPU (arm64 only).
3135 - KVM_REG_ARM64_SVE_VLS may be read using KVM_GET_ONE_REG: the
3136 initial value of this pseudo-register indicates the best set of
3141 - KVM_RUN and KVM_GET_REG_LIST are not available;
3143 - KVM_GET_ONE_REG and KVM_SET_ONE_REG cannot be used to access
3148 - KVM_REG_ARM64_SVE_VLS may optionally be written using
3154 - the KVM_REG_ARM64_SVE_VLS pseudo-register is immutable, and can
3158 -----------------------------
3164 :Returns: 0 on success; -1 on error
3177 kvm_vcpu_init->features bitmap returned will have feature bits set if
3187 ---------------------
3190 :Architectures: arm, arm64, mips
3193 :Returns: 0 on success; -1 on error
3214 -----------------------------------------
3220 :Returns: 0 on success, -1 on error
3250 ARM/arm64 currently only require this when using the in-kernel GIC
3256 base addresses will return -EEXIST.
3263 ------------------------------
3269 :Returns: 0 on success, -1 on error
3274 of a service that has a kernel-side implementation. If the token
3275 value is non-zero, it will be associated with that service, and
3283 ------------------------
3289 :Returns: 0 on success; -1 on error
3304 - KVM_GUESTDBG_ENABLE: guest debugging is enabled
3305 - KVM_GUESTDBG_SINGLESTEP: the next run should single-step
3310 - KVM_GUESTDBG_USE_SW_BP: using software breakpoints [x86, arm64]
3311 - KVM_GUESTDBG_USE_HW_BP: using hardware breakpoints [x86, s390, arm64]
3312 - KVM_GUESTDBG_INJECT_DB: inject DB type exception [x86]
3313 - KVM_GUESTDBG_INJECT_BP: inject BP type exception [x86]
3314 - KVM_GUESTDBG_EXIT_PENDING: trigger an immediate guest exit [s390]
3332 the single-step debug event (KVM_GUESTDBG_SINGLESTEP) is supported.
3339 ---------------------------
3345 :Returns: 0 on success, -1 on error
3380 the variable-size array 'entries'. If the number of entries is too low
3414 --------------------
3421 < 0 on generic error (e.g. -EFAULT or -ENOMEM),
3463 -----------------------
3489 will cause the ioctl to return -EINVAL.
3495 -----------------------
3513 will cause the ioctl to return -EINVAL.
3520 the ioctl will return -EINVAL.
3523 -----------------
3529 :Returns: 0 on success, -1 on error
3570 - KVM_S390_SIGP_STOP - sigp stop; parameter in .stop
3571 - KVM_S390_PROGRAM_INT - program check; parameters in .pgm
3572 - KVM_S390_SIGP_SET_PREFIX - sigp set prefix; parameters in .prefix
3573 - KVM_S390_RESTART - restart; no parameters
3574 - KVM_S390_INT_CLOCK_COMP - clock comparator interrupt; no parameters
3575 - KVM_S390_INT_CPU_TIMER - CPU timer interrupt; no parameters
3576 - KVM_S390_INT_EMERGENCY - sigp emergency; parameters in .emerg
3577 - KVM_S390_INT_EXTERNAL_CALL - sigp external call; parameters in .extcall
3578 - KVM_S390_MCHK - machine check interrupt; parameters in .mchk
3583 ---------------------------
3590 -EINVAL if buffer size is 0,
3591 -ENOBUFS if buffer size is too small to fit all pending interrupts,
3592 -EFAULT if the buffer address was invalid
3610 the kernel never checked for flags == 0 and QEMU never pre-zeroed flags and
3614 If -ENOBUFS is returned the buffer provided was too small and userspace
3618 ---------------------------
3625 -EFAULT if the buffer address was invalid,
3626 -EINVAL for an invalid buffer length (see below),
3627 -EBUSY if there were already interrupts pending,
3631 This ioctl allows userspace to set the complete state of all cpu-local
3653 which is the maximum number of possibly pending cpu-local interrupts.
3656 ------------
3662 :Returns: 0 on success, -1 on error
3667 -------------------------
3682 IBM pSeries (sPAPR) guest starts using them if "hcall-multi-tce" is
3683 present in the "ibm,hypertas-functions" device-tree property.
3693 ----------------------------
3726 -------------------------
3733 -EFAULT if struct kvm_reinject_control cannot be read,
3734 -ENXIO if KVM_CREATE_PIT or KVM_CREATE_PIT2 didn't succeed earlier.
3753 ------------------------------
3760 -EFAULT if struct kvm_ppc_mmuv3_cfg cannot be read,
3761 -EINVAL if the configuration is invalid
3763 This ioctl controls whether the guest will use radix or HPT (hashed
3776 to use radix tree translation, and if clear, to use HPT translation.
3787 ---------------------------
3794 -EFAULT if struct kvm_ppc_rmmu_info cannot be written,
3795 -EINVAL if no useful information can be returned
3824 --------------------------------
3831 >0 if a new HPT is being prepared, the value is an estimated
3833 -EFAULT if struct kvm_reinject_control cannot be read,
3834 -EINVAL if the supplied shift or flags are invalid,
3835 -ENOMEM if unable to allocate the new HPT,
3836 -ENOSPC if there was a hash collision
3860 --------------------------------
3867 >0 if a new HPT is being prepared, the value is an estimated
3869 -EFAULT if struct kvm_reinject_control cannot be read,
3870 -EINVAL if the supplied shift or flags are invalid,when moving existing
3871 HPT entries to the new HPT,
3872 -EIO on other error conditions
3875 Hashed Page Table (HPT). Specifically this starts, stops or monitors
3876 the preparation of a new potential HPT for the guest, essentially
3879 If called with shift > 0 when there is no pending HPT for the guest,
3880 this begins preparation of a new pending HPT of size 2^(shift) bytes.
3884 If called when there is a pending HPT whose size does not match that
3885 requested in the parameters, discards the existing pending HPT and
3888 If called when there is a pending HPT of the size requested, will:
3890 * If preparation of the pending HPT is already complete, return 0
3891 * If preparation of the pending HPT has failed, return an error
3892 code, then discard the pending HPT.
3893 * If preparation of the pending HPT is still in progress, return an
3896 If called with shift == 0, discards any currently pending HPT and
3897 returns 0 (i.e. cancels any in-progress preparation).
3900 flags will result in an -EINVAL.
3915 -------------------------------
3922 -EFAULT if struct kvm_reinject_control cannot be read,
3923 -EINVAL if the supplied shift or flags are invalid,
3924 -ENXIO is there is no pending HPT, or the pending HPT doesn't
3926 -EBUSY if the pending HPT is not fully prepared,
3927 -ENOSPC if there was a hash collision when moving existing
3928 HPT entries to the new HPT,
3929 -EIO on other error conditions
3932 Hashed Page Table (HPT). Specifically this requests that the guest be
3933 transferred to working with the new HPT, essentially implementing the
3938 KVM_PPC_RESIZE_HPT_COMMIT will return an error (usually -ENXIO or
3939 -EBUSY, though others may be possible if the preparation was started,
3946 On succsful completion, the pending HPT will become the guest's active
3947 HPT and the previous HPT will be discarded.
3949 On failure, the guest will still be operating on its previous HPT.
3960 -----------------------------------
3966 :Returns: 0 on success, -1 on error
3973 -----------------------
3980 -EFAULT if u64 mcg_cap cannot be read,
3981 -EINVAL if the requested number of banks is invalid,
3982 -EINVAL if requested MCE capability is not supported.
3987 supported number of error-reporting banks can be retrieved when
3992 ---------------------
3999 -EFAULT if struct kvm_x86_mce cannot be read,
4000 -EINVAL if the bank number is invalid,
4001 -EINVAL if VAL bit is not set in status field.
4026 ----------------------------
4049 - During live migration to save the CMMA values. Live migration needs
4051 - To non-destructively peek at the CMMA values, with the flag
4082 KVM_S390_SKEYS_MAX. KVM_S390_SKEYS_MAX is re-used for consistency with
4127 ----------------------------
4166 This ioctl can fail with -ENOMEM if not enough memory can be allocated to
4167 complete the task, with -ENXIO if CMMA is not enabled, with -EINVAL if
4169 if the flags field was not 0, with -EFAULT if the userspace address is
4175 --------------------------
4182 -EFAULT if struct kvm_ppc_cpu_char cannot be written
4187 CVE-2017-5715, CVE-2017-5753 and CVE-2017-5754). The information is
4204 with preventing inadvertent information disclosure - specifically,
4205 whether there is an instruction to flash-invalidate the L1 data cache
4222 ---------------------------
4228 :Returns: 0 on success; -1 on error
4231 for issuing platform-specific memory encryption commands to manage those
4236 Documentation/virt/kvm/amd-memory-encryption.rst.
4239 -----------------------------------
4245 :Returns: 0 on success; -1 on error
4250 It is used in the SEV-enabled guest. When encryption is enabled, a guest
4263 -------------------------------------
4269 :Returns: 0 on success; -1 on error
4275 ------------------------
4283 the specified Hyper-V connection id through the SIGNAL_EVENT hypercall, without
4284 causing a user exit. SIGNAL_EVENT hypercall with non-zero event flag number
4285 (bits 24-31) still triggers a KVM_EXIT_HYPERV_HCALL user exit.
4305 -EINVAL if conn_id or flags is outside the allowed range,
4306 -ENOENT on deassign if the conn_id isn't registered,
4307 -EEXIST on assign if the conn_id is already registered
4310 --------------------------
4316 :Returns: 0 on success, -1 on error
4384 --------------------------
4390 :Returns: 0 on success, -1 on error
4396 -------------------------------------
4425 ------------------------------------
4428 :Architectures: x86, arm, arm64, mips
4431 :Returns: 0 on success, -1 on error
4453 in KVM's dirty bitmap, and dirty tracking is re-enabled for that page
4454 (for example via write-protection, or by clearing the dirty bit in
4457 If KVM_CAP_MULTI_ADDRESS_SPACE is available, bits 16-31 specifies
4468 --------------------------------
4474 :Returns: 0 on success, -1 on error
4495 This ioctl returns x86 cpuid features leaves related to Hyper-V emulation in
4497 cpuid information presented to guests consuming Hyper-V enlightenments (e.g.
4498 Windows or Hyper-V guests).
4500 CPUID feature leaves returned by this ioctl are defined by Hyper-V Top Level
4506 - HYPERV_CPUID_VENDOR_AND_MAX_FUNCTIONS
4507 - HYPERV_CPUID_INTERFACE
4508 - HYPERV_CPUID_VERSION
4509 - HYPERV_CPUID_FEATURES
4510 - HYPERV_CPUID_ENLIGHTMENT_INFO
4511 - HYPERV_CPUID_IMPLEMENT_LIMITS
4512 - HYPERV_CPUID_NESTED_FEATURES
4513 - HYPERV_CPUID_SYNDBG_VENDOR_AND_MAX_FUNCTIONS
4514 - HYPERV_CPUID_SYNDBG_INTERFACE
4515 - HYPERV_CPUID_SYNDBG_PLATFORM_CAPABILITIES
4521 with the 'nent' field indicating the number of entries in the variable-size
4522 array 'entries'. If the number of entries is too low to describe all Hyper-V
4524 to the number of Hyper-V feature leaves, the 'nent' field is adjusted to the
4531 ---------------------------
4536 :Returns: 0 on success, -1 on error
4562 that should be performaned and how to do it are feature-dependent.
4566 -EPERM unless the feature has already been finalized by means of a
4573 ------------------------------
4579 :Returns: 0 on success, -1 on error
4607 ---------------------
4631 ---------------------------
4643 ----------------------------
4656 --------------------------
4670 -------------------------
4708 again. All registered VCPUs are converted back to non-protected
4723 ----------------------------
4790 default KVM in-kernel emulation behavior is fully preserved.
4847 This field is polled once when KVM_RUN starts; if non-zero, KVM_RUN
4848 exits immediately, returning -EINTR. In the common scenario where a
4852 a signal handler that sets run->immediate_exit to a non-zero value.
4878 The value of the current interrupt flag. Only valid if in-kernel
4885 More architecture-specific flags detailing state of the VCPU that may
4895 The value of the cr8 register. Only valid if in-kernel local APIC is
4902 The value of the APIC BASE msr. Only valid if in-kernel local
4914 reasons. Further architecture-specific information is available in
4926 to unknown reasons. Further architecture-specific information is
4979 executed a memory-mapped I/O instruction which could not be satisfied
4992 has re-entered the kernel with KVM_RUN. The kernel side will first finish
4994 can re-enter the guest with an unmasked signal pending to complete
5074 Deprecated - was used for 440 KVM.
5100 This is used on 64-bit PowerPC when emulating a pSeries partition,
5104 the arguments (from the guest R4 - R12). Userspace should put the
5161 a system-level event using some architecture specific mechanism (hypercall
5164 the system-level event type. The 'flags' field describes architecture
5165 specific flags for the system-level event.
5169 - KVM_SYSTEM_EVENT_SHUTDOWN -- the guest has requested a shutdown of the
5173 - KVM_SYSTEM_EVENT_RESET -- the guest has requested a reset of the VM.
5176 - KVM_SYSTEM_EVENT_CRASH -- the guest crash occurred and the guest
5188 Indicates that the VCPU's in-kernel local APIC received an EOI for a
5189 level-triggered IOAPIC interrupt. This exit only triggers when the
5231 related to Hyper-V emulation.
5235 - KVM_EXIT_HYPERV_SYNIC -- synchronously notify user-space about
5237 Hyper-V SynIC state change. Notification is used to remap SynIC
5241 - KVM_EXIT_HYPERV_SYNDBG -- synchronously notify user-space about
5243 Hyper-V Synthetic debugger state change. Notification is used to either update
5262 the VM. KVM assumed that if the guest accessed non-memslot memory, it was
5286 __u8 error; /* user -> kernel */
5288 __u32 reason; /* kernel -> user */
5289 __u32 index; /* kernel -> user */
5290 __u64 data; /* kernel <-> user */
5302 KVM_MSR_EXIT_REASON_UNKNOWN - access to MSR that is unknown to KVM
5303 KVM_MSR_EXIT_REASON_INVAL - access to invalid MSRs or reserved bits
5304 KVM_MSR_EXIT_REASON_FILTER - access blocked by KVM_X86_SET_MSR_FILTER
5373 whether this is a per-vcpu or per-vm capability.
5384 -------------------
5389 :Returns: 0 on success; -1 on error
5393 were invented by Mac-on-Linux to have a standardized communication mechanism
5400 --------------------
5405 :Returns: 0 on success; -1 on error
5421 ------------------
5426 :Returns: 0 on success; -1 on error
5439 addresses of mmu-type-specific data structures. The "array_len" field is an
5455 - The "params" field is of type "struct kvm_book3e_206_tlb_params".
5456 - The "array" field points to an array of type "struct
5458 - The array consists of all entries in the first TLB, followed by all
5460 - Within a TLB, entries are ordered first by increasing set number. Within a
5462 - The hash for determining set number in TLB0 is: (MAS2 >> 12) & (num_sets - 1)
5464 - The tsize field of mas1 shall be set to 4K on TLB0, even though the
5468 ----------------------------
5473 :Returns: 0 on success; -1 on error
5478 handled in-kernel, while the other I/O instructions are passed to userspace.
5483 Note that even though this capability is enabled per-vcpu, the complete
5487 -------------------
5492 :Returns: 0 on success; -1 on error
5506 --------------------
5512 This capability connects the vcpu to an in-kernel MPIC device.
5515 --------------------
5522 This capability connects the vcpu to an in-kernel XICS device.
5525 ------------------------
5531 This capability enables the in-kernel irqchip for s390. Please refer to
5535 --------------------
5537 :Architectures: mips
5549 ---------------------
5551 :Architectures: mips
5555 This capability allows the use of the MIPS SIMD Architecture (MSA) by the guest.
5562 ----------------------
5567 :Returns: x86: KVM_CHECK_EXTENSION returns a bit-array indicating which register
5583 - the register sets to be copied out to kvm_run are selectable
5585 - vcpu_events are available in addition to regs and sregs.
5588 function as an input bit-array field set by userspace to indicate the
5608 -------------------------
5615 This capability connects the vcpu to an in-kernel XIVE device.
5640 ----------------------------
5644 args[1] is 0 to disable, 1 to enable in-kernel handling
5647 get handled by the kernel or not. Enabling or disabling in-kernel
5649 initial set of hcalls are enabled for in-kernel handling, which
5650 consists of those hcalls for which in-kernel handlers were implemented
5657 If the hcall number specified is not one that has an in-kernel
5662 --------------------------
5671 - SENSE
5672 - SENSE RUNNING
5673 - EXTERNAL CALL
5674 - EMERGENCY SIGNAL
5675 - CONDITIONAL EMERGENCY SIGNAL
5684 ---------------------------------
5692 return -EINVAL if the machine does not support vectors.
5695 --------------------------
5700 This capability allows post-handlers for the STSI instruction. After
5705 vcpu->run::
5716 @addr - guest address of STSI SYSIB
5717 @fc - function code
5718 @sel1 - selector 1
5719 @sel2 - selector 2
5720 @ar - access register number
5722 KVM handlers should exit to userspace with rc = -EREMOTE.
5725 -------------------------
5728 :Parameters: args[0] - number of routes reserved for userspace IOAPICs
5729 :Returns: 0 on success, -1 on error
5746 -------------------
5751 Allows use of runtime-instrumentation introduced with zEC12 processor.
5752 Will return -EINVAL if the machine does not support runtime-instrumentation.
5753 Will return -EBUSY if a VCPU has already been created.
5756 ----------------------
5759 :Parameters: args[0] - features that should be enabled
5760 :Returns: 0 on success, -EINVAL when args[0] contains invalid features
5769 allowing the use of 32-bit APIC IDs. See KVM_CAP_X2APIC_API in their
5776 where 0xff represents CPUs 0-7 in cluster 0.
5779 ----------------------------
5786 mechanism e.g. to realize 2-byte software breakpoints. The kernel will
5794 -------------------
5798 :Returns: 0 on success; -EINVAL if the machine does not support
5799 guarded storage; -EBUSY if a VCPU has already been created.
5804 ---------------------
5809 Allow use of adapter-interruption suppression.
5810 :Returns: 0 on success; -EBUSY if a VCPU has already been created.
5813 --------------------
5831 ----------------------
5843 ------------------------------
5847 :Returns: 0 on success, -EINVAL when args[0] contains invalid exits
5866 --------------------------
5870 :Returns: 0 on success, -EINVAL if hpage module parameter was not set
5878 hpage module parameter is not set to 1, -EINVAL is returned.
5884 ------------------------------
5894 --------------------------
5898 :Returns: 0 on success, -EINVAL when the implementation doesn't support
5899 nested-HV virtualization.
5901 HV-KVM on POWER9 and later systems allows for "nested-HV"
5903 can run using the CPU's supervisor mode (privileged non-hypervisor
5906 kvm-hv module parameter.
5909 ------------------------------
5915 emulated VM-exit when L1 intercepts a #PF exception that occurs in
5916 L2. Similarly, for kvm-intel only, DR6 will not be modified prior to
5917 the emulated VM-exit when L1 intercepts a #DB exception that occurs in
5923 exception.has_payload and to put the faulting address - or the new DR6
5924 bits\ [#]_ - in the exception_payload field.
5936 :Architectures: x86, arm, arm64, mips
5945 automatically clear and write-protect all pages that are returned as dirty.
5951 KVM_CLEAR_DIRTY_LOG ioctl can operate on a 64-page granularity rather
5976 ------------------------------
5993 ----------------------
5998 :Returns: 0 on success; -1 on error
6006 the maximum halt time to specified on a per-VM basis, effectively overriding
6010 -------------------------------
6015 :Returns: 0 on success; -1 on error
6038 ---------------------
6044 H_RANDOM hypercall backed by a hardware random-number generator.
6049 ------------------------
6055 Hyper-V Synthetic interrupt controller(SynIC). Hyper-V SynIC is
6056 used to support Windows Hyper-V based guest paravirt drivers(VMBus).
6061 by the CPU, as it's incompatible with SynIC auto-EOI behavior.
6064 -------------------------
6074 ---------------------------
6081 the POWER9 processor), including in-memory segment tables.
6084 -------------------
6086 :Architectures: mips
6102 may be incompatible with the MIPS VZ ASE.
6109 1 The MIPS VZ ASE is in use, providing full hardware assisted
6114 -------------------
6116 :Architectures: mips
6128 ----------------------
6130 :Architectures: mips
6142 Both registers and addresses are 32-bits wide.
6143 It will only be possible to run 32-bit guest code.
6145 1 MIPS64 or microMIPS64 with access only to 32-bit compatibility segments.
6146 Registers are 64-bits wide, but addresses are 32-bits wide.
6147 64-bit guest code may run but cannot access MIPS64 memory segments.
6148 It will also be possible to run 32-bit guest code.
6151 Both registers and addresses are 64-bits wide.
6152 It will be possible to run 64-bit or 32-bit guest code.
6156 ------------------------
6161 that if userspace creates a VM without an in-kernel interrupt controller, it
6162 will be notified of changes to the output level of in-kernel emulated devices,
6165 updates the vcpu's run->s.regs.device_irq_level field to represent the actual
6171 userspace can always sample the device output level and re-compute the state of
6173 of run->s.regs.device_irq_level on every kvm exit.
6174 The value in run->s.regs.device_irq_level can represent both level and edge
6176 signals will exit to userspace with the bit in run->s.regs.device_irq_level
6179 The field run->s.regs.device_irq_level is available independent of
6180 run->kvm_valid_regs or run->kvm_dirty_regs bits.
6184 and thereby which bits in run->s.regs.device_irq_level can signal values.
6190 KVM_ARM_DEV_EL1_VTIMER - EL1 virtual timer
6191 KVM_ARM_DEV_EL1_PTIMER - EL1 physical timer
6192 KVM_ARM_DEV_PMU - ARM PMU overflow interrupt signal
6199 -----------------------------
6209 --------------------------
6213 This capability enables a newer version of Hyper-V Synthetic interrupt
6219 ----------------------------
6229 -------------------------------
6239 ---------------------
6246 ----------------------
6255 ---------------------
6260 use copy-on-write semantics as well as dirty pages tracking via read-only page
6264 ---------------------
6273 ----------------------------
6277 This capability indicates that KVM supports paravirtualized Hyper-V TLB Flush
6283 ----------------------------------
6298 ----------------------------
6302 This capability indicates that KVM supports paravirtualized Hyper-V IPI send
6307 -----------------------------------
6311 This capability indicates that KVM running on top of Hyper-V hypervisor
6313 hypercalls are handled by Level 0 hypervisor (Hyper-V) bypassing KVM.
6314 Due to the different ABI for hypercall parameters between Hyper-V and
6317 flush hypercalls by Hyper-V) so userspace should disable KVM identification
6318 in CPUID and only exposes Hyper-V identification. In this case, guest
6319 thinks it's running on Hyper-V and only use Hyper-V hypercalls.
6322 -----------------------------
6330 ---------------------------
6341 -----------------------
6347 architecture-specific interfaces. This capability and the architecture-
6354 -------------------------
6364 an 8-byte value consisting of a one-byte Control Program Name Code (CPNC) and
6365 a 7-byte Control Program Version Code (CPVC). The CPNC determines what
6374 -------------------------------
6385 ---------------------------
6399 -----------------------------
6419 --------
6433 ``KVM_ENABLE_CAP(KVM_CAP_IRQCHIP_SPLIT)`` are used to enable in-kernel emulation of
6440 has enabled in-kernel emulation of the local APIC.