• Paul Mackerras's avatar
    KVM: PPC: Book3S PR: Don't include SPAPR TCE code on non-pseries platforms · 76d837a4
    Paul Mackerras authored
    Commit e91aa8e6 ("KVM: PPC: Enable IOMMU_API for KVM_BOOK3S_64
    permanently", 2017-03-22) enabled the SPAPR TCE code for all 64-bit
    Book 3S kernel configurations in order to simplify the code and
    reduce #ifdefs.  However, 64-bit Book 3S PPC platforms other than
    pseries and powernv don't implement the necessary IOMMU callbacks,
    leading to build failures like the following (for a pasemi config):
    
    scripts/kconfig/conf  --silentoldconfig Kconfig
    warning: (KVM_BOOK3S_64) selects SPAPR_TCE_IOMMU which has unmet direct dependencies (IOMMU_SUPPORT && (PPC_POWERNV || PPC_PSERIES))
    
    ...
    
      CC [M]  arch/powerpc/kvm/book3s_64_vio.o
    /home/paulus/kernel/kvm/arch/powerpc/kvm/book3s_64_vio.c: In function ‘kvmppc_clear_tce’:
    /home/paulus/kernel/kvm/arch/powerpc/kvm/book3s_64_vio.c:363:2: error: implicit declaration of function ‘iommu_tce_xchg’ [-Werror=implicit-function-declaration]
      iommu_tce_xchg(tbl, entry, &hpa, &dir);
      ^
    
    To fix this, we make the inclusion of the SPAPR TCE support, and the
    code that uses it in book3s_vio.c and book3s_vio_hv.c, depend on
    the inclusion of support for the pseries and/or powernv platforms.
    This means that when running a 'pseries' guest on those platforms,
    the guest won't have in-kernel acceleration of the PAPR TCE hypercalls,
    but at least now they compile.
    Reviewed-by: default avatarAlexey Kardashevskiy <aik@ozlabs.ru>
    Signed-off-by: default avatarPaul Mackerras <paulus@ozlabs.org>
    76d837a4
book3s_pr_papr.c 11.8 KB