5 # = Target-specific commands & events
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
22 # -> { "execute": "rtc-reset-reinjection" }
26 { 'command': 'rtc-reset-reinjection',
27 'if': 'defined(TARGET_I386)' }
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
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.
52 'data': ['uninit', 'launch-update', 'launch-secret', 'running',
53 'send-update', 'receive-update' ],
54 'if': 'defined(TARGET_I386)' }
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
77 { 'struct': 'SevInfo',
78 'data': { 'enabled': 'bool',
80 'api-minor' : 'uint8',
86 'if': 'defined(TARGET_I386)'
92 # Returns information about SEV
100 # -> { "execute": "query-sev" }
101 # <- { "return": { "enabled": true, "api-major" : 0, "api-minor" : 0,
102 # "build-id" : 0, "policy" : 0, "state" : "running",
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
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
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)' }
145 # The struct describes capability for a Secure Encrypted Virtualization
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
159 { 'struct': 'SevCapability',
160 'data': { 'pdh': 'str',
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.
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)' }
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.
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.
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
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.
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
278 # Note: this command isn't specific to s390x, but is only implemented
279 # on this architecture currently.
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
321 # Note: this command isn't specific to s390x, but is only implemented
322 # on this architecture currently.
326 { 'command': 'query-cpu-model-baseline',
327 'data': { 'modela': 'CpuModelInfo',
328 'modelb': 'CpuModelInfo' },
329 'returns': 'CpuModelBaselineInfo',
330 'if': 'defined(TARGET_S390X)' }
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
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.
351 { 'struct': 'GICCapability',
352 'data': { 'version': 'int',
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.
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.
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
423 { 'command': 'query-cpu-model-expansion',
424 'data': { 'type': 'CpuModelExpansionType',
425 'model': 'CpuModelInfo' },
426 'returns': 'CpuModelExpansionInfo',
427 'if': 'defined(TARGET_S390X) || defined(TARGET_I386)' }