@@ -360,7 +360,7 @@ static int __arm_lpae_map(struct arm_lpae_io_pgtable *data, unsigned long iova,
360
360
max_entries = ARM_LPAE_PTES_PER_TABLE (data ) - map_idx_start ;
361
361
num_entries = min_t (int , pgcount , max_entries );
362
362
ret = arm_lpae_init_pte (data , iova , paddr , prot , lvl , num_entries , ptep );
363
- if (!ret && mapped )
363
+ if (!ret )
364
364
* mapped += num_entries * size ;
365
365
366
366
return ret ;
@@ -496,13 +496,6 @@ static int arm_lpae_map_pages(struct io_pgtable_ops *ops, unsigned long iova,
496
496
return ret ;
497
497
}
498
498
499
- static int arm_lpae_map (struct io_pgtable_ops * ops , unsigned long iova ,
500
- phys_addr_t paddr , size_t size , int iommu_prot , gfp_t gfp )
501
- {
502
- return arm_lpae_map_pages (ops , iova , paddr , size , 1 , iommu_prot , gfp ,
503
- NULL );
504
- }
505
-
506
499
static void __arm_lpae_free_pgtable (struct arm_lpae_io_pgtable * data , int lvl ,
507
500
arm_lpae_iopte * ptep )
508
501
{
@@ -682,12 +675,6 @@ static size_t arm_lpae_unmap_pages(struct io_pgtable_ops *ops, unsigned long iov
682
675
data -> start_level , ptep );
683
676
}
684
677
685
- static size_t arm_lpae_unmap (struct io_pgtable_ops * ops , unsigned long iova ,
686
- size_t size , struct iommu_iotlb_gather * gather )
687
- {
688
- return arm_lpae_unmap_pages (ops , iova , size , 1 , gather );
689
- }
690
-
691
678
static phys_addr_t arm_lpae_iova_to_phys (struct io_pgtable_ops * ops ,
692
679
unsigned long iova )
693
680
{
@@ -799,9 +786,7 @@ arm_lpae_alloc_pgtable(struct io_pgtable_cfg *cfg)
799
786
data -> pgd_bits = va_bits - (data -> bits_per_level * (levels - 1 ));
800
787
801
788
data -> iop .ops = (struct io_pgtable_ops ) {
802
- .map = arm_lpae_map ,
803
789
.map_pages = arm_lpae_map_pages ,
804
- .unmap = arm_lpae_unmap ,
805
790
.unmap_pages = arm_lpae_unmap_pages ,
806
791
.iova_to_phys = arm_lpae_iova_to_phys ,
807
792
};
@@ -1176,7 +1161,7 @@ static int __init arm_lpae_run_tests(struct io_pgtable_cfg *cfg)
1176
1161
1177
1162
int i , j ;
1178
1163
unsigned long iova ;
1179
- size_t size ;
1164
+ size_t size , mapped ;
1180
1165
struct io_pgtable_ops * ops ;
1181
1166
1182
1167
selftest_running = true;
@@ -1209,15 +1194,16 @@ static int __init arm_lpae_run_tests(struct io_pgtable_cfg *cfg)
1209
1194
for_each_set_bit (j , & cfg -> pgsize_bitmap , BITS_PER_LONG ) {
1210
1195
size = 1UL << j ;
1211
1196
1212
- if (ops -> map (ops , iova , iova , size , IOMMU_READ |
1213
- IOMMU_WRITE |
1214
- IOMMU_NOEXEC |
1215
- IOMMU_CACHE , GFP_KERNEL ))
1197
+ if (ops -> map_pages (ops , iova , iova , size , 1 ,
1198
+ IOMMU_READ | IOMMU_WRITE |
1199
+ IOMMU_NOEXEC | IOMMU_CACHE ,
1200
+ GFP_KERNEL , & mapped ))
1216
1201
return __FAIL (ops , i );
1217
1202
1218
1203
/* Overlapping mappings */
1219
- if (!ops -> map (ops , iova , iova + size , size ,
1220
- IOMMU_READ | IOMMU_NOEXEC , GFP_KERNEL ))
1204
+ if (!ops -> map_pages (ops , iova , iova + size , size , 1 ,
1205
+ IOMMU_READ | IOMMU_NOEXEC ,
1206
+ GFP_KERNEL , & mapped ))
1221
1207
return __FAIL (ops , i );
1222
1208
1223
1209
if (ops -> iova_to_phys (ops , iova + 42 ) != (iova + 42 ))
@@ -1228,11 +1214,12 @@ static int __init arm_lpae_run_tests(struct io_pgtable_cfg *cfg)
1228
1214
1229
1215
/* Partial unmap */
1230
1216
size = 1UL << __ffs (cfg -> pgsize_bitmap );
1231
- if (ops -> unmap (ops , SZ_1G + size , size , NULL ) != size )
1217
+ if (ops -> unmap_pages (ops , SZ_1G + size , size , 1 , NULL ) != size )
1232
1218
return __FAIL (ops , i );
1233
1219
1234
1220
/* Remap of partial unmap */
1235
- if (ops -> map (ops , SZ_1G + size , size , size , IOMMU_READ , GFP_KERNEL ))
1221
+ if (ops -> map_pages (ops , SZ_1G + size , size , size , 1 ,
1222
+ IOMMU_READ , GFP_KERNEL , & mapped ))
1236
1223
return __FAIL (ops , i );
1237
1224
1238
1225
if (ops -> iova_to_phys (ops , SZ_1G + size + 42 ) != (size + 42 ))
@@ -1243,14 +1230,15 @@ static int __init arm_lpae_run_tests(struct io_pgtable_cfg *cfg)
1243
1230
for_each_set_bit (j , & cfg -> pgsize_bitmap , BITS_PER_LONG ) {
1244
1231
size = 1UL << j ;
1245
1232
1246
- if (ops -> unmap (ops , iova , size , NULL ) != size )
1233
+ if (ops -> unmap_pages (ops , iova , size , 1 , NULL ) != size )
1247
1234
return __FAIL (ops , i );
1248
1235
1249
1236
if (ops -> iova_to_phys (ops , iova + 42 ))
1250
1237
return __FAIL (ops , i );
1251
1238
1252
1239
/* Remap full block */
1253
- if (ops -> map (ops , iova , iova , size , IOMMU_WRITE , GFP_KERNEL ))
1240
+ if (ops -> map_pages (ops , iova , iova , size , 1 ,
1241
+ IOMMU_WRITE , GFP_KERNEL , & mapped ))
1254
1242
return __FAIL (ops , i );
1255
1243
1256
1244
if (ops -> iova_to_phys (ops , iova + 42 ) != (iova + 42 ))
0 commit comments