You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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]>
* Otherwise the platform has a MSI window that is not isolated. For
180
-
* historical compat with VFIO allow a module parameter to ignore the
181
-
* insecurity.
167
+
* For historical compat with VFIO the insecure interrupt path is
168
+
* allowed if the module parameter is set. Insecure means that a MemWr
169
+
* operation from the device (eg a simple DMA) cannot trigger an
170
+
* interrupt outside this iommufd context.
182
171
*/
183
-
if (!allow_unsafe_interrupts)
184
-
return-EPERM;
172
+
if (!device_iommu_capable(idev->dev, IOMMU_CAP_INTR_REMAP) &&
173
+
!irq_domain_check_msi_remap()) {
174
+
if (!allow_unsafe_interrupts)
175
+
return-EPERM;
185
176
186
-
dev_warn(
187
-
idev->dev,
188
-
"MSI interrupt window cannot be isolated by the IOMMU, this platform is insecure. Use the \"allow_unsafe_interrupts\" module parameter to override\n");
177
+
dev_warn(
178
+
idev->dev,
179
+
"MSI interrupts are not secure, they cannot be isolated by the platform. "
180
+
"Check that platform features like interrupt remapping are enabled. "
181
+
"Use the \"allow_unsafe_interrupts\" module parameter to override\n");
0 commit comments