• G
    ppc/kvm: check some capabilities with kvm_vm_check_extension() · 6977afda
    Greg Kurz 提交于
    The following capabilities are VM specific:
    - KVM_CAP_PPC_SMT_POSSIBLE
    - KVM_CAP_PPC_HTAB_FD
    - KVM_CAP_PPC_ALLOC_HTAB
    
    If both KVM HV and KVM PR are present, checking them always return
    the HV value, even if we explicitely requested to use PR.
    
    This has no visible effect for KVM_CAP_PPC_ALLOC_HTAB, because we also
    try the KVM_PPC_ALLOCATE_HTAB ioctl which is only suppored by HV. As
    a consequence, the spapr code doesn't even check KVM_CAP_PPC_HTAB_FD.
    
    However, this will cause kvmppc_hint_smt_possible(), introduced by
    commit fa98fbfc, to report several VSMT modes (eg, Available
    VSMT modes: 8 4 2 1) whereas PR only support mode 1.
    
    This patch fixes all three anyway to use kvm_vm_check_extension(). It
    is okay since the VM is already created at the time kvm_arch_init() or
    kvmppc_reset_htab() is called.
    Signed-off-by: NGreg Kurz <groug@kaod.org>
    Reviewed-by: NThomas Huth <thuth@redhat.com>
    Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
    6977afda
kvm.c 78.9 KB