Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

docs: kvm: convert devices/xive.txt to ReST

- Use title markups;
- adjust indentation and add blank lines as needed;
- adjust tables to match ReST accepted formats;
- mark code blocks as such.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

authored by

Mauro Carvalho Chehab and committed by
Paolo Bonzini
d3b52e49 5cccf379

+100 -57
+1
Documentation/virt/kvm/devices/index.rst
··· 16 16 vfio 17 17 vm 18 18 xics 19 + xive
+99 -57
Documentation/virt/kvm/devices/xive.txt Documentation/virt/kvm/devices/xive.rst
··· 1 + .. SPDX-License-Identifier: GPL-2.0 2 + 3 + =========================================================== 1 4 POWER9 eXternal Interrupt Virtualization Engine (XIVE Gen1) 2 - ========================================================== 5 + =========================================================== 3 6 4 7 Device types supported: 5 - KVM_DEV_TYPE_XIVE POWER9 XIVE Interrupt Controller generation 1 8 + - KVM_DEV_TYPE_XIVE POWER9 XIVE Interrupt Controller generation 1 6 9 7 10 This device acts as a VM interrupt controller. It provides the KVM 8 11 interface to configure the interrupt sources of a VM in the underlying ··· 67 64 68 65 * Groups: 69 66 70 - 1. KVM_DEV_XIVE_GRP_CTRL 71 - Provides global controls on the device 67 + 1. KVM_DEV_XIVE_GRP_CTRL 68 + Provides global controls on the device 69 + 72 70 Attributes: 73 71 1.1 KVM_DEV_XIVE_RESET (write only) 74 72 Resets the interrupt controller configuration for sources and event 75 73 queues. To be used by kexec and kdump. 74 + 76 75 Errors: none 77 76 78 77 1.2 KVM_DEV_XIVE_EQ_SYNC (write only) 79 78 Sync all the sources and queues and mark the EQ pages dirty. This 80 79 to make sure that a consistent memory state is captured when 81 80 migrating the VM. 81 + 82 82 Errors: none 83 83 84 84 1.3 KVM_DEV_XIVE_NR_SERVERS (write only) 85 85 The kvm_device_attr.addr points to a __u32 value which is the number of 86 86 interrupt server numbers (ie, highest possible vcpu id plus one). 87 - Errors: 88 - -EINVAL: Value greater than KVM_MAX_VCPU_ID. 89 - -EFAULT: Invalid user pointer for attr->addr. 90 - -EBUSY: A vCPU is already connected to the device. 91 87 92 - 2. KVM_DEV_XIVE_GRP_SOURCE (write only) 93 - Initializes a new source in the XIVE device and mask it. 88 + Errors: 89 + 90 + ======= ========================================== 91 + -EINVAL Value greater than KVM_MAX_VCPU_ID. 92 + -EFAULT Invalid user pointer for attr->addr. 93 + -EBUSY A vCPU is already connected to the device. 94 + ======= ========================================== 95 + 96 + 2. KVM_DEV_XIVE_GRP_SOURCE (write only) 97 + Initializes a new source in the XIVE device and mask it. 98 + 94 99 Attributes: 95 100 Interrupt source number (64-bit) 96 - The kvm_device_attr.addr points to a __u64 value: 97 - bits: | 63 .... 2 | 1 | 0 98 - values: | unused | level | type 101 + 102 + The kvm_device_attr.addr points to a __u64 value:: 103 + 104 + bits: | 63 .... 2 | 1 | 0 105 + values: | unused | level | type 106 + 99 107 - type: 0:MSI 1:LSI 100 108 - level: assertion level in case of an LSI. 101 - Errors: 102 - -E2BIG: Interrupt source number is out of range 103 - -ENOMEM: Could not create a new source block 104 - -EFAULT: Invalid user pointer for attr->addr. 105 - -ENXIO: Could not allocate underlying HW interrupt 106 109 107 - 3. KVM_DEV_XIVE_GRP_SOURCE_CONFIG (write only) 108 - Configures source targeting 110 + Errors: 111 + 112 + ======= ========================================== 113 + -E2BIG Interrupt source number is out of range 114 + -ENOMEM Could not create a new source block 115 + -EFAULT Invalid user pointer for attr->addr. 116 + -ENXIO Could not allocate underlying HW interrupt 117 + ======= ========================================== 118 + 119 + 3. KVM_DEV_XIVE_GRP_SOURCE_CONFIG (write only) 120 + Configures source targeting 121 + 109 122 Attributes: 110 123 Interrupt source number (64-bit) 111 - The kvm_device_attr.addr points to a __u64 value: 112 - bits: | 63 .... 33 | 32 | 31 .. 3 | 2 .. 0 113 - values: | eisn | mask | server | priority 124 + 125 + The kvm_device_attr.addr points to a __u64 value:: 126 + 127 + bits: | 63 .... 33 | 32 | 31 .. 3 | 2 .. 0 128 + values: | eisn | mask | server | priority 129 + 114 130 - priority: 0-7 interrupt priority level 115 131 - server: CPU number chosen to handle the interrupt 116 132 - mask: mask flag (unused) 117 133 - eisn: Effective Interrupt Source Number 118 - Errors: 119 - -ENOENT: Unknown source number 120 - -EINVAL: Not initialized source number 121 - -EINVAL: Invalid priority 122 - -EINVAL: Invalid CPU number. 123 - -EFAULT: Invalid user pointer for attr->addr. 124 - -ENXIO: CPU event queues not configured or configuration of the 125 - underlying HW interrupt failed 126 - -EBUSY: No CPU available to serve interrupt 127 134 128 - 4. KVM_DEV_XIVE_GRP_EQ_CONFIG (read-write) 129 - Configures an event queue of a CPU 135 + Errors: 136 + 137 + ======= ======================================================= 138 + -ENOENT Unknown source number 139 + -EINVAL Not initialized source number 140 + -EINVAL Invalid priority 141 + -EINVAL Invalid CPU number. 142 + -EFAULT Invalid user pointer for attr->addr. 143 + -ENXIO CPU event queues not configured or configuration of the 144 + underlying HW interrupt failed 145 + -EBUSY No CPU available to serve interrupt 146 + ======= ======================================================= 147 + 148 + 4. KVM_DEV_XIVE_GRP_EQ_CONFIG (read-write) 149 + Configures an event queue of a CPU 150 + 130 151 Attributes: 131 152 EQ descriptor identifier (64-bit) 132 - The EQ descriptor identifier is a tuple (server, priority) : 133 - bits: | 63 .... 32 | 31 .. 3 | 2 .. 0 134 - values: | unused | server | priority 135 - The kvm_device_attr.addr points to : 153 + 154 + The EQ descriptor identifier is a tuple (server, priority):: 155 + 156 + bits: | 63 .... 32 | 31 .. 3 | 2 .. 0 157 + values: | unused | server | priority 158 + 159 + The kvm_device_attr.addr points to:: 160 + 136 161 struct kvm_ppc_xive_eq { 137 162 __u32 flags; 138 163 __u32 qshift; ··· 169 138 __u32 qindex; 170 139 __u8 pad[40]; 171 140 }; 141 + 172 142 - flags: queue flags 173 - KVM_XIVE_EQ_ALWAYS_NOTIFY (required) 143 + KVM_XIVE_EQ_ALWAYS_NOTIFY (required) 174 144 forces notification without using the coalescing mechanism 175 145 provided by the XIVE END ESBs. 176 146 - qshift: queue size (power of 2) ··· 179 147 - qtoggle: current queue toggle bit 180 148 - qindex: current queue index 181 149 - pad: reserved for future use 182 - Errors: 183 - -ENOENT: Invalid CPU number 184 - -EINVAL: Invalid priority 185 - -EINVAL: Invalid flags 186 - -EINVAL: Invalid queue size 187 - -EINVAL: Invalid queue address 188 - -EFAULT: Invalid user pointer for attr->addr. 189 - -EIO: Configuration of the underlying HW failed 190 150 191 - 5. KVM_DEV_XIVE_GRP_SOURCE_SYNC (write only) 192 - Synchronize the source to flush event notifications 151 + Errors: 152 + 153 + ======= ========================================= 154 + -ENOENT Invalid CPU number 155 + -EINVAL Invalid priority 156 + -EINVAL Invalid flags 157 + -EINVAL Invalid queue size 158 + -EINVAL Invalid queue address 159 + -EFAULT Invalid user pointer for attr->addr. 160 + -EIO Configuration of the underlying HW failed 161 + ======= ========================================= 162 + 163 + 5. KVM_DEV_XIVE_GRP_SOURCE_SYNC (write only) 164 + Synchronize the source to flush event notifications 165 + 193 166 Attributes: 194 167 Interrupt source number (64-bit) 168 + 195 169 Errors: 196 - -ENOENT: Unknown source number 197 - -EINVAL: Not initialized source number 170 + 171 + ======= ============================= 172 + -ENOENT Unknown source number 173 + -EINVAL Not initialized source number 174 + ======= ============================= 198 175 199 176 * VCPU state 200 177 ··· 216 175 as it synthesizes the priorities of the pending interrupts. We 217 176 capture a bit more to report debug information. 218 177 219 - KVM_REG_PPC_VP_STATE (2 * 64bits) 220 - bits: | 63 .... 32 | 31 .... 0 | 221 - values: | TIMA word0 | TIMA word1 | 222 - bits: | 127 .......... 64 | 223 - values: | unused | 178 + KVM_REG_PPC_VP_STATE (2 * 64bits):: 179 + 180 + bits: | 63 .... 32 | 31 .... 0 | 181 + values: | TIMA word0 | TIMA word1 | 182 + bits: | 127 .......... 64 | 183 + values: | unused | 224 184 225 185 * Migration: 226 186 ··· 238 196 3. Capture the state of the source targeting, the EQs configuration 239 197 and the state of thread interrupt context registers. 240 198 241 - Restore is similar : 199 + Restore is similar: 242 200 243 201 1. Restore the EQ configuration. As targeting depends on it. 244 202 2. Restore targeting