17f7b4e7aSMarkus Armbruster# -*- Mode: Python -*- 2f7160f32SAndrea Bolognani# vim: filetype=python 37f7b4e7aSMarkus Armbruster# 47f7b4e7aSMarkus Armbruster# This work is licensed under the terms of the GNU GPL, version 2 or later. 57f7b4e7aSMarkus Armbruster# See the COPYING file in the top-level directory. 67f7b4e7aSMarkus Armbruster 7a457c2abSPierre Morel{ 'include': 'machine-common.json' } 8a457c2abSPierre Morel 97f7b4e7aSMarkus Armbruster## 107f7b4e7aSMarkus Armbruster# @CpuModelInfo: 117f7b4e7aSMarkus Armbruster# 127f7b4e7aSMarkus Armbruster# Virtual CPU model. 137f7b4e7aSMarkus Armbruster# 14a937b6aaSMarkus Armbruster# A CPU model consists of the name of a CPU definition, to which delta 1501bed0ffSMarkus Armbruster# changes are applied (e.g. features added/removed). Most magic 1601bed0ffSMarkus Armbruster# values that an architecture might require should be hidden behind 1701bed0ffSMarkus Armbruster# the name. However, if required, architectures can expose relevant 1801bed0ffSMarkus Armbruster# properties. 197f7b4e7aSMarkus Armbruster# 207f7b4e7aSMarkus Armbruster# @name: the name of the CPU definition the model is based on 21a937b6aaSMarkus Armbruster# 227f7b4e7aSMarkus Armbruster# @props: a dictionary of QOM properties to be applied 237f7b4e7aSMarkus Armbruster# 249bc6e893SMarkus Armbruster# Since: 2.8 257f7b4e7aSMarkus Armbruster## 267f7b4e7aSMarkus Armbruster{ 'struct': 'CpuModelInfo', 277f7b4e7aSMarkus Armbruster 'data': { 'name': 'str', 28442110bcSCollin Walling '*props': 'any' } } 297f7b4e7aSMarkus Armbruster 307f7b4e7aSMarkus Armbruster## 317f7b4e7aSMarkus Armbruster# @CpuModelExpansionType: 327f7b4e7aSMarkus Armbruster# 337f7b4e7aSMarkus Armbruster# An enumeration of CPU model expansion types. 347f7b4e7aSMarkus Armbruster# 35a937b6aaSMarkus Armbruster# @static: Expand to a static CPU model, a combination of a static 36a937b6aaSMarkus Armbruster# base model name and property delta changes. As the static base 37a937b6aaSMarkus Armbruster# model will never change, the expanded CPU model will be the 38a937b6aaSMarkus Armbruster# same, independent of QEMU version, machine type, machine 39a937b6aaSMarkus Armbruster# options, and accelerator options. Therefore, the resulting 40a937b6aaSMarkus Armbruster# model can be used by tooling without having to specify a 41a937b6aaSMarkus Armbruster# compatibility machine - e.g. when displaying the "host" model. 42a937b6aaSMarkus Armbruster# The @static CPU models are migration-safe. 437f7b4e7aSMarkus Armbruster# 44a937b6aaSMarkus Armbruster# @full: Expand all properties. The produced model is not guaranteed 45a937b6aaSMarkus Armbruster# to be migration-safe, but allows tooling to get an insight and 46a937b6aaSMarkus Armbruster# work with model details. 47a937b6aaSMarkus Armbruster# 48d461c279SJohn Snow# .. note:: When a non-migration-safe CPU model is expanded in static 49a937b6aaSMarkus Armbruster# mode, some features enabled by the CPU model may be omitted, 5001bed0ffSMarkus Armbruster# because they can't be implemented by a static CPU model 5101bed0ffSMarkus Armbruster# definition (e.g. cache info passthrough and PMU passthrough in 5201bed0ffSMarkus Armbruster# x86). If you need an accurate representation of the features 5301bed0ffSMarkus Armbruster# enabled by a non-migration-safe CPU model, use @full. If you 5401bed0ffSMarkus Armbruster# need a static representation that will keep ABI compatibility 5501bed0ffSMarkus Armbruster# even when changing QEMU version or machine-type, use @static (but 5601bed0ffSMarkus Armbruster# keep in mind that some features may be omitted). 577f7b4e7aSMarkus Armbruster# 589bc6e893SMarkus Armbruster# Since: 2.8 597f7b4e7aSMarkus Armbruster## 607f7b4e7aSMarkus Armbruster{ 'enum': 'CpuModelExpansionType', 617f7b4e7aSMarkus Armbruster 'data': [ 'static', 'full' ] } 627f7b4e7aSMarkus Armbruster 637f7b4e7aSMarkus Armbruster## 647f7b4e7aSMarkus Armbruster# @CpuModelCompareResult: 657f7b4e7aSMarkus Armbruster# 66a937b6aaSMarkus Armbruster# An enumeration of CPU model comparison results. The result is 67a937b6aaSMarkus Armbruster# usually calculated using e.g. CPU features or CPU generations. 687f7b4e7aSMarkus Armbruster# 697f7b4e7aSMarkus Armbruster# @incompatible: If model A is incompatible to model B, model A is not 707f7b4e7aSMarkus Armbruster# guaranteed to run where model B runs and the other way around. 717f7b4e7aSMarkus Armbruster# 72a937b6aaSMarkus Armbruster# @identical: If model A is identical to model B, model A is 73a937b6aaSMarkus Armbruster# guaranteed to run where model B runs and the other way around. 747f7b4e7aSMarkus Armbruster# 75a937b6aaSMarkus Armbruster# @superset: If model A is a superset of model B, model B is 76a937b6aaSMarkus Armbruster# guaranteed to run where model A runs. There are no guarantees 77a937b6aaSMarkus Armbruster# about the other way. 787f7b4e7aSMarkus Armbruster# 79a937b6aaSMarkus Armbruster# @subset: If model A is a subset of model B, model A is guaranteed to 80a937b6aaSMarkus Armbruster# run where model B runs. There are no guarantees about the other 81a937b6aaSMarkus Armbruster# way. 827f7b4e7aSMarkus Armbruster# 839bc6e893SMarkus Armbruster# Since: 2.8 847f7b4e7aSMarkus Armbruster## 857f7b4e7aSMarkus Armbruster{ 'enum': 'CpuModelCompareResult', 867f7b4e7aSMarkus Armbruster 'data': [ 'incompatible', 'identical', 'superset', 'subset' ] } 877f7b4e7aSMarkus Armbruster 887f7b4e7aSMarkus Armbruster## 897f7b4e7aSMarkus Armbruster# @CpuModelBaselineInfo: 907f7b4e7aSMarkus Armbruster# 917f7b4e7aSMarkus Armbruster# The result of a CPU model baseline. 927f7b4e7aSMarkus Armbruster# 937f7b4e7aSMarkus Armbruster# @model: the baselined CpuModelInfo. 947f7b4e7aSMarkus Armbruster# 959bc6e893SMarkus Armbruster# Since: 2.8 967f7b4e7aSMarkus Armbruster## 977f7b4e7aSMarkus Armbruster{ 'struct': 'CpuModelBaselineInfo', 987f7b4e7aSMarkus Armbruster 'data': { 'model': 'CpuModelInfo' }, 998a9f1e1dSMarc-André Lureau 'if': 'TARGET_S390X' } 1007f7b4e7aSMarkus Armbruster 1017f7b4e7aSMarkus Armbruster## 1027f7b4e7aSMarkus Armbruster# @CpuModelCompareInfo: 1037f7b4e7aSMarkus Armbruster# 1047f7b4e7aSMarkus Armbruster# The result of a CPU model comparison. 1057f7b4e7aSMarkus Armbruster# 1067f7b4e7aSMarkus Armbruster# @result: The result of the compare operation. 107a937b6aaSMarkus Armbruster# 108a937b6aaSMarkus Armbruster# @responsible-properties: List of properties that led to the 109a937b6aaSMarkus Armbruster# comparison result not being identical. 1107f7b4e7aSMarkus Armbruster# 1117f7b4e7aSMarkus Armbruster# @responsible-properties is a list of QOM property names that led to 112a937b6aaSMarkus Armbruster# both CPUs not being detected as identical. For identical models, 113a937b6aaSMarkus Armbruster# this list is empty. If a QOM property is read-only, that means 114a937b6aaSMarkus Armbruster# there's no known way to make the CPU models identical. If the 115a937b6aaSMarkus Armbruster# special property name "type" is included, the models are by 116a937b6aaSMarkus Armbruster# definition not identical and cannot be made identical. 1177f7b4e7aSMarkus Armbruster# 1189bc6e893SMarkus Armbruster# Since: 2.8 1197f7b4e7aSMarkus Armbruster## 1207f7b4e7aSMarkus Armbruster{ 'struct': 'CpuModelCompareInfo', 1217f7b4e7aSMarkus Armbruster 'data': { 'result': 'CpuModelCompareResult', 1227f7b4e7aSMarkus Armbruster 'responsible-properties': ['str'] }, 1238a9f1e1dSMarc-André Lureau 'if': 'TARGET_S390X' } 1247f7b4e7aSMarkus Armbruster 1257f7b4e7aSMarkus Armbruster## 1267f7b4e7aSMarkus Armbruster# @query-cpu-model-comparison: 1277f7b4e7aSMarkus Armbruster# 1281a533ce9SDavid Hildenbrand# Compares two CPU models, @modela and @modelb, returning how they 1291a533ce9SDavid Hildenbrand# compare in a specific configuration. The results indicates how 1301a533ce9SDavid Hildenbrand# both models compare regarding runnability. This result can be 1311a533ce9SDavid Hildenbrand# used by tooling to make decisions if a certain CPU model will 1321a533ce9SDavid Hildenbrand# run in a certain configuration or if a compatible CPU model has 1331a533ce9SDavid Hildenbrand# to be created by baselining. 1347f7b4e7aSMarkus Armbruster# 135a937b6aaSMarkus Armbruster# Usually, a CPU model is compared against the maximum possible CPU 136a937b6aaSMarkus Armbruster# model of a certain configuration (e.g. the "host" model for KVM). 137a937b6aaSMarkus Armbruster# If that CPU model is identical or a subset, it will run in that 138a937b6aaSMarkus Armbruster# configuration. 1397f7b4e7aSMarkus Armbruster# 1407f7b4e7aSMarkus Armbruster# The result returned by this command may be affected by: 1417f7b4e7aSMarkus Armbruster# 142a937b6aaSMarkus Armbruster# * QEMU version: CPU models may look different depending on the QEMU 143a937b6aaSMarkus Armbruster# version. (Except for CPU models reported as "static" in 144a937b6aaSMarkus Armbruster# query-cpu-definitions.) 145a937b6aaSMarkus Armbruster# * machine-type: CPU model may look different depending on the 146a937b6aaSMarkus Armbruster# machine-type. (Except for CPU models reported as "static" in 147a937b6aaSMarkus Armbruster# query-cpu-definitions.) 148a937b6aaSMarkus Armbruster# * machine options (including accelerator): in some architectures, 149a937b6aaSMarkus Armbruster# CPU models may look different depending on machine and accelerator 150a937b6aaSMarkus Armbruster# options. (Except for CPU models reported as "static" in 151a937b6aaSMarkus Armbruster# query-cpu-definitions.) 152a937b6aaSMarkus Armbruster# * "-cpu" arguments and global properties: arguments to the -cpu 153a937b6aaSMarkus Armbruster# option and global properties may affect expansion of CPU models. 154a937b6aaSMarkus Armbruster# Using query-cpu-model-expansion while using these is not advised. 1557f7b4e7aSMarkus Armbruster# 156a937b6aaSMarkus Armbruster# Some architectures may not support comparing CPU models. s390x 157a937b6aaSMarkus Armbruster# supports comparing CPU models. 1587f7b4e7aSMarkus Armbruster# 15901bed0ffSMarkus Armbruster# @modela: description of the first CPU model to compare, referred to 16001bed0ffSMarkus Armbruster# as "model A" in CpuModelCompareResult 1611a533ce9SDavid Hildenbrand# 16201bed0ffSMarkus Armbruster# @modelb: description of the second CPU model to compare, referred to 16301bed0ffSMarkus Armbruster# as "model B" in CpuModelCompareResult 1641a533ce9SDavid Hildenbrand# 1651a533ce9SDavid Hildenbrand# Returns: a CpuModelCompareInfo describing how both CPU models 1661a533ce9SDavid Hildenbrand# compare 1672746f060SMarkus Armbruster# 1682746f060SMarkus Armbruster# Errors: 1692746f060SMarkus Armbruster# - if comparing CPU models is not supported 1702746f060SMarkus Armbruster# - if a model cannot be used 1712746f060SMarkus Armbruster# - if a model contains an unknown cpu definition name, unknown 1722746f060SMarkus Armbruster# properties or properties with wrong types. 1737f7b4e7aSMarkus Armbruster# 174d461c279SJohn Snow# .. note:: This command isn't specific to s390x, but is only 175d461c279SJohn Snow# implemented on this architecture currently. 1767f7b4e7aSMarkus Armbruster# 1779bc6e893SMarkus Armbruster# Since: 2.8 1787f7b4e7aSMarkus Armbruster## 1797f7b4e7aSMarkus Armbruster{ 'command': 'query-cpu-model-comparison', 1807f7b4e7aSMarkus Armbruster 'data': { 'modela': 'CpuModelInfo', 'modelb': 'CpuModelInfo' }, 1817f7b4e7aSMarkus Armbruster 'returns': 'CpuModelCompareInfo', 1828a9f1e1dSMarc-André Lureau 'if': 'TARGET_S390X' } 1837f7b4e7aSMarkus Armbruster 1847f7b4e7aSMarkus Armbruster## 1857f7b4e7aSMarkus Armbruster# @query-cpu-model-baseline: 1867f7b4e7aSMarkus Armbruster# 1871a533ce9SDavid Hildenbrand# Baseline two CPU models, @modela and @modelb, creating a compatible 1881a533ce9SDavid Hildenbrand# third model. The created model will always be a static, 18901bed0ffSMarkus Armbruster# migration-safe CPU model (see "static" CPU model expansion for 19001bed0ffSMarkus Armbruster# details). 1917f7b4e7aSMarkus Armbruster# 192a937b6aaSMarkus Armbruster# This interface can be used by tooling to create a compatible CPU 193a937b6aaSMarkus Armbruster# model out two CPU models. The created CPU model will be identical 194a937b6aaSMarkus Armbruster# to or a subset of both CPU models when comparing them. Therefore, 195a937b6aaSMarkus Armbruster# the created CPU model is guaranteed to run where the given CPU 196a937b6aaSMarkus Armbruster# models run. 1977f7b4e7aSMarkus Armbruster# 1987f7b4e7aSMarkus Armbruster# The result returned by this command may be affected by: 1997f7b4e7aSMarkus Armbruster# 200a937b6aaSMarkus Armbruster# * QEMU version: CPU models may look different depending on the QEMU 201a937b6aaSMarkus Armbruster# version. (Except for CPU models reported as "static" in 202a937b6aaSMarkus Armbruster# query-cpu-definitions.) 203a937b6aaSMarkus Armbruster# * machine-type: CPU model may look different depending on the 204a937b6aaSMarkus Armbruster# machine-type. (Except for CPU models reported as "static" in 205a937b6aaSMarkus Armbruster# query-cpu-definitions.) 206a937b6aaSMarkus Armbruster# * machine options (including accelerator): in some architectures, 207a937b6aaSMarkus Armbruster# CPU models may look different depending on machine and accelerator 208a937b6aaSMarkus Armbruster# options. (Except for CPU models reported as "static" in 209a937b6aaSMarkus Armbruster# query-cpu-definitions.) 210a937b6aaSMarkus Armbruster# * "-cpu" arguments and global properties: arguments to the -cpu 211a937b6aaSMarkus Armbruster# option and global properties may affect expansion of CPU models. 212a937b6aaSMarkus Armbruster# Using query-cpu-model-expansion while using these is not advised. 2137f7b4e7aSMarkus Armbruster# 214a937b6aaSMarkus Armbruster# Some architectures may not support baselining CPU models. s390x 215a937b6aaSMarkus Armbruster# supports baselining CPU models. 2167f7b4e7aSMarkus Armbruster# 2171a533ce9SDavid Hildenbrand# @modela: description of the first CPU model to baseline 2181a533ce9SDavid Hildenbrand# 2191a533ce9SDavid Hildenbrand# @modelb: description of the second CPU model to baseline 2201a533ce9SDavid Hildenbrand# 2211a533ce9SDavid Hildenbrand# Returns: a CpuModelBaselineInfo describing the baselined CPU model 2222746f060SMarkus Armbruster# 2232746f060SMarkus Armbruster# Errors: 2242746f060SMarkus Armbruster# - if baselining CPU models is not supported 2252746f060SMarkus Armbruster# - if a model cannot be used 2262746f060SMarkus Armbruster# - if a model contains an unknown cpu definition name, unknown 2272746f060SMarkus Armbruster# properties or properties with wrong types. 2287f7b4e7aSMarkus Armbruster# 229d461c279SJohn Snow# .. note:: This command isn't specific to s390x, but is only 230d461c279SJohn Snow# implemented on this architecture currently. 2317f7b4e7aSMarkus Armbruster# 2329bc6e893SMarkus Armbruster# Since: 2.8 2337f7b4e7aSMarkus Armbruster## 2347f7b4e7aSMarkus Armbruster{ 'command': 'query-cpu-model-baseline', 2357f7b4e7aSMarkus Armbruster 'data': { 'modela': 'CpuModelInfo', 2367f7b4e7aSMarkus Armbruster 'modelb': 'CpuModelInfo' }, 2377f7b4e7aSMarkus Armbruster 'returns': 'CpuModelBaselineInfo', 2388a9f1e1dSMarc-André Lureau 'if': 'TARGET_S390X' } 2397f7b4e7aSMarkus Armbruster 2407f7b4e7aSMarkus Armbruster## 2417f7b4e7aSMarkus Armbruster# @CpuModelExpansionInfo: 2427f7b4e7aSMarkus Armbruster# 2437f7b4e7aSMarkus Armbruster# The result of a cpu model expansion. 2447f7b4e7aSMarkus Armbruster# 2457f7b4e7aSMarkus Armbruster# @model: the expanded CpuModelInfo. 2467f7b4e7aSMarkus Armbruster# 24701bed0ffSMarkus Armbruster# @deprecated-props: a list of properties that are flagged as 24801bed0ffSMarkus Armbruster# deprecated by the CPU vendor. The list depends on the 24901bed0ffSMarkus Armbruster# CpuModelExpansionType: "static" properties are a subset of the 25001bed0ffSMarkus Armbruster# enabled-properties for the expanded model; "full" properties are 25101bed0ffSMarkus Armbruster# a set of properties that are deprecated across all models for 25201bed0ffSMarkus Armbruster# the architecture. (since: 9.1). 253442110bcSCollin Walling# 2549bc6e893SMarkus Armbruster# Since: 2.8 2557f7b4e7aSMarkus Armbruster## 2567f7b4e7aSMarkus Armbruster{ 'struct': 'CpuModelExpansionInfo', 257442110bcSCollin Walling 'data': { 'model': 'CpuModelInfo', 258442110bcSCollin Walling 'deprecated-props' : { 'type': ['str'], 259442110bcSCollin Walling 'if': 'TARGET_S390X' } }, 2608a9f1e1dSMarc-André Lureau 'if': { 'any': [ 'TARGET_S390X', 2618a9f1e1dSMarc-André Lureau 'TARGET_I386', 26231f694b9SSong Gao 'TARGET_ARM', 263aeb2bc59SDaniel Henrique Barboza 'TARGET_LOONGARCH64', 264aeb2bc59SDaniel Henrique Barboza 'TARGET_RISCV' ] } } 2657f7b4e7aSMarkus Armbruster 2667f7b4e7aSMarkus Armbruster## 2677f7b4e7aSMarkus Armbruster# @query-cpu-model-expansion: 2687f7b4e7aSMarkus Armbruster# 2691a533ce9SDavid Hildenbrand# Expands a given CPU model, @model, (or a combination of CPU model + 27001bed0ffSMarkus Armbruster# additional options) to different granularities, specified by @type, 27101bed0ffSMarkus Armbruster# allowing tooling to get an understanding what a specific CPU model 27201bed0ffSMarkus Armbruster# looks like in QEMU under a certain configuration. 2737f7b4e7aSMarkus Armbruster# 2747f7b4e7aSMarkus Armbruster# This interface can be used to query the "host" CPU model. 2757f7b4e7aSMarkus Armbruster# 2767f7b4e7aSMarkus Armbruster# The data returned by this command may be affected by: 2777f7b4e7aSMarkus Armbruster# 278a937b6aaSMarkus Armbruster# * QEMU version: CPU models may look different depending on the QEMU 279a937b6aaSMarkus Armbruster# version. (Except for CPU models reported as "static" in 280a937b6aaSMarkus Armbruster# query-cpu-definitions.) 281a937b6aaSMarkus Armbruster# * machine-type: CPU model may look different depending on the 282a937b6aaSMarkus Armbruster# machine-type. (Except for CPU models reported as "static" in 283a937b6aaSMarkus Armbruster# query-cpu-definitions.) 284a937b6aaSMarkus Armbruster# * machine options (including accelerator): in some architectures, 285a937b6aaSMarkus Armbruster# CPU models may look different depending on machine and accelerator 286a937b6aaSMarkus Armbruster# options. (Except for CPU models reported as "static" in 287a937b6aaSMarkus Armbruster# query-cpu-definitions.) 288a937b6aaSMarkus Armbruster# * "-cpu" arguments and global properties: arguments to the -cpu 289a937b6aaSMarkus Armbruster# option and global properties may affect expansion of CPU models. 290a937b6aaSMarkus Armbruster# Using query-cpu-model-expansion while using these is not advised. 2917f7b4e7aSMarkus Armbruster# 292a937b6aaSMarkus Armbruster# Some architectures may not support all expansion types. s390x 293a937b6aaSMarkus Armbruster# supports "full" and "static". Arm only supports "full". 2947f7b4e7aSMarkus Armbruster# 2951a533ce9SDavid Hildenbrand# @model: description of the CPU model to expand 2961a533ce9SDavid Hildenbrand# 2971a533ce9SDavid Hildenbrand# @type: expansion type, specifying how to expand the CPU model 2981a533ce9SDavid Hildenbrand# 2991a533ce9SDavid Hildenbrand# Returns: a CpuModelExpansionInfo describing the expanded CPU model 3002746f060SMarkus Armbruster# 3012746f060SMarkus Armbruster# Errors: 3022746f060SMarkus Armbruster# - if expanding CPU models is not supported 3032746f060SMarkus Armbruster# - if the model cannot be expanded 3042746f060SMarkus Armbruster# - if the model contains an unknown CPU definition name, unknown 3052746f060SMarkus Armbruster# properties or properties with a wrong type 3062746f060SMarkus Armbruster# - if an expansion type is not supported 3077f7b4e7aSMarkus Armbruster# 3089bc6e893SMarkus Armbruster# Since: 2.8 3097f7b4e7aSMarkus Armbruster## 3107f7b4e7aSMarkus Armbruster{ 'command': 'query-cpu-model-expansion', 3117f7b4e7aSMarkus Armbruster 'data': { 'type': 'CpuModelExpansionType', 3127f7b4e7aSMarkus Armbruster 'model': 'CpuModelInfo' }, 3137f7b4e7aSMarkus Armbruster 'returns': 'CpuModelExpansionInfo', 3148a9f1e1dSMarc-André Lureau 'if': { 'any': [ 'TARGET_S390X', 3158a9f1e1dSMarc-André Lureau 'TARGET_I386', 31631f694b9SSong Gao 'TARGET_ARM', 317aeb2bc59SDaniel Henrique Barboza 'TARGET_LOONGARCH64', 318aeb2bc59SDaniel Henrique Barboza 'TARGET_RISCV' ] } } 3197f7b4e7aSMarkus Armbruster 3207f7b4e7aSMarkus Armbruster## 3217f7b4e7aSMarkus Armbruster# @CpuDefinitionInfo: 3227f7b4e7aSMarkus Armbruster# 3237f7b4e7aSMarkus Armbruster# Virtual CPU definition. 3247f7b4e7aSMarkus Armbruster# 3257f7b4e7aSMarkus Armbruster# @name: the name of the CPU definition 3267f7b4e7aSMarkus Armbruster# 3277f7b4e7aSMarkus Armbruster# @migration-safe: whether a CPU definition can be safely used for 328a937b6aaSMarkus Armbruster# migration in combination with a QEMU compatibility machine when 329a937b6aaSMarkus Armbruster# migrating between different QEMU versions and between hosts with 330a937b6aaSMarkus Armbruster# different sets of (hardware or software) capabilities. If not 331a937b6aaSMarkus Armbruster# provided, information is not available and callers should not 332a937b6aaSMarkus Armbruster# assume the CPU definition to be migration-safe. (since 2.8) 3337f7b4e7aSMarkus Armbruster# 334a937b6aaSMarkus Armbruster# @static: whether a CPU definition is static and will not change 335a937b6aaSMarkus Armbruster# depending on QEMU version, machine type, machine options and 336a937b6aaSMarkus Armbruster# accelerator options. A static model is always migration-safe. 337a937b6aaSMarkus Armbruster# (since 2.8) 3387f7b4e7aSMarkus Armbruster# 339a937b6aaSMarkus Armbruster# @unavailable-features: List of properties that prevent the CPU model 340a937b6aaSMarkus Armbruster# from running in the current host. (since 2.8) 3417f7b4e7aSMarkus Armbruster# 342a937b6aaSMarkus Armbruster# @typename: Type name that can be used as argument to 343a937b6aaSMarkus Armbruster# @device-list-properties, to introspect properties configurable 344a937b6aaSMarkus Armbruster# using -cpu or -global. (since 2.9) 345a937b6aaSMarkus Armbruster# 346a937b6aaSMarkus Armbruster# @alias-of: Name of CPU model this model is an alias for. The target 347a937b6aaSMarkus Armbruster# of the CPU model alias may change depending on the machine type. 3487d753f61SEduardo Habkost# Management software is supposed to translate CPU model aliases 3497d753f61SEduardo Habkost# in the VM configuration, because aliases may stop being 3507d753f61SEduardo Habkost# migration-safe in the future (since 4.1) 3517d753f61SEduardo Habkost# 352a937b6aaSMarkus Armbruster# @deprecated: If true, this CPU model is deprecated and may be 353a937b6aaSMarkus Armbruster# removed in in some future version of QEMU according to the QEMU 354a937b6aaSMarkus Armbruster# deprecation policy. (since 5.2) 35561ad65d0SRobert Hoo# 356a937b6aaSMarkus Armbruster# @unavailable-features is a list of QOM property names that represent 357a937b6aaSMarkus Armbruster# CPU model attributes that prevent the CPU from running. If the QOM 358a937b6aaSMarkus Armbruster# property is read-only, that means there's no known way to make the 359a937b6aaSMarkus Armbruster# CPU model run in the current host. Implementations that choose not 360a937b6aaSMarkus Armbruster# to provide specific information return the property name "type". If 361a937b6aaSMarkus Armbruster# the property is read-write, it means that it MAY be possible to run 362a937b6aaSMarkus Armbruster# the CPU model in the current host if that property is changed. 363a937b6aaSMarkus Armbruster# Management software can use it as hints to suggest or choose an 364a937b6aaSMarkus Armbruster# alternative for the user, or just to generate meaningful error 365a937b6aaSMarkus Armbruster# messages explaining why the CPU model can't be used. If 366a937b6aaSMarkus Armbruster# @unavailable-features is an empty list, the CPU model is runnable 367a937b6aaSMarkus Armbruster# using the current host and machine-type. If @unavailable-features 368a937b6aaSMarkus Armbruster# is not present, runnability information for the CPU is not 369a937b6aaSMarkus Armbruster# available. 3707f7b4e7aSMarkus Armbruster# 3719bc6e893SMarkus Armbruster# Since: 1.2 3727f7b4e7aSMarkus Armbruster## 3737f7b4e7aSMarkus Armbruster{ 'struct': 'CpuDefinitionInfo', 3747f7b4e7aSMarkus Armbruster 'data': { 'name': 'str', 3757f7b4e7aSMarkus Armbruster '*migration-safe': 'bool', 3767f7b4e7aSMarkus Armbruster 'static': 'bool', 3777f7b4e7aSMarkus Armbruster '*unavailable-features': [ 'str' ], 3787d753f61SEduardo Habkost 'typename': 'str', 37961ad65d0SRobert Hoo '*alias-of' : 'str', 38061ad65d0SRobert Hoo 'deprecated' : 'bool' }, 3818a9f1e1dSMarc-André Lureau 'if': { 'any': [ 'TARGET_PPC', 3828a9f1e1dSMarc-André Lureau 'TARGET_ARM', 3838a9f1e1dSMarc-André Lureau 'TARGET_I386', 3848a9f1e1dSMarc-André Lureau 'TARGET_S390X', 385425876f5SXiaojuan Yang 'TARGET_MIPS', 386c0177f91SDaniel Henrique Barboza 'TARGET_LOONGARCH64', 387c0177f91SDaniel Henrique Barboza 'TARGET_RISCV' ] } } 3887f7b4e7aSMarkus Armbruster 3897f7b4e7aSMarkus Armbruster## 3907f7b4e7aSMarkus Armbruster# @query-cpu-definitions: 3917f7b4e7aSMarkus Armbruster# 3927f7b4e7aSMarkus Armbruster# Return a list of supported virtual CPU definitions 3937f7b4e7aSMarkus Armbruster# 394d93ed1bdSMarkus Armbruster# Returns: a list of CpuDefinitionInfo 3957f7b4e7aSMarkus Armbruster# 3969bc6e893SMarkus Armbruster# Since: 1.2 3977f7b4e7aSMarkus Armbruster## 3987f7b4e7aSMarkus Armbruster{ 'command': 'query-cpu-definitions', 'returns': ['CpuDefinitionInfo'], 3998a9f1e1dSMarc-André Lureau 'if': { 'any': [ 'TARGET_PPC', 4008a9f1e1dSMarc-André Lureau 'TARGET_ARM', 4018a9f1e1dSMarc-André Lureau 'TARGET_I386', 4028a9f1e1dSMarc-André Lureau 'TARGET_S390X', 403425876f5SXiaojuan Yang 'TARGET_MIPS', 404c0177f91SDaniel Henrique Barboza 'TARGET_LOONGARCH64', 405c0177f91SDaniel Henrique Barboza 'TARGET_RISCV' ] } } 406f4f54b58SPierre Morel 407f4f54b58SPierre Morel## 408*32cfefb9SMarkus Armbruster# @S390CpuPolarization: 409f4f54b58SPierre Morel# 410f4f54b58SPierre Morel# An enumeration of CPU polarization that can be assumed by a virtual 411f4f54b58SPierre Morel# S390 CPU 412f4f54b58SPierre Morel# 413f4f54b58SPierre Morel# Since: 8.2 414f4f54b58SPierre Morel## 415*32cfefb9SMarkus Armbruster{ 'enum': 'S390CpuPolarization', 416f4f54b58SPierre Morel 'data': [ 'horizontal', 'vertical' ], 417f4f54b58SPierre Morel 'if': 'TARGET_S390X' 418f4f54b58SPierre Morel} 419a457c2abSPierre Morel 420a457c2abSPierre Morel## 421a457c2abSPierre Morel# @set-cpu-topology: 422a457c2abSPierre Morel# 423209e64d9SMarkus Armbruster# Modify the topology by moving the CPU inside the topology tree, or 424209e64d9SMarkus Armbruster# by changing a modifier attribute of a CPU. Absent values will not 425209e64d9SMarkus Armbruster# be modified. 426a457c2abSPierre Morel# 427a457c2abSPierre Morel# @core-id: the vCPU ID to be moved 428a457c2abSPierre Morel# 429a457c2abSPierre Morel# @socket-id: destination socket to move the vCPU to 430a457c2abSPierre Morel# 431a457c2abSPierre Morel# @book-id: destination book to move the vCPU to 432a457c2abSPierre Morel# 433a457c2abSPierre Morel# @drawer-id: destination drawer to move the vCPU to 434a457c2abSPierre Morel# 435a457c2abSPierre Morel# @entitlement: entitlement to set 436a457c2abSPierre Morel# 437209e64d9SMarkus Armbruster# @dedicated: whether the provisioning of real to virtual CPU is 438209e64d9SMarkus Armbruster# dedicated 439a457c2abSPierre Morel# 440a457c2abSPierre Morel# Features: 441a457c2abSPierre Morel# 442a457c2abSPierre Morel# @unstable: This command is experimental. 443a457c2abSPierre Morel# 444a457c2abSPierre Morel# Since: 8.2 445a457c2abSPierre Morel## 446a457c2abSPierre Morel{ 'command': 'set-cpu-topology', 447a457c2abSPierre Morel 'data': { 448a457c2abSPierre Morel 'core-id': 'uint16', 449a457c2abSPierre Morel '*socket-id': 'uint16', 450a457c2abSPierre Morel '*book-id': 'uint16', 451a457c2abSPierre Morel '*drawer-id': 'uint16', 452*32cfefb9SMarkus Armbruster '*entitlement': 'S390CpuEntitlement', 453a457c2abSPierre Morel '*dedicated': 'bool' 454a457c2abSPierre Morel }, 455a457c2abSPierre Morel 'features': [ 'unstable' ], 456a457c2abSPierre Morel 'if': { 'all': [ 'TARGET_S390X' , 'CONFIG_KVM' ] } 457a457c2abSPierre Morel} 4581cfe52b7SPierre Morel 4591cfe52b7SPierre Morel## 4601cfe52b7SPierre Morel# @CPU_POLARIZATION_CHANGE: 4611cfe52b7SPierre Morel# 4621cfe52b7SPierre Morel# Emitted when the guest asks to change the polarization. 4631cfe52b7SPierre Morel# 4641cfe52b7SPierre Morel# The guest can tell the host (via the PTF instruction) whether the 465209e64d9SMarkus Armbruster# CPUs should be provisioned using horizontal or vertical 466209e64d9SMarkus Armbruster# polarization. 4671cfe52b7SPierre Morel# 468209e64d9SMarkus Armbruster# On horizontal polarization the host is expected to provision all 469209e64d9SMarkus Armbruster# vCPUs equally. 4701cfe52b7SPierre Morel# 471209e64d9SMarkus Armbruster# On vertical polarization the host can provision each vCPU 472209e64d9SMarkus Armbruster# differently. The guest will get information on the details of the 473209e64d9SMarkus Armbruster# provisioning the next time it uses the STSI(15) instruction. 4741cfe52b7SPierre Morel# 4751cfe52b7SPierre Morel# @polarization: polarization specified by the guest 4761cfe52b7SPierre Morel# 4771cfe52b7SPierre Morel# Features: 4781cfe52b7SPierre Morel# 4791cfe52b7SPierre Morel# @unstable: This event is experimental. 4801cfe52b7SPierre Morel# 4811cfe52b7SPierre Morel# Since: 8.2 4821cfe52b7SPierre Morel# 48314b48aaaSJohn Snow# .. qmp-example:: 4841cfe52b7SPierre Morel# 4851cfe52b7SPierre Morel# <- { "event": "CPU_POLARIZATION_CHANGE", 4861cfe52b7SPierre Morel# "data": { "polarization": "horizontal" }, 4871cfe52b7SPierre Morel# "timestamp": { "seconds": 1401385907, "microseconds": 422329 } } 4881cfe52b7SPierre Morel## 4891cfe52b7SPierre Morel{ 'event': 'CPU_POLARIZATION_CHANGE', 490*32cfefb9SMarkus Armbruster 'data': { 'polarization': 'S390CpuPolarization' }, 4911cfe52b7SPierre Morel 'features': [ 'unstable' ], 4921cfe52b7SPierre Morel 'if': { 'all': [ 'TARGET_S390X', 'CONFIG_KVM' ] } 4931cfe52b7SPierre Morel} 494154893a7SPierre Morel 495154893a7SPierre Morel## 496154893a7SPierre Morel# @CpuPolarizationInfo: 497154893a7SPierre Morel# 498154893a7SPierre Morel# The result of a CPU polarization query. 499154893a7SPierre Morel# 500154893a7SPierre Morel# @polarization: the CPU polarization 501154893a7SPierre Morel# 502154893a7SPierre Morel# Since: 8.2 503154893a7SPierre Morel## 504154893a7SPierre Morel{ 'struct': 'CpuPolarizationInfo', 505*32cfefb9SMarkus Armbruster 'data': { 'polarization': 'S390CpuPolarization' }, 506154893a7SPierre Morel 'if': { 'all': [ 'TARGET_S390X', 'CONFIG_KVM' ] } 507154893a7SPierre Morel} 508154893a7SPierre Morel 509154893a7SPierre Morel## 510154893a7SPierre Morel# @query-s390x-cpu-polarization: 511154893a7SPierre Morel# 512154893a7SPierre Morel# Features: 513154893a7SPierre Morel# 514154893a7SPierre Morel# @unstable: This command is experimental. 515154893a7SPierre Morel# 516154893a7SPierre Morel# Returns: the machine's CPU polarization 517154893a7SPierre Morel# 518154893a7SPierre Morel# Since: 8.2 519154893a7SPierre Morel## 520154893a7SPierre Morel{ 'command': 'query-s390x-cpu-polarization', 'returns': 'CpuPolarizationInfo', 521154893a7SPierre Morel 'features': [ 'unstable' ], 522154893a7SPierre Morel 'if': { 'all': [ 'TARGET_S390X', 'CONFIG_KVM' ] } 523154893a7SPierre Morel} 524