Commit 4855215
committed
Merge tag 'for-linus-iommufd' of git://git.kernel.org/pub/scm/linux/kernel/git/jgg/iommufd
Pull iommufd updates from Jason Gunthorpe:
"Two significant new items:
- Allow reporting IOMMU HW events to userspace when the events are
clearly linked to a device.
This is linked to the VIOMMU object and is intended to be used by a
VMM to forward HW events to the virtual machine as part of
emulating a vIOMMU. ARM SMMUv3 is the first driver to use this
mechanism. Like the existing fault events the data is delivered
through a simple FD returning event records on read().
- PASID support in VFIO.
The "Process Address Space ID" is a PCI feature that allows the
device to tag all PCI DMA operations with an ID. The IOMMU will
then use the ID to select a unique translation for those DMAs. This
is part of Intel's vIOMMU support as VT-D HW requires the
hypervisor to manage each PASID entry.
The support is generic so any VFIO user could attach any
translation to a PASID, and the support should work on ARM SMMUv3
as well. AMD requires additional driver work.
Some minor updates, along with fixes:
- Prevent using nested parents with fault's, no driver support today
- Put a single "cookie_type" value in the iommu_domain to indicate
what owns the various opaque owner fields"
* tag 'for-linus-iommufd' of git://git.kernel.org/pub/scm/linux/kernel/git/jgg/iommufd: (49 commits)
iommufd: Test attach before detaching pasid
iommufd: Fix iommu_vevent_header tables markup
iommu: Convert unreachable() to BUG()
iommufd: Balance veventq->num_events inc/dec
iommufd: Initialize the flags of vevent in iommufd_viommu_report_event()
iommufd/selftest: Add coverage for reporting max_pasid_log2 via IOMMU_HW_INFO
iommufd: Extend IOMMU_GET_HW_INFO to report PASID capability
vfio: VFIO_DEVICE_[AT|DE]TACH_IOMMUFD_PT support pasid
vfio-iommufd: Support pasid [at|de]tach for physical VFIO devices
ida: Add ida_find_first_range()
iommufd/selftest: Add coverage for iommufd pasid attach/detach
iommufd/selftest: Add test ops to test pasid attach/detach
iommufd/selftest: Add a helper to get test device
iommufd/selftest: Add set_dev_pasid in mock iommu
iommufd: Allow allocating PASID-compatible domain
iommu/vt-d: Add IOMMU_HWPT_ALLOC_PASID support
iommufd: Enforce PASID-compatible domain for RID
iommufd: Support pasid attach/replace
iommufd: Enforce PASID-compatible domain in PASID path
iommufd/device: Add pasid_attach array to track per-PASID attach
...File tree
39 files changed
+3147
-829
lines changed- Documentation/userspace-api
- drivers
- iommu
- arm/arm-smmu-v3
- intel
- iommufd
- pci
- vfio
- pci
- include
- linux
- uapi/linux
- lib
- tools/testing/selftests/iommu
39 files changed
+3147
-829
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
66 | 73 | | |
67 | 74 | | |
68 | 75 | | |
| |||
109 | 116 | | |
110 | 117 | | |
111 | 118 | | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
112 | 127 | | |
113 | 128 | | |
114 | 129 | | |
| |||
251 | 266 | | |
252 | 267 | | |
253 | 268 | | |
| 269 | + | |
254 | 270 | | |
255 | 271 | | |
| 272 | + | |
256 | 273 | | |
257 | 274 | | |
258 | 275 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
| 46 | + | |
| 47 | + | |
46 | 48 | | |
47 | 49 | | |
48 | 50 | | |
| |||
85 | 87 | | |
86 | 88 | | |
87 | 89 | | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
88 | 131 | | |
89 | 132 | | |
90 | 133 | | |
| |||
392 | 435 | | |
393 | 436 | | |
394 | 437 | | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
395 | 455 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1052 | 1052 | | |
1053 | 1053 | | |
1054 | 1054 | | |
1055 | | - | |
| 1055 | + | |
1056 | 1056 | | |
1057 | 1057 | | |
1058 | 1058 | | |
| |||
1068 | 1068 | | |
1069 | 1069 | | |
1070 | 1070 | | |
1071 | | - | |
| 1071 | + | |
1072 | 1072 | | |
1073 | 1073 | | |
1074 | 1074 | | |
| |||
1813 | 1813 | | |
1814 | 1814 | | |
1815 | 1815 | | |
1816 | | - | |
1817 | | - | |
| 1816 | + | |
| 1817 | + | |
1818 | 1818 | | |
1819 | 1819 | | |
1820 | 1820 | | |
| |||
1823 | 1823 | | |
1824 | 1824 | | |
1825 | 1825 | | |
| 1826 | + | |
| 1827 | + | |
| 1828 | + | |
| 1829 | + | |
1826 | 1830 | | |
1827 | 1831 | | |
1828 | 1832 | | |
| |||
1832 | 1836 | | |
1833 | 1837 | | |
1834 | 1838 | | |
1835 | | - | |
1836 | | - | |
1837 | | - | |
1838 | | - | |
1839 | | - | |
1840 | | - | |
1841 | | - | |
| 1839 | + | |
| 1840 | + | |
| 1841 | + | |
| 1842 | + | |
| 1843 | + | |
1842 | 1844 | | |
1843 | | - | |
1844 | | - | |
| 1845 | + | |
| 1846 | + | |
1845 | 1847 | | |
1846 | | - | |
1847 | | - | |
| 1848 | + | |
| 1849 | + | |
1848 | 1850 | | |
1849 | | - | |
1850 | | - | |
1851 | | - | |
1852 | | - | |
1853 | | - | |
1854 | | - | |
1855 | | - | |
| 1851 | + | |
| 1852 | + | |
| 1853 | + | |
| 1854 | + | |
| 1855 | + | |
| 1856 | + | |
| 1857 | + | |
1856 | 1858 | | |
1857 | | - | |
1858 | | - | |
1859 | | - | |
| 1859 | + | |
| 1860 | + | |
| 1861 | + | |
| 1862 | + | |
1860 | 1863 | | |
1861 | 1864 | | |
1862 | 1865 | | |
| |||
1866 | 1869 | | |
1867 | 1870 | | |
1868 | 1871 | | |
1869 | | - | |
| 1872 | + | |
| 1873 | + | |
| 1874 | + | |
| 1875 | + | |
| 1876 | + | |
| 1877 | + | |
1870 | 1878 | | |
1871 | 1879 | | |
1872 | 1880 | | |
| |||
1944 | 1952 | | |
1945 | 1953 | | |
1946 | 1954 | | |
1947 | | - | |
| 1955 | + | |
1948 | 1956 | | |
1949 | 1957 | | |
1950 | 1958 | | |
| |||
2803 | 2811 | | |
2804 | 2812 | | |
2805 | 2813 | | |
| 2814 | + | |
2806 | 2815 | | |
2807 | 2816 | | |
2808 | 2817 | | |
| |||
2832 | 2841 | | |
2833 | 2842 | | |
2834 | 2843 | | |
| 2844 | + | |
| 2845 | + | |
| 2846 | + | |
| 2847 | + | |
| 2848 | + | |
| 2849 | + | |
| 2850 | + | |
2835 | 2851 | | |
2836 | | - | |
| 2852 | + | |
| 2853 | + | |
2837 | 2854 | | |
| 2855 | + | |
2838 | 2856 | | |
2839 | 2857 | | |
2840 | 2858 | | |
| |||
2861 | 2879 | | |
2862 | 2880 | | |
2863 | 2881 | | |
| 2882 | + | |
2864 | 2883 | | |
2865 | 2884 | | |
2866 | 2885 | | |
| |||
2893 | 2912 | | |
2894 | 2913 | | |
2895 | 2914 | | |
| 2915 | + | |
| 2916 | + | |
2896 | 2917 | | |
2897 | 2918 | | |
2898 | 2919 | | |
| |||
3162 | 3183 | | |
3163 | 3184 | | |
3164 | 3185 | | |
| 3186 | + | |
3165 | 3187 | | |
3166 | 3188 | | |
3167 | 3189 | | |
| |||
3180 | 3202 | | |
3181 | 3203 | | |
3182 | 3204 | | |
| 3205 | + | |
3183 | 3206 | | |
| 3207 | + | |
3184 | 3208 | | |
3185 | 3209 | | |
3186 | 3210 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
266 | 266 | | |
267 | 267 | | |
268 | 268 | | |
| 269 | + | |
269 | 270 | | |
270 | 271 | | |
271 | 272 | | |
| |||
799 | 800 | | |
800 | 801 | | |
801 | 802 | | |
| 803 | + | |
| 804 | + | |
| 805 | + | |
| 806 | + | |
| 807 | + | |
802 | 808 | | |
803 | 809 | | |
804 | 810 | | |
| |||
824 | 830 | | |
825 | 831 | | |
826 | 832 | | |
| 833 | + | |
827 | 834 | | |
828 | 835 | | |
829 | 836 | | |
| |||
972 | 979 | | |
973 | 980 | | |
974 | 981 | | |
| 982 | + | |
975 | 983 | | |
976 | 984 | | |
977 | 985 | | |
| |||
1055 | 1063 | | |
1056 | 1064 | | |
1057 | 1065 | | |
| 1066 | + | |
| 1067 | + | |
| 1068 | + | |
| 1069 | + | |
| 1070 | + | |
1058 | 1071 | | |
1059 | 1072 | | |
1060 | 1073 | | |
| 1074 | + | |
| 1075 | + | |
| 1076 | + | |
| 1077 | + | |
| 1078 | + | |
| 1079 | + | |
| 1080 | + | |
| 1081 | + | |
| 1082 | + | |
| 1083 | + | |
| 1084 | + | |
| 1085 | + | |
| 1086 | + | |
| 1087 | + | |
| 1088 | + | |
| 1089 | + | |
| 1090 | + | |
| 1091 | + | |
| 1092 | + | |
| 1093 | + | |
| 1094 | + | |
| 1095 | + | |
| 1096 | + | |
1061 | 1097 | | |
1062 | 1098 | | |
1063 | 1099 | | |
0 commit comments