]> git.proxmox.com Git - mirror_qemu.git/blob - qapi/target.json
qapi: make query-cpu-model-expansion depend on s390 or x86
[mirror_qemu.git] / qapi / target.json
1 # -*- Mode: Python -*-
2 #
3
4 ##
5 # = Target-specific commands & events
6 ##
7
8 { 'include': 'misc.json' }
9
10 ##
11 # @rtc-reset-reinjection:
12 #
13 # This command will reset the RTC interrupt reinjection backlog.
14 # Can be used if another mechanism to synchronize guest time
15 # is in effect, for example QEMU guest agent's guest-set-time
16 # command.
17 #
18 # Since: 2.1
19 #
20 # Example:
21 #
22 # -> { "execute": "rtc-reset-reinjection" }
23 # <- { "return": {} }
24 #
25 ##
26 { 'command': 'rtc-reset-reinjection',
27 'if': 'defined(TARGET_I386)' }
28
29
30 ##
31 # @SevState:
32 #
33 # An enumeration of SEV state information used during @query-sev.
34 #
35 # @uninit: The guest is uninitialized.
36 #
37 # @launch-update: The guest is currently being launched; plaintext data and
38 # register state is being imported.
39 #
40 # @launch-secret: The guest is currently being launched; ciphertext data
41 # is being imported.
42 #
43 # @running: The guest is fully launched or migrated in.
44 #
45 # @send-update: The guest is currently being migrated out to another machine.
46 #
47 # @receive-update: The guest is currently being migrated from another machine.
48 #
49 # Since: 2.12
50 ##
51 { 'enum': 'SevState',
52 'data': ['uninit', 'launch-update', 'launch-secret', 'running',
53 'send-update', 'receive-update' ],
54 'if': 'defined(TARGET_I386)' }
55
56 ##
57 # @SevInfo:
58 #
59 # Information about Secure Encrypted Virtualization (SEV) support
60 #
61 # @enabled: true if SEV is active
62 #
63 # @api-major: SEV API major version
64 #
65 # @api-minor: SEV API minor version
66 #
67 # @build-id: SEV FW build id
68 #
69 # @policy: SEV policy value
70 #
71 # @state: SEV guest state
72 #
73 # @handle: SEV firmware handle
74 #
75 # Since: 2.12
76 ##
77 { 'struct': 'SevInfo',
78 'data': { 'enabled': 'bool',
79 'api-major': 'uint8',
80 'api-minor' : 'uint8',
81 'build-id' : 'uint8',
82 'policy' : 'uint32',
83 'state' : 'SevState',
84 'handle' : 'uint32'
85 },
86 'if': 'defined(TARGET_I386)'
87 }
88
89 ##
90 # @query-sev:
91 #
92 # Returns information about SEV
93 #
94 # Returns: @SevInfo
95 #
96 # Since: 2.12
97 #
98 # Example:
99 #
100 # -> { "execute": "query-sev" }
101 # <- { "return": { "enabled": true, "api-major" : 0, "api-minor" : 0,
102 # "build-id" : 0, "policy" : 0, "state" : "running",
103 # "handle" : 1 } }
104 #
105 ##
106 { 'command': 'query-sev', 'returns': 'SevInfo',
107 'if': 'defined(TARGET_I386)' }
108
109
110 ##
111 # @SevLaunchMeasureInfo:
112 #
113 # SEV Guest Launch measurement information
114 #
115 # @data: the measurement value encoded in base64
116 #
117 # Since: 2.12
118 #
119 ##
120 { 'struct': 'SevLaunchMeasureInfo', 'data': {'data': 'str'},
121 'if': 'defined(TARGET_I386)' }
122
123 ##
124 # @query-sev-launch-measure:
125 #
126 # Query the SEV guest launch information.
127 #
128 # Returns: The @SevLaunchMeasureInfo for the guest
129 #
130 # Since: 2.12
131 #
132 # Example:
133 #
134 # -> { "execute": "query-sev-launch-measure" }
135 # <- { "return": { "data": "4l8LXeNlSPUDlXPJG5966/8%YZ" } }
136 #
137 ##
138 { 'command': 'query-sev-launch-measure', 'returns': 'SevLaunchMeasureInfo',
139 'if': 'defined(TARGET_I386)' }
140
141
142 ##
143 # @SevCapability:
144 #
145 # The struct describes capability for a Secure Encrypted Virtualization
146 # feature.
147 #
148 # @pdh: Platform Diffie-Hellman key (base64 encoded)
149 #
150 # @cert-chain: PDH certificate chain (base64 encoded)
151 #
152 # @cbitpos: C-bit location in page table entry
153 #
154 # @reduced-phys-bits: Number of physical Address bit reduction when SEV is
155 # enabled
156 #
157 # Since: 2.12
158 ##
159 { 'struct': 'SevCapability',
160 'data': { 'pdh': 'str',
161 'cert-chain': 'str',
162 'cbitpos': 'int',
163 'reduced-phys-bits': 'int'},
164 'if': 'defined(TARGET_I386)' }
165
166 ##
167 # @query-sev-capabilities:
168 #
169 # This command is used to get the SEV capabilities, and is supported on AMD
170 # X86 platforms only.
171 #
172 # Returns: SevCapability objects.
173 #
174 # Since: 2.12
175 #
176 # Example:
177 #
178 # -> { "execute": "query-sev-capabilities" }
179 # <- { "return": { "pdh": "8CCDD8DDD", "cert-chain": "888CCCDDDEE",
180 # "cbitpos": 47, "reduced-phys-bits": 5}}
181 #
182 ##
183 { 'command': 'query-sev-capabilities', 'returns': 'SevCapability',
184 'if': 'defined(TARGET_I386)' }
185
186 ##
187 # @dump-skeys:
188 #
189 # Dump guest's storage keys
190 #
191 # @filename: the path to the file to dump to
192 #
193 # This command is only supported on s390 architecture.
194 #
195 # Since: 2.5
196 #
197 # Example:
198 #
199 # -> { "execute": "dump-skeys",
200 # "arguments": { "filename": "/tmp/skeys" } }
201 # <- { "return": {} }
202 #
203 ##
204 { 'command': 'dump-skeys',
205 'data': { 'filename': 'str' },
206 'if': 'defined(TARGET_S390X)' }
207
208 ##
209 # @CpuModelBaselineInfo:
210 #
211 # The result of a CPU model baseline.
212 #
213 # @model: the baselined CpuModelInfo.
214 #
215 # Since: 2.8.0
216 ##
217 { 'struct': 'CpuModelBaselineInfo',
218 'data': { 'model': 'CpuModelInfo' },
219 'if': 'defined(TARGET_S390X)' }
220
221 ##
222 # @CpuModelCompareInfo:
223 #
224 # The result of a CPU model comparison.
225 #
226 # @result: The result of the compare operation.
227 # @responsible-properties: List of properties that led to the comparison result
228 # not being identical.
229 #
230 # @responsible-properties is a list of QOM property names that led to
231 # both CPUs not being detected as identical. For identical models, this
232 # list is empty.
233 # If a QOM property is read-only, that means there's no known way to make the
234 # CPU models identical. If the special property name "type" is included, the
235 # models are by definition not identical and cannot be made identical.
236 #
237 # Since: 2.8.0
238 ##
239 { 'struct': 'CpuModelCompareInfo',
240 'data': { 'result': 'CpuModelCompareResult',
241 'responsible-properties': ['str'] },
242 'if': 'defined(TARGET_S390X)' }
243
244 ##
245 # @query-cpu-model-comparison:
246 #
247 # Compares two CPU models, returning how they compare in a specific
248 # configuration. The results indicates how both models compare regarding
249 # runnability. This result can be used by tooling to make decisions if a
250 # certain CPU model will run in a certain configuration or if a compatible
251 # CPU model has to be created by baselining.
252 #
253 # Usually, a CPU model is compared against the maximum possible CPU model
254 # of a certain configuration (e.g. the "host" model for KVM). If that CPU
255 # model is identical or a subset, it will run in that configuration.
256 #
257 # The result returned by this command may be affected by:
258 #
259 # * QEMU version: CPU models may look different depending on the QEMU version.
260 # (Except for CPU models reported as "static" in query-cpu-definitions.)
261 # * machine-type: CPU model may look different depending on the machine-type.
262 # (Except for CPU models reported as "static" in query-cpu-definitions.)
263 # * machine options (including accelerator): in some architectures, CPU models
264 # may look different depending on machine and accelerator options. (Except for
265 # CPU models reported as "static" in query-cpu-definitions.)
266 # * "-cpu" arguments and global properties: arguments to the -cpu option and
267 # global properties may affect expansion of CPU models. Using
268 # query-cpu-model-expansion while using these is not advised.
269 #
270 # Some architectures may not support comparing CPU models. s390x supports
271 # comparing CPU models.
272 #
273 # Returns: a CpuModelBaselineInfo. Returns an error if comparing CPU models is
274 # not supported, if a model cannot be used, if a model contains
275 # an unknown cpu definition name, unknown properties or properties
276 # with wrong types.
277 #
278 # Note: this command isn't specific to s390x, but is only implemented
279 # on this architecture currently.
280 #
281 # Since: 2.8.0
282 ##
283 { 'command': 'query-cpu-model-comparison',
284 'data': { 'modela': 'CpuModelInfo', 'modelb': 'CpuModelInfo' },
285 'returns': 'CpuModelCompareInfo',
286 'if': 'defined(TARGET_S390X)' }
287
288 ##
289 # @query-cpu-model-baseline:
290 #
291 # Baseline two CPU models, creating a compatible third model. The created
292 # model will always be a static, migration-safe CPU model (see "static"
293 # CPU model expansion for details).
294 #
295 # This interface can be used by tooling to create a compatible CPU model out
296 # two CPU models. The created CPU model will be identical to or a subset of
297 # both CPU models when comparing them. Therefore, the created CPU model is
298 # guaranteed to run where the given CPU models run.
299 #
300 # The result returned by this command may be affected by:
301 #
302 # * QEMU version: CPU models may look different depending on the QEMU version.
303 # (Except for CPU models reported as "static" in query-cpu-definitions.)
304 # * machine-type: CPU model may look different depending on the machine-type.
305 # (Except for CPU models reported as "static" in query-cpu-definitions.)
306 # * machine options (including accelerator): in some architectures, CPU models
307 # may look different depending on machine and accelerator options. (Except for
308 # CPU models reported as "static" in query-cpu-definitions.)
309 # * "-cpu" arguments and global properties: arguments to the -cpu option and
310 # global properties may affect expansion of CPU models. Using
311 # query-cpu-model-expansion while using these is not advised.
312 #
313 # Some architectures may not support baselining CPU models. s390x supports
314 # baselining CPU models.
315 #
316 # Returns: a CpuModelBaselineInfo. Returns an error if baselining CPU models is
317 # not supported, if a model cannot be used, if a model contains
318 # an unknown cpu definition name, unknown properties or properties
319 # with wrong types.
320 #
321 # Note: this command isn't specific to s390x, but is only implemented
322 # on this architecture currently.
323 #
324 # Since: 2.8.0
325 ##
326 { 'command': 'query-cpu-model-baseline',
327 'data': { 'modela': 'CpuModelInfo',
328 'modelb': 'CpuModelInfo' },
329 'returns': 'CpuModelBaselineInfo',
330 'if': 'defined(TARGET_S390X)' }
331
332 ##
333 # @GICCapability:
334 #
335 # The struct describes capability for a specific GIC (Generic
336 # Interrupt Controller) version. These bits are not only decided by
337 # QEMU/KVM software version, but also decided by the hardware that
338 # the program is running upon.
339 #
340 # @version: version of GIC to be described. Currently, only 2 and 3
341 # are supported.
342 #
343 # @emulated: whether current QEMU/hardware supports emulated GIC
344 # device in user space.
345 #
346 # @kernel: whether current QEMU/hardware supports hardware
347 # accelerated GIC device in kernel.
348 #
349 # Since: 2.6
350 ##
351 { 'struct': 'GICCapability',
352 'data': { 'version': 'int',
353 'emulated': 'bool',
354 'kernel': 'bool' },
355 'if': 'defined(TARGET_ARM)' }
356
357 ##
358 # @query-gic-capabilities:
359 #
360 # This command is ARM-only. It will return a list of GICCapability
361 # objects that describe its capability bits.
362 #
363 # Returns: a list of GICCapability objects.
364 #
365 # Since: 2.6
366 #
367 # Example:
368 #
369 # -> { "execute": "query-gic-capabilities" }
370 # <- { "return": [{ "version": 2, "emulated": true, "kernel": false },
371 # { "version": 3, "emulated": false, "kernel": true } ] }
372 #
373 ##
374 { 'command': 'query-gic-capabilities', 'returns': ['GICCapability'],
375 'if': 'defined(TARGET_ARM)' }
376
377 ##
378 # @CpuModelExpansionInfo:
379 #
380 # The result of a cpu model expansion.
381 #
382 # @model: the expanded CpuModelInfo.
383 #
384 # Since: 2.8.0
385 ##
386 { 'struct': 'CpuModelExpansionInfo',
387 'data': { 'model': 'CpuModelInfo' },
388 'if': 'defined(TARGET_S390X) || defined(TARGET_I386)' }
389
390 ##
391 # @query-cpu-model-expansion:
392 #
393 # Expands a given CPU model (or a combination of CPU model + additional options)
394 # to different granularities, allowing tooling to get an understanding what a
395 # specific CPU model looks like in QEMU under a certain configuration.
396 #
397 # This interface can be used to query the "host" CPU model.
398 #
399 # The data returned by this command may be affected by:
400 #
401 # * QEMU version: CPU models may look different depending on the QEMU version.
402 # (Except for CPU models reported as "static" in query-cpu-definitions.)
403 # * machine-type: CPU model may look different depending on the machine-type.
404 # (Except for CPU models reported as "static" in query-cpu-definitions.)
405 # * machine options (including accelerator): in some architectures, CPU models
406 # may look different depending on machine and accelerator options. (Except for
407 # CPU models reported as "static" in query-cpu-definitions.)
408 # * "-cpu" arguments and global properties: arguments to the -cpu option and
409 # global properties may affect expansion of CPU models. Using
410 # query-cpu-model-expansion while using these is not advised.
411 #
412 # Some architectures may not support all expansion types. s390x supports
413 # "full" and "static".
414 #
415 # Returns: a CpuModelExpansionInfo. Returns an error if expanding CPU models is
416 # not supported, if the model cannot be expanded, if the model contains
417 # an unknown CPU definition name, unknown properties or properties
418 # with a wrong type. Also returns an error if an expansion type is
419 # not supported.
420 #
421 # Since: 2.8.0
422 ##
423 { 'command': 'query-cpu-model-expansion',
424 'data': { 'type': 'CpuModelExpansionType',
425 'model': 'CpuModelInfo' },
426 'returns': 'CpuModelExpansionInfo',
427 'if': 'defined(TARGET_S390X) || defined(TARGET_I386)' }