diff options
Diffstat (limited to 'Documentation')
-rw-r--r-- | Documentation/virtual/kvm/api.txt | 140 |
1 files changed, 135 insertions, 5 deletions
diff --git a/Documentation/virtual/kvm/api.txt b/Documentation/virtual/kvm/api.txt index f6ec3a92e621..a4df5535996b 100644 --- a/Documentation/virtual/kvm/api.txt +++ b/Documentation/virtual/kvm/api.txt | |||
@@ -1194,12 +1194,15 @@ struct kvm_ppc_pvinfo { | |||
1194 | This ioctl fetches PV specific information that need to be passed to the guest | 1194 | This ioctl fetches PV specific information that need to be passed to the guest |
1195 | using the device tree or other means from vm context. | 1195 | using the device tree or other means from vm context. |
1196 | 1196 | ||
1197 | For now the only implemented piece of information distributed here is an array | 1197 | The hcall array defines 4 instructions that make up a hypercall. |
1198 | of 4 instructions that make up a hypercall. | ||
1199 | 1198 | ||
1200 | If any additional field gets added to this structure later on, a bit for that | 1199 | If any additional field gets added to this structure later on, a bit for that |
1201 | additional piece of information will be set in the flags bitmap. | 1200 | additional piece of information will be set in the flags bitmap. |
1202 | 1201 | ||
1202 | The flags bitmap is defined as: | ||
1203 | |||
1204 | /* the host supports the ePAPR idle hcall | ||
1205 | #define KVM_PPC_PVINFO_FLAGS_EV_IDLE (1<<0) | ||
1203 | 1206 | ||
1204 | 4.48 KVM_ASSIGN_PCI_DEVICE | 1207 | 4.48 KVM_ASSIGN_PCI_DEVICE |
1205 | 1208 | ||
@@ -1731,7 +1734,46 @@ registers, find a list below: | |||
1731 | Arch | Register | Width (bits) | 1734 | Arch | Register | Width (bits) |
1732 | | | | 1735 | | | |
1733 | PPC | KVM_REG_PPC_HIOR | 64 | 1736 | PPC | KVM_REG_PPC_HIOR | 64 |
1734 | 1737 | PPC | KVM_REG_PPC_IAC1 | 64 | |
1738 | PPC | KVM_REG_PPC_IAC2 | 64 | ||
1739 | PPC | KVM_REG_PPC_IAC3 | 64 | ||
1740 | PPC | KVM_REG_PPC_IAC4 | 64 | ||
1741 | PPC | KVM_REG_PPC_DAC1 | 64 | ||
1742 | PPC | KVM_REG_PPC_DAC2 | 64 | ||
1743 | PPC | KVM_REG_PPC_DABR | 64 | ||
1744 | PPC | KVM_REG_PPC_DSCR | 64 | ||
1745 | PPC | KVM_REG_PPC_PURR | 64 | ||
1746 | PPC | KVM_REG_PPC_SPURR | 64 | ||
1747 | PPC | KVM_REG_PPC_DAR | 64 | ||
1748 | PPC | KVM_REG_PPC_DSISR | 32 | ||
1749 | PPC | KVM_REG_PPC_AMR | 64 | ||
1750 | PPC | KVM_REG_PPC_UAMOR | 64 | ||
1751 | PPC | KVM_REG_PPC_MMCR0 | 64 | ||
1752 | PPC | KVM_REG_PPC_MMCR1 | 64 | ||
1753 | PPC | KVM_REG_PPC_MMCRA | 64 | ||
1754 | PPC | KVM_REG_PPC_PMC1 | 32 | ||
1755 | PPC | KVM_REG_PPC_PMC2 | 32 | ||
1756 | PPC | KVM_REG_PPC_PMC3 | 32 | ||
1757 | PPC | KVM_REG_PPC_PMC4 | 32 | ||
1758 | PPC | KVM_REG_PPC_PMC5 | 32 | ||
1759 | PPC | KVM_REG_PPC_PMC6 | 32 | ||
1760 | PPC | KVM_REG_PPC_PMC7 | 32 | ||
1761 | PPC | KVM_REG_PPC_PMC8 | 32 | ||
1762 | PPC | KVM_REG_PPC_FPR0 | 64 | ||
1763 | ... | ||
1764 | PPC | KVM_REG_PPC_FPR31 | 64 | ||
1765 | PPC | KVM_REG_PPC_VR0 | 128 | ||
1766 | ... | ||
1767 | PPC | KVM_REG_PPC_VR31 | 128 | ||
1768 | PPC | KVM_REG_PPC_VSR0 | 128 | ||
1769 | ... | ||
1770 | PPC | KVM_REG_PPC_VSR31 | 128 | ||
1771 | PPC | KVM_REG_PPC_FPSCR | 64 | ||
1772 | PPC | KVM_REG_PPC_VSCR | 32 | ||
1773 | PPC | KVM_REG_PPC_VPA_ADDR | 64 | ||
1774 | PPC | KVM_REG_PPC_VPA_SLB | 128 | ||
1775 | PPC | KVM_REG_PPC_VPA_DTL | 128 | ||
1776 | PPC | KVM_REG_PPC_EPCR | 32 | ||
1735 | 1777 | ||
1736 | 4.69 KVM_GET_ONE_REG | 1778 | 4.69 KVM_GET_ONE_REG |
1737 | 1779 | ||
@@ -1747,7 +1789,7 @@ kvm_one_reg struct passed in. On success, the register value can be found | |||
1747 | at the memory location pointed to by "addr". | 1789 | at the memory location pointed to by "addr". |
1748 | 1790 | ||
1749 | The list of registers accessible using this interface is identical to the | 1791 | The list of registers accessible using this interface is identical to the |
1750 | list in 4.64. | 1792 | list in 4.68. |
1751 | 1793 | ||
1752 | 1794 | ||
1753 | 4.70 KVM_KVMCLOCK_CTRL | 1795 | 4.70 KVM_KVMCLOCK_CTRL |
@@ -1997,6 +2039,93 @@ return the hash table order in the parameter. (If the guest is using | |||
1997 | the virtualized real-mode area (VRMA) facility, the kernel will | 2039 | the virtualized real-mode area (VRMA) facility, the kernel will |
1998 | re-create the VMRA HPTEs on the next KVM_RUN of any vcpu.) | 2040 | re-create the VMRA HPTEs on the next KVM_RUN of any vcpu.) |
1999 | 2041 | ||
2042 | 4.77 KVM_S390_INTERRUPT | ||
2043 | |||
2044 | Capability: basic | ||
2045 | Architectures: s390 | ||
2046 | Type: vm ioctl, vcpu ioctl | ||
2047 | Parameters: struct kvm_s390_interrupt (in) | ||
2048 | Returns: 0 on success, -1 on error | ||
2049 | |||
2050 | Allows to inject an interrupt to the guest. Interrupts can be floating | ||
2051 | (vm ioctl) or per cpu (vcpu ioctl), depending on the interrupt type. | ||
2052 | |||
2053 | Interrupt parameters are passed via kvm_s390_interrupt: | ||
2054 | |||
2055 | struct kvm_s390_interrupt { | ||
2056 | __u32 type; | ||
2057 | __u32 parm; | ||
2058 | __u64 parm64; | ||
2059 | }; | ||
2060 | |||
2061 | type can be one of the following: | ||
2062 | |||
2063 | KVM_S390_SIGP_STOP (vcpu) - sigp restart | ||
2064 | KVM_S390_PROGRAM_INT (vcpu) - program check; code in parm | ||
2065 | KVM_S390_SIGP_SET_PREFIX (vcpu) - sigp set prefix; prefix address in parm | ||
2066 | KVM_S390_RESTART (vcpu) - restart | ||
2067 | KVM_S390_INT_VIRTIO (vm) - virtio external interrupt; external interrupt | ||
2068 | parameters in parm and parm64 | ||
2069 | KVM_S390_INT_SERVICE (vm) - sclp external interrupt; sclp parameter in parm | ||
2070 | KVM_S390_INT_EMERGENCY (vcpu) - sigp emergency; source cpu in parm | ||
2071 | KVM_S390_INT_EXTERNAL_CALL (vcpu) - sigp external call; source cpu in parm | ||
2072 | |||
2073 | Note that the vcpu ioctl is asynchronous to vcpu execution. | ||
2074 | |||
2075 | 4.78 KVM_PPC_GET_HTAB_FD | ||
2076 | |||
2077 | Capability: KVM_CAP_PPC_HTAB_FD | ||
2078 | Architectures: powerpc | ||
2079 | Type: vm ioctl | ||
2080 | Parameters: Pointer to struct kvm_get_htab_fd (in) | ||
2081 | Returns: file descriptor number (>= 0) on success, -1 on error | ||
2082 | |||
2083 | This returns a file descriptor that can be used either to read out the | ||
2084 | entries in the guest's hashed page table (HPT), or to write entries to | ||
2085 | initialize the HPT. The returned fd can only be written to if the | ||
2086 | KVM_GET_HTAB_WRITE bit is set in the flags field of the argument, and | ||
2087 | can only be read if that bit is clear. The argument struct looks like | ||
2088 | this: | ||
2089 | |||
2090 | /* For KVM_PPC_GET_HTAB_FD */ | ||
2091 | struct kvm_get_htab_fd { | ||
2092 | __u64 flags; | ||
2093 | __u64 start_index; | ||
2094 | __u64 reserved[2]; | ||
2095 | }; | ||
2096 | |||
2097 | /* Values for kvm_get_htab_fd.flags */ | ||
2098 | #define KVM_GET_HTAB_BOLTED_ONLY ((__u64)0x1) | ||
2099 | #define KVM_GET_HTAB_WRITE ((__u64)0x2) | ||
2100 | |||
2101 | The `start_index' field gives the index in the HPT of the entry at | ||
2102 | which to start reading. It is ignored when writing. | ||
2103 | |||
2104 | Reads on the fd will initially supply information about all | ||
2105 | "interesting" HPT entries. Interesting entries are those with the | ||
2106 | bolted bit set, if the KVM_GET_HTAB_BOLTED_ONLY bit is set, otherwise | ||
2107 | all entries. When the end of the HPT is reached, the read() will | ||
2108 | return. If read() is called again on the fd, it will start again from | ||
2109 | the beginning of the HPT, but will only return HPT entries that have | ||
2110 | changed since they were last read. | ||
2111 | |||
2112 | Data read or written is structured as a header (8 bytes) followed by a | ||
2113 | series of valid HPT entries (16 bytes) each. The header indicates how | ||
2114 | many valid HPT entries there are and how many invalid entries follow | ||
2115 | the valid entries. The invalid entries are not represented explicitly | ||
2116 | in the stream. The header format is: | ||
2117 | |||
2118 | struct kvm_get_htab_header { | ||
2119 | __u32 index; | ||
2120 | __u16 n_valid; | ||
2121 | __u16 n_invalid; | ||
2122 | }; | ||
2123 | |||
2124 | Writes to the fd create HPT entries starting at the index given in the | ||
2125 | header; first `n_valid' valid entries with contents from the data | ||
2126 | written, then `n_invalid' invalid entries, invalidating any previously | ||
2127 | valid entries found. | ||
2128 | |||
2000 | 2129 | ||
2001 | 5. The kvm_run structure | 2130 | 5. The kvm_run structure |
2002 | ------------------------ | 2131 | ------------------------ |
@@ -2109,7 +2238,8 @@ executed a memory-mapped I/O instruction which could not be satisfied | |||
2109 | by kvm. The 'data' member contains the written data if 'is_write' is | 2238 | by kvm. The 'data' member contains the written data if 'is_write' is |
2110 | true, and should be filled by application code otherwise. | 2239 | true, and should be filled by application code otherwise. |
2111 | 2240 | ||
2112 | NOTE: For KVM_EXIT_IO, KVM_EXIT_MMIO and KVM_EXIT_OSI, the corresponding | 2241 | NOTE: For KVM_EXIT_IO, KVM_EXIT_MMIO, KVM_EXIT_OSI, KVM_EXIT_DCR |
2242 | and KVM_EXIT_PAPR the corresponding | ||
2113 | operations are complete (and guest state is consistent) only after userspace | 2243 | operations are complete (and guest state is consistent) only after userspace |
2114 | has re-entered the kernel with KVM_RUN. The kernel side will first finish | 2244 | has re-entered the kernel with KVM_RUN. The kernel side will first finish |
2115 | incomplete operations and then check for pending signals. Userspace | 2245 | incomplete operations and then check for pending signals. Userspace |