Some VM capabilities are currently checked with kvm_check_extension(). This doesn't have any impact for most host architectures because they don't depend on the KVM type. However, this is a problem for server-class ppc hosts that can support the PR and HV KVM types. Both implementations can co-exist in the kernel at the same time and we decide which one will be used with the "type" argument of the KVM_CREATE_VM ioctl.
Each KVM type has a different set of capabilities, and checking them with kvm_check_extension() will always cause KVM to assume we're in HV mode, even if they are VM specific and we have explicitely requested to run in PR mode. This may produce unexpected results. A similar issue was recently fix in the ppc code: https://lists.nongnu.org/archive/html/qemu-devel/2017-09/msg03751.html This series goes a bit further, and turns more kvm_check_extension() into kvm_vm_check_extension() where appropriate. -- Greg --- Greg Kurz (3): kvm: check KVM_CAP_SYNC_MMU with kvm_vm_check_extension() kvm: check KVM_CAP_NR_VCPUS with kvm_vm_check_extension() ppc/kvm: check some capabilities with kvm_vm_check_extension() accel/kvm/kvm-all.c | 47 ++++++++++++++++++++++++----------------------- target/ppc/kvm.c | 6 +++--- 2 files changed, 27 insertions(+), 26 deletions(-)