From: eric.auger@redhat.com (Auger Eric)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/2] vfio/type1: Cope with hardware MSI reserved regions
Date: Sun, 30 Jul 2017 12:39:27 +0200 [thread overview]
Message-ID: <263da1c2-1a76-020a-62d8-e65b2256030f@redhat.com> (raw)
In-Reply-To: <d244103e295a81d7f556f297adc79c2ac45345cc.1501163100.git.robin.murphy@arm.com>
Hi Robin,
On 27/07/2017 16:54, Robin Murphy wrote:
> 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>
Reviewed-by: Eric Auger <eric.auger@redhat.com>
Thanks
Eric
> ---
> 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",
>
next prev parent reply other threads:[~2017-07-30 10:39 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
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 ` Auger Eric [this message]
2017-07-31 15:59 ` [PATCH 1/2] vfio/type1: Cope with hardware MSI reserved regions Shameerali Kolothum Thodi
2017-08-10 19:16 ` Alex Williamson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=263da1c2-1a76-020a-62d8-e65b2256030f@redhat.com \
--to=eric.auger@redhat.com \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox