From: Lu Baolu <baolu.lu@linux.intel.com>
To: Jerry Snitselaar <jsnitsel@redhat.com>, iommu@lists.linux-foundation.org
Subject: Re: Seeing some another issue with mixed domains in the same iommu_group
Date: Fri, 7 Feb 2020 15:19:43 +0800 [thread overview]
Message-ID: <41fcb72a-ef3e-9be3-7a63-8800b6eb0a0f@linux.intel.com> (raw)
In-Reply-To: <20200206231657.aflur5zq2jvexrdn@cantor>
Hi Jerry,
On 2020/2/7 7:16, Jerry Snitselaar wrote:
>
> Hi Baolu,
>
> Would something along these lines makes sense?
>
> diff --git a/drivers/iommu/intel-iommu.c b/drivers/iommu/intel-iommu.c
> index 9dc37672bf89..40cc8f5a3ebb 100644
> --- a/drivers/iommu/intel-iommu.c
> +++ b/drivers/iommu/intel-iommu.c
> @@ -3614,6 +3614,20 @@ static bool iommu_need_mapping(struct device *dev)
> }
> dmar_remove_one_dev_info(dev);
> get_private_domain_for_dev(dev);
> + } else {
> + if (dev->archdata.iommu == NULL) {
> + struct iommu_domain *domain;
> + struct iommu_group *group;
> + struct dmar_domain *dmar_domain, *tmp;
> +
> + group = iommu_group_get_for_dev(dev);
> + domain = iommu_group_default_domain(group);
> + dmar_domain = to_dmar_domain(domain);
> + tmp = set_domain_for_dev(dev, dmar_domain);
> + }
> }
>
> dev_info(dev, "32bit DMA uses non-identity mapping\n");
Thanks for reporting.
Actually, I prefer to removing this domain switch as long as users are
able to make a 32-bit device use DMA domain while system default is
identity or it breaks anything. 32-bit devices (or normally devices
with limited addressing capability over the whole system memory) using
DMA domain helps by removing the swiotlb performance overhead, which is
the original motivation of this code.
Best regards,
baolu
_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu
prev parent reply other threads:[~2020-02-07 7:19 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-06 17:54 Seeing some another issue with mixed domains in the same iommu_group Jerry Snitselaar
2020-02-06 18:47 ` Jerry Snitselaar
2020-02-06 21:36 ` Jerry Snitselaar
2020-02-06 23:16 ` Jerry Snitselaar
2020-02-07 7:19 ` Lu Baolu [this message]
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=41fcb72a-ef3e-9be3-7a63-8800b6eb0a0f@linux.intel.com \
--to=baolu.lu@linux.intel.com \
--cc=iommu@lists.linux-foundation.org \
--cc=jsnitsel@redhat.com \
/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