Commit d6c55c0
committed
iommufd: Change the order of MSI setup
Eric points out this is wrong for the rare case of someone using
allow_unsafe_interrupts on ARM. We always have to setup the MSI window in
the domain if the iommu driver asks for it.
Move the iommu_get_msi_cookie() setup to the top of the function and
always do it, regardless of the security mode. Add checks to
iommufd_device_setup_msi() to ensure the driver is not doing something
incomprehensible. No current driver will set both a HW and SW MSI window,
or have more than one SW MSI window.
Fixes: e8d5721 ("iommufd: Add kAPI toward external drivers for physical devices")
Link: https://lore.kernel.org/r/[email protected]
Reviewed-by: Kevin Tian <[email protected]>
Reported-by: Eric Auger <[email protected]>
Signed-off-by: Jason Gunthorpe <[email protected]>1 parent a26fa39 commit d6c55c0
2 files changed
+39
-41
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
139 | 139 | | |
140 | 140 | | |
141 | 141 | | |
142 | | - | |
143 | | - | |
144 | | - | |
145 | | - | |
146 | | - | |
147 | | - | |
148 | | - | |
149 | | - | |
150 | | - | |
151 | | - | |
152 | | - | |
153 | | - | |
154 | | - | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
155 | 147 | | |
156 | 148 | | |
157 | 149 | | |
158 | 150 | | |
159 | 151 | | |
160 | 152 | | |
161 | 153 | | |
162 | | - | |
163 | | - | |
164 | | - | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
165 | 159 | | |
166 | 160 | | |
167 | 161 | | |
168 | 162 | | |
169 | | - | |
170 | | - | |
171 | | - | |
172 | | - | |
173 | | - | |
174 | 163 | | |
175 | | - | |
176 | 164 | | |
177 | 165 | | |
178 | 166 | | |
179 | | - | |
180 | | - | |
181 | | - | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
182 | 171 | | |
183 | | - | |
184 | | - | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
185 | 176 | | |
186 | | - | |
187 | | - | |
188 | | - | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
189 | 183 | | |
190 | 184 | | |
191 | 185 | | |
| |||
203 | 197 | | |
204 | 198 | | |
205 | 199 | | |
206 | | - | |
| 200 | + | |
207 | 201 | | |
208 | 202 | | |
209 | 203 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1170 | 1170 | | |
1171 | 1171 | | |
1172 | 1172 | | |
| 1173 | + | |
| 1174 | + | |
1173 | 1175 | | |
1174 | 1176 | | |
1175 | 1177 | | |
| |||
1181 | 1183 | | |
1182 | 1184 | | |
1183 | 1185 | | |
1184 | | - | |
1185 | | - | |
1186 | | - | |
1187 | | - | |
1188 | | - | |
1189 | | - | |
1190 | | - | |
1191 | | - | |
1192 | | - | |
1193 | | - | |
| 1186 | + | |
| 1187 | + | |
| 1188 | + | |
1194 | 1189 | | |
| 1190 | + | |
| 1191 | + | |
1195 | 1192 | | |
1196 | 1193 | | |
1197 | 1194 | | |
1198 | 1195 | | |
1199 | 1196 | | |
1200 | 1197 | | |
| 1198 | + | |
| 1199 | + | |
| 1200 | + | |
| 1201 | + | |
| 1202 | + | |
| 1203 | + | |
| 1204 | + | |
1201 | 1205 | | |
1202 | 1206 | | |
1203 | 1207 | | |
| |||
0 commit comments