Commit b67483b
iommu/dma: Centralise iommu_setup_dma_ops()
It's somewhat hard to see, but arm64's arch_setup_dma_ops() should only
ever call iommu_setup_dma_ops() after a successful iommu_probe_device(),
which means there should be no harm in achieving the same order of
operations by running it off the back of iommu_probe_device() itself.
This then puts it in line with the x86 and s390 .probe_finalize bodges,
letting us pull it all into the main flow properly. As a bonus this lets
us fold in and de-scope the PCI workaround setup as well.
At this point we can also then pull the call up inside the group mutex,
and avoid having to think about whether iommu_group_store_type() could
theoretically race and free the domain if iommu_setup_dma_ops() ran just
*before* iommu_device_use_default_domain() claims it... Furthermore we
replace one .probe_finalize call completely, since the only remaining
implementations are now one which only needs to run once for the initial
boot-time probe, and two which themselves render that path unreachable.
This leaves us a big step closer to realistically being able to unpick
the variety of different things that iommu_setup_dma_ops() has been
muddling together, and further streamline iommu-dma into core API flows
in future.
Reviewed-by: Lu Baolu <[email protected]> # For Intel IOMMU
Reviewed-by: Jason Gunthorpe <[email protected]>
Tested-by: Hanjun Guo <[email protected]>
Signed-off-by: Robin Murphy <[email protected]>
Acked-by: Catalin Marinas <[email protected]>
Link: https://lore.kernel.org/r/bebea331c1d688b34d9862eefd5ede47503961b8.1713523152.git.robin.murphy@arm.com
Signed-off-by: Joerg Roedel <[email protected]>1 parent ad4750b commit b67483b
File tree
9 files changed
+19
-73
lines changed- arch/arm64/mm
- drivers/iommu
- amd
- intel
- include/linux
9 files changed
+19
-73
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
61 | | - | |
62 | | - | |
63 | 61 | | |
64 | 62 | | |
65 | 63 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2175 | 2175 | | |
2176 | 2176 | | |
2177 | 2177 | | |
2178 | | - | |
2179 | | - | |
2180 | | - | |
2181 | | - | |
2182 | | - | |
2183 | | - | |
2184 | | - | |
2185 | 2178 | | |
2186 | 2179 | | |
2187 | 2180 | | |
| |||
2784 | 2777 | | |
2785 | 2778 | | |
2786 | 2779 | | |
2787 | | - | |
2788 | 2780 | | |
2789 | 2781 | | |
2790 | 2782 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1741 | 1741 | | |
1742 | 1742 | | |
1743 | 1743 | | |
1744 | | - | |
1745 | | - | |
1746 | | - | |
1747 | | - | |
1748 | | - | |
| 1744 | + | |
1749 | 1745 | | |
1750 | 1746 | | |
1751 | 1747 | | |
1752 | | - | |
1753 | | - | |
| 1748 | + | |
| 1749 | + | |
1754 | 1750 | | |
1755 | | - | |
1756 | | - | |
1757 | | - | |
1758 | | - | |
1759 | 1751 | | |
1760 | 1752 | | |
1761 | 1753 | | |
1762 | 1754 | | |
| 1755 | + | |
| 1756 | + | |
| 1757 | + | |
1763 | 1758 | | |
1764 | 1759 | | |
1765 | 1760 | | |
1766 | 1761 | | |
1767 | 1762 | | |
1768 | 1763 | | |
1769 | 1764 | | |
1770 | | - | |
1771 | 1765 | | |
1772 | 1766 | | |
1773 | 1767 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
| 13 | + | |
12 | 14 | | |
13 | 15 | | |
14 | 16 | | |
| |||
17 | 19 | | |
18 | 20 | | |
19 | 21 | | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | 22 | | |
25 | 23 | | |
26 | 24 | | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
27 | 29 | | |
28 | 30 | | |
29 | 31 | | |
| |||
42 | 44 | | |
43 | 45 | | |
44 | 46 | | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | 47 | | |
50 | 48 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4349 | 4349 | | |
4350 | 4350 | | |
4351 | 4351 | | |
4352 | | - | |
4353 | | - | |
4354 | | - | |
4355 | | - | |
4356 | | - | |
4357 | | - | |
4358 | 4352 | | |
4359 | 4353 | | |
4360 | 4354 | | |
| |||
4834 | 4828 | | |
4835 | 4829 | | |
4836 | 4830 | | |
4837 | | - | |
4838 | 4831 | | |
4839 | 4832 | | |
4840 | 4833 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
581 | 581 | | |
582 | 582 | | |
583 | 583 | | |
584 | | - | |
585 | 584 | | |
586 | | - | |
587 | | - | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
588 | 589 | | |
589 | 590 | | |
590 | 591 | | |
| |||
1828 | 1829 | | |
1829 | 1830 | | |
1830 | 1831 | | |
| 1832 | + | |
| 1833 | + | |
1831 | 1834 | | |
1832 | 1835 | | |
1833 | 1836 | | |
| |||
3066 | 3069 | | |
3067 | 3070 | | |
3068 | 3071 | | |
3069 | | - | |
3070 | | - | |
3071 | | - | |
3072 | | - | |
3073 | | - | |
3074 | | - | |
3075 | | - | |
3076 | | - | |
3077 | 3072 | | |
3078 | 3073 | | |
3079 | | - | |
3080 | | - | |
| 3074 | + | |
3081 | 3075 | | |
3082 | 3076 | | |
3083 | 3077 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
695 | 695 | | |
696 | 696 | | |
697 | 697 | | |
698 | | - | |
699 | | - | |
700 | | - | |
701 | | - | |
702 | | - | |
703 | 698 | | |
704 | 699 | | |
705 | 700 | | |
| |||
785 | 780 | | |
786 | 781 | | |
787 | 782 | | |
788 | | - | |
789 | 783 | | |
790 | 784 | | |
791 | 785 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1025 | 1025 | | |
1026 | 1026 | | |
1027 | 1027 | | |
1028 | | - | |
1029 | | - | |
1030 | | - | |
1031 | | - | |
1032 | | - | |
1033 | | - | |
1034 | | - | |
1035 | | - | |
1036 | | - | |
1037 | 1028 | | |
1038 | 1029 | | |
1039 | 1030 | | |
| |||
1073 | 1064 | | |
1074 | 1065 | | |
1075 | 1066 | | |
1076 | | - | |
1077 | 1067 | | |
1078 | 1068 | | |
1079 | 1069 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1446 | 1446 | | |
1447 | 1447 | | |
1448 | 1448 | | |
1449 | | - | |
1450 | | - | |
1451 | | - | |
1452 | 1449 | | |
1453 | 1450 | | |
1454 | 1451 | | |
| |||
1459 | 1456 | | |
1460 | 1457 | | |
1461 | 1458 | | |
1462 | | - | |
1463 | | - | |
1464 | | - | |
1465 | | - | |
1466 | 1459 | | |
1467 | 1460 | | |
1468 | 1461 | | |
| |||
0 commit comments