3 # This work is licensed under the terms of the GNU GPL, version 2 or later.
4 # See the COPYING file in the top-level directory.
13 # The comprehensive enumeration of QEMU system emulation ("softmmu")
14 # targets. Run "./configure --help" in the project root directory, and
15 # look for the *-softmmu targets near the "--target-list" option. The
16 # individual target constants are not documented here, for the time
19 # Notes: The resulting QMP strings can be appended to the "qemu-system-"
20 # prefix to produce the corresponding QEMU executable name. This
21 # is true even for "qemu-system-x86_64".
25 { 'enum' : 'SysEmuTarget',
26 'data' : [ 'aarch64', 'alpha', 'arm', 'cris', 'hppa', 'i386', 'lm32',
27 'm68k', 'microblaze', 'microblazeel', 'mips', 'mips64',
28 'mips64el', 'mipsel', 'moxie', 'nios2', 'or1k', 'ppc',
29 'ppc64', 'riscv32', 'riscv64', 's390x', 'sh4',
30 'sh4eb', 'sparc', 'sparc64', 'tricore', 'unicore32',
31 'x86_64', 'xtensa', 'xtensaeb' ] }
36 # An enumeration of cpu types that enable additional information during
37 # @query-cpus and @query-cpus-fast.
45 { 'enum': 'CpuInfoArch',
46 'data': ['x86', 'sparc', 'ppc', 'mips', 'tricore', 's390', 'riscv', 'other' ] }
51 # Information about a virtual CPU
53 # @CPU: the index of the virtual CPU
55 # @current: this only exists for backwards compatibility and should be ignored
57 # @halted: true if the virtual CPU is in the halt state. Halt usually refers
58 # to a processor specific low power mode.
60 # @qom_path: path to the CPU object in the QOM tree (since 2.4)
62 # @thread_id: ID of the underlying host thread
64 # @props: properties describing to which node/socket/core/thread
65 # virtual CPU belongs to, provided if supported by board (since 2.10)
67 # @arch: architecture of the cpu, which determines which additional fields
68 # will be listed (since 2.6)
72 # Notes: @halted is a transient state that changes frequently. By the time the
73 # data is sent to the client, the guest may no longer be halted.
76 'base': {'CPU': 'int', 'current': 'bool', 'halted': 'bool',
77 'qom_path': 'str', 'thread_id': 'int',
78 '*props': 'CpuInstanceProperties', 'arch': 'CpuInfoArch' },
79 'discriminator': 'arch',
80 'data': { 'x86': 'CpuInfoX86',
81 'sparc': 'CpuInfoSPARC',
83 'mips': 'CpuInfoMIPS',
84 'tricore': 'CpuInfoTricore',
85 's390': 'CpuInfoS390',
86 'riscv': 'CpuInfoRISCV' } }
91 # Additional information about a virtual i386 or x86_64 CPU
93 # @pc: the 64-bit instruction pointer
97 { 'struct': 'CpuInfoX86', 'data': { 'pc': 'int' } }
102 # Additional information about a virtual SPARC CPU
104 # @pc: the PC component of the instruction pointer
106 # @npc: the NPC component of the instruction pointer
110 { 'struct': 'CpuInfoSPARC', 'data': { 'pc': 'int', 'npc': 'int' } }
115 # Additional information about a virtual PPC CPU
117 # @nip: the instruction pointer
121 { 'struct': 'CpuInfoPPC', 'data': { 'nip': 'int' } }
126 # Additional information about a virtual MIPS CPU
128 # @PC: the instruction pointer
132 { 'struct': 'CpuInfoMIPS', 'data': { 'PC': 'int' } }
137 # Additional information about a virtual Tricore CPU
139 # @PC: the instruction pointer
143 { 'struct': 'CpuInfoTricore', 'data': { 'PC': 'int' } }
148 # Additional information about a virtual RISCV CPU
150 # @pc: the instruction pointer
154 { 'struct': 'CpuInfoRISCV', 'data': { 'pc': 'int' } }
159 # An enumeration of cpu states that can be assumed by a virtual
164 { 'enum': 'CpuS390State',
165 'prefix': 'S390_CPU_STATE',
166 'data': [ 'uninitialized', 'stopped', 'check-stop', 'operating', 'load' ] }
171 # Additional information about a virtual S390 CPU
173 # @cpu-state: the virtual CPU's state
177 { 'struct': 'CpuInfoS390', 'data': { 'cpu-state': 'CpuS390State' } }
182 # Returns a list of information about each virtual CPU.
184 # This command causes vCPU threads to exit to userspace, which causes
185 # a small interruption to guest CPU execution. This will have a negative
186 # impact on realtime guests and other latency sensitive guest workloads.
189 # @deprecated: This command is deprecated, because it interferes with
190 # the guest. Use 'query-cpus-fast' instead to avoid the vCPU
193 # Returns: a list of @CpuInfo for each virtual CPU
199 # -> { "execute": "query-cpus" }
205 # "qom_path":"/machine/unattached/device[0]",
214 # "qom_path":"/machine/unattached/device[2]",
223 { 'command': 'query-cpus', 'returns': ['CpuInfo'],
224 'features': [ 'deprecated' ] }
229 # Information about a virtual CPU
231 # @cpu-index: index of the virtual CPU
233 # @qom-path: path to the CPU object in the QOM tree
235 # @thread-id: ID of the underlying host thread
237 # @props: properties describing to which node/socket/core/thread
238 # virtual CPU belongs to, provided if supported by board
240 # @arch: base architecture of the cpu
242 # @target: the QEMU system emulation target, which determines which
243 # additional fields will be listed (since 3.0)
246 # @deprecated: Member @arch is deprecated. Use @target instead.
251 { 'union' : 'CpuInfoFast',
252 'base' : { 'cpu-index' : 'int',
255 '*props' : 'CpuInstanceProperties',
256 'arch' : { 'type': 'CpuInfoArch',
257 'features': [ 'deprecated' ] },
258 'target' : 'SysEmuTarget' },
259 'discriminator' : 'target',
260 'data' : { 's390x' : 'CpuInfoS390' } }
265 # Returns information about all virtual CPUs. This command does not
266 # incur a performance penalty and should be used in production
267 # instead of query-cpus.
269 # Returns: list of @CpuInfoFast
275 # -> { "execute": "query-cpus-fast" }
278 # "thread-id": 25627,
284 # "qom-path": "/machine/unattached/device[0]",
290 # "thread-id": 25628,
296 # "qom-path": "/machine/unattached/device[2]",
304 { 'command': 'query-cpus-fast', 'returns': [ 'CpuInfoFast' ] }
309 # Adds CPU with specified ID.
311 # @id: ID of CPU to be created, valid values [0..max_cpus)
314 # @deprecated: This command is deprecated. Use `device_add` instead.
315 # See the `query-hotpluggable-cpus` command for details.
317 # Returns: Nothing on success
323 # -> { "execute": "cpu-add", "arguments": { "id": 2 } }
324 # <- { "return": {} }
327 { 'command': 'cpu-add', 'data': {'id': 'int'},
328 'features': [ 'deprecated' ] }
333 # Information describing a machine.
335 # @name: the name of the machine
337 # @alias: an alias for the machine name
339 # @is-default: whether the machine is default
341 # @cpu-max: maximum number of CPUs supported by the machine type
344 # @hotpluggable-cpus: cpu hotplug via -device is supported (since 2.7.0)
346 # @numa-mem-supported: true if '-numa node,mem' option is supported by
347 # the machine type and false otherwise (since 4.1)
349 # @deprecated: if true, the machine type is deprecated and may be removed
350 # in future versions of QEMU according to the QEMU deprecation
351 # policy (since 4.1.0)
353 # @default-cpu-type: default CPU model typename if none is requested via
354 # the -cpu argument. (since 4.2)
358 { 'struct': 'MachineInfo',
359 'data': { 'name': 'str', '*alias': 'str',
360 '*is-default': 'bool', 'cpu-max': 'int',
361 'hotpluggable-cpus': 'bool', 'numa-mem-supported': 'bool',
362 'deprecated': 'bool', '*default-cpu-type': 'str' } }
367 # Return a list of supported machines
369 # Returns: a list of MachineInfo
373 { 'command': 'query-machines', 'returns': ['MachineInfo'] }
376 # @CurrentMachineParams:
378 # Information describing the running machine parameters.
380 # @wakeup-suspend-support: true if the machine supports wake up from
385 { 'struct': 'CurrentMachineParams',
386 'data': { 'wakeup-suspend-support': 'bool'} }
389 # @query-current-machine:
391 # Return information on the current virtual machine.
393 # Returns: CurrentMachineParams
397 { 'command': 'query-current-machine', 'returns': 'CurrentMachineParams' }
402 # Information describing the QEMU target.
404 # @arch: the target architecture
408 { 'struct': 'TargetInfo',
409 'data': { 'arch': 'SysEmuTarget' } }
414 # Return information about the target for this QEMU
416 # Returns: TargetInfo
420 { 'command': 'query-target', 'returns': 'TargetInfo' }
425 # @node: NUMA nodes configuration
427 # @dist: NUMA distance configuration (since 2.10)
429 # @cpu: property based CPU(s) to node mapping (Since: 2.10)
431 # @hmat-lb: memory latency and bandwidth information (Since: 5.0)
433 # @hmat-cache: memory side cache information (Since: 5.0)
437 { 'enum': 'NumaOptionsType',
438 'data': [ 'node', 'dist', 'cpu', 'hmat-lb', 'hmat-cache' ] }
443 # A discriminated record of NUMA options. (for OptsVisitor)
447 { 'union': 'NumaOptions',
448 'base': { 'type': 'NumaOptionsType' },
449 'discriminator': 'type',
451 'node': 'NumaNodeOptions',
452 'dist': 'NumaDistOptions',
453 'cpu': 'NumaCpuOptions',
454 'hmat-lb': 'NumaHmatLBOptions',
455 'hmat-cache': 'NumaHmatCacheOptions' }}
460 # Create a guest NUMA node. (for OptsVisitor)
462 # @nodeid: NUMA node ID (increase by 1 from 0 if omitted)
464 # @cpus: VCPUs belonging to this node (assign VCPUS round-robin
467 # @mem: memory size of this node; mutually exclusive with @memdev.
468 # Equally divide total memory among nodes if both @mem and @memdev are
471 # @memdev: memory backend object. If specified for one node,
472 # it must be specified for all nodes.
474 # @initiator: defined in ACPI 6.3 Chapter 5.2.27.3 Table 5-145,
475 # points to the nodeid which has the memory controller
476 # responsible for this NUMA node. This field provides
477 # additional information as to the initiator node that
478 # is closest (as in directly attached) to this node, and
479 # therefore has the best performance (since 5.0)
483 { 'struct': 'NumaNodeOptions',
489 '*initiator': 'uint16' }}
494 # Set the distance between 2 NUMA nodes.
496 # @src: source NUMA node.
498 # @dst: destination NUMA node.
500 # @val: NUMA distance from source node to destination node.
501 # When a node is unreachable from another node, set the distance
502 # between them to 255.
506 { 'struct': 'NumaDistOptions',
515 # A X86 32-bit register
519 { 'enum': 'X86CPURegister32',
520 'data': [ 'EAX', 'EBX', 'ECX', 'EDX', 'ESP', 'EBP', 'ESI', 'EDI' ] }
523 # @X86CPUFeatureWordInfo:
525 # Information about a X86 CPU feature word
527 # @cpuid-input-eax: Input EAX value for CPUID instruction for that feature word
529 # @cpuid-input-ecx: Input ECX value for CPUID instruction for that
532 # @cpuid-register: Output register containing the feature bits
534 # @features: value of output register, containing the feature bits
538 { 'struct': 'X86CPUFeatureWordInfo',
539 'data': { 'cpuid-input-eax': 'int',
540 '*cpuid-input-ecx': 'int',
541 'cpuid-register': 'X86CPURegister32',
542 'features': 'int' } }
547 # Not used by QMP; hack to let us use X86CPUFeatureWordInfoList internally
551 { 'struct': 'DummyForceArrays',
552 'data': { 'unused': ['X86CPUFeatureWordInfo'] } }
557 # Option "-numa cpu" overrides default cpu to node mapping.
558 # It accepts the same set of cpu properties as returned by
559 # query-hotpluggable-cpus[].props, where node-id could be used to
560 # override default node mapping.
564 { 'struct': 'NumaCpuOptions',
565 'base': 'CpuInstanceProperties',
569 # @HmatLBMemoryHierarchy:
571 # The memory hierarchy in the System Locality Latency and Bandwidth
572 # Information Structure of HMAT (Heterogeneous Memory Attribute Table)
574 # For more information about @HmatLBMemoryHierarchy, see chapter
575 # 5.2.27.4: Table 5-146: Field "Flags" of ACPI 6.3 spec.
577 # @memory: the structure represents the memory performance
579 # @first-level: first level of memory side cache
581 # @second-level: second level of memory side cache
583 # @third-level: third level of memory side cache
587 { 'enum': 'HmatLBMemoryHierarchy',
588 'data': [ 'memory', 'first-level', 'second-level', 'third-level' ] }
593 # Data type in the System Locality Latency and Bandwidth
594 # Information Structure of HMAT (Heterogeneous Memory Attribute Table)
596 # For more information about @HmatLBDataType, see chapter
597 # 5.2.27.4: Table 5-146: Field "Data Type" of ACPI 6.3 spec.
599 # @access-latency: access latency (nanoseconds)
601 # @read-latency: read latency (nanoseconds)
603 # @write-latency: write latency (nanoseconds)
605 # @access-bandwidth: access bandwidth (Bytes per second)
607 # @read-bandwidth: read bandwidth (Bytes per second)
609 # @write-bandwidth: write bandwidth (Bytes per second)
613 { 'enum': 'HmatLBDataType',
614 'data': [ 'access-latency', 'read-latency', 'write-latency',
615 'access-bandwidth', 'read-bandwidth', 'write-bandwidth' ] }
618 # @NumaHmatLBOptions:
620 # Set the system locality latency and bandwidth information
621 # between Initiator and Target proximity Domains.
623 # For more information about @NumaHmatLBOptions, see chapter
624 # 5.2.27.4: Table 5-146 of ACPI 6.3 spec.
626 # @initiator: the Initiator Proximity Domain.
628 # @target: the Target Proximity Domain.
630 # @hierarchy: the Memory Hierarchy. Indicates the performance
631 # of memory or side cache.
633 # @data-type: presents the type of data, access/read/write
634 # latency or hit latency.
636 # @latency: the value of latency from @initiator to @target
637 # proximity domain, the latency unit is "ns(nanosecond)".
639 # @bandwidth: the value of bandwidth between @initiator and @target
640 # proximity domain, the bandwidth unit is
641 # "Bytes per second".
645 { 'struct': 'NumaHmatLBOptions',
647 'initiator': 'uint16',
649 'hierarchy': 'HmatLBMemoryHierarchy',
650 'data-type': 'HmatLBDataType',
651 '*latency': 'uint64',
652 '*bandwidth': 'size' }}
655 # @HmatCacheAssociativity:
657 # Cache associativity in the Memory Side Cache Information Structure
660 # For more information of @HmatCacheAssociativity, see chapter
661 # 5.2.27.5: Table 5-147 of ACPI 6.3 spec.
663 # @none: None (no memory side cache in this proximity domain,
664 # or cache associativity unknown)
666 # @direct: Direct Mapped
668 # @complex: Complex Cache Indexing (implementation specific)
672 { 'enum': 'HmatCacheAssociativity',
673 'data': [ 'none', 'direct', 'complex' ] }
676 # @HmatCacheWritePolicy:
678 # Cache write policy in the Memory Side Cache Information Structure
681 # For more information of @HmatCacheWritePolicy, see chapter
682 # 5.2.27.5: Table 5-147: Field "Cache Attributes" of ACPI 6.3 spec.
684 # @none: None (no memory side cache in this proximity domain,
685 # or cache write policy unknown)
687 # @write-back: Write Back (WB)
689 # @write-through: Write Through (WT)
693 { 'enum': 'HmatCacheWritePolicy',
694 'data': [ 'none', 'write-back', 'write-through' ] }
697 # @NumaHmatCacheOptions:
699 # Set the memory side cache information for a given memory domain.
701 # For more information of @NumaHmatCacheOptions, see chapter
702 # 5.2.27.5: Table 5-147: Field "Cache Attributes" of ACPI 6.3 spec.
704 # @node-id: the memory proximity domain to which the memory belongs.
706 # @size: the size of memory side cache in bytes.
708 # @level: the cache level described in this structure.
710 # @associativity: the cache associativity,
711 # none/direct-mapped/complex(complex cache indexing).
713 # @policy: the write policy, none/write-back/write-through.
715 # @line: the cache Line size in bytes.
719 { 'struct': 'NumaHmatCacheOptions',
724 'associativity': 'HmatCacheAssociativity',
725 'policy': 'HmatCacheWritePolicy',
731 # Host memory policy types
733 # @default: restore default policy, remove any nondefault policy
735 # @preferred: set the preferred host nodes for allocation
737 # @bind: a strict policy that restricts memory allocation to the
738 # host nodes specified
740 # @interleave: memory allocations are interleaved across the set
741 # of host nodes specified
745 { 'enum': 'HostMemPolicy',
746 'data': [ 'default', 'preferred', 'bind', 'interleave' ] }
751 # Information about memory backend
753 # @id: backend's ID if backend has 'id' property (since 2.9)
755 # @size: memory backend size
757 # @merge: enables or disables memory merge support
759 # @dump: includes memory backend's memory in a core dump or not
761 # @prealloc: enables or disables memory preallocation
763 # @host-nodes: host nodes for its memory policy
765 # @policy: memory policy of memory backend
769 { 'struct': 'Memdev',
776 'host-nodes': ['uint16'],
777 'policy': 'HostMemPolicy' }}
782 # Returns information for all memory backends.
784 # Returns: a list of @Memdev.
790 # -> { "execute": "query-memdev" }
798 # "host-nodes": [0, 1],
806 # "host-nodes": [2, 3],
807 # "policy": "preferred"
813 { 'command': 'query-memdev', 'returns': ['Memdev'], 'allow-preconfig': true }
816 # @CpuInstanceProperties:
818 # List of properties to be used for hotplugging a CPU instance,
819 # it should be passed by management with device_add command when
820 # a CPU is being hotplugged.
822 # @node-id: NUMA node ID the CPU belongs to
823 # @socket-id: socket number within node/board the CPU belongs to
824 # @die-id: die number within node/board the CPU belongs to (Since 4.1)
825 # @core-id: core number within die the CPU belongs to# @thread-id: thread number within core the CPU belongs to
827 # Note: currently there are 5 properties that could be present
828 # but management should be prepared to pass through other
829 # properties with device_add command to allow for future
830 # interface extension. This also requires the filed names to be kept in
831 # sync with the properties passed to -device/device_add.
835 { 'struct': 'CpuInstanceProperties',
836 'data': { '*node-id': 'int',
847 # @type: CPU object type for usage with device_add command
848 # @props: list of properties to be used for hotplugging CPU
849 # @vcpus-count: number of logical VCPU threads @HotpluggableCPU provides
850 # @qom-path: link to existing CPU object if CPU is present or
851 # omitted if CPU is not present.
855 { 'struct': 'HotpluggableCPU',
856 'data': { 'type': 'str',
857 'vcpus-count': 'int',
858 'props': 'CpuInstanceProperties',
864 # @query-hotpluggable-cpus:
866 # TODO: Better documentation; currently there is none.
868 # Returns: a list of HotpluggableCPU objects.
874 # For pseries machine type started with -smp 2,cores=2,maxcpus=4 -cpu POWER8:
876 # -> { "execute": "query-hotpluggable-cpus" }
878 # { "props": { "core": 8 }, "type": "POWER8-spapr-cpu-core",
879 # "vcpus-count": 1 },
880 # { "props": { "core": 0 }, "type": "POWER8-spapr-cpu-core",
881 # "vcpus-count": 1, "qom-path": "/machine/unattached/device[0]"}
884 # For pc machine type started with -smp 1,maxcpus=2:
886 # -> { "execute": "query-hotpluggable-cpus" }
889 # "type": "qemu64-x86_64-cpu", "vcpus-count": 1,
890 # "props": {"core-id": 0, "socket-id": 1, "thread-id": 0}
893 # "qom-path": "/machine/unattached/device[0]",
894 # "type": "qemu64-x86_64-cpu", "vcpus-count": 1,
895 # "props": {"core-id": 0, "socket-id": 0, "thread-id": 0}
899 # For s390x-virtio-ccw machine type started with -smp 1,maxcpus=2 -cpu qemu
902 # -> { "execute": "query-hotpluggable-cpus" }
905 # "type": "qemu-s390x-cpu", "vcpus-count": 1,
906 # "props": { "core-id": 1 }
909 # "qom-path": "/machine/unattached/device[0]",
910 # "type": "qemu-s390x-cpu", "vcpus-count": 1,
911 # "props": { "core-id": 0 }
916 { 'command': 'query-hotpluggable-cpus', 'returns': ['HotpluggableCPU'],
917 'allow-preconfig': true }
922 # Runtime equivalent of '-numa' CLI option, available at
923 # preconfigure stage to configure numa mapping before initializing
928 { 'command': 'set-numa-node', 'boxed': true,
929 'data': 'NumaOptions',
930 'allow-preconfig': true