unicorn/qemu/target/i386
Eduardo Habkost e71c7b7819
i386: Don't override -cpu options on -cpu host/max
The existing code for "host" and "max" CPU models overrides every
single feature in the CPU object at realize time, even the ones
that were explicitly enabled or disabled by the user using
"feat=on" or "feat=off", while features set using +feat/-feat are
kept.

This means "-cpu host,+invtsc" works as expected, while
"-cpu host,invtsc=on" doesn't.

This was a known bug, already documented in a comment inside
x86_cpu_expand_features(). What makes this bug worse now is that
libvirt 3.0.0 and newer now use "feat=on|off" instead of
+feat/-feat when it detects a QEMU version that supports it (see
libvirt commit d47db7b16dd5422c7e487c8c8ee5b181a2f9cd66).

Change the feature property getter/setter to set a
env->user_features field, to keep track of features that were
explicitly changed using QOM properties. Then make the
max_features code not override user features when handling "-cpu
host" and "-cpu max".

This will also allow us to remove the plus_features/minus_features
hack in the future, but I plan to do that after 2.9.0 is
released.

Backports commit d4a606b38b5d4b3689b86cc1575908e82179ecfb from qemu
2018-03-02 14:22:45 -05:00
..
arch_memory_mapping.c Move target-* CPU file into a target/ folder 2018-03-01 22:50:58 -05:00
bpt_helper.c Move target-* CPU file into a target/ folder 2018-03-01 22:50:58 -05:00
cc_helper_template.h Move target-* CPU file into a target/ folder 2018-03-01 22:50:58 -05:00
cc_helper.c Move target-* CPU file into a target/ folder 2018-03-01 22:50:58 -05:00
cpu-qom.h Move target-* CPU file into a target/ folder 2018-03-01 22:50:58 -05:00
cpu.c i386: Don't override -cpu options on -cpu host/max 2018-03-02 14:22:45 -05:00
cpu.h i386: Don't override -cpu options on -cpu host/max 2018-03-02 14:22:45 -05:00
excp_helper.c Move target-* CPU file into a target/ folder 2018-03-01 22:50:58 -05:00
fpu_helper.c Move target-* CPU file into a target/ folder 2018-03-01 22:50:58 -05:00
helper.c Move target-* CPU file into a target/ folder 2018-03-01 22:50:58 -05:00
helper.h Move target-* CPU file into a target/ folder 2018-03-01 22:50:58 -05:00
int_helper.c Move target-* CPU file into a target/ folder 2018-03-01 22:50:58 -05:00
Makefile.objs Move target-* CPU file into a target/ folder 2018-03-01 22:50:58 -05:00
mem_helper.c Move target-* CPU file into a target/ folder 2018-03-01 22:50:58 -05:00
misc_helper.c Move target-* CPU file into a target/ folder 2018-03-01 22:50:58 -05:00
mpx_helper.c Move target-* CPU file into a target/ folder 2018-03-01 22:50:58 -05:00
ops_sse_header.h Move target-* CPU file into a target/ folder 2018-03-01 22:50:58 -05:00
ops_sse.h Move target-* CPU file into a target/ folder 2018-03-01 22:50:58 -05:00
seg_helper.c target-i386: defer VMEXIT to do_interrupt 2018-03-02 12:49:18 -05:00
shift_helper_template.h Move target-* CPU file into a target/ folder 2018-03-01 22:50:58 -05:00
smm_helper.c Move target-* CPU file into a target/ folder 2018-03-01 22:50:58 -05:00
svm_helper.c target-i386: defer VMEXIT to do_interrupt 2018-03-02 12:49:18 -05:00
svm.h Move target-* CPU file into a target/ folder 2018-03-01 22:50:58 -05:00
TODO Move target-* CPU file into a target/ folder 2018-03-01 22:50:58 -05:00
topology.h Move target-* CPU file into a target/ folder 2018-03-01 22:50:58 -05:00
translate.c tcg/i386: Check the size of instruction being translated 2018-03-02 14:19:35 -05:00
unicorn.c Move target-* CPU file into a target/ folder 2018-03-01 22:50:58 -05:00
unicorn.h Move target-* CPU file into a target/ folder 2018-03-01 22:50:58 -05:00