[PATCH qom-cpu 00/11] disable-kvm_mmu + -cpu check/enforce fixes (v2)

Eduardo Habkost
2013-01-04T22:01:01Z

Changes on v2:
- Now both the kvm_mmu-disable and -cpu "enforce" changes are on the same
series
- Coding style fixes

Git tree for reference:
git://github.com/ehabkost/qemu-hacks.git cpu-enforce-all.v2
https://github.com/ehabkost/qemu-hacks/tree/cpu-enforce-all.v2

Patches 1-2 disable the "kvm_mmu" feature by default on pc-1.4. Host-side
support for the kvm_mmu feature was removed from the kernel since v3.3
(released in March 2012), it was marked for removal since January 2011 and it's
slower than shadow or hardware assisted paging (see kernel commit fb92045843).
It doesn't make sense to keep it enabled by default.

Also, keeping it enabled by default would cause unnecessary hassle when
libvirt start using the "enforce" option.

Patches 3-11 change the -cpu check/enforce code to work as it should: it will
check every single CPUID bit to make sure it is supported by the host.

The changes are a bit intrusive, but:

- The longer we take to make "enforce" strict as it should (and make libvirt
finally use it), more users will have VMs with migration-unsafe unpredictable
guest ABIs. For this reason, I would like to get this into QEMU 1.4.
- The changes in this series should affect only users that are already using
the "enforce" flag, and I believe whoever is using the "enforce" flag really
want the strict behavior introduced by this series.

Eduardo Habkost (11):
target-i386: Don't set any KVM flag by default if KVM is disabled
target-i386: Disable kvm_mmu_op by default on pc-1.4
target-i386: kvm: -cpu host: Use GET_SUPPORTED_CPUID for SVM features
target-i386: kvm: Enable all supported KVM features for -cpu host
target-i386: check/enforce: Fix CPUID leaf numbers on error messages
target-i386: check/enforce: Do not ignore "hypervisor" flag
target-i386: check/enforce: Check all CPUID.80000001H.EDX bits
target-i386: check/enforce: Check SVM flag support as well
target-i386: check/enforce: Eliminate check_feat field
target-i386: Call kvm_check_features_against_host() only if
CONFIG_KVM is set
target-i386: check/enforce: Check all feature words

hw/pc_piix.c | 9 +++++-
target-i386/cpu.c | 93 +++++++++++++++++++++++++++++++++++++++++--------------
target-i386/cpu.h | 4 +++
3 files changed, 81 insertions(+), 25 deletions(-)

--
1.7.11.7