new file mode 100644
@@ -0,0 +1,12 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+#ifndef _ASM_S390_MSI_H
+#define _ASM_S390_MSI_H
+#include <asm-generic/msi.h>
+
+/*
+ * Work around S390 not using irq_domain at all so we can't set
+ * IRQ_DOMAIN_FLAG_SECURE_MSI
+ */
+#define arch_is_secure_msi() true
+
+#endif
@@ -44,8 +44,6 @@ static bool s390_iommu_capable(struct device *dev, enum iommu_cap cap)
switch (cap) {
case IOMMU_CAP_CACHE_COHERENCY:
return true;
- case IOMMU_CAP_INTR_REMAP:
- return true;
default:
return false;
}
@@ -48,6 +48,10 @@ typedef struct arch_msi_msg_data {
} __attribute__ ((packed)) arch_msi_msg_data_t;
#endif
+#ifndef arch_is_secure_msi
+#define arch_is_secure_msi() false
+#endif
+
/**
* msi_msg - Representation of a MSI message
* @address_lo: Low 32 bits of msi message address
@@ -660,7 +664,7 @@ static inline bool msi_device_has_secure_msi(struct device *dev)
* inherently secure by our definition. As nobody seems to needs this be
* conservative and return false anyhow.
*/
- return false;
+ return arch_is_secure_msi();
}
#endif /* CONFIG_GENERIC_MSI_IRQ */
@@ -1644,6 +1644,6 @@ bool msi_device_has_secure_msi(struct device *dev)
for (; domain; domain = domain->parent)
if (domain->flags & IRQ_DOMAIN_FLAG_SECURE_MSI)
return true;
- return false;
+ return arch_is_secure_msi();
}
EXPORT_SYMBOL_GPL(msi_device_has_secure_msi);
s390 doesn't use irq_domains, so it has no place to set IRQ_DOMAIN_FLAG_SECURE_MSI. Instead of continuing to abuse the iommu subsystem to convey this information add a simple define which s390 can make statically true. The define will cause irq_device_has_secure_msi() to return true. I do not know if S390 meets the definition of "Secure MSI" if someone can explain how it works I will update the comment in the arch/msi.h to explain it. Please consider updating S390 to use the modern IRQ infrastructure. Remove IOMMU_CAP_INTR_REMAP from the s390 iommu driver. Cc: Matthew Rosato <mjrosato@linux.ibm.com> Cc: Christian Borntraeger <borntraeger@de.ibm.com> Cc: Eric Farman <farman@linux.ibm.com> Signed-off-by: Jason Gunthorpe <jgg@nvidia.com> --- arch/s390/include/asm/msi.h | 12 ++++++++++++ drivers/iommu/s390-iommu.c | 2 -- include/linux/msi.h | 6 +++++- kernel/irq/msi.c | 2 +- 4 files changed, 18 insertions(+), 4 deletions(-) create mode 100644 arch/s390/include/asm/msi.h