@@ -167,8 +167,6 @@ static void device_rbtree_remove(struct device_domain_info *info)
167167 spin_unlock_irqrestore (& iommu -> device_rbtree_lock , flags );
168168}
169169
170- static struct dmar_domain * si_domain ;
171-
172170struct dmar_rmrr_unit {
173171 struct list_head list ; /* list of rmrr units */
174172 struct acpi_dmar_header * hdr ; /* ACPI header */
@@ -286,11 +284,6 @@ static int __init intel_iommu_setup(char *str)
286284}
287285__setup ("intel_iommu=" , intel_iommu_setup );
288286
289- static int domain_type_is_si (struct dmar_domain * domain )
290- {
291- return domain -> domain .type == IOMMU_DOMAIN_IDENTITY ;
292- }
293-
294287static int domain_pfn_supported (struct dmar_domain * domain , unsigned long pfn )
295288{
296289 int addr_width = agaw_to_width (domain -> agaw ) - VTD_PAGE_SHIFT ;
@@ -1664,9 +1657,6 @@ static int domain_context_mapping_one(struct dmar_domain *domain,
16641657 struct context_entry * context ;
16651658 int agaw , ret ;
16661659
1667- if (domain_type_is_si (domain ))
1668- translation = CONTEXT_TT_PASS_THROUGH ;
1669-
16701660 pr_debug ("Set context mapping for %02x:%02x.%d\n" ,
16711661 bus , PCI_SLOT (devfn ), PCI_FUNC (devfn ));
16721662
@@ -1685,34 +1675,24 @@ static int domain_context_mapping_one(struct dmar_domain *domain,
16851675
16861676 context_set_domain_id (context , did );
16871677
1688- if (translation != CONTEXT_TT_PASS_THROUGH ) {
1689- /*
1690- * Skip top levels of page tables for iommu which has
1691- * less agaw than default. Unnecessary for PT mode.
1692- */
1693- for (agaw = domain -> agaw ; agaw > iommu -> agaw ; agaw -- ) {
1694- ret = - ENOMEM ;
1695- pgd = phys_to_virt (dma_pte_addr (pgd ));
1696- if (!dma_pte_present (pgd ))
1697- goto out_unlock ;
1698- }
1699-
1700- if (info && info -> ats_supported )
1701- translation = CONTEXT_TT_DEV_IOTLB ;
1702- else
1703- translation = CONTEXT_TT_MULTI_LEVEL ;
1704-
1705- context_set_address_root (context , virt_to_phys (pgd ));
1706- context_set_address_width (context , agaw );
1707- } else {
1708- /*
1709- * In pass through mode, AW must be programmed to
1710- * indicate the largest AGAW value supported by
1711- * hardware. And ASR is ignored by hardware.
1712- */
1713- context_set_address_width (context , iommu -> msagaw );
1678+ /*
1679+ * Skip top levels of page tables for iommu which has
1680+ * less agaw than default. Unnecessary for PT mode.
1681+ */
1682+ for (agaw = domain -> agaw ; agaw > iommu -> agaw ; agaw -- ) {
1683+ ret = - ENOMEM ;
1684+ pgd = phys_to_virt (dma_pte_addr (pgd ));
1685+ if (!dma_pte_present (pgd ))
1686+ goto out_unlock ;
17141687 }
17151688
1689+ if (info && info -> ats_supported )
1690+ translation = CONTEXT_TT_DEV_IOTLB ;
1691+ else
1692+ translation = CONTEXT_TT_MULTI_LEVEL ;
1693+
1694+ context_set_address_root (context , virt_to_phys (pgd ));
1695+ context_set_address_width (context , agaw );
17161696 context_set_translation_type (context , translation );
17171697 context_set_fault_enable (context );
17181698 context_set_present (context );
@@ -1977,23 +1957,6 @@ static bool dev_is_real_dma_subdevice(struct device *dev)
19771957 pci_real_dma_dev (to_pci_dev (dev )) != to_pci_dev (dev );
19781958}
19791959
1980- static int md_domain_init (struct dmar_domain * domain , int guest_width );
1981-
1982- static int __init si_domain_init (void )
1983- {
1984- si_domain = alloc_domain (IOMMU_DOMAIN_IDENTITY );
1985- if (!si_domain )
1986- return - EFAULT ;
1987-
1988- if (md_domain_init (si_domain , DEFAULT_DOMAIN_ADDRESS_WIDTH )) {
1989- domain_exit (si_domain );
1990- si_domain = NULL ;
1991- return - EFAULT ;
1992- }
1993-
1994- return 0 ;
1995- }
1996-
19971960static int dmar_domain_attach_device (struct dmar_domain * domain ,
19981961 struct device * dev )
19991962{
@@ -2016,8 +1979,6 @@ static int dmar_domain_attach_device(struct dmar_domain *domain,
20161979
20171980 if (!sm_supported (iommu ))
20181981 ret = domain_context_mapping (domain , dev );
2019- else if (domain_type_is_si (domain ))
2020- ret = intel_pasid_setup_pass_through (iommu , dev , IOMMU_NO_PASID );
20211982 else if (domain -> use_first_level )
20221983 ret = domain_setup_first_level (iommu , domain , dev , IOMMU_NO_PASID );
20231984 else
@@ -2026,8 +1987,7 @@ static int dmar_domain_attach_device(struct dmar_domain *domain,
20261987 if (ret )
20271988 goto out_block_translation ;
20281989
2029- if (sm_supported (info -> iommu ) || !domain_type_is_si (info -> domain ))
2030- iommu_enable_pci_caps (info );
1990+ iommu_enable_pci_caps (info );
20311991
20321992 ret = cache_tag_assign_domain (domain , dev , IOMMU_NO_PASID );
20331993 if (ret )
@@ -2386,10 +2346,6 @@ static int __init init_dmars(void)
23862346
23872347 check_tylersburg_isoch ();
23882348
2389- ret = si_domain_init ();
2390- if (ret )
2391- goto free_iommu ;
2392-
23932349 /*
23942350 * for each drhd
23952351 * enable fault log
@@ -2435,10 +2391,6 @@ static int __init init_dmars(void)
24352391 disable_dmar_iommu (iommu );
24362392 free_dmar_iommu (iommu );
24372393 }
2438- if (si_domain ) {
2439- domain_exit (si_domain );
2440- si_domain = NULL ;
2441- }
24422394
24432395 return ret ;
24442396}
@@ -3572,8 +3524,6 @@ static struct iommu_domain *intel_iommu_domain_alloc(unsigned type)
35723524 domain -> geometry .force_aperture = true;
35733525
35743526 return domain ;
3575- case IOMMU_DOMAIN_IDENTITY :
3576- return & si_domain -> domain ;
35773527 default :
35783528 return NULL ;
35793529 }
@@ -3640,8 +3590,7 @@ static void intel_iommu_domain_free(struct iommu_domain *domain)
36403590
36413591 WARN_ON (dmar_domain -> nested_parent &&
36423592 !list_empty (& dmar_domain -> s1_domains ));
3643- if (domain != & si_domain -> domain )
3644- domain_exit (dmar_domain );
3593+ domain_exit (dmar_domain );
36453594}
36463595
36473596int prepare_domain_attach_device (struct iommu_domain * domain ,
@@ -4364,9 +4313,7 @@ static int intel_iommu_set_dev_pasid(struct iommu_domain *domain,
43644313 if (ret )
43654314 goto out_detach_iommu ;
43664315
4367- if (domain_type_is_si (dmar_domain ))
4368- ret = intel_pasid_setup_pass_through (iommu , dev , pasid );
4369- else if (dmar_domain -> use_first_level )
4316+ if (dmar_domain -> use_first_level )
43704317 ret = domain_setup_first_level (iommu , dmar_domain ,
43714318 dev , pasid );
43724319 else
0 commit comments