@@ -88,8 +88,6 @@ struct kmem_cache *amd_iommu_irq_cache;
88
88
89
89
static void update_domain (struct protection_domain * domain );
90
90
static void detach_device (struct device * dev );
91
- static void update_and_flush_device_table (struct protection_domain * domain ,
92
- struct domain_pgtable * pgtable );
93
91
94
92
/****************************************************************************
95
93
*
@@ -1501,7 +1499,7 @@ static bool increase_address_space(struct protection_domain *domain,
1501
1499
1502
1500
pgtable .root = pte ;
1503
1501
pgtable .mode += 1 ;
1504
- update_and_flush_device_table (domain , & pgtable );
1502
+ amd_iommu_update_and_flush_device_table (domain );
1505
1503
domain_flush_complete (domain );
1506
1504
1507
1505
/*
@@ -1876,17 +1874,16 @@ static void free_gcr3_table(struct protection_domain *domain)
1876
1874
}
1877
1875
1878
1876
static void set_dte_entry (u16 devid , struct protection_domain * domain ,
1879
- struct domain_pgtable * pgtable ,
1880
1877
bool ats , bool ppr )
1881
1878
{
1882
1879
u64 pte_root = 0 ;
1883
1880
u64 flags = 0 ;
1884
1881
u32 old_domid ;
1885
1882
1886
- if (pgtable -> mode != PAGE_MODE_NONE )
1887
- pte_root = iommu_virt_to_phys (pgtable -> root );
1883
+ if (domain -> iop . mode != PAGE_MODE_NONE )
1884
+ pte_root = iommu_virt_to_phys (domain -> iop . root );
1888
1885
1889
- pte_root |= (pgtable -> mode & DEV_ENTRY_MODE_MASK )
1886
+ pte_root |= (domain -> iop . mode & DEV_ENTRY_MODE_MASK )
1890
1887
<< DEV_ENTRY_MODE_SHIFT ;
1891
1888
pte_root |= DTE_FLAG_IR | DTE_FLAG_IW | DTE_FLAG_V | DTE_FLAG_TV ;
1892
1889
@@ -1976,7 +1973,7 @@ static void do_attach(struct iommu_dev_data *dev_data,
1976
1973
1977
1974
/* Update device table */
1978
1975
amd_iommu_domain_get_pgtable (domain , & pgtable );
1979
- set_dte_entry (dev_data -> devid , domain , & pgtable ,
1976
+ set_dte_entry (dev_data -> devid , domain ,
1980
1977
ats , dev_data -> iommu_v2 );
1981
1978
clone_aliases (dev_data -> pdev );
1982
1979
@@ -2283,22 +2280,20 @@ static int amd_iommu_domain_get_attr(struct iommu_domain *domain,
2283
2280
*
2284
2281
*****************************************************************************/
2285
2282
2286
- static void update_device_table (struct protection_domain * domain ,
2287
- struct domain_pgtable * pgtable )
2283
+ static void update_device_table (struct protection_domain * domain )
2288
2284
{
2289
2285
struct iommu_dev_data * dev_data ;
2290
2286
2291
2287
list_for_each_entry (dev_data , & domain -> dev_list , list ) {
2292
- set_dte_entry (dev_data -> devid , domain , pgtable ,
2288
+ set_dte_entry (dev_data -> devid , domain ,
2293
2289
dev_data -> ats .enabled , dev_data -> iommu_v2 );
2294
2290
clone_aliases (dev_data -> pdev );
2295
2291
}
2296
2292
}
2297
2293
2298
- static void update_and_flush_device_table (struct protection_domain * domain ,
2299
- struct domain_pgtable * pgtable )
2294
+ void amd_iommu_update_and_flush_device_table (struct protection_domain * domain )
2300
2295
{
2301
- update_device_table (domain , pgtable );
2296
+ update_device_table (domain );
2302
2297
domain_flush_devices (domain );
2303
2298
}
2304
2299
@@ -2308,7 +2303,7 @@ static void update_domain(struct protection_domain *domain)
2308
2303
2309
2304
/* Update device table */
2310
2305
amd_iommu_domain_get_pgtable (domain , & pgtable );
2311
- update_and_flush_device_table (domain , & pgtable );
2306
+ amd_iommu_update_and_flush_device_table (domain );
2312
2307
2313
2308
/* Flush domain TLB(s) and wait for completion */
2314
2309
domain_flush_tlb_pde (domain );
0 commit comments