Commit a05ef161 authored by Michael Ellerman's avatar Michael Ellerman

powerpc/mm: Fix build break when CMA=n && SPAPR_TCE_IOMMU=y

Currently the build breaks if CMA=n and SPAPR_TCE_IOMMU=y:

  arch/powerpc/mm/mmu_context_iommu.c: In function ‘mm_iommu_get’:
  arch/powerpc/mm/mmu_context_iommu.c:193:42: error: ‘MIGRATE_CMA’ undeclared (first use in this function)
  if (get_pageblock_migratetype(page) == MIGRATE_CMA) {
  ^~~~~~~~~~~

Fix it by using the existing is_migrate_cma_page(), which evaulates to
false when CMA=n.

Fixes: 2e5bbb54 ("KVM: PPC: Book3S HV: Migrate pinned pages out of CMA")
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
parent aad71e39
...@@ -184,7 +184,7 @@ long mm_iommu_get(struct mm_struct *mm, unsigned long ua, unsigned long entries, ...@@ -184,7 +184,7 @@ long mm_iommu_get(struct mm_struct *mm, unsigned long ua, unsigned long entries,
* of the CMA zone if possible. NOTE: faulting in + migration * of the CMA zone if possible. NOTE: faulting in + migration
* can be expensive. Batching can be considered later * can be expensive. Batching can be considered later
*/ */
if (get_pageblock_migratetype(page) == MIGRATE_CMA) { if (is_migrate_cma_page(page)) {
if (mm_iommu_move_page_from_cma(page)) if (mm_iommu_move_page_from_cma(page))
goto populate; goto populate;
if (1 != get_user_pages_fast(ua + (i << PAGE_SHIFT), if (1 != get_user_pages_fast(ua + (i << PAGE_SHIFT),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment