]> xenbits.xensource.com Git - libvirt.git/commit
cpu_x86: Ignore enabled features for input models in x86DecodeUseCandidate
authorJiri Denemark <jdenemar@redhat.com>
Fri, 29 Apr 2022 08:35:02 +0000 (10:35 +0200)
committerJiri Denemark <jdenemar@redhat.com>
Fri, 6 May 2022 15:33:47 +0000 (17:33 +0200)
commitbb6cedd2082599323257ee0df18c93a6e0551b0b
tree8ab67020da6e55440cc3f916a79d4a6e44764a85
parent48341b025acdd04a66696a709c7b09b3bfd42acf
cpu_x86: Ignore enabled features for input models in x86DecodeUseCandidate

While we don't want to aim for the shortest list of disabled features in
the baseline result (it would select a very old model), we want to do so
while looking at any of the input models for which we're trying to
compute a baseline CPU model. Given a set of input models, we always
want to take the least capable one of them (i.e., the one with shortest
list of disabled features) or a better model which is not one of the
input models.

So when considering an input model, we just check whether its list of
disabled features is shorter than the currently best one. When looking
at other models we check both enabled and disabled features while
penalizing disabled features as implemented by the previous patch.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
src/cpu/cpu_x86.c
tests/cputestdata/x86_64-baseline-Westmere+Nehalem-migratable.xml
tests/cputestdata/x86_64-baseline-Westmere+Nehalem-result.xml
tests/cputestdata/x86_64-cpuid-baseline-Cooperlake+Cascadelake.xml