qapi: make query-cpu-definitions depend on specific targets
[qemu/ar7.git] / qapi / target.json
blob5c41a0aee70e25f0b37e0918037138952d5bf3c0
1 # -*- Mode: Python -*-
4 ##
5 # = Target-specific commands & events
6 ##
8 { 'include': 'misc.json' }
11 # @rtc-reset-reinjection:
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.
18 # Since: 2.1
20 # Example:
22 # -> { "execute": "rtc-reset-reinjection" }
23 # <- { "return": {} }
26 { 'command': 'rtc-reset-reinjection',
27   'if': 'defined(TARGET_I386)' }
31 # @SevState:
33 # An enumeration of SEV state information used during @query-sev.
35 # @uninit: The guest is uninitialized.
37 # @launch-update: The guest is currently being launched; plaintext data and
38 #                 register state is being imported.
40 # @launch-secret: The guest is currently being launched; ciphertext data
41 #                 is being imported.
43 # @running: The guest is fully launched or migrated in.
45 # @send-update: The guest is currently being migrated out to another machine.
47 # @receive-update: The guest is currently being migrated from another machine.
49 # Since: 2.12
51 { 'enum': 'SevState',
52   'data': ['uninit', 'launch-update', 'launch-secret', 'running',
53            'send-update', 'receive-update' ],
54   'if': 'defined(TARGET_I386)' }
57 # @SevInfo:
59 # Information about Secure Encrypted Virtualization (SEV) support
61 # @enabled: true if SEV is active
63 # @api-major: SEV API major version
65 # @api-minor: SEV API minor version
67 # @build-id: SEV FW build id
69 # @policy: SEV policy value
71 # @state: SEV guest state
73 # @handle: SEV firmware handle
75 # Since: 2.12
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)'
90 # @query-sev:
92 # Returns information about SEV
94 # Returns: @SevInfo
96 # Since: 2.12
98 # Example:
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 } }
106 { 'command': 'query-sev', 'returns': 'SevInfo',
107   'if': 'defined(TARGET_I386)' }
111 # @SevLaunchMeasureInfo:
113 # SEV Guest Launch measurement information
115 # @data: the measurement value encoded in base64
117 # Since: 2.12
120 { 'struct': 'SevLaunchMeasureInfo', 'data': {'data': 'str'},
121   'if': 'defined(TARGET_I386)' }
124 # @query-sev-launch-measure:
126 # Query the SEV guest launch information.
128 # Returns: The @SevLaunchMeasureInfo for the guest
130 # Since: 2.12
132 # Example:
134 # -> { "execute": "query-sev-launch-measure" }
135 # <- { "return": { "data": "4l8LXeNlSPUDlXPJG5966/8%YZ" } }
138 { 'command': 'query-sev-launch-measure', 'returns': 'SevLaunchMeasureInfo',
139   'if': 'defined(TARGET_I386)' }
143 # @SevCapability:
145 # The struct describes capability for a Secure Encrypted Virtualization
146 # feature.
148 # @pdh:  Platform Diffie-Hellman key (base64 encoded)
150 # @cert-chain:  PDH certificate chain (base64 encoded)
152 # @cbitpos: C-bit location in page table entry
154 # @reduced-phys-bits: Number of physical Address bit reduction when SEV is
155 #                     enabled
157 # Since: 2.12
159 { 'struct': 'SevCapability',
160   'data': { 'pdh': 'str',
161             'cert-chain': 'str',
162             'cbitpos': 'int',
163             'reduced-phys-bits': 'int'},
164   'if': 'defined(TARGET_I386)' }
167 # @query-sev-capabilities:
169 # This command is used to get the SEV capabilities, and is supported on AMD
170 # X86 platforms only.
172 # Returns: SevCapability objects.
174 # Since: 2.12
176 # Example:
178 # -> { "execute": "query-sev-capabilities" }
179 # <- { "return": { "pdh": "8CCDD8DDD", "cert-chain": "888CCCDDDEE",
180 #                  "cbitpos": 47, "reduced-phys-bits": 5}}
183 { 'command': 'query-sev-capabilities', 'returns': 'SevCapability',
184   'if': 'defined(TARGET_I386)' }
187 # @dump-skeys:
189 # Dump guest's storage keys
191 # @filename: the path to the file to dump to
193 # This command is only supported on s390 architecture.
195 # Since: 2.5
197 # Example:
199 # -> { "execute": "dump-skeys",
200 #      "arguments": { "filename": "/tmp/skeys" } }
201 # <- { "return": {} }
204 { 'command': 'dump-skeys',
205   'data': { 'filename': 'str' },
206   'if': 'defined(TARGET_S390X)' }
209 # @CpuModelBaselineInfo:
211 # The result of a CPU model baseline.
213 # @model: the baselined CpuModelInfo.
215 # Since: 2.8.0
217 { 'struct': 'CpuModelBaselineInfo',
218   'data': { 'model': 'CpuModelInfo' },
219   'if': 'defined(TARGET_S390X)' }
222 # @CpuModelCompareInfo:
224 # The result of a CPU model comparison.
226 # @result: The result of the compare operation.
227 # @responsible-properties: List of properties that led to the comparison result
228 #                          not being identical.
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.
237 # Since: 2.8.0
239 { 'struct': 'CpuModelCompareInfo',
240   'data': { 'result': 'CpuModelCompareResult',
241             'responsible-properties': ['str'] },
242   'if': 'defined(TARGET_S390X)' }
245 # @query-cpu-model-comparison:
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.
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.
257 # The result returned by this command may be affected by:
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.
270 # Some architectures may not support comparing CPU models. s390x supports
271 # comparing CPU models.
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.
278 # Note: this command isn't specific to s390x, but is only implemented
279 # on this architecture currently.
281 # Since: 2.8.0
283 { 'command': 'query-cpu-model-comparison',
284   'data': { 'modela': 'CpuModelInfo', 'modelb': 'CpuModelInfo' },
285   'returns': 'CpuModelCompareInfo',
286   'if': 'defined(TARGET_S390X)' }
289 # @query-cpu-model-baseline:
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).
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.
300 # The result returned by this command may be affected by:
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.
313 # Some architectures may not support baselining CPU models. s390x supports
314 # baselining CPU models.
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.
321 # Note: this command isn't specific to s390x, but is only implemented
322 # on this architecture currently.
324 # Since: 2.8.0
326 { 'command': 'query-cpu-model-baseline',
327   'data': { 'modela': 'CpuModelInfo',
328             'modelb': 'CpuModelInfo' },
329   'returns': 'CpuModelBaselineInfo',
330   'if': 'defined(TARGET_S390X)' }
333 # @GICCapability:
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.
340 # @version:  version of GIC to be described. Currently, only 2 and 3
341 #            are supported.
343 # @emulated: whether current QEMU/hardware supports emulated GIC
344 #            device in user space.
346 # @kernel:   whether current QEMU/hardware supports hardware
347 #            accelerated GIC device in kernel.
349 # Since: 2.6
351 { 'struct': 'GICCapability',
352   'data': { 'version': 'int',
353             'emulated': 'bool',
354             'kernel': 'bool' },
355   'if': 'defined(TARGET_ARM)' }
358 # @query-gic-capabilities:
360 # This command is ARM-only. It will return a list of GICCapability
361 # objects that describe its capability bits.
363 # Returns: a list of GICCapability objects.
365 # Since: 2.6
367 # Example:
369 # -> { "execute": "query-gic-capabilities" }
370 # <- { "return": [{ "version": 2, "emulated": true, "kernel": false },
371 #                 { "version": 3, "emulated": false, "kernel": true } ] }
374 { 'command': 'query-gic-capabilities', 'returns': ['GICCapability'],
375   'if': 'defined(TARGET_ARM)' }
378 # @CpuModelExpansionInfo:
380 # The result of a cpu model expansion.
382 # @model: the expanded CpuModelInfo.
384 # Since: 2.8.0
386 { 'struct': 'CpuModelExpansionInfo',
387   'data': { 'model': 'CpuModelInfo' },
388   'if': 'defined(TARGET_S390X) || defined(TARGET_I386)' }
391 # @query-cpu-model-expansion:
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.
397 # This interface can be used to query the "host" CPU model.
399 # The data returned by this command may be affected by:
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.
412 # Some architectures may not support all expansion types. s390x supports
413 # "full" and "static".
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.
421 # Since: 2.8.0
423 { 'command': 'query-cpu-model-expansion',
424   'data': { 'type': 'CpuModelExpansionType',
425             'model': 'CpuModelInfo' },
426   'returns': 'CpuModelExpansionInfo',
427   'if': 'defined(TARGET_S390X) || defined(TARGET_I386)' }
430 # @CpuDefinitionInfo:
432 # Virtual CPU definition.
434 # @name: the name of the CPU definition
436 # @migration-safe: whether a CPU definition can be safely used for
437 #                  migration in combination with a QEMU compatibility machine
438 #                  when migrating between different QEMU versions and between
439 #                  hosts with different sets of (hardware or software)
440 #                  capabilities. If not provided, information is not available
441 #                  and callers should not assume the CPU definition to be
442 #                  migration-safe. (since 2.8)
444 # @static: whether a CPU definition is static and will not change depending on
445 #          QEMU version, machine type, machine options and accelerator options.
446 #          A static model is always migration-safe. (since 2.8)
448 # @unavailable-features: List of properties that prevent
449 #                        the CPU model from running in the current
450 #                        host. (since 2.8)
451 # @typename: Type name that can be used as argument to @device-list-properties,
452 #            to introspect properties configurable using -cpu or -global.
453 #            (since 2.9)
455 # @unavailable-features is a list of QOM property names that
456 # represent CPU model attributes that prevent the CPU from running.
457 # If the QOM property is read-only, that means there's no known
458 # way to make the CPU model run in the current host. Implementations
459 # that choose not to provide specific information return the
460 # property name "type".
461 # If the property is read-write, it means that it MAY be possible
462 # to run the CPU model in the current host if that property is
463 # changed. Management software can use it as hints to suggest or
464 # choose an alternative for the user, or just to generate meaningful
465 # error messages explaining why the CPU model can't be used.
466 # If @unavailable-features is an empty list, the CPU model is
467 # runnable using the current host and machine-type.
468 # If @unavailable-features is not present, runnability
469 # information for the CPU is not available.
471 # Since: 1.2.0
473 { 'struct': 'CpuDefinitionInfo',
474   'data': { 'name': 'str',
475             '*migration-safe': 'bool',
476             'static': 'bool',
477             '*unavailable-features': [ 'str' ],
478             'typename': 'str' },
479   'if': 'defined(TARGET_PPC) || defined(TARGET_ARM) || defined(TARGET_I386) || defined(TARGET_S390X)' }
482 # @query-cpu-definitions:
484 # Return a list of supported virtual CPU definitions
486 # Returns: a list of CpuDefInfo
488 # Since: 1.2.0
490 { 'command': 'query-cpu-definitions', 'returns': ['CpuDefinitionInfo'],
491   'if': 'defined(TARGET_PPC) || defined(TARGET_ARM) || defined(TARGET_I386) || defined(TARGET_S390X)' }