]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: PPC: Book3S PR: Don't include SPAPR TCE code on non-pseries platforms
authorPaul Mackerras <paulus@ozlabs.org>
Thu, 11 May 2017 04:31:59 +0000 (14:31 +1000)
committerPaul Mackerras <paulus@ozlabs.org>
Fri, 12 May 2017 05:32:30 +0000 (15:32 +1000)
commite99e46965182f3349a8a348993fc90a2e31dd221
tree261a1370503e3359216feff47c3e34046cc18f50
parent4342ffec0ffe9992b0e765812f546ff2a2c84b81
KVM: PPC: Book3S PR: Don't include SPAPR TCE code on non-pseries platforms

Commit 7b9b9c90a0f7 ("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: Alexey Kardashevskiy <aik@ozlabs.ru>
Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
arch/powerpc/kvm/Kconfig
arch/powerpc/kvm/Makefile
arch/powerpc/kvm/book3s_pr_papr.c
arch/powerpc/kvm/powerpc.c