Skip to content
Commit 2401d8a4 authored by Eduardo Habkost's avatar Eduardo Habkost Committed by Michael Roth
Browse files

pc: Use "min-[x]level" on compat_props

Since the automatic cpuid-level code was introduced in commit
c39c0edf ("target-i386: Automatically
set level/xlevel/xlevel2 when needed"), the CPU model tables just define
the default CPUID level code (set using "min-level").  Setting
"[x]level" forces CPUID level to a specific value and disable the
automatic-level logic.

But the PC compat code was not updated and the existing "[x]level"
compat properties broke compatibility for people using features that
triggered the auto-level code.  To keep previous behavior, we should set
"min-[x]level" instead of "[x]level" on compat_props.

This was not a problem for most cases, because old machine-types don't
have full-cpuid-auto-level enabled.  The only common use case it broke
was the CPUID[7] auto-level code, that was already enabled since the
first CPUID[7] feature was introduced (in QEMU 1.4.0).

This causes the regression reported at:
https://bugzilla.redhat.com/show_bug.cgi?id=1454641



Change the PC compat code to use "min-[x]level" instead of "[x]level" on
compat_props, and add new test cases to ensure we don't break this
again.

Reported-by: default avatar"Guo, Zhiyi" <zhguo@redhat.com>
Fixes: c39c0edf ("target-i386: Automatically set level/xlevel/xlevel2 when needed")
Cc: qemu-stable@nongnu.org
Acked-by: default avatarMichael S. Tsirkin <mst@redhat.com>
Signed-off-by: default avatarEduardo Habkost <ehabkost@redhat.com>
(cherry picked from commit 1f435716)
Signed-off-by: default avatarMichael Roth <mdroth@linux.vnet.ibm.com>
parent 1775fe61
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment