2019-06-19 23:10:45 +03:00
|
|
|
# -*- Mode: Python -*-
|
2020-07-29 21:50:24 +03:00
|
|
|
# vim: filetype=python
|
2019-06-19 23:10:45 +03:00
|
|
|
#
|
|
|
|
# This work is licensed under the terms of the GNU GPL, version 2 or later.
|
|
|
|
# See the COPYING file in the top-level directory.
|
|
|
|
|
2023-10-16 21:39:13 +03:00
|
|
|
{ 'include': 'machine-common.json' }
|
|
|
|
|
2019-06-19 23:10:45 +03:00
|
|
|
##
|
|
|
|
# @CpuModelInfo:
|
|
|
|
#
|
|
|
|
# Virtual CPU model.
|
|
|
|
#
|
2023-04-28 13:54:29 +03:00
|
|
|
# A CPU model consists of the name of a CPU definition, to which delta
|
|
|
|
# changes are applied (e.g. features added/removed). Most magic values
|
2019-06-19 23:10:45 +03:00
|
|
|
# that an architecture might require should be hidden behind the name.
|
|
|
|
# However, if required, architectures can expose relevant properties.
|
|
|
|
#
|
|
|
|
# @name: the name of the CPU definition the model is based on
|
2023-04-28 13:54:29 +03:00
|
|
|
#
|
2019-06-19 23:10:45 +03:00
|
|
|
# @props: a dictionary of QOM properties to be applied
|
|
|
|
#
|
2020-11-18 09:41:58 +03:00
|
|
|
# Since: 2.8
|
2019-06-19 23:10:45 +03:00
|
|
|
##
|
|
|
|
{ 'struct': 'CpuModelInfo',
|
|
|
|
'data': { 'name': 'str',
|
|
|
|
'*props': 'any' } }
|
|
|
|
|
|
|
|
##
|
|
|
|
# @CpuModelExpansionType:
|
|
|
|
#
|
|
|
|
# An enumeration of CPU model expansion types.
|
|
|
|
#
|
2023-04-28 13:54:29 +03:00
|
|
|
# @static: Expand to a static CPU model, a combination of a static
|
|
|
|
# base model name and property delta changes. As the static base
|
|
|
|
# model will never change, the expanded CPU model will be the
|
|
|
|
# same, independent of QEMU version, machine type, machine
|
|
|
|
# options, and accelerator options. Therefore, the resulting
|
|
|
|
# model can be used by tooling without having to specify a
|
|
|
|
# compatibility machine - e.g. when displaying the "host" model.
|
|
|
|
# The @static CPU models are migration-safe.
|
|
|
|
#
|
|
|
|
# @full: Expand all properties. The produced model is not guaranteed
|
|
|
|
# to be migration-safe, but allows tooling to get an insight and
|
|
|
|
# work with model details.
|
|
|
|
#
|
|
|
|
# Note: When a non-migration-safe CPU model is expanded in static
|
|
|
|
# mode, some features enabled by the CPU model may be omitted,
|
|
|
|
# because they can't be implemented by a static CPU model
|
|
|
|
# definition (e.g. cache info passthrough and PMU passthrough in
|
|
|
|
# x86). If you need an accurate representation of the features
|
|
|
|
# enabled by a non-migration-safe CPU model, use @full. If you
|
|
|
|
# need a static representation that will keep ABI compatibility
|
|
|
|
# even when changing QEMU version or machine-type, use @static
|
|
|
|
# (but keep in mind that some features may be omitted).
|
2019-06-19 23:10:45 +03:00
|
|
|
#
|
2020-11-18 09:41:58 +03:00
|
|
|
# Since: 2.8
|
2019-06-19 23:10:45 +03:00
|
|
|
##
|
|
|
|
{ 'enum': 'CpuModelExpansionType',
|
|
|
|
'data': [ 'static', 'full' ] }
|
|
|
|
|
|
|
|
##
|
|
|
|
# @CpuModelCompareResult:
|
|
|
|
#
|
2023-04-28 13:54:29 +03:00
|
|
|
# An enumeration of CPU model comparison results. The result is
|
2023-07-20 10:16:09 +03:00
|
|
|
# usually calculated using e.g. CPU features or CPU generations.
|
2019-06-19 23:10:45 +03:00
|
|
|
#
|
|
|
|
# @incompatible: If model A is incompatible to model B, model A is not
|
2023-04-28 13:54:29 +03:00
|
|
|
# guaranteed to run where model B runs and the other way around.
|
2019-06-19 23:10:45 +03:00
|
|
|
#
|
2023-04-28 13:54:29 +03:00
|
|
|
# @identical: If model A is identical to model B, model A is
|
|
|
|
# guaranteed to run where model B runs and the other way around.
|
2019-06-19 23:10:45 +03:00
|
|
|
#
|
2023-04-28 13:54:29 +03:00
|
|
|
# @superset: If model A is a superset of model B, model B is
|
|
|
|
# guaranteed to run where model A runs. There are no guarantees
|
|
|
|
# about the other way.
|
2019-06-19 23:10:45 +03:00
|
|
|
#
|
2023-04-28 13:54:29 +03:00
|
|
|
# @subset: If model A is a subset of model B, model A is guaranteed to
|
|
|
|
# run where model B runs. There are no guarantees about the other
|
|
|
|
# way.
|
2019-06-19 23:10:45 +03:00
|
|
|
#
|
2020-11-18 09:41:58 +03:00
|
|
|
# Since: 2.8
|
2019-06-19 23:10:45 +03:00
|
|
|
##
|
|
|
|
{ 'enum': 'CpuModelCompareResult',
|
|
|
|
'data': [ 'incompatible', 'identical', 'superset', 'subset' ] }
|
|
|
|
|
|
|
|
##
|
|
|
|
# @CpuModelBaselineInfo:
|
|
|
|
#
|
|
|
|
# The result of a CPU model baseline.
|
|
|
|
#
|
|
|
|
# @model: the baselined CpuModelInfo.
|
|
|
|
#
|
2020-11-18 09:41:58 +03:00
|
|
|
# Since: 2.8
|
2019-06-19 23:10:45 +03:00
|
|
|
##
|
|
|
|
{ 'struct': 'CpuModelBaselineInfo',
|
|
|
|
'data': { 'model': 'CpuModelInfo' },
|
2021-08-04 11:31:05 +03:00
|
|
|
'if': 'TARGET_S390X' }
|
2019-06-19 23:10:45 +03:00
|
|
|
|
|
|
|
##
|
|
|
|
# @CpuModelCompareInfo:
|
|
|
|
#
|
|
|
|
# The result of a CPU model comparison.
|
|
|
|
#
|
|
|
|
# @result: The result of the compare operation.
|
2023-04-28 13:54:29 +03:00
|
|
|
#
|
|
|
|
# @responsible-properties: List of properties that led to the
|
|
|
|
# comparison result not being identical.
|
2019-06-19 23:10:45 +03:00
|
|
|
#
|
|
|
|
# @responsible-properties is a list of QOM property names that led to
|
2023-04-28 13:54:29 +03:00
|
|
|
# both CPUs not being detected as identical. For identical models,
|
|
|
|
# this list is empty. If a QOM property is read-only, that means
|
|
|
|
# there's no known way to make the CPU models identical. If the
|
|
|
|
# special property name "type" is included, the models are by
|
|
|
|
# definition not identical and cannot be made identical.
|
2019-06-19 23:10:45 +03:00
|
|
|
#
|
2020-11-18 09:41:58 +03:00
|
|
|
# Since: 2.8
|
2019-06-19 23:10:45 +03:00
|
|
|
##
|
|
|
|
{ 'struct': 'CpuModelCompareInfo',
|
|
|
|
'data': { 'result': 'CpuModelCompareResult',
|
|
|
|
'responsible-properties': ['str'] },
|
2021-08-04 11:31:05 +03:00
|
|
|
'if': 'TARGET_S390X' }
|
2019-06-19 23:10:45 +03:00
|
|
|
|
|
|
|
##
|
|
|
|
# @query-cpu-model-comparison:
|
|
|
|
#
|
|
|
|
# Compares two CPU models, returning how they compare in a specific
|
2023-04-28 13:54:29 +03:00
|
|
|
# configuration. The results indicates how both models compare
|
|
|
|
# regarding runnability. This result can be used by tooling to make
|
|
|
|
# decisions if a certain CPU model will run in a certain configuration
|
|
|
|
# or if a compatible CPU model has to be created by baselining.
|
2019-06-19 23:10:45 +03:00
|
|
|
#
|
2023-04-28 13:54:29 +03:00
|
|
|
# Usually, a CPU model is compared against the maximum possible CPU
|
|
|
|
# model of a certain configuration (e.g. the "host" model for KVM).
|
|
|
|
# If that CPU model is identical or a subset, it will run in that
|
|
|
|
# configuration.
|
2019-06-19 23:10:45 +03:00
|
|
|
#
|
|
|
|
# The result returned by this command may be affected by:
|
|
|
|
#
|
2023-04-28 13:54:29 +03:00
|
|
|
# * QEMU version: CPU models may look different depending on the QEMU
|
|
|
|
# version. (Except for CPU models reported as "static" in
|
|
|
|
# query-cpu-definitions.)
|
|
|
|
# * machine-type: CPU model may look different depending on the
|
|
|
|
# machine-type. (Except for CPU models reported as "static" in
|
|
|
|
# query-cpu-definitions.)
|
|
|
|
# * machine options (including accelerator): in some architectures,
|
|
|
|
# CPU models may look different depending on machine and accelerator
|
|
|
|
# options. (Except for CPU models reported as "static" in
|
|
|
|
# query-cpu-definitions.)
|
|
|
|
# * "-cpu" arguments and global properties: arguments to the -cpu
|
|
|
|
# option and global properties may affect expansion of CPU models.
|
|
|
|
# Using query-cpu-model-expansion while using these is not advised.
|
|
|
|
#
|
|
|
|
# Some architectures may not support comparing CPU models. s390x
|
|
|
|
# supports comparing CPU models.
|
|
|
|
#
|
|
|
|
# Returns: a CpuModelBaselineInfo. Returns an error if comparing CPU
|
|
|
|
# models is not supported, if a model cannot be used, if a model
|
|
|
|
# contains an unknown cpu definition name, unknown properties or
|
|
|
|
# properties with wrong types.
|
2019-06-19 23:10:45 +03:00
|
|
|
#
|
|
|
|
# Note: this command isn't specific to s390x, but is only implemented
|
2023-04-28 13:54:29 +03:00
|
|
|
# on this architecture currently.
|
2019-06-19 23:10:45 +03:00
|
|
|
#
|
2020-11-18 09:41:58 +03:00
|
|
|
# Since: 2.8
|
2019-06-19 23:10:45 +03:00
|
|
|
##
|
|
|
|
{ 'command': 'query-cpu-model-comparison',
|
|
|
|
'data': { 'modela': 'CpuModelInfo', 'modelb': 'CpuModelInfo' },
|
|
|
|
'returns': 'CpuModelCompareInfo',
|
2021-08-04 11:31:05 +03:00
|
|
|
'if': 'TARGET_S390X' }
|
2019-06-19 23:10:45 +03:00
|
|
|
|
|
|
|
##
|
|
|
|
# @query-cpu-model-baseline:
|
|
|
|
#
|
2023-04-28 13:54:29 +03:00
|
|
|
# Baseline two CPU models, creating a compatible third model. The
|
|
|
|
# created model will always be a static, migration-safe CPU model (see
|
|
|
|
# "static" CPU model expansion for details).
|
2019-06-19 23:10:45 +03:00
|
|
|
#
|
2023-04-28 13:54:29 +03:00
|
|
|
# This interface can be used by tooling to create a compatible CPU
|
|
|
|
# model out two CPU models. The created CPU model will be identical
|
|
|
|
# to or a subset of both CPU models when comparing them. Therefore,
|
|
|
|
# the created CPU model is guaranteed to run where the given CPU
|
|
|
|
# models run.
|
2019-06-19 23:10:45 +03:00
|
|
|
#
|
|
|
|
# The result returned by this command may be affected by:
|
|
|
|
#
|
2023-04-28 13:54:29 +03:00
|
|
|
# * QEMU version: CPU models may look different depending on the QEMU
|
|
|
|
# version. (Except for CPU models reported as "static" in
|
|
|
|
# query-cpu-definitions.)
|
|
|
|
# * machine-type: CPU model may look different depending on the
|
|
|
|
# machine-type. (Except for CPU models reported as "static" in
|
|
|
|
# query-cpu-definitions.)
|
|
|
|
# * machine options (including accelerator): in some architectures,
|
|
|
|
# CPU models may look different depending on machine and accelerator
|
|
|
|
# options. (Except for CPU models reported as "static" in
|
|
|
|
# query-cpu-definitions.)
|
|
|
|
# * "-cpu" arguments and global properties: arguments to the -cpu
|
|
|
|
# option and global properties may affect expansion of CPU models.
|
|
|
|
# Using query-cpu-model-expansion while using these is not advised.
|
|
|
|
#
|
|
|
|
# Some architectures may not support baselining CPU models. s390x
|
|
|
|
# supports baselining CPU models.
|
|
|
|
#
|
|
|
|
# Returns: a CpuModelBaselineInfo. Returns an error if baselining CPU
|
|
|
|
# models is not supported, if a model cannot be used, if a model
|
|
|
|
# contains an unknown cpu definition name, unknown properties or
|
|
|
|
# properties with wrong types.
|
2019-06-19 23:10:45 +03:00
|
|
|
#
|
|
|
|
# Note: this command isn't specific to s390x, but is only implemented
|
2023-04-28 13:54:29 +03:00
|
|
|
# on this architecture currently.
|
2019-06-19 23:10:45 +03:00
|
|
|
#
|
2020-11-18 09:41:58 +03:00
|
|
|
# Since: 2.8
|
2019-06-19 23:10:45 +03:00
|
|
|
##
|
|
|
|
{ 'command': 'query-cpu-model-baseline',
|
|
|
|
'data': { 'modela': 'CpuModelInfo',
|
|
|
|
'modelb': 'CpuModelInfo' },
|
|
|
|
'returns': 'CpuModelBaselineInfo',
|
2021-08-04 11:31:05 +03:00
|
|
|
'if': 'TARGET_S390X' }
|
2019-06-19 23:10:45 +03:00
|
|
|
|
|
|
|
##
|
|
|
|
# @CpuModelExpansionInfo:
|
|
|
|
#
|
|
|
|
# The result of a cpu model expansion.
|
|
|
|
#
|
|
|
|
# @model: the expanded CpuModelInfo.
|
|
|
|
#
|
2020-11-18 09:41:58 +03:00
|
|
|
# Since: 2.8
|
2019-06-19 23:10:45 +03:00
|
|
|
##
|
|
|
|
{ 'struct': 'CpuModelExpansionInfo',
|
|
|
|
'data': { 'model': 'CpuModelInfo' },
|
2021-08-04 11:31:05 +03:00
|
|
|
'if': { 'any': [ 'TARGET_S390X',
|
|
|
|
'TARGET_I386',
|
target/loongarch: Implement query-cpu-model-expansion
Add support for the query-cpu-model-expansion QMP command to LoongArch.
We support query the cpu features.
e.g
la464 and max cpu support LSX/LASX, default enable,
la132 not support LSX/LASX.
1. start with '-cpu max,lasx=off'
(QEMU) query-cpu-model-expansion type=static model={"name":"max"}
{"return": {"model": {"name": "max", "props": {"lasx": false, "lsx": true}}}}
2. start with '-cpu la464,lasx=off'
(QEMU) query-cpu-model-expansion type=static model={"name":"la464"}
{"return": {"model": {"name": "max", "props": {"lasx": false, "lsx": true}}}
3. start with '-cpu la132,lasx=off'
qemu-system-loongarch64: can't apply global la132-loongarch-cpu.lasx=off: Property 'la132-loongarch-cpu.lasx' not found
4. start with '-cpu max,lasx=off' or start with '-cpu la464,lasx=off' query cpu model la132
(QEMU) query-cpu-model-expansion type=static model={"name":"la132"}
{"return": {"model": {"name": "la132"}}}
Acked-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Song Gao <gaosong@loongson.cn>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20231020084925.3457084-4-gaosong@loongson.cn>
2023-10-20 11:49:25 +03:00
|
|
|
'TARGET_ARM',
|
qapi,risc-v: add query-cpu-model-expansion
This API is used to inspect the characteristics of a given CPU model. It
also allows users to validate a CPU model with a certain configuration,
e.g. if "-cpu X,a=true,b=false" is a valid setup for a given QEMU
binary. We'll start implementing the first part. The second requires
more changes in RISC-V CPU boot flow.
The implementation is inspired by the existing ARM
query-cpu-model-expansion impl in target/arm/arm-qmp-cmds.c. We'll
create a RISCVCPU object with the required model, fetch its existing
properties, add a couple of relevant boolean options (pmp and mmu) and
display it to users.
Here's an usage example:
./build/qemu-system-riscv64 -S -M virt -display none \
-qmp tcp:localhost:1234,server,wait=off
./scripts/qmp/qmp-shell localhost:1234
Welcome to the QMP low-level shell!
Connected to QEMU 8.1.50
(QEMU) query-cpu-model-expansion type=full model={"name":"rv64"}
{"return": {"model": {"name": "rv64", "props": {"zicond": false, "x-zvfh": false, "mmu": true, "x-zvfbfwma": false, "x-zvfbfmin": false, "xtheadbs": false, "xtheadbb": false, "xtheadba": false, "xtheadmemidx": false, "smstateen": false, "zfinx": false, "Zve64f": false, "Zve32f": false, "x-zvfhmin": false, "xventanacondops": false, "xtheadcondmov": false, "svpbmt": false, "zbs": true, "zbc": true, "zbb": true, "zba": true, "zicboz": true, "xtheadmac": false, "Zfh": false, "Zfa": true, "zbkx": false, "zbkc": false, "zbkb": false, "Zve64d": false, "x-zfbfmin": false, "zk": false, "x-epmp": false, "xtheadmempair": false, "zkt": false, "zks": false, "zkr": false, "zkn": false, "Zfhmin": false, "zksh": false, "zknh": false, "zkne": false, "zknd": false, "zhinx": false, "Zicsr": true, "sscofpmf": false, "Zihintntl": true, "sstc": true, "xtheadcmo": false, "x-zvbb": false, "zksed": false, "x-zvkned": false, "xtheadsync": false, "x-zvkg": false, "zhinxmin": false, "svadu": true, "xtheadfmv": false, "x-zvksed": false, "svnapot": false, "pmp": true, "x-zvknhb": false, "x-zvknha": false, "xtheadfmemidx": false, "x-zvksh": false, "zdinx": false, "zicbom": true, "Zihintpause": true, "svinval": false, "zcf": false, "zce": false, "zcd": false, "zcb": false, "zca": false, "x-ssaia": false, "x-smaia": false, "zmmul": false, "x-zvbc": false, "Zifencei": true, "zcmt": false, "zcmp": false, "Zawrs": true}}}}
Signed-off-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Message-ID: <20231018195638.211151-3-dbarboza@ventanamicro.com>
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
2023-10-18 22:56:34 +03:00
|
|
|
'TARGET_LOONGARCH64',
|
|
|
|
'TARGET_RISCV' ] } }
|
2019-06-19 23:10:45 +03:00
|
|
|
|
|
|
|
##
|
|
|
|
# @query-cpu-model-expansion:
|
|
|
|
#
|
2023-04-28 13:54:29 +03:00
|
|
|
# Expands a given CPU model (or a combination of CPU model +
|
|
|
|
# additional options) to different granularities, allowing tooling to
|
|
|
|
# get an understanding what a specific CPU model looks like in QEMU
|
|
|
|
# under a certain configuration.
|
2019-06-19 23:10:45 +03:00
|
|
|
#
|
|
|
|
# This interface can be used to query the "host" CPU model.
|
|
|
|
#
|
|
|
|
# The data returned by this command may be affected by:
|
|
|
|
#
|
2023-04-28 13:54:29 +03:00
|
|
|
# * QEMU version: CPU models may look different depending on the QEMU
|
|
|
|
# version. (Except for CPU models reported as "static" in
|
|
|
|
# query-cpu-definitions.)
|
|
|
|
# * machine-type: CPU model may look different depending on the
|
|
|
|
# machine-type. (Except for CPU models reported as "static" in
|
|
|
|
# query-cpu-definitions.)
|
|
|
|
# * machine options (including accelerator): in some architectures,
|
|
|
|
# CPU models may look different depending on machine and accelerator
|
|
|
|
# options. (Except for CPU models reported as "static" in
|
|
|
|
# query-cpu-definitions.)
|
|
|
|
# * "-cpu" arguments and global properties: arguments to the -cpu
|
|
|
|
# option and global properties may affect expansion of CPU models.
|
|
|
|
# Using query-cpu-model-expansion while using these is not advised.
|
|
|
|
#
|
|
|
|
# Some architectures may not support all expansion types. s390x
|
|
|
|
# supports "full" and "static". Arm only supports "full".
|
|
|
|
#
|
|
|
|
# Returns: a CpuModelExpansionInfo. Returns an error if expanding CPU
|
|
|
|
# models is not supported, if the model cannot be expanded, if the
|
|
|
|
# model contains an unknown CPU definition name, unknown
|
|
|
|
# properties or properties with a wrong type. Also returns an
|
|
|
|
# error if an expansion type is not supported.
|
2019-06-19 23:10:45 +03:00
|
|
|
#
|
2020-11-18 09:41:58 +03:00
|
|
|
# Since: 2.8
|
2019-06-19 23:10:45 +03:00
|
|
|
##
|
|
|
|
{ 'command': 'query-cpu-model-expansion',
|
|
|
|
'data': { 'type': 'CpuModelExpansionType',
|
|
|
|
'model': 'CpuModelInfo' },
|
|
|
|
'returns': 'CpuModelExpansionInfo',
|
2021-08-04 11:31:05 +03:00
|
|
|
'if': { 'any': [ 'TARGET_S390X',
|
|
|
|
'TARGET_I386',
|
target/loongarch: Implement query-cpu-model-expansion
Add support for the query-cpu-model-expansion QMP command to LoongArch.
We support query the cpu features.
e.g
la464 and max cpu support LSX/LASX, default enable,
la132 not support LSX/LASX.
1. start with '-cpu max,lasx=off'
(QEMU) query-cpu-model-expansion type=static model={"name":"max"}
{"return": {"model": {"name": "max", "props": {"lasx": false, "lsx": true}}}}
2. start with '-cpu la464,lasx=off'
(QEMU) query-cpu-model-expansion type=static model={"name":"la464"}
{"return": {"model": {"name": "max", "props": {"lasx": false, "lsx": true}}}
3. start with '-cpu la132,lasx=off'
qemu-system-loongarch64: can't apply global la132-loongarch-cpu.lasx=off: Property 'la132-loongarch-cpu.lasx' not found
4. start with '-cpu max,lasx=off' or start with '-cpu la464,lasx=off' query cpu model la132
(QEMU) query-cpu-model-expansion type=static model={"name":"la132"}
{"return": {"model": {"name": "la132"}}}
Acked-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Song Gao <gaosong@loongson.cn>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20231020084925.3457084-4-gaosong@loongson.cn>
2023-10-20 11:49:25 +03:00
|
|
|
'TARGET_ARM',
|
qapi,risc-v: add query-cpu-model-expansion
This API is used to inspect the characteristics of a given CPU model. It
also allows users to validate a CPU model with a certain configuration,
e.g. if "-cpu X,a=true,b=false" is a valid setup for a given QEMU
binary. We'll start implementing the first part. The second requires
more changes in RISC-V CPU boot flow.
The implementation is inspired by the existing ARM
query-cpu-model-expansion impl in target/arm/arm-qmp-cmds.c. We'll
create a RISCVCPU object with the required model, fetch its existing
properties, add a couple of relevant boolean options (pmp and mmu) and
display it to users.
Here's an usage example:
./build/qemu-system-riscv64 -S -M virt -display none \
-qmp tcp:localhost:1234,server,wait=off
./scripts/qmp/qmp-shell localhost:1234
Welcome to the QMP low-level shell!
Connected to QEMU 8.1.50
(QEMU) query-cpu-model-expansion type=full model={"name":"rv64"}
{"return": {"model": {"name": "rv64", "props": {"zicond": false, "x-zvfh": false, "mmu": true, "x-zvfbfwma": false, "x-zvfbfmin": false, "xtheadbs": false, "xtheadbb": false, "xtheadba": false, "xtheadmemidx": false, "smstateen": false, "zfinx": false, "Zve64f": false, "Zve32f": false, "x-zvfhmin": false, "xventanacondops": false, "xtheadcondmov": false, "svpbmt": false, "zbs": true, "zbc": true, "zbb": true, "zba": true, "zicboz": true, "xtheadmac": false, "Zfh": false, "Zfa": true, "zbkx": false, "zbkc": false, "zbkb": false, "Zve64d": false, "x-zfbfmin": false, "zk": false, "x-epmp": false, "xtheadmempair": false, "zkt": false, "zks": false, "zkr": false, "zkn": false, "Zfhmin": false, "zksh": false, "zknh": false, "zkne": false, "zknd": false, "zhinx": false, "Zicsr": true, "sscofpmf": false, "Zihintntl": true, "sstc": true, "xtheadcmo": false, "x-zvbb": false, "zksed": false, "x-zvkned": false, "xtheadsync": false, "x-zvkg": false, "zhinxmin": false, "svadu": true, "xtheadfmv": false, "x-zvksed": false, "svnapot": false, "pmp": true, "x-zvknhb": false, "x-zvknha": false, "xtheadfmemidx": false, "x-zvksh": false, "zdinx": false, "zicbom": true, "Zihintpause": true, "svinval": false, "zcf": false, "zce": false, "zcd": false, "zcb": false, "zca": false, "x-ssaia": false, "x-smaia": false, "zmmul": false, "x-zvbc": false, "Zifencei": true, "zcmt": false, "zcmp": false, "Zawrs": true}}}}
Signed-off-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Message-ID: <20231018195638.211151-3-dbarboza@ventanamicro.com>
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
2023-10-18 22:56:34 +03:00
|
|
|
'TARGET_LOONGARCH64',
|
|
|
|
'TARGET_RISCV' ] } }
|
2019-06-19 23:10:45 +03:00
|
|
|
|
|
|
|
##
|
|
|
|
# @CpuDefinitionInfo:
|
|
|
|
#
|
|
|
|
# Virtual CPU definition.
|
|
|
|
#
|
|
|
|
# @name: the name of the CPU definition
|
|
|
|
#
|
|
|
|
# @migration-safe: whether a CPU definition can be safely used for
|
2023-04-28 13:54:29 +03:00
|
|
|
# migration in combination with a QEMU compatibility machine when
|
|
|
|
# migrating between different QEMU versions and between hosts with
|
|
|
|
# different sets of (hardware or software) capabilities. If not
|
|
|
|
# provided, information is not available and callers should not
|
|
|
|
# assume the CPU definition to be migration-safe. (since 2.8)
|
|
|
|
#
|
|
|
|
# @static: whether a CPU definition is static and will not change
|
|
|
|
# depending on QEMU version, machine type, machine options and
|
|
|
|
# accelerator options. A static model is always migration-safe.
|
|
|
|
# (since 2.8)
|
|
|
|
#
|
|
|
|
# @unavailable-features: List of properties that prevent the CPU model
|
|
|
|
# from running in the current host. (since 2.8)
|
|
|
|
#
|
|
|
|
# @typename: Type name that can be used as argument to
|
|
|
|
# @device-list-properties, to introspect properties configurable
|
|
|
|
# using -cpu or -global. (since 2.9)
|
|
|
|
#
|
|
|
|
# @alias-of: Name of CPU model this model is an alias for. The target
|
|
|
|
# of the CPU model alias may change depending on the machine type.
|
|
|
|
# Management software is supposed to translate CPU model aliases
|
|
|
|
# in the VM configuration, because aliases may stop being
|
|
|
|
# migration-safe in the future (since 4.1)
|
|
|
|
#
|
|
|
|
# @deprecated: If true, this CPU model is deprecated and may be
|
|
|
|
# removed in in some future version of QEMU according to the QEMU
|
|
|
|
# deprecation policy. (since 5.2)
|
|
|
|
#
|
|
|
|
# @unavailable-features is a list of QOM property names that represent
|
|
|
|
# CPU model attributes that prevent the CPU from running. If the QOM
|
|
|
|
# property is read-only, that means there's no known way to make the
|
|
|
|
# CPU model run in the current host. Implementations that choose not
|
|
|
|
# to provide specific information return the property name "type". If
|
|
|
|
# the property is read-write, it means that it MAY be possible to run
|
|
|
|
# the CPU model in the current host if that property is changed.
|
|
|
|
# Management software can use it as hints to suggest or choose an
|
|
|
|
# alternative for the user, or just to generate meaningful error
|
|
|
|
# messages explaining why the CPU model can't be used. If
|
|
|
|
# @unavailable-features is an empty list, the CPU model is runnable
|
|
|
|
# using the current host and machine-type. If @unavailable-features
|
|
|
|
# is not present, runnability information for the CPU is not
|
|
|
|
# available.
|
2019-06-19 23:10:45 +03:00
|
|
|
#
|
2020-11-18 09:41:58 +03:00
|
|
|
# Since: 1.2
|
2019-06-19 23:10:45 +03:00
|
|
|
##
|
|
|
|
{ 'struct': 'CpuDefinitionInfo',
|
|
|
|
'data': { 'name': 'str',
|
|
|
|
'*migration-safe': 'bool',
|
|
|
|
'static': 'bool',
|
|
|
|
'*unavailable-features': [ 'str' ],
|
2019-06-28 03:28:36 +03:00
|
|
|
'typename': 'str',
|
2020-09-22 10:14:14 +03:00
|
|
|
'*alias-of' : 'str',
|
|
|
|
'deprecated' : 'bool' },
|
2021-08-04 11:31:05 +03:00
|
|
|
'if': { 'any': [ 'TARGET_PPC',
|
|
|
|
'TARGET_ARM',
|
|
|
|
'TARGET_I386',
|
|
|
|
'TARGET_S390X',
|
2022-06-06 15:43:11 +03:00
|
|
|
'TARGET_MIPS',
|
target/riscv: add query-cpy-definitions support
This command is used by tooling like libvirt to retrieve a list of
supported CPUs. Each entry returns a CpuDefinitionInfo object that
contains more information about each CPU.
This initial support includes only the name of the CPU and its typename.
Here's what the command produces for the riscv64 target:
$ ./build/qemu-system-riscv64 -S -M virt -display none -qmp stdio
{"QMP": {"version": (...)}
{"execute": "qmp_capabilities", "arguments": {"enable": ["oob"]}}
{"return": {}}
{"execute": "query-cpu-definitions"}
{"return": [
{"name": "rv64", "typename": "rv64-riscv-cpu", "static": false, "deprecated": false},
{"name": "sifive-e51", "typename": "sifive-e51-riscv-cpu", "static": false, "deprecated": false},
{"name": "any", "typename": "any-riscv-cpu", "static": false, "deprecated": false},
{"name": "x-rv128", "typename": "x-rv128-riscv-cpu", "static": false, "deprecated": false},
{"name": "shakti-c", "typename": "shakti-c-riscv-cpu", "static": false, "deprecated": false},
{"name": "thead-c906", "typename": "thead-c906-riscv-cpu", "static": false, "deprecated": false},
{"name": "sifive-u54", "typename": "sifive-u54-riscv-cpu", "static": false, "deprecated": false}]
}
Next patch will introduce a way to tell whether a given CPU is static or
not.
Signed-off-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Message-Id: <20230411183511.189632-3-dbarboza@ventanamicro.com>
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
2023-04-11 21:35:10 +03:00
|
|
|
'TARGET_LOONGARCH64',
|
|
|
|
'TARGET_RISCV' ] } }
|
2019-06-19 23:10:45 +03:00
|
|
|
|
|
|
|
##
|
|
|
|
# @query-cpu-definitions:
|
|
|
|
#
|
|
|
|
# Return a list of supported virtual CPU definitions
|
|
|
|
#
|
2023-04-25 09:42:10 +03:00
|
|
|
# Returns: a list of CpuDefinitionInfo
|
2019-06-19 23:10:45 +03:00
|
|
|
#
|
2020-11-18 09:41:58 +03:00
|
|
|
# Since: 1.2
|
2019-06-19 23:10:45 +03:00
|
|
|
##
|
|
|
|
{ 'command': 'query-cpu-definitions', 'returns': ['CpuDefinitionInfo'],
|
2021-08-04 11:31:05 +03:00
|
|
|
'if': { 'any': [ 'TARGET_PPC',
|
|
|
|
'TARGET_ARM',
|
|
|
|
'TARGET_I386',
|
|
|
|
'TARGET_S390X',
|
2022-06-06 15:43:11 +03:00
|
|
|
'TARGET_MIPS',
|
target/riscv: add query-cpy-definitions support
This command is used by tooling like libvirt to retrieve a list of
supported CPUs. Each entry returns a CpuDefinitionInfo object that
contains more information about each CPU.
This initial support includes only the name of the CPU and its typename.
Here's what the command produces for the riscv64 target:
$ ./build/qemu-system-riscv64 -S -M virt -display none -qmp stdio
{"QMP": {"version": (...)}
{"execute": "qmp_capabilities", "arguments": {"enable": ["oob"]}}
{"return": {}}
{"execute": "query-cpu-definitions"}
{"return": [
{"name": "rv64", "typename": "rv64-riscv-cpu", "static": false, "deprecated": false},
{"name": "sifive-e51", "typename": "sifive-e51-riscv-cpu", "static": false, "deprecated": false},
{"name": "any", "typename": "any-riscv-cpu", "static": false, "deprecated": false},
{"name": "x-rv128", "typename": "x-rv128-riscv-cpu", "static": false, "deprecated": false},
{"name": "shakti-c", "typename": "shakti-c-riscv-cpu", "static": false, "deprecated": false},
{"name": "thead-c906", "typename": "thead-c906-riscv-cpu", "static": false, "deprecated": false},
{"name": "sifive-u54", "typename": "sifive-u54-riscv-cpu", "static": false, "deprecated": false}]
}
Next patch will introduce a way to tell whether a given CPU is static or
not.
Signed-off-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Message-Id: <20230411183511.189632-3-dbarboza@ventanamicro.com>
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
2023-04-11 21:35:10 +03:00
|
|
|
'TARGET_LOONGARCH64',
|
|
|
|
'TARGET_RISCV' ] } }
|
2023-10-16 21:39:08 +03:00
|
|
|
|
|
|
|
##
|
|
|
|
# @CpuS390Polarization:
|
|
|
|
#
|
|
|
|
# An enumeration of CPU polarization that can be assumed by a virtual
|
|
|
|
# S390 CPU
|
|
|
|
#
|
|
|
|
# Since: 8.2
|
|
|
|
##
|
|
|
|
{ 'enum': 'CpuS390Polarization',
|
|
|
|
'prefix': 'S390_CPU_POLARIZATION',
|
|
|
|
'data': [ 'horizontal', 'vertical' ],
|
|
|
|
'if': 'TARGET_S390X'
|
|
|
|
}
|
2023-10-16 21:39:13 +03:00
|
|
|
|
|
|
|
##
|
|
|
|
# @set-cpu-topology:
|
|
|
|
#
|
|
|
|
# Modify the topology by moving the CPU inside the topology tree,
|
|
|
|
# or by changing a modifier attribute of a CPU.
|
|
|
|
# Absent values will not be modified.
|
|
|
|
#
|
|
|
|
# @core-id: the vCPU ID to be moved
|
|
|
|
#
|
|
|
|
# @socket-id: destination socket to move the vCPU to
|
|
|
|
#
|
|
|
|
# @book-id: destination book to move the vCPU to
|
|
|
|
#
|
|
|
|
# @drawer-id: destination drawer to move the vCPU to
|
|
|
|
#
|
|
|
|
# @entitlement: entitlement to set
|
|
|
|
#
|
|
|
|
# @dedicated: whether the provisioning of real to virtual CPU is dedicated
|
|
|
|
#
|
|
|
|
# Features:
|
|
|
|
#
|
|
|
|
# @unstable: This command is experimental.
|
|
|
|
#
|
|
|
|
# Returns: Nothing on success.
|
|
|
|
#
|
|
|
|
# Since: 8.2
|
|
|
|
##
|
|
|
|
{ 'command': 'set-cpu-topology',
|
|
|
|
'data': {
|
|
|
|
'core-id': 'uint16',
|
|
|
|
'*socket-id': 'uint16',
|
|
|
|
'*book-id': 'uint16',
|
|
|
|
'*drawer-id': 'uint16',
|
|
|
|
'*entitlement': 'CpuS390Entitlement',
|
|
|
|
'*dedicated': 'bool'
|
|
|
|
},
|
|
|
|
'features': [ 'unstable' ],
|
|
|
|
'if': { 'all': [ 'TARGET_S390X' , 'CONFIG_KVM' ] }
|
|
|
|
}
|
2023-10-16 21:39:16 +03:00
|
|
|
|
|
|
|
##
|
|
|
|
# @CPU_POLARIZATION_CHANGE:
|
|
|
|
#
|
|
|
|
# Emitted when the guest asks to change the polarization.
|
|
|
|
#
|
|
|
|
# The guest can tell the host (via the PTF instruction) whether the
|
|
|
|
# CPUs should be provisioned using horizontal or vertical polarization.
|
|
|
|
#
|
|
|
|
# On horizontal polarization the host is expected to provision all vCPUs
|
|
|
|
# equally.
|
|
|
|
#
|
|
|
|
# On vertical polarization the host can provision each vCPU differently.
|
|
|
|
# The guest will get information on the details of the provisioning
|
|
|
|
# the next time it uses the STSI(15) instruction.
|
|
|
|
#
|
|
|
|
# @polarization: polarization specified by the guest
|
|
|
|
#
|
|
|
|
# Features:
|
|
|
|
#
|
|
|
|
# @unstable: This event is experimental.
|
|
|
|
#
|
|
|
|
# Since: 8.2
|
|
|
|
#
|
|
|
|
# Example:
|
|
|
|
#
|
2024-02-16 17:58:34 +03:00
|
|
|
# <- { "event": "CPU_POLARIZATION_CHANGE",
|
|
|
|
# "data": { "polarization": "horizontal" },
|
|
|
|
# "timestamp": { "seconds": 1401385907, "microseconds": 422329 } }
|
2023-10-16 21:39:16 +03:00
|
|
|
##
|
|
|
|
{ 'event': 'CPU_POLARIZATION_CHANGE',
|
|
|
|
'data': { 'polarization': 'CpuS390Polarization' },
|
|
|
|
'features': [ 'unstable' ],
|
|
|
|
'if': { 'all': [ 'TARGET_S390X', 'CONFIG_KVM' ] }
|
|
|
|
}
|
2023-10-16 21:39:17 +03:00
|
|
|
|
|
|
|
##
|
|
|
|
# @CpuPolarizationInfo:
|
|
|
|
#
|
|
|
|
# The result of a CPU polarization query.
|
|
|
|
#
|
|
|
|
# @polarization: the CPU polarization
|
|
|
|
#
|
|
|
|
# Since: 8.2
|
|
|
|
##
|
|
|
|
{ 'struct': 'CpuPolarizationInfo',
|
|
|
|
'data': { 'polarization': 'CpuS390Polarization' },
|
|
|
|
'if': { 'all': [ 'TARGET_S390X', 'CONFIG_KVM' ] }
|
|
|
|
}
|
|
|
|
|
|
|
|
##
|
|
|
|
# @query-s390x-cpu-polarization:
|
|
|
|
#
|
|
|
|
# Features:
|
|
|
|
#
|
|
|
|
# @unstable: This command is experimental.
|
|
|
|
#
|
|
|
|
# Returns: the machine's CPU polarization
|
|
|
|
#
|
|
|
|
# Since: 8.2
|
|
|
|
##
|
|
|
|
{ 'command': 'query-s390x-cpu-polarization', 'returns': 'CpuPolarizationInfo',
|
|
|
|
'features': [ 'unstable' ],
|
|
|
|
'if': { 'all': [ 'TARGET_S390X', 'CONFIG_KVM' ] }
|
|
|
|
}
|