@@ -2487,30 +2487,6 @@ static int dmar_domain_attach_device(struct dmar_domain *domain,
2487
2487
return 0 ;
2488
2488
}
2489
2489
2490
- static bool device_has_rmrr (struct device * dev )
2491
- {
2492
- struct dmar_rmrr_unit * rmrr ;
2493
- struct device * tmp ;
2494
- int i ;
2495
-
2496
- rcu_read_lock ();
2497
- for_each_rmrr_units (rmrr ) {
2498
- /*
2499
- * Return TRUE if this RMRR contains the device that
2500
- * is passed in.
2501
- */
2502
- for_each_active_dev_scope (rmrr -> devices ,
2503
- rmrr -> devices_cnt , i , tmp )
2504
- if (tmp == dev ||
2505
- is_downstream_to_pci_bridge (dev , tmp )) {
2506
- rcu_read_unlock ();
2507
- return true;
2508
- }
2509
- }
2510
- rcu_read_unlock ();
2511
- return false;
2512
- }
2513
-
2514
2490
/**
2515
2491
* device_rmrr_is_relaxable - Test whether the RMRR of this device
2516
2492
* is relaxable (ie. is allowed to be not enforced under some conditions)
@@ -2540,34 +2516,6 @@ static bool device_rmrr_is_relaxable(struct device *dev)
2540
2516
return false;
2541
2517
}
2542
2518
2543
- /*
2544
- * There are a couple cases where we need to restrict the functionality of
2545
- * devices associated with RMRRs. The first is when evaluating a device for
2546
- * identity mapping because problems exist when devices are moved in and out
2547
- * of domains and their respective RMRR information is lost. This means that
2548
- * a device with associated RMRRs will never be in a "passthrough" domain.
2549
- * The second is use of the device through the IOMMU API. This interface
2550
- * expects to have full control of the IOVA space for the device. We cannot
2551
- * satisfy both the requirement that RMRR access is maintained and have an
2552
- * unencumbered IOVA space. We also have no ability to quiesce the device's
2553
- * use of the RMRR space or even inform the IOMMU API user of the restriction.
2554
- * We therefore prevent devices associated with an RMRR from participating in
2555
- * the IOMMU API, which eliminates them from device assignment.
2556
- *
2557
- * In both cases, devices which have relaxable RMRRs are not concerned by this
2558
- * restriction. See device_rmrr_is_relaxable comment.
2559
- */
2560
- static bool device_is_rmrr_locked (struct device * dev )
2561
- {
2562
- if (!device_has_rmrr (dev ))
2563
- return false;
2564
-
2565
- if (device_rmrr_is_relaxable (dev ))
2566
- return false;
2567
-
2568
- return true;
2569
- }
2570
-
2571
2519
/*
2572
2520
* Return the required default domain type for a specific device.
2573
2521
*
@@ -4180,12 +4128,6 @@ static int intel_iommu_attach_device(struct iommu_domain *domain,
4180
4128
struct device_domain_info * info = dev_iommu_priv_get (dev );
4181
4129
int ret ;
4182
4130
4183
- if (domain -> type == IOMMU_DOMAIN_UNMANAGED &&
4184
- device_is_rmrr_locked (dev )) {
4185
- dev_warn (dev , "Device is ineligible for IOMMU domain attach due to platform RMRR requirement. Contact your platform vendor.\n" );
4186
- return - EPERM ;
4187
- }
4188
-
4189
4131
if (info -> domain )
4190
4132
device_block_translation (dev );
4191
4133
0 commit comments