Skip to content

i386: Add `machine` parameter to query-cpu-definitions

Eduardo Habkost qemu-arm qemu-devel 2 versions – New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest7 patches 0 repliesNew
  2. v17 patches 12 repliesSuperseded

Changes in v2 from the cover letter

* Rewrite documentation, with suggestions from Markus
* Try to reduce churn and keep the existing default_cpu_version static variable
* Replace x86_cpu_class_get_alias_of() with x86_cpu_model_resolve_alias()

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/7machine: machine_find_class() functionhw/core/machine.c include/hw/boards.h softmmu/vl.c+19 -160 replies
2/7i386: Add X86CPUModel.alias_of fieldtarget/i386/cpu.c+11 -40 replies
3/7i386: Replace x86_cpu_class_get_alias_of() with x86_cpu_model_resolve_alias()target/i386/cpu.c+17 -160 replies
4/7i386: Add default_version parameter to CPU version functionstarget/i386/cpu.c+10 -60 replies
5/7i386: Wrap QMP code in !CONFIG_USER_ONLYtarget/i386/cpu.c+6 -00 replies
6/7i386: Don't use default_cpu_version inside x86_cpu_definition_entry()target/i386/cpu.c+15 -80 replies
7/7cpu: Add `machine` parameter to query-cpu-definitionsqapi/machine-target.json target/arm/helper.c target/i386/cpu.c +4 more+95 -70 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [PATCH v2 0/7] i386: Add `machine` parameter to query-cpu-definitions

Changes v1 -> v2:
* Rewrite documentation, with suggestions from Markus
* Try to reduce churn and keep the existing default_cpu_version static variable
* Replace x86_cpu_class_get_alias_of() with x86_cpu_model_resolve_alias()

Link to v1:
https://lore.kernel.org/qemu-devel/[email protected]

We had introduced versioned CPU models in QEMU 4.1, including a method for querying for CPU model versions using query-cpu-definitions. This solution had one problem: fetching CPU alias information for multiple machine types required restarting QEMU for each machine being queried.

This series adds a new machine parameter to query-cpu-definitions, that can be used to query CPU model alias information for multiple machines without restarting QEMU.

About CPU model versioning vs query-cpu-model-expansion
-------------------------------------------------------

There had been some discussion[1] about using a mechanism for this similar to what's done in s390x, based on query-cpu-model-expansion. I had considered that approach in the beginning, but this would require
query-cpu-model-expansion type=static
to resolve to a useful base CPU model that is static.

Unfortunately, we have no useful static CPU model in x86 yet, except for "base", because of the complex accelerator-dependent rules that affect expansion of CPU models. Maybe in the future we'll be able to define static versions of each CPU model, and unify the CPU model versioning approaches in all architectures.

While we don't have this, we need to work with what we have. What we have today in x86 are CPU models that are not static and not accelerator-independent.

[1] https://lore.kernel.org/qemu-devel/[email protected]/

Eduardo Habkost (7):
machine: machine_find_class() function
i386: Add X86CPUModel.alias_of field
i386: Replace x86_cpu_class_get_alias_of() with

    x86_cpu_model_resolve_alias()

i386: Add default_version parameter to CPU version functions
i386: Wrap QMP code in !CONFIG_USER_ONLY
i386: Don't use default_cpu_version inside x86_cpu_definition_entry()
cpu: Add machine parameter to query-cpu-definitions

 qapi/machine-target.json                   |  14 ++-
 include/hw/boards.h                        |   2 +
 hw/core/machine.c                          |  16 ++++
 softmmu/vl.c                               |  17 +---
 target/arm/helper.c                        |   4 +-
 target/i386/cpu.c                          | 105 +++++++++++++++------
 target/mips/helper.c                       |   4 +-
 target/s390x/cpu_models.c                  |   4 +-
 target/ppc/translate_init.c.inc            |   4 +-
 tests/acceptance/x86_cpu_model_versions.py |  48 ++++++++++
 10 files changed, 167 insertions(+), 51 deletions(-)
Signature · 1 line
2.28.0