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.
187 # It is recommended to use @query-cpus-fast instead of this command to
188 # avoid the vCPU interruption.
190 # Returns: a list of @CpuInfo for each virtual CPU
196 # -> { "execute": "query-cpus" }
202 # "qom_path":"/machine/unattached/device[0]",
211 # "qom_path":"/machine/unattached/device[2]",
219 # Notes: This interface is deprecated (since 2.12.0), and it is strongly
220 # recommended that you avoid using it. Use @query-cpus-fast to
221 # obtain information about virtual CPUs.
224 { 'command': 'query-cpus', 'returns': ['CpuInfo'] }
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; deprecated since 3.0.0 in favor
243 # @target: the QEMU system emulation target, which determines which
244 # additional fields will be listed (since 3.0)
249 { 'union' : 'CpuInfoFast',
250 'base' : { 'cpu-index' : 'int',
253 '*props' : 'CpuInstanceProperties',
254 'arch' : 'CpuInfoArch',
255 'target' : 'SysEmuTarget' },
256 'discriminator' : 'target',
257 'data' : { 's390x' : 'CpuInfoS390' } }
262 # Returns information about all virtual CPUs. This command does not
263 # incur a performance penalty and should be used in production
264 # instead of query-cpus.
266 # Returns: list of @CpuInfoFast
272 # -> { "execute": "query-cpus-fast" }
275 # "thread-id": 25627,
281 # "qom-path": "/machine/unattached/device[0]",
287 # "thread-id": 25628,
293 # "qom-path": "/machine/unattached/device[2]",
301 { 'command': 'query-cpus-fast', 'returns': [ 'CpuInfoFast' ] }
306 # Adds CPU with specified ID.
308 # @id: ID of CPU to be created, valid values [0..max_cpus)
310 # Returns: Nothing on success
314 # Note: This command is deprecated. The `device_add` command should be
315 # used instead. See the `query-hotpluggable-cpus` command for
320 # -> { "execute": "cpu-add", "arguments": { "id": 2 } }
321 # <- { "return": {} }
324 { 'command': 'cpu-add', 'data': {'id': 'int'} }
329 # Information describing a machine.
331 # @name: the name of the machine
333 # @alias: an alias for the machine name
335 # @is-default: whether the machine is default
337 # @cpu-max: maximum number of CPUs supported by the machine type
340 # @hotpluggable-cpus: cpu hotplug via -device is supported (since 2.7.0)
342 # @numa-mem-supported: true if '-numa node,mem' option is supported by
343 # the machine type and false otherwise (since 4.1)
345 # @deprecated: if true, the machine type is deprecated and may be removed
346 # in future versions of QEMU according to the QEMU deprecation
347 # policy (since 4.1.0)
349 # @default-cpu-type: default CPU model typename if none is requested via
350 # the -cpu argument. (since 4.2)
354 { 'struct': 'MachineInfo',
355 'data': { 'name': 'str', '*alias': 'str',
356 '*is-default': 'bool', 'cpu-max': 'int',
357 'hotpluggable-cpus': 'bool', 'numa-mem-supported': 'bool',
358 'deprecated': 'bool', '*default-cpu-type': 'str' } }
363 # Return a list of supported machines
365 # Returns: a list of MachineInfo
369 { 'command': 'query-machines', 'returns': ['MachineInfo'] }
372 # @CurrentMachineParams:
374 # Information describing the running machine parameters.
376 # @wakeup-suspend-support: true if the machine supports wake up from
381 { 'struct': 'CurrentMachineParams',
382 'data': { 'wakeup-suspend-support': 'bool'} }
385 # @query-current-machine:
387 # Return information on the current virtual machine.
389 # Returns: CurrentMachineParams
393 { 'command': 'query-current-machine', 'returns': 'CurrentMachineParams' }
398 # Information describing the QEMU target.
400 # @arch: the target architecture
404 { 'struct': 'TargetInfo',
405 'data': { 'arch': 'SysEmuTarget' } }
410 # Return information about the target for this QEMU
412 # Returns: TargetInfo
416 { 'command': 'query-target', 'returns': 'TargetInfo' }
421 # @node: NUMA nodes configuration
423 # @dist: NUMA distance configuration (since 2.10)
425 # @cpu: property based CPU(s) to node mapping (Since: 2.10)
427 # @hmat-lb: memory latency and bandwidth information (Since: 5.0)
429 # @hmat-cache: memory side cache information (Since: 5.0)
433 { 'enum': 'NumaOptionsType',
434 'data': [ 'node', 'dist', 'cpu', 'hmat-lb', 'hmat-cache' ] }
439 # A discriminated record of NUMA options. (for OptsVisitor)
443 { 'union': 'NumaOptions',
444 'base': { 'type': 'NumaOptionsType' },
445 'discriminator': 'type',
447 'node': 'NumaNodeOptions',
448 'dist': 'NumaDistOptions',
449 'cpu': 'NumaCpuOptions',
450 'hmat-lb': 'NumaHmatLBOptions',
451 'hmat-cache': 'NumaHmatCacheOptions' }}
456 # Create a guest NUMA node. (for OptsVisitor)
458 # @nodeid: NUMA node ID (increase by 1 from 0 if omitted)
460 # @cpus: VCPUs belonging to this node (assign VCPUS round-robin
463 # @mem: memory size of this node; mutually exclusive with @memdev.
464 # Equally divide total memory among nodes if both @mem and @memdev are
467 # @memdev: memory backend object. If specified for one node,
468 # it must be specified for all nodes.
470 # @initiator: defined in ACPI 6.3 Chapter 5.2.27.3 Table 5-145,
471 # points to the nodeid which has the memory controller
472 # responsible for this NUMA node. This field provides
473 # additional information as to the initiator node that
474 # is closest (as in directly attached) to this node, and
475 # therefore has the best performance (since 5.0)
479 { 'struct': 'NumaNodeOptions',
485 '*initiator': 'uint16' }}
490 # Set the distance between 2 NUMA nodes.
492 # @src: source NUMA node.
494 # @dst: destination NUMA node.
496 # @val: NUMA distance from source node to destination node.
497 # When a node is unreachable from another node, set the distance
498 # between them to 255.
502 { 'struct': 'NumaDistOptions',
511 # A X86 32-bit register
515 { 'enum': 'X86CPURegister32',
516 'data': [ 'EAX', 'EBX', 'ECX', 'EDX', 'ESP', 'EBP', 'ESI', 'EDI' ] }
519 # @X86CPUFeatureWordInfo:
521 # Information about a X86 CPU feature word
523 # @cpuid-input-eax: Input EAX value for CPUID instruction for that feature word
525 # @cpuid-input-ecx: Input ECX value for CPUID instruction for that
528 # @cpuid-register: Output register containing the feature bits
530 # @features: value of output register, containing the feature bits
534 { 'struct': 'X86CPUFeatureWordInfo',
535 'data': { 'cpuid-input-eax': 'int',
536 '*cpuid-input-ecx': 'int',
537 'cpuid-register': 'X86CPURegister32',
538 'features': 'int' } }
543 # Not used by QMP; hack to let us use X86CPUFeatureWordInfoList internally
547 { 'struct': 'DummyForceArrays',
548 'data': { 'unused': ['X86CPUFeatureWordInfo'] } }
553 # Option "-numa cpu" overrides default cpu to node mapping.
554 # It accepts the same set of cpu properties as returned by
555 # query-hotpluggable-cpus[].props, where node-id could be used to
556 # override default node mapping.
560 { 'struct': 'NumaCpuOptions',
561 'base': 'CpuInstanceProperties',
565 # @HmatLBMemoryHierarchy:
567 # The memory hierarchy in the System Locality Latency and Bandwidth
568 # Information Structure of HMAT (Heterogeneous Memory Attribute Table)
570 # For more information about @HmatLBMemoryHierarchy, see chapter
571 # 5.2.27.4: Table 5-146: Field "Flags" of ACPI 6.3 spec.
573 # @memory: the structure represents the memory performance
575 # @first-level: first level of memory side cache
577 # @second-level: second level of memory side cache
579 # @third-level: third level of memory side cache
583 { 'enum': 'HmatLBMemoryHierarchy',
584 'data': [ 'memory', 'first-level', 'second-level', 'third-level' ] }
589 # Data type in the System Locality Latency and Bandwidth
590 # Information Structure of HMAT (Heterogeneous Memory Attribute Table)
592 # For more information about @HmatLBDataType, see chapter
593 # 5.2.27.4: Table 5-146: Field "Data Type" of ACPI 6.3 spec.
595 # @access-latency: access latency (nanoseconds)
597 # @read-latency: read latency (nanoseconds)
599 # @write-latency: write latency (nanoseconds)
601 # @access-bandwidth: access bandwidth (Bytes per second)
603 # @read-bandwidth: read bandwidth (Bytes per second)
605 # @write-bandwidth: write bandwidth (Bytes per second)
609 { 'enum': 'HmatLBDataType',
610 'data': [ 'access-latency', 'read-latency', 'write-latency',
611 'access-bandwidth', 'read-bandwidth', 'write-bandwidth' ] }
614 # @NumaHmatLBOptions:
616 # Set the system locality latency and bandwidth information
617 # between Initiator and Target proximity Domains.
619 # For more information about @NumaHmatLBOptions, see chapter
620 # 5.2.27.4: Table 5-146 of ACPI 6.3 spec.
622 # @initiator: the Initiator Proximity Domain.
624 # @target: the Target Proximity Domain.
626 # @hierarchy: the Memory Hierarchy. Indicates the performance
627 # of memory or side cache.
629 # @data-type: presents the type of data, access/read/write
630 # latency or hit latency.
632 # @latency: the value of latency from @initiator to @target
633 # proximity domain, the latency unit is "ns(nanosecond)".
635 # @bandwidth: the value of bandwidth between @initiator and @target
636 # proximity domain, the bandwidth unit is
637 # "Bytes per second".
641 { 'struct': 'NumaHmatLBOptions',
643 'initiator': 'uint16',
645 'hierarchy': 'HmatLBMemoryHierarchy',
646 'data-type': 'HmatLBDataType',
647 '*latency': 'uint64',
648 '*bandwidth': 'size' }}
651 # @HmatCacheAssociativity:
653 # Cache associativity in the Memory Side Cache Information Structure
656 # For more information of @HmatCacheAssociativity, see chapter
657 # 5.2.27.5: Table 5-147 of ACPI 6.3 spec.
659 # @none: None (no memory side cache in this proximity domain,
660 # or cache associativity unknown)
662 # @direct: Direct Mapped
664 # @complex: Complex Cache Indexing (implementation specific)
668 { 'enum': 'HmatCacheAssociativity',
669 'data': [ 'none', 'direct', 'complex' ] }
672 # @HmatCacheWritePolicy:
674 # Cache write policy in the Memory Side Cache Information Structure
677 # For more information of @HmatCacheWritePolicy, see chapter
678 # 5.2.27.5: Table 5-147: Field "Cache Attributes" of ACPI 6.3 spec.
680 # @none: None (no memory side cache in this proximity domain,
681 # or cache write policy unknown)
683 # @write-back: Write Back (WB)
685 # @write-through: Write Through (WT)
689 { 'enum': 'HmatCacheWritePolicy',
690 'data': [ 'none', 'write-back', 'write-through' ] }
693 # @NumaHmatCacheOptions:
695 # Set the memory side cache information for a given memory domain.
697 # For more information of @NumaHmatCacheOptions, see chapter
698 # 5.2.27.5: Table 5-147: Field "Cache Attributes" of ACPI 6.3 spec.
700 # @node-id: the memory proximity domain to which the memory belongs.
702 # @size: the size of memory side cache in bytes.
704 # @level: the cache level described in this structure.
706 # @associativity: the cache associativity,
707 # none/direct-mapped/complex(complex cache indexing).
709 # @policy: the write policy, none/write-back/write-through.
711 # @line: the cache Line size in bytes.
715 { 'struct': 'NumaHmatCacheOptions',
720 'associativity': 'HmatCacheAssociativity',
721 'policy': 'HmatCacheWritePolicy',
727 # Host memory policy types
729 # @default: restore default policy, remove any nondefault policy
731 # @preferred: set the preferred host nodes for allocation
733 # @bind: a strict policy that restricts memory allocation to the
734 # host nodes specified
736 # @interleave: memory allocations are interleaved across the set
737 # of host nodes specified
741 { 'enum': 'HostMemPolicy',
742 'data': [ 'default', 'preferred', 'bind', 'interleave' ] }
747 # Information about memory backend
749 # @id: backend's ID if backend has 'id' property (since 2.9)
751 # @size: memory backend size
753 # @merge: enables or disables memory merge support
755 # @dump: includes memory backend's memory in a core dump or not
757 # @prealloc: enables or disables memory preallocation
759 # @host-nodes: host nodes for its memory policy
761 # @policy: memory policy of memory backend
765 { 'struct': 'Memdev',
772 'host-nodes': ['uint16'],
773 'policy': 'HostMemPolicy' }}
778 # Returns information for all memory backends.
780 # Returns: a list of @Memdev.
786 # -> { "execute": "query-memdev" }
794 # "host-nodes": [0, 1],
802 # "host-nodes": [2, 3],
803 # "policy": "preferred"
809 { 'command': 'query-memdev', 'returns': ['Memdev'], 'allow-preconfig': true }
812 # @CpuInstanceProperties:
814 # List of properties to be used for hotplugging a CPU instance,
815 # it should be passed by management with device_add command when
816 # a CPU is being hotplugged.
818 # @node-id: NUMA node ID the CPU belongs to
819 # @socket-id: socket number within node/board the CPU belongs to
820 # @die-id: die number within node/board the CPU belongs to (Since 4.1)
821 # @core-id: core number within die the CPU belongs to# @thread-id: thread number within core the CPU belongs to
823 # Note: currently there are 5 properties that could be present
824 # but management should be prepared to pass through other
825 # properties with device_add command to allow for future
826 # interface extension. This also requires the filed names to be kept in
827 # sync with the properties passed to -device/device_add.
831 { 'struct': 'CpuInstanceProperties',
832 'data': { '*node-id': 'int',
843 # @type: CPU object type for usage with device_add command
844 # @props: list of properties to be used for hotplugging CPU
845 # @vcpus-count: number of logical VCPU threads @HotpluggableCPU provides
846 # @qom-path: link to existing CPU object if CPU is present or
847 # omitted if CPU is not present.
851 { 'struct': 'HotpluggableCPU',
852 'data': { 'type': 'str',
853 'vcpus-count': 'int',
854 'props': 'CpuInstanceProperties',
860 # @query-hotpluggable-cpus:
862 # TODO: Better documentation; currently there is none.
864 # Returns: a list of HotpluggableCPU objects.
870 # For pseries machine type started with -smp 2,cores=2,maxcpus=4 -cpu POWER8:
872 # -> { "execute": "query-hotpluggable-cpus" }
874 # { "props": { "core": 8 }, "type": "POWER8-spapr-cpu-core",
875 # "vcpus-count": 1 },
876 # { "props": { "core": 0 }, "type": "POWER8-spapr-cpu-core",
877 # "vcpus-count": 1, "qom-path": "/machine/unattached/device[0]"}
880 # For pc machine type started with -smp 1,maxcpus=2:
882 # -> { "execute": "query-hotpluggable-cpus" }
885 # "type": "qemu64-x86_64-cpu", "vcpus-count": 1,
886 # "props": {"core-id": 0, "socket-id": 1, "thread-id": 0}
889 # "qom-path": "/machine/unattached/device[0]",
890 # "type": "qemu64-x86_64-cpu", "vcpus-count": 1,
891 # "props": {"core-id": 0, "socket-id": 0, "thread-id": 0}
895 # For s390x-virtio-ccw machine type started with -smp 1,maxcpus=2 -cpu qemu
898 # -> { "execute": "query-hotpluggable-cpus" }
901 # "type": "qemu-s390x-cpu", "vcpus-count": 1,
902 # "props": { "core-id": 1 }
905 # "qom-path": "/machine/unattached/device[0]",
906 # "type": "qemu-s390x-cpu", "vcpus-count": 1,
907 # "props": { "core-id": 0 }
912 { 'command': 'query-hotpluggable-cpus', 'returns': ['HotpluggableCPU'],
913 'allow-preconfig': true }
918 # Runtime equivalent of '-numa' CLI option, available at
919 # preconfigure stage to configure numa mapping before initializing
924 { 'command': 'set-numa-node', 'boxed': true,
925 'data': 'NumaOptions',
926 'allow-preconfig': true