4 # This work is licensed under the terms of the GNU GPL, version 2 or later.
5 # See the COPYING file in the top-level directory.
14 # The comprehensive enumeration of QEMU system emulation ("softmmu")
15 # targets. Run "./configure --help" in the project root directory, and
16 # look for the *-softmmu targets near the "--target-list" option. The
17 # individual target constants are not documented here, for the time
23 # Notes: The resulting QMP strings can be appended to the "qemu-system-"
24 # prefix to produce the corresponding QEMU executable name. This
25 # is true even for "qemu-system-x86_64".
29 { 'enum' : 'SysEmuTarget',
30 'data' : [ 'aarch64', 'alpha', 'arm', 'avr', 'cris', 'hppa', 'i386', 'lm32',
31 'm68k', 'microblaze', 'microblazeel', 'mips', 'mips64',
32 'mips64el', 'mipsel', 'moxie', 'nios2', 'or1k', 'ppc',
33 'ppc64', 'riscv32', 'riscv64', 'rx', 's390x', 'sh4',
34 'sh4eb', 'sparc', 'sparc64', 'tricore', 'unicore32',
35 'x86_64', 'xtensa', 'xtensaeb' ] }
40 # An enumeration of cpu types that enable additional information during
41 # @query-cpus and @query-cpus-fast.
49 { 'enum': 'CpuInfoArch',
50 'data': ['x86', 'sparc', 'ppc', 'mips', 'tricore', 's390', 'riscv', 'other' ] }
55 # Information about a virtual CPU
57 # @CPU: the index of the virtual CPU
59 # @current: this only exists for backwards compatibility and should be ignored
61 # @halted: true if the virtual CPU is in the halt state. Halt usually refers
62 # to a processor specific low power mode.
64 # @qom_path: path to the CPU object in the QOM tree (since 2.4)
66 # @thread_id: ID of the underlying host thread
68 # @props: properties describing to which node/socket/core/thread
69 # virtual CPU belongs to, provided if supported by board (since 2.10)
71 # @arch: architecture of the cpu, which determines which additional fields
72 # will be listed (since 2.6)
76 # Notes: @halted is a transient state that changes frequently. By the time the
77 # data is sent to the client, the guest may no longer be halted.
80 'base': {'CPU': 'int', 'current': 'bool', 'halted': 'bool',
81 'qom_path': 'str', 'thread_id': 'int',
82 '*props': 'CpuInstanceProperties', 'arch': 'CpuInfoArch' },
83 'discriminator': 'arch',
84 'data': { 'x86': 'CpuInfoX86',
85 'sparc': 'CpuInfoSPARC',
87 'mips': 'CpuInfoMIPS',
88 'tricore': 'CpuInfoTricore',
89 's390': 'CpuInfoS390',
90 'riscv': 'CpuInfoRISCV' } }
95 # Additional information about a virtual i386 or x86_64 CPU
97 # @pc: the 64-bit instruction pointer
101 { 'struct': 'CpuInfoX86', 'data': { 'pc': 'int' } }
106 # Additional information about a virtual SPARC CPU
108 # @pc: the PC component of the instruction pointer
110 # @npc: the NPC component of the instruction pointer
114 { 'struct': 'CpuInfoSPARC', 'data': { 'pc': 'int', 'npc': 'int' } }
119 # Additional information about a virtual PPC CPU
121 # @nip: the instruction pointer
125 { 'struct': 'CpuInfoPPC', 'data': { 'nip': 'int' } }
130 # Additional information about a virtual MIPS CPU
132 # @PC: the instruction pointer
136 { 'struct': 'CpuInfoMIPS', 'data': { 'PC': 'int' } }
141 # Additional information about a virtual Tricore CPU
143 # @PC: the instruction pointer
147 { 'struct': 'CpuInfoTricore', 'data': { 'PC': 'int' } }
152 # Additional information about a virtual RISCV CPU
154 # @pc: the instruction pointer
158 { 'struct': 'CpuInfoRISCV', 'data': { 'pc': 'int' } }
163 # An enumeration of cpu states that can be assumed by a virtual
168 { 'enum': 'CpuS390State',
169 'prefix': 'S390_CPU_STATE',
170 'data': [ 'uninitialized', 'stopped', 'check-stop', 'operating', 'load' ] }
175 # Additional information about a virtual S390 CPU
177 # @cpu-state: the virtual CPU's state
181 { 'struct': 'CpuInfoS390', 'data': { 'cpu-state': 'CpuS390State' } }
186 # Returns a list of information about each virtual CPU.
188 # This command causes vCPU threads to exit to userspace, which causes
189 # a small interruption to guest CPU execution. This will have a negative
190 # impact on realtime guests and other latency sensitive guest workloads.
193 # @deprecated: This command is deprecated, because it interferes with
194 # the guest. Use 'query-cpus-fast' instead to avoid the vCPU
197 # Returns: a list of @CpuInfo for each virtual CPU
203 # -> { "execute": "query-cpus" }
209 # "qom_path":"/machine/unattached/device[0]",
218 # "qom_path":"/machine/unattached/device[2]",
227 { 'command': 'query-cpus', 'returns': ['CpuInfo'],
228 'features': [ 'deprecated' ] }
233 # Information about a virtual CPU
235 # @cpu-index: index of the virtual CPU
237 # @qom-path: path to the CPU object in the QOM tree
239 # @thread-id: ID of the underlying host thread
241 # @props: properties describing to which node/socket/core/thread
242 # virtual CPU belongs to, provided if supported by board
244 # @arch: base architecture of the cpu
246 # @target: the QEMU system emulation target, which determines which
247 # additional fields will be listed (since 3.0)
250 # @deprecated: Member @arch is deprecated. Use @target instead.
255 { 'union' : 'CpuInfoFast',
256 'base' : { 'cpu-index' : 'int',
259 '*props' : 'CpuInstanceProperties',
260 'arch' : { 'type': 'CpuInfoArch',
261 'features': [ 'deprecated' ] },
262 'target' : 'SysEmuTarget' },
263 'discriminator' : 'target',
264 'data' : { 's390x' : 'CpuInfoS390' } }
269 # Returns information about all virtual CPUs. This command does not
270 # incur a performance penalty and should be used in production
271 # instead of query-cpus.
273 # Returns: list of @CpuInfoFast
279 # -> { "execute": "query-cpus-fast" }
282 # "thread-id": 25627,
288 # "qom-path": "/machine/unattached/device[0]",
294 # "thread-id": 25628,
300 # "qom-path": "/machine/unattached/device[2]",
308 { 'command': 'query-cpus-fast', 'returns': [ 'CpuInfoFast' ] }
313 # Information describing a machine.
315 # @name: the name of the machine
317 # @alias: an alias for the machine name
319 # @is-default: whether the machine is default
321 # @cpu-max: maximum number of CPUs supported by the machine type
324 # @hotpluggable-cpus: cpu hotplug via -device is supported (since 2.7.0)
326 # @numa-mem-supported: true if '-numa node,mem' option is supported by
327 # the machine type and false otherwise (since 4.1)
329 # @deprecated: if true, the machine type is deprecated and may be removed
330 # in future versions of QEMU according to the QEMU deprecation
331 # policy (since 4.1.0)
333 # @default-cpu-type: default CPU model typename if none is requested via
334 # the -cpu argument. (since 4.2)
336 # @default-ram-id: the default ID of initial RAM memory backend (since 5.2)
340 { 'struct': 'MachineInfo',
341 'data': { 'name': 'str', '*alias': 'str',
342 '*is-default': 'bool', 'cpu-max': 'int',
343 'hotpluggable-cpus': 'bool', 'numa-mem-supported': 'bool',
344 'deprecated': 'bool', '*default-cpu-type': 'str',
345 '*default-ram-id': 'str' } }
350 # Return a list of supported machines
352 # Returns: a list of MachineInfo
356 { 'command': 'query-machines', 'returns': ['MachineInfo'] }
359 # @CurrentMachineParams:
361 # Information describing the running machine parameters.
363 # @wakeup-suspend-support: true if the machine supports wake up from
368 { 'struct': 'CurrentMachineParams',
369 'data': { 'wakeup-suspend-support': 'bool'} }
372 # @query-current-machine:
374 # Return information on the current virtual machine.
376 # Returns: CurrentMachineParams
380 { 'command': 'query-current-machine', 'returns': 'CurrentMachineParams' }
385 # Information describing the QEMU target.
387 # @arch: the target architecture
391 { 'struct': 'TargetInfo',
392 'data': { 'arch': 'SysEmuTarget' } }
397 # Return information about the target for this QEMU
399 # Returns: TargetInfo
403 { 'command': 'query-target', 'returns': 'TargetInfo' }
408 # @node: NUMA nodes configuration
410 # @dist: NUMA distance configuration (since 2.10)
412 # @cpu: property based CPU(s) to node mapping (Since: 2.10)
414 # @hmat-lb: memory latency and bandwidth information (Since: 5.0)
416 # @hmat-cache: memory side cache information (Since: 5.0)
420 { 'enum': 'NumaOptionsType',
421 'data': [ 'node', 'dist', 'cpu', 'hmat-lb', 'hmat-cache' ] }
426 # A discriminated record of NUMA options. (for OptsVisitor)
430 { 'union': 'NumaOptions',
431 'base': { 'type': 'NumaOptionsType' },
432 'discriminator': 'type',
434 'node': 'NumaNodeOptions',
435 'dist': 'NumaDistOptions',
436 'cpu': 'NumaCpuOptions',
437 'hmat-lb': 'NumaHmatLBOptions',
438 'hmat-cache': 'NumaHmatCacheOptions' }}
443 # Create a guest NUMA node. (for OptsVisitor)
445 # @nodeid: NUMA node ID (increase by 1 from 0 if omitted)
447 # @cpus: VCPUs belonging to this node (assign VCPUS round-robin
450 # @mem: memory size of this node; mutually exclusive with @memdev.
451 # Equally divide total memory among nodes if both @mem and @memdev are
454 # @memdev: memory backend object. If specified for one node,
455 # it must be specified for all nodes.
457 # @initiator: defined in ACPI 6.3 Chapter 5.2.27.3 Table 5-145,
458 # points to the nodeid which has the memory controller
459 # responsible for this NUMA node. This field provides
460 # additional information as to the initiator node that
461 # is closest (as in directly attached) to this node, and
462 # therefore has the best performance (since 5.0)
466 { 'struct': 'NumaNodeOptions',
472 '*initiator': 'uint16' }}
477 # Set the distance between 2 NUMA nodes.
479 # @src: source NUMA node.
481 # @dst: destination NUMA node.
483 # @val: NUMA distance from source node to destination node.
484 # When a node is unreachable from another node, set the distance
485 # between them to 255.
489 { 'struct': 'NumaDistOptions',
498 # A X86 32-bit register
502 { 'enum': 'X86CPURegister32',
503 'data': [ 'EAX', 'EBX', 'ECX', 'EDX', 'ESP', 'EBP', 'ESI', 'EDI' ] }
506 # @X86CPUFeatureWordInfo:
508 # Information about a X86 CPU feature word
510 # @cpuid-input-eax: Input EAX value for CPUID instruction for that feature word
512 # @cpuid-input-ecx: Input ECX value for CPUID instruction for that
515 # @cpuid-register: Output register containing the feature bits
517 # @features: value of output register, containing the feature bits
521 { 'struct': 'X86CPUFeatureWordInfo',
522 'data': { 'cpuid-input-eax': 'int',
523 '*cpuid-input-ecx': 'int',
524 'cpuid-register': 'X86CPURegister32',
525 'features': 'int' } }
530 # Not used by QMP; hack to let us use X86CPUFeatureWordInfoList internally
534 { 'struct': 'DummyForceArrays',
535 'data': { 'unused': ['X86CPUFeatureWordInfo'] } }
540 # Option "-numa cpu" overrides default cpu to node mapping.
541 # It accepts the same set of cpu properties as returned by
542 # query-hotpluggable-cpus[].props, where node-id could be used to
543 # override default node mapping.
547 { 'struct': 'NumaCpuOptions',
548 'base': 'CpuInstanceProperties',
552 # @HmatLBMemoryHierarchy:
554 # The memory hierarchy in the System Locality Latency and Bandwidth
555 # Information Structure of HMAT (Heterogeneous Memory Attribute Table)
557 # For more information about @HmatLBMemoryHierarchy, see chapter
558 # 5.2.27.4: Table 5-146: Field "Flags" of ACPI 6.3 spec.
560 # @memory: the structure represents the memory performance
562 # @first-level: first level of memory side cache
564 # @second-level: second level of memory side cache
566 # @third-level: third level of memory side cache
570 { 'enum': 'HmatLBMemoryHierarchy',
571 'data': [ 'memory', 'first-level', 'second-level', 'third-level' ] }
576 # Data type in the System Locality Latency and Bandwidth
577 # Information Structure of HMAT (Heterogeneous Memory Attribute Table)
579 # For more information about @HmatLBDataType, see chapter
580 # 5.2.27.4: Table 5-146: Field "Data Type" of ACPI 6.3 spec.
582 # @access-latency: access latency (nanoseconds)
584 # @read-latency: read latency (nanoseconds)
586 # @write-latency: write latency (nanoseconds)
588 # @access-bandwidth: access bandwidth (Bytes per second)
590 # @read-bandwidth: read bandwidth (Bytes per second)
592 # @write-bandwidth: write bandwidth (Bytes per second)
596 { 'enum': 'HmatLBDataType',
597 'data': [ 'access-latency', 'read-latency', 'write-latency',
598 'access-bandwidth', 'read-bandwidth', 'write-bandwidth' ] }
601 # @NumaHmatLBOptions:
603 # Set the system locality latency and bandwidth information
604 # between Initiator and Target proximity Domains.
606 # For more information about @NumaHmatLBOptions, see chapter
607 # 5.2.27.4: Table 5-146 of ACPI 6.3 spec.
609 # @initiator: the Initiator Proximity Domain.
611 # @target: the Target Proximity Domain.
613 # @hierarchy: the Memory Hierarchy. Indicates the performance
614 # of memory or side cache.
616 # @data-type: presents the type of data, access/read/write
617 # latency or hit latency.
619 # @latency: the value of latency from @initiator to @target
620 # proximity domain, the latency unit is "ns(nanosecond)".
622 # @bandwidth: the value of bandwidth between @initiator and @target
623 # proximity domain, the bandwidth unit is
624 # "Bytes per second".
628 { 'struct': 'NumaHmatLBOptions',
630 'initiator': 'uint16',
632 'hierarchy': 'HmatLBMemoryHierarchy',
633 'data-type': 'HmatLBDataType',
634 '*latency': 'uint64',
635 '*bandwidth': 'size' }}
638 # @HmatCacheAssociativity:
640 # Cache associativity in the Memory Side Cache Information Structure
643 # For more information of @HmatCacheAssociativity, see chapter
644 # 5.2.27.5: Table 5-147 of ACPI 6.3 spec.
646 # @none: None (no memory side cache in this proximity domain,
647 # or cache associativity unknown)
649 # @direct: Direct Mapped
651 # @complex: Complex Cache Indexing (implementation specific)
655 { 'enum': 'HmatCacheAssociativity',
656 'data': [ 'none', 'direct', 'complex' ] }
659 # @HmatCacheWritePolicy:
661 # Cache write policy in the Memory Side Cache Information Structure
664 # For more information of @HmatCacheWritePolicy, see chapter
665 # 5.2.27.5: Table 5-147: Field "Cache Attributes" of ACPI 6.3 spec.
667 # @none: None (no memory side cache in this proximity domain,
668 # or cache write policy unknown)
670 # @write-back: Write Back (WB)
672 # @write-through: Write Through (WT)
676 { 'enum': 'HmatCacheWritePolicy',
677 'data': [ 'none', 'write-back', 'write-through' ] }
680 # @NumaHmatCacheOptions:
682 # Set the memory side cache information for a given memory domain.
684 # For more information of @NumaHmatCacheOptions, see chapter
685 # 5.2.27.5: Table 5-147: Field "Cache Attributes" of ACPI 6.3 spec.
687 # @node-id: the memory proximity domain to which the memory belongs.
689 # @size: the size of memory side cache in bytes.
691 # @level: the cache level described in this structure.
693 # @associativity: the cache associativity,
694 # none/direct-mapped/complex(complex cache indexing).
696 # @policy: the write policy, none/write-back/write-through.
698 # @line: the cache Line size in bytes.
702 { 'struct': 'NumaHmatCacheOptions',
707 'associativity': 'HmatCacheAssociativity',
708 'policy': 'HmatCacheWritePolicy',
714 # Host memory policy types
716 # @default: restore default policy, remove any nondefault policy
718 # @preferred: set the preferred host nodes for allocation
720 # @bind: a strict policy that restricts memory allocation to the
721 # host nodes specified
723 # @interleave: memory allocations are interleaved across the set
724 # of host nodes specified
728 { 'enum': 'HostMemPolicy',
729 'data': [ 'default', 'preferred', 'bind', 'interleave' ] }
734 # Information about memory backend
736 # @id: backend's ID if backend has 'id' property (since 2.9)
738 # @size: memory backend size
740 # @merge: enables or disables memory merge support
742 # @dump: includes memory backend's memory in a core dump or not
744 # @prealloc: enables or disables memory preallocation
746 # @host-nodes: host nodes for its memory policy
748 # @policy: memory policy of memory backend
752 { 'struct': 'Memdev',
759 'host-nodes': ['uint16'],
760 'policy': 'HostMemPolicy' }}
765 # Returns information for all memory backends.
767 # Returns: a list of @Memdev.
773 # -> { "execute": "query-memdev" }
781 # "host-nodes": [0, 1],
789 # "host-nodes": [2, 3],
790 # "policy": "preferred"
796 { 'command': 'query-memdev', 'returns': ['Memdev'], 'allow-preconfig': true }
799 # @CpuInstanceProperties:
801 # List of properties to be used for hotplugging a CPU instance,
802 # it should be passed by management with device_add command when
803 # a CPU is being hotplugged.
805 # @node-id: NUMA node ID the CPU belongs to
806 # @socket-id: socket number within node/board the CPU belongs to
807 # @die-id: die number within node/board the CPU belongs to (Since 4.1)
808 # @core-id: core number within die the CPU belongs to
809 # @thread-id: thread number within core the CPU belongs to
811 # Note: currently there are 5 properties that could be present
812 # but management should be prepared to pass through other
813 # properties with device_add command to allow for future
814 # interface extension. This also requires the filed names to be kept in
815 # sync with the properties passed to -device/device_add.
819 { 'struct': 'CpuInstanceProperties',
820 'data': { '*node-id': 'int',
831 # @type: CPU object type for usage with device_add command
832 # @props: list of properties to be used for hotplugging CPU
833 # @vcpus-count: number of logical VCPU threads @HotpluggableCPU provides
834 # @qom-path: link to existing CPU object if CPU is present or
835 # omitted if CPU is not present.
839 { 'struct': 'HotpluggableCPU',
840 'data': { 'type': 'str',
841 'vcpus-count': 'int',
842 'props': 'CpuInstanceProperties',
848 # @query-hotpluggable-cpus:
850 # TODO: Better documentation; currently there is none.
852 # Returns: a list of HotpluggableCPU objects.
858 # For pseries machine type started with -smp 2,cores=2,maxcpus=4 -cpu POWER8:
860 # -> { "execute": "query-hotpluggable-cpus" }
862 # { "props": { "core": 8 }, "type": "POWER8-spapr-cpu-core",
863 # "vcpus-count": 1 },
864 # { "props": { "core": 0 }, "type": "POWER8-spapr-cpu-core",
865 # "vcpus-count": 1, "qom-path": "/machine/unattached/device[0]"}
868 # For pc machine type started with -smp 1,maxcpus=2:
870 # -> { "execute": "query-hotpluggable-cpus" }
873 # "type": "qemu64-x86_64-cpu", "vcpus-count": 1,
874 # "props": {"core-id": 0, "socket-id": 1, "thread-id": 0}
877 # "qom-path": "/machine/unattached/device[0]",
878 # "type": "qemu64-x86_64-cpu", "vcpus-count": 1,
879 # "props": {"core-id": 0, "socket-id": 0, "thread-id": 0}
883 # For s390x-virtio-ccw machine type started with -smp 1,maxcpus=2 -cpu qemu
886 # -> { "execute": "query-hotpluggable-cpus" }
889 # "type": "qemu-s390x-cpu", "vcpus-count": 1,
890 # "props": { "core-id": 1 }
893 # "qom-path": "/machine/unattached/device[0]",
894 # "type": "qemu-s390x-cpu", "vcpus-count": 1,
895 # "props": { "core-id": 0 }
900 { 'command': 'query-hotpluggable-cpus', 'returns': ['HotpluggableCPU'],
901 'allow-preconfig': true }
906 # Runtime equivalent of '-numa' CLI option, available at
907 # preconfigure stage to configure numa mapping before initializing
912 { 'command': 'set-numa-node', 'boxed': true,
913 'data': 'NumaOptions',
914 'allow-preconfig': true