@@ -88,50 +88,6 @@ static void intel_nested_domain_free(struct iommu_domain *domain)
88
88
kfree (dmar_domain );
89
89
}
90
90
91
- static void nested_flush_dev_iotlb (struct dmar_domain * domain , u64 addr ,
92
- unsigned int mask )
93
- {
94
- struct device_domain_info * info ;
95
- unsigned long flags ;
96
- u16 sid , qdep ;
97
-
98
- spin_lock_irqsave (& domain -> lock , flags );
99
- list_for_each_entry (info , & domain -> devices , link ) {
100
- if (!info -> ats_enabled )
101
- continue ;
102
- sid = info -> bus << 8 | info -> devfn ;
103
- qdep = info -> ats_qdep ;
104
- qi_flush_dev_iotlb (info -> iommu , sid , info -> pfsid ,
105
- qdep , addr , mask );
106
- quirk_extra_dev_tlb_flush (info , addr , mask ,
107
- IOMMU_NO_PASID , qdep );
108
- }
109
- spin_unlock_irqrestore (& domain -> lock , flags );
110
- }
111
-
112
- static void intel_nested_flush_cache (struct dmar_domain * domain , u64 addr ,
113
- u64 npages , bool ih )
114
- {
115
- struct iommu_domain_info * info ;
116
- unsigned int mask ;
117
- unsigned long i ;
118
-
119
- xa_for_each (& domain -> iommu_array , i , info )
120
- qi_flush_piotlb (info -> iommu ,
121
- domain_id_iommu (domain , info -> iommu ),
122
- IOMMU_NO_PASID , addr , npages , ih );
123
-
124
- if (!domain -> has_iotlb_device )
125
- return ;
126
-
127
- if (npages == U64_MAX )
128
- mask = 64 - VTD_PAGE_SHIFT ;
129
- else
130
- mask = ilog2 (__roundup_pow_of_two (npages ));
131
-
132
- nested_flush_dev_iotlb (domain , addr , mask );
133
- }
134
-
135
91
static int intel_nested_cache_invalidate_user (struct iommu_domain * domain ,
136
92
struct iommu_user_data_array * array )
137
93
{
@@ -164,9 +120,9 @@ static int intel_nested_cache_invalidate_user(struct iommu_domain *domain,
164
120
break ;
165
121
}
166
122
167
- intel_nested_flush_cache (dmar_domain , inv_entry .addr ,
168
- inv_entry .npages ,
169
- inv_entry .flags & IOMMU_VTD_INV_FLAGS_LEAF );
123
+ cache_tag_flush_range (dmar_domain , inv_entry .addr ,
124
+ inv_entry .addr + nrpages_to_size ( inv_entry . npages ) - 1 ,
125
+ inv_entry .flags & IOMMU_VTD_INV_FLAGS_LEAF );
170
126
processed ++ ;
171
127
}
172
128
0 commit comments