@@ -86,7 +86,6 @@ struct iommu_cmd {
86
86
87
87
struct kmem_cache * amd_iommu_irq_cache ;
88
88
89
- static void update_domain (struct protection_domain * domain );
90
89
static void detach_device (struct device * dev );
91
90
92
91
/****************************************************************************
@@ -1313,12 +1312,12 @@ static void domain_flush_pages(struct protection_domain *domain,
1313
1312
}
1314
1313
1315
1314
/* Flush the whole IO/TLB for a given protection domain - including PDE */
1316
- static void domain_flush_tlb_pde (struct protection_domain * domain )
1315
+ void amd_iommu_domain_flush_tlb_pde (struct protection_domain * domain )
1317
1316
{
1318
1317
__domain_flush_pages (domain , 0 , CMD_INV_IOMMU_ALL_PAGES_ADDRESS , 1 );
1319
1318
}
1320
1319
1321
- static void domain_flush_complete (struct protection_domain * domain )
1320
+ void amd_iommu_domain_flush_complete (struct protection_domain * domain )
1322
1321
{
1323
1322
int i ;
1324
1323
@@ -1343,7 +1342,7 @@ static void domain_flush_np_cache(struct protection_domain *domain,
1343
1342
1344
1343
spin_lock_irqsave (& domain -> lock , flags );
1345
1344
domain_flush_pages (domain , iova , size );
1346
- domain_flush_complete (domain );
1345
+ amd_iommu_domain_flush_complete (domain );
1347
1346
spin_unlock_irqrestore (& domain -> lock , flags );
1348
1347
}
1349
1348
}
@@ -1500,7 +1499,7 @@ static bool increase_address_space(struct protection_domain *domain,
1500
1499
pgtable .root = pte ;
1501
1500
pgtable .mode += 1 ;
1502
1501
amd_iommu_update_and_flush_device_table (domain );
1503
- domain_flush_complete (domain );
1502
+ amd_iommu_domain_flush_complete (domain );
1504
1503
1505
1504
/*
1506
1505
* Device Table needs to be updated and flushed before the new root can
@@ -1753,8 +1752,8 @@ static int iommu_map_page(struct protection_domain *dom,
1753
1752
* Updates and flushing already happened in
1754
1753
* increase_address_space().
1755
1754
*/
1756
- domain_flush_tlb_pde (dom );
1757
- domain_flush_complete (dom );
1755
+ amd_iommu_domain_flush_tlb_pde (dom );
1756
+ amd_iommu_domain_flush_complete (dom );
1758
1757
spin_unlock_irqrestore (& dom -> lock , flags );
1759
1758
}
1760
1759
@@ -1997,10 +1996,10 @@ static void do_detach(struct iommu_dev_data *dev_data)
1997
1996
device_flush_dte (dev_data );
1998
1997
1999
1998
/* Flush IOTLB */
2000
- domain_flush_tlb_pde (domain );
1999
+ amd_iommu_domain_flush_tlb_pde (domain );
2001
2000
2002
2001
/* Wait for the flushes to finish */
2003
- domain_flush_complete (domain );
2002
+ amd_iommu_domain_flush_complete (domain );
2004
2003
2005
2004
/* decrease reference counters - needs to happen after the flushes */
2006
2005
domain -> dev_iommu [iommu -> index ] -= 1 ;
@@ -2133,9 +2132,9 @@ static int attach_device(struct device *dev,
2133
2132
* left the caches in the IOMMU dirty. So we have to flush
2134
2133
* here to evict all dirty stuff.
2135
2134
*/
2136
- domain_flush_tlb_pde (domain );
2135
+ amd_iommu_domain_flush_tlb_pde (domain );
2137
2136
2138
- domain_flush_complete (domain );
2137
+ amd_iommu_domain_flush_complete (domain );
2139
2138
2140
2139
out :
2141
2140
spin_unlock (& dev_data -> lock );
@@ -2297,7 +2296,7 @@ void amd_iommu_update_and_flush_device_table(struct protection_domain *domain)
2297
2296
domain_flush_devices (domain );
2298
2297
}
2299
2298
2300
- static void update_domain (struct protection_domain * domain )
2299
+ void amd_iommu_domain_update (struct protection_domain * domain )
2301
2300
{
2302
2301
struct domain_pgtable pgtable ;
2303
2302
@@ -2306,8 +2305,8 @@ static void update_domain(struct protection_domain *domain)
2306
2305
amd_iommu_update_and_flush_device_table (domain );
2307
2306
2308
2307
/* Flush domain TLB(s) and wait for completion */
2309
- domain_flush_tlb_pde (domain );
2310
- domain_flush_complete (domain );
2308
+ amd_iommu_domain_flush_tlb_pde (domain );
2309
+ amd_iommu_domain_flush_complete (domain );
2311
2310
}
2312
2311
2313
2312
int __init amd_iommu_init_api (void )
@@ -2695,8 +2694,8 @@ static void amd_iommu_flush_iotlb_all(struct iommu_domain *domain)
2695
2694
unsigned long flags ;
2696
2695
2697
2696
spin_lock_irqsave (& dom -> lock , flags );
2698
- domain_flush_tlb_pde (dom );
2699
- domain_flush_complete (dom );
2697
+ amd_iommu_domain_flush_tlb_pde (dom );
2698
+ amd_iommu_domain_flush_complete (dom );
2700
2699
spin_unlock_irqrestore (& dom -> lock , flags );
2701
2700
}
2702
2701
@@ -2786,7 +2785,7 @@ void amd_iommu_domain_direct_map(struct iommu_domain *dom)
2786
2785
amd_iommu_domain_clr_pt_root (domain );
2787
2786
2788
2787
/* Make changes visible to IOMMUs */
2789
- update_domain (domain );
2788
+ amd_iommu_domain_update (domain );
2790
2789
2791
2790
/* Page-table is not visible to IOMMU anymore, so free it */
2792
2791
free_pagetable (& pgtable );
@@ -2830,7 +2829,7 @@ int amd_iommu_domain_enable_v2(struct iommu_domain *dom, int pasids)
2830
2829
domain -> glx = levels ;
2831
2830
domain -> flags |= PD_IOMMUV2_MASK ;
2832
2831
2833
- update_domain (domain );
2832
+ amd_iommu_domain_update (domain );
2834
2833
2835
2834
ret = 0 ;
2836
2835
@@ -2867,7 +2866,7 @@ static int __flush_pasid(struct protection_domain *domain, u32 pasid,
2867
2866
}
2868
2867
2869
2868
/* Wait until IOMMU TLB flushes are complete */
2870
- domain_flush_complete (domain );
2869
+ amd_iommu_domain_flush_complete (domain );
2871
2870
2872
2871
/* Now flush device TLBs */
2873
2872
list_for_each_entry (dev_data , & domain -> dev_list , list ) {
@@ -2893,7 +2892,7 @@ static int __flush_pasid(struct protection_domain *domain, u32 pasid,
2893
2892
}
2894
2893
2895
2894
/* Wait until all device TLBs are flushed */
2896
- domain_flush_complete (domain );
2895
+ amd_iommu_domain_flush_complete (domain );
2897
2896
2898
2897
ret = 0 ;
2899
2898
0 commit comments