linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] vfio/type1: Cope with hardware MSI reserved regions
@ 2017-07-27 14:54 Robin Murphy
  2017-07-27 14:54 ` [PATCH 2/2] vfio/type1: Give hardware MSI regions precedence Robin Murphy
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Robin Murphy @ 2017-07-27 14:54 UTC (permalink / raw)
  To: alex.williamson
  Cc: kvm, linux-kernel, linux-arm-kernel, eric.auger,
	shameerali.kolothum.thodi, marc.zyngier

For ARM-based systems with a GICv3 ITS to provide interrupt isolation,
but hardware limitations which are worked around by having MSIs bypass
SMMU translation (e.g. HiSilicon Hip06/Hip07), VFIO neglects to check
for the IRQ_DOMAIN_FLAG_MSI_REMAP capability, (and thus erroneously
demands unsafe_interrupts) if a software-managed MSI region is absent.

Fix this by always checking for isolation capability at both the IRQ
domain and IOMMU domain levels, rather than predicating that on whether
MSIs require an IOMMU mapping (which was always slightly tenuous logic).

Signed-off-by: Robin Murphy <robin.murphy@arm.com>
---
 drivers/vfio/vfio_iommu_type1.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/vfio/vfio_iommu_type1.c b/drivers/vfio/vfio_iommu_type1.c
index 8549cb111627..2328be628f21 100644
--- a/drivers/vfio/vfio_iommu_type1.c
+++ b/drivers/vfio/vfio_iommu_type1.c
@@ -1265,8 +1265,8 @@ static int vfio_iommu_type1_attach_group(void *iommu_data,
 	INIT_LIST_HEAD(&domain->group_list);
 	list_add(&group->next, &domain->group_list);
 
-	msi_remap = resv_msi ? irq_domain_check_msi_remap() :
-				iommu_capable(bus, IOMMU_CAP_INTR_REMAP);
+	msi_remap = irq_domain_check_msi_remap() ||
+		    iommu_capable(bus, IOMMU_CAP_INTR_REMAP);
 
 	if (!allow_unsafe_interrupts && !msi_remap) {
 		pr_warn("%s: No interrupt remapping support.  Use the module param \"allow_unsafe_interrupts\" to enable VFIO IOMMU support on this platform\n",
-- 
2.12.2.dirty

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2017-08-10 19:16 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-27 14:54 [PATCH 1/2] vfio/type1: Cope with hardware MSI reserved regions Robin Murphy
2017-07-27 14:54 ` [PATCH 2/2] vfio/type1: Give hardware MSI regions precedence Robin Murphy
2017-07-30 10:39   ` Auger Eric
2017-07-30 10:39 ` [PATCH 1/2] vfio/type1: Cope with hardware MSI reserved regions Auger Eric
2017-07-31 15:59 ` Shameerali Kolothum Thodi
2017-08-10 19:16 ` Alex Williamson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).