@@ -167,8 +167,6 @@ static void device_rbtree_remove(struct device_domain_info *info)
167
167
spin_unlock_irqrestore (& iommu -> device_rbtree_lock , flags );
168
168
}
169
169
170
- static struct dmar_domain * si_domain ;
171
-
172
170
struct dmar_rmrr_unit {
173
171
struct list_head list ; /* list of rmrr units */
174
172
struct acpi_dmar_header * hdr ; /* ACPI header */
@@ -286,11 +284,6 @@ static int __init intel_iommu_setup(char *str)
286
284
}
287
285
__setup ("intel_iommu=" , intel_iommu_setup );
288
286
289
- static int domain_type_is_si (struct dmar_domain * domain )
290
- {
291
- return domain -> domain .type == IOMMU_DOMAIN_IDENTITY ;
292
- }
293
-
294
287
static int domain_pfn_supported (struct dmar_domain * domain , unsigned long pfn )
295
288
{
296
289
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,
1664
1657
struct context_entry * context ;
1665
1658
int agaw , ret ;
1666
1659
1667
- if (domain_type_is_si (domain ))
1668
- translation = CONTEXT_TT_PASS_THROUGH ;
1669
-
1670
1660
pr_debug ("Set context mapping for %02x:%02x.%d\n" ,
1671
1661
bus , PCI_SLOT (devfn ), PCI_FUNC (devfn ));
1672
1662
@@ -1685,34 +1675,24 @@ static int domain_context_mapping_one(struct dmar_domain *domain,
1685
1675
1686
1676
context_set_domain_id (context , did );
1687
1677
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 ;
1714
1687
}
1715
1688
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 );
1716
1696
context_set_translation_type (context , translation );
1717
1697
context_set_fault_enable (context );
1718
1698
context_set_present (context );
@@ -1977,23 +1957,6 @@ static bool dev_is_real_dma_subdevice(struct device *dev)
1977
1957
pci_real_dma_dev (to_pci_dev (dev )) != to_pci_dev (dev );
1978
1958
}
1979
1959
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
-
1997
1960
static int dmar_domain_attach_device (struct dmar_domain * domain ,
1998
1961
struct device * dev )
1999
1962
{
@@ -2016,8 +1979,6 @@ static int dmar_domain_attach_device(struct dmar_domain *domain,
2016
1979
2017
1980
if (!sm_supported (iommu ))
2018
1981
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 );
2021
1982
else if (domain -> use_first_level )
2022
1983
ret = domain_setup_first_level (iommu , domain , dev , IOMMU_NO_PASID );
2023
1984
else
@@ -2026,8 +1987,7 @@ static int dmar_domain_attach_device(struct dmar_domain *domain,
2026
1987
if (ret )
2027
1988
goto out_block_translation ;
2028
1989
2029
- if (sm_supported (info -> iommu ) || !domain_type_is_si (info -> domain ))
2030
- iommu_enable_pci_caps (info );
1990
+ iommu_enable_pci_caps (info );
2031
1991
2032
1992
ret = cache_tag_assign_domain (domain , dev , IOMMU_NO_PASID );
2033
1993
if (ret )
@@ -2386,10 +2346,6 @@ static int __init init_dmars(void)
2386
2346
2387
2347
check_tylersburg_isoch ();
2388
2348
2389
- ret = si_domain_init ();
2390
- if (ret )
2391
- goto free_iommu ;
2392
-
2393
2349
/*
2394
2350
* for each drhd
2395
2351
* enable fault log
@@ -2435,10 +2391,6 @@ static int __init init_dmars(void)
2435
2391
disable_dmar_iommu (iommu );
2436
2392
free_dmar_iommu (iommu );
2437
2393
}
2438
- if (si_domain ) {
2439
- domain_exit (si_domain );
2440
- si_domain = NULL ;
2441
- }
2442
2394
2443
2395
return ret ;
2444
2396
}
@@ -3572,8 +3524,6 @@ static struct iommu_domain *intel_iommu_domain_alloc(unsigned type)
3572
3524
domain -> geometry .force_aperture = true;
3573
3525
3574
3526
return domain ;
3575
- case IOMMU_DOMAIN_IDENTITY :
3576
- return & si_domain -> domain ;
3577
3527
default :
3578
3528
return NULL ;
3579
3529
}
@@ -3640,8 +3590,7 @@ static void intel_iommu_domain_free(struct iommu_domain *domain)
3640
3590
3641
3591
WARN_ON (dmar_domain -> nested_parent &&
3642
3592
!list_empty (& dmar_domain -> s1_domains ));
3643
- if (domain != & si_domain -> domain )
3644
- domain_exit (dmar_domain );
3593
+ domain_exit (dmar_domain );
3645
3594
}
3646
3595
3647
3596
int prepare_domain_attach_device (struct iommu_domain * domain ,
@@ -4364,9 +4313,7 @@ static int intel_iommu_set_dev_pasid(struct iommu_domain *domain,
4364
4313
if (ret )
4365
4314
goto out_detach_iommu ;
4366
4315
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 )
4370
4317
ret = domain_setup_first_level (iommu , dmar_domain ,
4371
4318
dev , pasid );
4372
4319
else
0 commit comments