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
22 # Notes: The resulting QMP strings can be appended to the "qemu-system-"
23 # prefix to produce the corresponding QEMU executable name. This
24 # is true even for "qemu-system-x86_64".
28 { 'enum' : 'SysEmuTarget',
29 'data' : [ 'aarch64', 'alpha', 'arm', 'avr', 'cris', 'hppa', 'i386', 'lm32',
30 'm68k', 'microblaze', 'microblazeel', 'mips', 'mips64',
31 'mips64el', 'mipsel', 'moxie', 'nios2', 'or1k', 'ppc',
32 'ppc64', 'riscv32', 'riscv64', 'rx', 's390x', 'sh4',
33 'sh4eb', 'sparc', 'sparc64', 'tricore', 'unicore32',
34 'x86_64', 'xtensa', 'xtensaeb' ] }
39 # An enumeration of cpu types that enable additional information during
40 # @query-cpus and @query-cpus-fast.
48 { 'enum': 'CpuInfoArch',
49 'data': ['x86', 'sparc', 'ppc', 'mips', 'tricore', 's390', 'riscv', 'other' ] }
54 # Information about a virtual CPU
56 # @CPU: the index of the virtual CPU
58 # @current: this only exists for backwards compatibility and should be ignored
60 # @halted: true if the virtual CPU is in the halt state. Halt usually refers
61 # to a processor specific low power mode.
63 # @qom_path: path to the CPU object in the QOM tree (since 2.4)
65 # @thread_id: ID of the underlying host thread
67 # @props: properties describing to which node/socket/core/thread
68 # virtual CPU belongs to, provided if supported by board (since 2.10)
70 # @arch: architecture of the cpu, which determines which additional fields
71 # will be listed (since 2.6)
75 # Notes: @halted is a transient state that changes frequently. By the time the
76 # data is sent to the client, the guest may no longer be halted.
79 'base': {'CPU': 'int', 'current': 'bool', 'halted': 'bool',
80 'qom_path': 'str', 'thread_id': 'int',
81 '*props': 'CpuInstanceProperties', 'arch': 'CpuInfoArch' },
82 'discriminator': 'arch',
83 'data': { 'x86': 'CpuInfoX86',
84 'sparc': 'CpuInfoSPARC',
86 'mips': 'CpuInfoMIPS',
87 'tricore': 'CpuInfoTricore',
88 's390': 'CpuInfoS390',
89 'riscv': 'CpuInfoRISCV' } }
94 # Additional information about a virtual i386 or x86_64 CPU
96 # @pc: the 64-bit instruction pointer
100 { 'struct': 'CpuInfoX86', 'data': { 'pc': 'int' } }
105 # Additional information about a virtual SPARC CPU
107 # @pc: the PC component of the instruction pointer
109 # @npc: the NPC component of the instruction pointer
113 { 'struct': 'CpuInfoSPARC', 'data': { 'pc': 'int', 'npc': 'int' } }
118 # Additional information about a virtual PPC CPU
120 # @nip: the instruction pointer
124 { 'struct': 'CpuInfoPPC', 'data': { 'nip': 'int' } }
129 # Additional information about a virtual MIPS CPU
131 # @PC: the instruction pointer
135 { 'struct': 'CpuInfoMIPS', 'data': { 'PC': 'int' } }
140 # Additional information about a virtual Tricore CPU
142 # @PC: the instruction pointer
146 { 'struct': 'CpuInfoTricore', 'data': { 'PC': 'int' } }
151 # Additional information about a virtual RISCV CPU
153 # @pc: the instruction pointer
157 { 'struct': 'CpuInfoRISCV', 'data': { 'pc': 'int' } }
162 # An enumeration of cpu states that can be assumed by a virtual
167 { 'enum': 'CpuS390State',
168 'prefix': 'S390_CPU_STATE',
169 'data': [ 'uninitialized', 'stopped', 'check-stop', 'operating', 'load' ] }
174 # Additional information about a virtual S390 CPU
176 # @cpu-state: the virtual CPU's state
180 { 'struct': 'CpuInfoS390', 'data': { 'cpu-state': 'CpuS390State' } }
185 # Returns a list of information about each virtual CPU.
187 # This command causes vCPU threads to exit to userspace, which causes
188 # a small interruption to guest CPU execution. This will have a negative
189 # impact on realtime guests and other latency sensitive guest workloads.
192 # @deprecated: This command is deprecated, because it interferes with
193 # the guest. Use 'query-cpus-fast' instead to avoid the vCPU
196 # Returns: a list of @CpuInfo for each virtual CPU
202 # -> { "execute": "query-cpus" }
208 # "qom_path":"/machine/unattached/device[0]",
217 # "qom_path":"/machine/unattached/device[2]",
226 { 'command': 'query-cpus', 'returns': ['CpuInfo'],
227 'features': [ 'deprecated' ] }
232 # Information about a virtual CPU
234 # @cpu-index: index of the virtual CPU
236 # @qom-path: path to the CPU object in the QOM tree
238 # @thread-id: ID of the underlying host thread
240 # @props: properties describing to which node/socket/core/thread
241 # virtual CPU belongs to, provided if supported by board
243 # @arch: base architecture of the cpu
245 # @target: the QEMU system emulation target, which determines which
246 # additional fields will be listed (since 3.0)
249 # @deprecated: Member @arch is deprecated. Use @target instead.
254 { 'union' : 'CpuInfoFast',
255 'base' : { 'cpu-index' : 'int',
258 '*props' : 'CpuInstanceProperties',
259 'arch' : { 'type': 'CpuInfoArch',
260 'features': [ 'deprecated' ] },
261 'target' : 'SysEmuTarget' },
262 'discriminator' : 'target',
263 'data' : { 's390x' : 'CpuInfoS390' } }
268 # Returns information about all virtual CPUs. This command does not
269 # incur a performance penalty and should be used in production
270 # instead of query-cpus.
272 # Returns: list of @CpuInfoFast
278 # -> { "execute": "query-cpus-fast" }
281 # "thread-id": 25627,
287 # "qom-path": "/machine/unattached/device[0]",
293 # "thread-id": 25628,
299 # "qom-path": "/machine/unattached/device[2]",
307 { 'command': 'query-cpus-fast', 'returns': [ 'CpuInfoFast' ] }
312 # Adds CPU with specified ID.
314 # @id: ID of CPU to be created, valid values [0..max_cpus)
317 # @deprecated: This command is deprecated. Use `device_add` instead.
318 # See the `query-hotpluggable-cpus` command for details.
320 # Returns: Nothing on success
326 # -> { "execute": "cpu-add", "arguments": { "id": 2 } }
327 # <- { "return": {} }
330 { 'command': 'cpu-add', 'data': {'id': 'int'},
331 'features': [ 'deprecated' ] }
336 # Information describing a machine.
338 # @name: the name of the machine
340 # @alias: an alias for the machine name
342 # @is-default: whether the machine is default
344 # @cpu-max: maximum number of CPUs supported by the machine type
347 # @hotpluggable-cpus: cpu hotplug via -device is supported (since 2.7.0)
349 # @numa-mem-supported: true if '-numa node,mem' option is supported by
350 # the machine type and false otherwise (since 4.1)
352 # @deprecated: if true, the machine type is deprecated and may be removed
353 # in future versions of QEMU according to the QEMU deprecation
354 # policy (since 4.1.0)
356 # @default-cpu-type: default CPU model typename if none is requested via
357 # the -cpu argument. (since 4.2)
361 { 'struct': 'MachineInfo',
362 'data': { 'name': 'str', '*alias': 'str',
363 '*is-default': 'bool', 'cpu-max': 'int',
364 'hotpluggable-cpus': 'bool', 'numa-mem-supported': 'bool',
365 'deprecated': 'bool', '*default-cpu-type': 'str' } }
370 # Return a list of supported machines
372 # Returns: a list of MachineInfo
376 { 'command': 'query-machines', 'returns': ['MachineInfo'] }
379 # @CurrentMachineParams:
381 # Information describing the running machine parameters.
383 # @wakeup-suspend-support: true if the machine supports wake up from
388 { 'struct': 'CurrentMachineParams',
389 'data': { 'wakeup-suspend-support': 'bool'} }
392 # @query-current-machine:
394 # Return information on the current virtual machine.
396 # Returns: CurrentMachineParams
400 { 'command': 'query-current-machine', 'returns': 'CurrentMachineParams' }
405 # Information describing the QEMU target.
407 # @arch: the target architecture
411 { 'struct': 'TargetInfo',
412 'data': { 'arch': 'SysEmuTarget' } }
417 # Return information about the target for this QEMU
419 # Returns: TargetInfo
423 { 'command': 'query-target', 'returns': 'TargetInfo' }
428 # @node: NUMA nodes configuration
430 # @dist: NUMA distance configuration (since 2.10)
432 # @cpu: property based CPU(s) to node mapping (Since: 2.10)
434 # @hmat-lb: memory latency and bandwidth information (Since: 5.0)
436 # @hmat-cache: memory side cache information (Since: 5.0)
440 { 'enum': 'NumaOptionsType',
441 'data': [ 'node', 'dist', 'cpu', 'hmat-lb', 'hmat-cache' ] }
446 # A discriminated record of NUMA options. (for OptsVisitor)
450 { 'union': 'NumaOptions',
451 'base': { 'type': 'NumaOptionsType' },
452 'discriminator': 'type',
454 'node': 'NumaNodeOptions',
455 'dist': 'NumaDistOptions',
456 'cpu': 'NumaCpuOptions',
457 'hmat-lb': 'NumaHmatLBOptions',
458 'hmat-cache': 'NumaHmatCacheOptions' }}
463 # Create a guest NUMA node. (for OptsVisitor)
465 # @nodeid: NUMA node ID (increase by 1 from 0 if omitted)
467 # @cpus: VCPUs belonging to this node (assign VCPUS round-robin
470 # @mem: memory size of this node; mutually exclusive with @memdev.
471 # Equally divide total memory among nodes if both @mem and @memdev are
474 # @memdev: memory backend object. If specified for one node,
475 # it must be specified for all nodes.
477 # @initiator: defined in ACPI 6.3 Chapter 5.2.27.3 Table 5-145,
478 # points to the nodeid which has the memory controller
479 # responsible for this NUMA node. This field provides
480 # additional information as to the initiator node that
481 # is closest (as in directly attached) to this node, and
482 # therefore has the best performance (since 5.0)
486 { 'struct': 'NumaNodeOptions',
492 '*initiator': 'uint16' }}
497 # Set the distance between 2 NUMA nodes.
499 # @src: source NUMA node.
501 # @dst: destination NUMA node.
503 # @val: NUMA distance from source node to destination node.
504 # When a node is unreachable from another node, set the distance
505 # between them to 255.
509 { 'struct': 'NumaDistOptions',
518 # A X86 32-bit register
522 { 'enum': 'X86CPURegister32',
523 'data': [ 'EAX', 'EBX', 'ECX', 'EDX', 'ESP', 'EBP', 'ESI', 'EDI' ] }
526 # @X86CPUFeatureWordInfo:
528 # Information about a X86 CPU feature word
530 # @cpuid-input-eax: Input EAX value for CPUID instruction for that feature word
532 # @cpuid-input-ecx: Input ECX value for CPUID instruction for that
535 # @cpuid-register: Output register containing the feature bits
537 # @features: value of output register, containing the feature bits
541 { 'struct': 'X86CPUFeatureWordInfo',
542 'data': { 'cpuid-input-eax': 'int',
543 '*cpuid-input-ecx': 'int',
544 'cpuid-register': 'X86CPURegister32',
545 'features': 'int' } }
550 # Not used by QMP; hack to let us use X86CPUFeatureWordInfoList internally
554 { 'struct': 'DummyForceArrays',
555 'data': { 'unused': ['X86CPUFeatureWordInfo'] } }
560 # Option "-numa cpu" overrides default cpu to node mapping.
561 # It accepts the same set of cpu properties as returned by
562 # query-hotpluggable-cpus[].props, where node-id could be used to
563 # override default node mapping.
567 { 'struct': 'NumaCpuOptions',
568 'base': 'CpuInstanceProperties',
572 # @HmatLBMemoryHierarchy:
574 # The memory hierarchy in the System Locality Latency and Bandwidth
575 # Information Structure of HMAT (Heterogeneous Memory Attribute Table)
577 # For more information about @HmatLBMemoryHierarchy, see chapter
578 # 5.2.27.4: Table 5-146: Field "Flags" of ACPI 6.3 spec.
580 # @memory: the structure represents the memory performance
582 # @first-level: first level of memory side cache
584 # @second-level: second level of memory side cache
586 # @third-level: third level of memory side cache
590 { 'enum': 'HmatLBMemoryHierarchy',
591 'data': [ 'memory', 'first-level', 'second-level', 'third-level' ] }
596 # Data type in the System Locality Latency and Bandwidth
597 # Information Structure of HMAT (Heterogeneous Memory Attribute Table)
599 # For more information about @HmatLBDataType, see chapter
600 # 5.2.27.4: Table 5-146: Field "Data Type" of ACPI 6.3 spec.
602 # @access-latency: access latency (nanoseconds)
604 # @read-latency: read latency (nanoseconds)
606 # @write-latency: write latency (nanoseconds)
608 # @access-bandwidth: access bandwidth (Bytes per second)
610 # @read-bandwidth: read bandwidth (Bytes per second)
612 # @write-bandwidth: write bandwidth (Bytes per second)
616 { 'enum': 'HmatLBDataType',
617 'data': [ 'access-latency', 'read-latency', 'write-latency',
618 'access-bandwidth', 'read-bandwidth', 'write-bandwidth' ] }
621 # @NumaHmatLBOptions:
623 # Set the system locality latency and bandwidth information
624 # between Initiator and Target proximity Domains.
626 # For more information about @NumaHmatLBOptions, see chapter
627 # 5.2.27.4: Table 5-146 of ACPI 6.3 spec.
629 # @initiator: the Initiator Proximity Domain.
631 # @target: the Target Proximity Domain.
633 # @hierarchy: the Memory Hierarchy. Indicates the performance
634 # of memory or side cache.
636 # @data-type: presents the type of data, access/read/write
637 # latency or hit latency.
639 # @latency: the value of latency from @initiator to @target
640 # proximity domain, the latency unit is "ns(nanosecond)".
642 # @bandwidth: the value of bandwidth between @initiator and @target
643 # proximity domain, the bandwidth unit is
644 # "Bytes per second".
648 { 'struct': 'NumaHmatLBOptions',
650 'initiator': 'uint16',
652 'hierarchy': 'HmatLBMemoryHierarchy',
653 'data-type': 'HmatLBDataType',
654 '*latency': 'uint64',
655 '*bandwidth': 'size' }}
658 # @HmatCacheAssociativity:
660 # Cache associativity in the Memory Side Cache Information Structure
663 # For more information of @HmatCacheAssociativity, see chapter
664 # 5.2.27.5: Table 5-147 of ACPI 6.3 spec.
666 # @none: None (no memory side cache in this proximity domain,
667 # or cache associativity unknown)
669 # @direct: Direct Mapped
671 # @complex: Complex Cache Indexing (implementation specific)
675 { 'enum': 'HmatCacheAssociativity',
676 'data': [ 'none', 'direct', 'complex' ] }
679 # @HmatCacheWritePolicy:
681 # Cache write policy in the Memory Side Cache Information Structure
684 # For more information of @HmatCacheWritePolicy, see chapter
685 # 5.2.27.5: Table 5-147: Field "Cache Attributes" of ACPI 6.3 spec.
687 # @none: None (no memory side cache in this proximity domain,
688 # or cache write policy unknown)
690 # @write-back: Write Back (WB)
692 # @write-through: Write Through (WT)
696 { 'enum': 'HmatCacheWritePolicy',
697 'data': [ 'none', 'write-back', 'write-through' ] }
700 # @NumaHmatCacheOptions:
702 # Set the memory side cache information for a given memory domain.
704 # For more information of @NumaHmatCacheOptions, see chapter
705 # 5.2.27.5: Table 5-147: Field "Cache Attributes" of ACPI 6.3 spec.
707 # @node-id: the memory proximity domain to which the memory belongs.
709 # @size: the size of memory side cache in bytes.
711 # @level: the cache level described in this structure.
713 # @associativity: the cache associativity,
714 # none/direct-mapped/complex(complex cache indexing).
716 # @policy: the write policy, none/write-back/write-through.
718 # @line: the cache Line size in bytes.
722 { 'struct': 'NumaHmatCacheOptions',
727 'associativity': 'HmatCacheAssociativity',
728 'policy': 'HmatCacheWritePolicy',
734 # Host memory policy types
736 # @default: restore default policy, remove any nondefault policy
738 # @preferred: set the preferred host nodes for allocation
740 # @bind: a strict policy that restricts memory allocation to the
741 # host nodes specified
743 # @interleave: memory allocations are interleaved across the set
744 # of host nodes specified
748 { 'enum': 'HostMemPolicy',
749 'data': [ 'default', 'preferred', 'bind', 'interleave' ] }
754 # Information about memory backend
756 # @id: backend's ID if backend has 'id' property (since 2.9)
758 # @size: memory backend size
760 # @merge: enables or disables memory merge support
762 # @dump: includes memory backend's memory in a core dump or not
764 # @prealloc: enables or disables memory preallocation
766 # @host-nodes: host nodes for its memory policy
768 # @policy: memory policy of memory backend
772 { 'struct': 'Memdev',
779 'host-nodes': ['uint16'],
780 'policy': 'HostMemPolicy' }}
785 # Returns information for all memory backends.
787 # Returns: a list of @Memdev.
793 # -> { "execute": "query-memdev" }
801 # "host-nodes": [0, 1],
809 # "host-nodes": [2, 3],
810 # "policy": "preferred"
816 { 'command': 'query-memdev', 'returns': ['Memdev'], 'allow-preconfig': true }
819 # @CpuInstanceProperties:
821 # List of properties to be used for hotplugging a CPU instance,
822 # it should be passed by management with device_add command when
823 # a CPU is being hotplugged.
825 # @node-id: NUMA node ID the CPU belongs to
826 # @socket-id: socket number within node/board the CPU belongs to
827 # @die-id: die number within node/board the CPU belongs to (Since 4.1)
828 # @core-id: core number within die the CPU belongs to# @thread-id: thread number within core the CPU belongs to
830 # Note: currently there are 5 properties that could be present
831 # but management should be prepared to pass through other
832 # properties with device_add command to allow for future
833 # interface extension. This also requires the filed names to be kept in
834 # sync with the properties passed to -device/device_add.
838 { 'struct': 'CpuInstanceProperties',
839 'data': { '*node-id': 'int',
850 # @type: CPU object type for usage with device_add command
851 # @props: list of properties to be used for hotplugging CPU
852 # @vcpus-count: number of logical VCPU threads @HotpluggableCPU provides
853 # @qom-path: link to existing CPU object if CPU is present or
854 # omitted if CPU is not present.
858 { 'struct': 'HotpluggableCPU',
859 'data': { 'type': 'str',
860 'vcpus-count': 'int',
861 'props': 'CpuInstanceProperties',
867 # @query-hotpluggable-cpus:
869 # TODO: Better documentation; currently there is none.
871 # Returns: a list of HotpluggableCPU objects.
877 # For pseries machine type started with -smp 2,cores=2,maxcpus=4 -cpu POWER8:
879 # -> { "execute": "query-hotpluggable-cpus" }
881 # { "props": { "core": 8 }, "type": "POWER8-spapr-cpu-core",
882 # "vcpus-count": 1 },
883 # { "props": { "core": 0 }, "type": "POWER8-spapr-cpu-core",
884 # "vcpus-count": 1, "qom-path": "/machine/unattached/device[0]"}
887 # For pc machine type started with -smp 1,maxcpus=2:
889 # -> { "execute": "query-hotpluggable-cpus" }
892 # "type": "qemu64-x86_64-cpu", "vcpus-count": 1,
893 # "props": {"core-id": 0, "socket-id": 1, "thread-id": 0}
896 # "qom-path": "/machine/unattached/device[0]",
897 # "type": "qemu64-x86_64-cpu", "vcpus-count": 1,
898 # "props": {"core-id": 0, "socket-id": 0, "thread-id": 0}
902 # For s390x-virtio-ccw machine type started with -smp 1,maxcpus=2 -cpu qemu
905 # -> { "execute": "query-hotpluggable-cpus" }
908 # "type": "qemu-s390x-cpu", "vcpus-count": 1,
909 # "props": { "core-id": 1 }
912 # "qom-path": "/machine/unattached/device[0]",
913 # "type": "qemu-s390x-cpu", "vcpus-count": 1,
914 # "props": { "core-id": 0 }
919 { 'command': 'query-hotpluggable-cpus', 'returns': ['HotpluggableCPU'],
920 'allow-preconfig': true }
925 # Runtime equivalent of '-numa' CLI option, available at
926 # preconfigure stage to configure numa mapping before initializing
931 { 'command': 'set-numa-node', 'boxed': true,
932 'data': 'NumaOptions',
933 'allow-preconfig': true