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
@@ -64,72 +67,100 @@ the legacy interrupt mode, referred as XICS (POWER7/8).
64
67
65
68
* Groups:
66
69
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
+
69
73
Attributes:
70
74
1.1 KVM_DEV_XIVE_RESET (write only)
71
75
Resets the interrupt controller configuration for sources and event
72
76
queues. To be used by kexec and kdump.
77
+
73
78
Errors: none
74
79
75
80
1.2 KVM_DEV_XIVE_EQ_SYNC (write only)
76
81
Sync all the sources and queues and mark the EQ pages dirty. This
77
82
to make sure that a consistent memory state is captured when
78
83
migrating the VM.
84
+
79
85
Errors: none
80
86
81
87
1.3 KVM_DEV_XIVE_NR_SERVERS (write only)
82
88
The kvm_device_attr.addr points to a __u32 value which is the number of
83
89
interrupt server numbers (ie, highest possible vcpu id plus one).
90
+
84
91
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.
88
92
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
+
91
102
Attributes:
92
103
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
+
96
110
- type: 0:MSI 1: LSI
97
111
- level: assertion level in case of an LSI.
112
+
98
113
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
103
114
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
+
106
125
Attributes:
107
126
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
+
111
133
- priority: 0-7 interrupt priority level
112
134
- server: CPU number chosen to handle the interrupt
113
135
- mask: mask flag (unused)
114
136
- eisn: Effective Interrupt Source Number
137
+
115
138
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
+
127
154
Attributes:
128
155
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
+
133
164
struct kvm_ppc_xive_eq {
134
165
__u32 flags;
135
166
__u32 qshift;
@@ -138,31 +169,41 @@ the legacy interrupt mode, referred as XICS (POWER7/8).
138
169
__u32 qindex;
139
170
__u8 pad[40];
140
171
};
172
+
141
173
- flags: queue flags
142
- KVM_XIVE_EQ_ALWAYS_NOTIFY (required)
174
+ KVM_XIVE_EQ_ALWAYS_NOTIFY (required)
143
175
forces notification without using the coalescing mechanism
144
176
provided by the XIVE END ESBs.
145
177
- qshift: queue size (power of 2)
146
178
- qaddr: real address of queue
147
179
- qtoggle: current queue toggle bit
148
180
- qindex: current queue index
149
181
- pad: reserved for future use
182
+
150
183
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
+
161
198
Attributes:
162
199
Interrupt source number (64-bit)
200
+
163
201
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
+ ======= =============================
166
207
167
208
* VCPU state
168
209
@@ -175,11 +216,12 @@ the legacy interrupt mode, referred as XICS (POWER7/8).
175
216
as it synthesizes the priorities of the pending interrupts. We
176
217
capture a bit more to report debug information.
177
218
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 |
183
225
184
226
* Migration:
185
227
@@ -196,7 +238,7 @@ the legacy interrupt mode, referred as XICS (POWER7/8).
196
238
3. Capture the state of the source targeting, the EQs configuration
197
239
and the state of thread interrupt context registers.
198
240
199
- Restore is similar :
241
+ Restore is similar:
200
242
201
243
1. Restore the EQ configuration. As targeting depends on it.
202
244
2. Restore targeting
0 commit comments