]> git.proxmox.com Git - mirror_qemu.git/commit
i386: Resolve CPU models to v1 by default
authorEduardo Habkost <ehabkost@redhat.com>
Thu, 5 Dec 2019 22:33:39 +0000 (19:33 -0300)
committerEduardo Habkost <ehabkost@redhat.com>
Thu, 19 Dec 2019 17:38:51 +0000 (14:38 -0300)
commitad18392892c04637fb56956d997f4bc600224356
tree0851524dcf34914d303a9baa8a08383121ee971e
parentaceeaa69d28e6f08a24395d0aa6915b687d0a681
i386: Resolve CPU models to v1 by default

When using `query-cpu-definitions` using `-machine none`,
QEMU is resolving all CPU models to their latest versions.  The
actual CPU model version being used by another machine type (e.g.
`pc-q35-4.0`) might be different.

In theory, this was OK because the correct CPU model
version is returned when using the correct `-machine` argument.

Except that in practice, this breaks libvirt expectations:
libvirt always use `-machine none` when checking if a CPU model
is runnable, because runnability is not expected to be affected
when the machine type is changed.

For example, when running on a Haswell host without TSX,
Haswell-v4 is runnable, but Haswell-v1 is not.  On those hosts,
`query-cpu-definitions` says Haswell is runnable if using
`-machine none`, but Haswell is actually not runnable using any
of the `pc-*` machine types (because they resolve Haswell to
Haswell-v1).  In other words, we're breaking the "runnability
guarantee" we promised to not break for a few releases (see
qemu-deprecated.texi).

To address this issue, change the default CPU model version to v1
on all machine types, so we make `query-cpu-definitions` output
when using `-machine none` match the results when using `pc-*`.
This will change in the future (the plan is to always return the
latest CPU model version if using `-machine none`), but only
after giving libvirt the opportunity to adapt.

Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1779078
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Message-Id: <20191205223339.764534-1-ehabkost@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
qemu-deprecated.texi
target/i386/cpu.c