@@ -68,7 +68,9 @@ static struct iommu_table *iommu_pseries_alloc_table(int node)
68
68
return tbl ;
69
69
}
70
70
71
+ #ifdef CONFIG_IOMMU_API
71
72
static struct iommu_table_group_ops spapr_tce_table_group_ops ;
73
+ #endif
72
74
73
75
static struct iommu_table_group * iommu_pseries_alloc_group (int node )
74
76
{
@@ -165,6 +167,7 @@ static unsigned long tce_get_pseries(struct iommu_table *tbl, long index)
165
167
return be64_to_cpu (* tcep );
166
168
}
167
169
170
+ #ifdef CONFIG_IOMMU_API
168
171
static long pseries_tce_iommu_userspace_view_alloc (struct iommu_table * tbl )
169
172
{
170
173
unsigned long cb = ALIGN (sizeof (tbl -> it_userspace [0 ]) * tbl -> it_size , PAGE_SIZE );
@@ -183,6 +186,7 @@ static long pseries_tce_iommu_userspace_view_alloc(struct iommu_table *tbl)
183
186
184
187
return 0 ;
185
188
}
189
+ #endif
186
190
187
191
static void tce_iommu_userspace_view_free (struct iommu_table * tbl )
188
192
{
@@ -738,6 +742,7 @@ struct iommu_table_ops iommu_table_lpar_multi_ops = {
738
742
.free = tce_free_pSeries
739
743
};
740
744
745
+ #ifdef CONFIG_IOMMU_API
741
746
/*
742
747
* When the DMA window properties might have been removed,
743
748
* the parent node has the table_group setup on it.
@@ -757,6 +762,7 @@ static struct device_node *pci_dma_find_parent_node(struct pci_dev *dev,
757
762
758
763
return NULL ;
759
764
}
765
+ #endif
760
766
761
767
/*
762
768
* Find nearest ibm,dma-window (default DMA window) or direct DMA window or
@@ -1845,6 +1851,7 @@ static bool iommu_bypass_supported_pSeriesLP(struct pci_dev *pdev, u64 dma_mask)
1845
1851
return false;
1846
1852
}
1847
1853
1854
+ #ifdef CONFIG_IOMMU_API
1848
1855
/*
1849
1856
* A simple iommu_table_group_ops which only allows reusing the existing
1850
1857
* iommu_table. This handles VFIO for POWER7 or the nested KVM.
@@ -2327,6 +2334,7 @@ static struct iommu_table_group_ops spapr_tce_table_group_ops = {
2327
2334
.take_ownership = spapr_tce_take_ownership ,
2328
2335
.release_ownership = spapr_tce_release_ownership ,
2329
2336
};
2337
+ #endif
2330
2338
2331
2339
static int iommu_mem_notifier (struct notifier_block * nb , unsigned long action ,
2332
2340
void * data )
0 commit comments