Skip to content

Commit d3b52e4

Browse files
mchehabbonzini
authored andcommitted
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 <[email protected]> Signed-off-by: Paolo Bonzini <[email protected]>
1 parent 5cccf37 commit d3b52e4

File tree

2 files changed

+98
-55
lines changed

2 files changed

+98
-55
lines changed

Documentation/virt/kvm/devices/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,4 @@ Devices
1616
vfio
1717
vm
1818
xics
19+
xive

Documentation/virt/kvm/devices/xive.txt renamed to Documentation/virt/kvm/devices/xive.rst

Lines changed: 97 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
1+
.. SPDX-License-Identifier: GPL-2.0
2+
3+
===========================================================
14
POWER9 eXternal Interrupt Virtualization Engine (XIVE Gen1)
2-
==========================================================
5+
===========================================================
36

47
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
69

710
This device acts as a VM interrupt controller. It provides the KVM
811
interface to configure the interrupt sources of a VM in the underlying
@@ -64,72 +67,100 @@ the legacy interrupt mode, referred as XICS (POWER7/8).
6467

6568
* Groups:
6669

67-
1. KVM_DEV_XIVE_GRP_CTRL
68-
Provides global controls on the device
70+
1. KVM_DEV_XIVE_GRP_CTRL
71+
Provides global controls on the device
72+
6973
Attributes:
7074
1.1 KVM_DEV_XIVE_RESET (write only)
7175
Resets the interrupt controller configuration for sources and event
7276
queues. To be used by kexec and kdump.
77+
7378
Errors: none
7479

7580
1.2 KVM_DEV_XIVE_EQ_SYNC (write only)
7681
Sync all the sources and queues and mark the EQ pages dirty. This
7782
to make sure that a consistent memory state is captured when
7883
migrating the VM.
84+
7985
Errors: none
8086

8187
1.3 KVM_DEV_XIVE_NR_SERVERS (write only)
8288
The kvm_device_attr.addr points to a __u32 value which is the number of
8389
interrupt server numbers (ie, highest possible vcpu id plus one).
90+
8491
Errors:
85-
-EINVAL: Value greater than KVM_MAX_VCPU_ID.
86-
-EFAULT: Invalid user pointer for attr->addr.
87-
-EBUSY: A vCPU is already connected to the device.
8892

89-
2. KVM_DEV_XIVE_GRP_SOURCE (write only)
90-
Initializes a new source in the XIVE device and mask it.
93+
======= ==========================================
94+
-EINVAL Value greater than KVM_MAX_VCPU_ID.
95+
-EFAULT Invalid user pointer for attr->addr.
96+
-EBUSY A vCPU is already connected to the device.
97+
======= ==========================================
98+
99+
2. KVM_DEV_XIVE_GRP_SOURCE (write only)
100+
Initializes a new source in the XIVE device and mask it.
101+
91102
Attributes:
92103
Interrupt source number (64-bit)
93-
The kvm_device_attr.addr points to a __u64 value:
94-
bits: | 63 .... 2 | 1 | 0
95-
values: | unused | level | type
104+
105+
The kvm_device_attr.addr points to a __u64 value::
106+
107+
bits: | 63 .... 2 | 1 | 0
108+
values: | unused | level | type
109+
96110
- type: 0:MSI 1:LSI
97111
- level: assertion level in case of an LSI.
112+
98113
Errors:
99-
-E2BIG: Interrupt source number is out of range
100-
-ENOMEM: Could not create a new source block
101-
-EFAULT: Invalid user pointer for attr->addr.
102-
-ENXIO: Could not allocate underlying HW interrupt
103114

104-
3. KVM_DEV_XIVE_GRP_SOURCE_CONFIG (write only)
105-
Configures source targeting
115+
======= ==========================================
116+
-E2BIG Interrupt source number is out of range
117+
-ENOMEM Could not create a new source block
118+
-EFAULT Invalid user pointer for attr->addr.
119+
-ENXIO Could not allocate underlying HW interrupt
120+
======= ==========================================
121+
122+
3. KVM_DEV_XIVE_GRP_SOURCE_CONFIG (write only)
123+
Configures source targeting
124+
106125
Attributes:
107126
Interrupt source number (64-bit)
108-
The kvm_device_attr.addr points to a __u64 value:
109-
bits: | 63 .... 33 | 32 | 31 .. 3 | 2 .. 0
110-
values: | eisn | mask | server | priority
127+
128+
The kvm_device_attr.addr points to a __u64 value::
129+
130+
bits: | 63 .... 33 | 32 | 31 .. 3 | 2 .. 0
131+
values: | eisn | mask | server | priority
132+
111133
- priority: 0-7 interrupt priority level
112134
- server: CPU number chosen to handle the interrupt
113135
- mask: mask flag (unused)
114136
- eisn: Effective Interrupt Source Number
137+
115138
Errors:
116-
-ENOENT: Unknown source number
117-
-EINVAL: Not initialized source number
118-
-EINVAL: Invalid priority
119-
-EINVAL: Invalid CPU number.
120-
-EFAULT: Invalid user pointer for attr->addr.
121-
-ENXIO: CPU event queues not configured or configuration of the
122-
underlying HW interrupt failed
123-
-EBUSY: No CPU available to serve interrupt
124-
125-
4. KVM_DEV_XIVE_GRP_EQ_CONFIG (read-write)
126-
Configures an event queue of a CPU
139+
140+
======= =======================================================
141+
-ENOENT Unknown source number
142+
-EINVAL Not initialized source number
143+
-EINVAL Invalid priority
144+
-EINVAL Invalid CPU number.
145+
-EFAULT Invalid user pointer for attr->addr.
146+
-ENXIO CPU event queues not configured or configuration of the
147+
underlying HW interrupt failed
148+
-EBUSY No CPU available to serve interrupt
149+
======= =======================================================
150+
151+
4. KVM_DEV_XIVE_GRP_EQ_CONFIG (read-write)
152+
Configures an event queue of a CPU
153+
127154
Attributes:
128155
EQ descriptor identifier (64-bit)
129-
The EQ descriptor identifier is a tuple (server, priority) :
130-
bits: | 63 .... 32 | 31 .. 3 | 2 .. 0
131-
values: | unused | server | priority
132-
The kvm_device_attr.addr points to :
156+
157+
The EQ descriptor identifier is a tuple (server, priority)::
158+
159+
bits: | 63 .... 32 | 31 .. 3 | 2 .. 0
160+
values: | unused | server | priority
161+
162+
The kvm_device_attr.addr points to::
163+
133164
struct kvm_ppc_xive_eq {
134165
__u32 flags;
135166
__u32 qshift;
@@ -138,31 +169,41 @@ the legacy interrupt mode, referred as XICS (POWER7/8).
138169
__u32 qindex;
139170
__u8 pad[40];
140171
};
172+
141173
- flags: queue flags
142-
KVM_XIVE_EQ_ALWAYS_NOTIFY (required)
174+
KVM_XIVE_EQ_ALWAYS_NOTIFY (required)
143175
forces notification without using the coalescing mechanism
144176
provided by the XIVE END ESBs.
145177
- qshift: queue size (power of 2)
146178
- qaddr: real address of queue
147179
- qtoggle: current queue toggle bit
148180
- qindex: current queue index
149181
- pad: reserved for future use
182+
150183
Errors:
151-
-ENOENT: Invalid CPU number
152-
-EINVAL: Invalid priority
153-
-EINVAL: Invalid flags
154-
-EINVAL: Invalid queue size
155-
-EINVAL: Invalid queue address
156-
-EFAULT: Invalid user pointer for attr->addr.
157-
-EIO: Configuration of the underlying HW failed
158-
159-
5. KVM_DEV_XIVE_GRP_SOURCE_SYNC (write only)
160-
Synchronize the source to flush event notifications
184+
185+
======= =========================================
186+
-ENOENT Invalid CPU number
187+
-EINVAL Invalid priority
188+
-EINVAL Invalid flags
189+
-EINVAL Invalid queue size
190+
-EINVAL Invalid queue address
191+
-EFAULT Invalid user pointer for attr->addr.
192+
-EIO Configuration of the underlying HW failed
193+
======= =========================================
194+
195+
5. KVM_DEV_XIVE_GRP_SOURCE_SYNC (write only)
196+
Synchronize the source to flush event notifications
197+
161198
Attributes:
162199
Interrupt source number (64-bit)
200+
163201
Errors:
164-
-ENOENT: Unknown source number
165-
-EINVAL: Not initialized source number
202+
203+
======= =============================
204+
-ENOENT Unknown source number
205+
-EINVAL Not initialized source number
206+
======= =============================
166207

167208
* VCPU state
168209

@@ -175,11 +216,12 @@ the legacy interrupt mode, referred as XICS (POWER7/8).
175216
as it synthesizes the priorities of the pending interrupts. We
176217
capture a bit more to report debug information.
177218

178-
KVM_REG_PPC_VP_STATE (2 * 64bits)
179-
bits: | 63 .... 32 | 31 .... 0 |
180-
values: | TIMA word0 | TIMA word1 |
181-
bits: | 127 .......... 64 |
182-
values: | unused |
219+
KVM_REG_PPC_VP_STATE (2 * 64bits)::
220+
221+
bits: | 63 .... 32 | 31 .... 0 |
222+
values: | TIMA word0 | TIMA word1 |
223+
bits: | 127 .......... 64 |
224+
values: | unused |
183225

184226
* Migration:
185227

@@ -196,7 +238,7 @@ the legacy interrupt mode, referred as XICS (POWER7/8).
196238
3. Capture the state of the source targeting, the EQs configuration
197239
and the state of thread interrupt context registers.
198240

199-
Restore is similar :
241+
Restore is similar:
200242

201243
1. Restore the EQ configuration. As targeting depends on it.
202244
2. Restore targeting

0 commit comments

Comments
 (0)