diff options
author | Eduardo Habkost <ehabkost@redhat.com> | 2016-10-14 15:42:45 -0300 |
---|---|---|
committer | Eduardo Habkost <ehabkost@redhat.com> | 2016-10-17 15:50:57 -0200 |
commit | 46c032f3afcc05a0123914609f1003906ba63fda (patch) | |
tree | 8ff43f3df613eeba9047c18d6edd08bcde41e253 /hw/intc | |
parent | b54c93778b5850aaaea176803fe1e46f9732ee1a (diff) | |
download | qemu-46c032f3afcc05a0123914609f1003906ba63fda.zip qemu-46c032f3afcc05a0123914609f1003906ba63fda.tar.gz qemu-46c032f3afcc05a0123914609f1003906ba63fda.tar.bz2 |
target-i386: Don't use cpu->migratable when filtering features
When explicitly enabling unmigratable flags using "-cpu host"
(e.g. "-cpu host,+invtsc"), the requested feature won't be
enabled because cpu->migratable is true by default.
This is inconsistent with all other CPU models, which don't have
the "migratable" option, making "+invtsc" work without the need
for extra options.
This happens because x86_cpu_filter_features() uses
cpu->migratable as an argument for
x86_cpu_get_supported_feature_word(). This is not useful
because:
2) on "-cpu host" it only makes QEMU disable features that were
explicitly enabled in the command-line;
1) on all the other CPU models, cpu->migratable is already false.
The fix is to just use 'false' as an argument to
x86_cpu_get_supported_feature_word() in
x86_cpu_filter_features().
Note that:
* This won't change anything for people using using
"-cpu host" or "-cpu host,migratable=<on|off>" (with no extra
features) because the x86_cpu_get_supported_feature_word() call
on the cpu->host_features check uses cpu->migratable as
argument.
* This won't change anything for any CPU model except "host"
because they all have cpu->migratable == false (and only "host"
has the "migratable" property that allows it to be changed).
* This will only change things for people using "-cpu host,+<feature>",
where <feature> is a non-migratable feature. The only existing
named non-migratable feature is "invtsc".
In other words, this change will only affect people using
"-cpu host,+invtsc" (that will now get what they asked for: the
invtsc flag will be enabled). All other use cases are unaffected.
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Diffstat (limited to 'hw/intc')
0 files changed, 0 insertions, 0 deletions