From: Jerry Snitselaar <jsnitsel@redhat.com>
To: Lu Baolu <baolu.lu@linux.intel.com>
Cc: kevin.tian@intel.com, ashok.raj@intel.com,
linux-kernel@vger.kernel.org, stable@vger.kernel.org,
iommu@lists.linux-foundation.org, jacob.jun.pan@intel.com,
David Woodhouse <dwmw2@infradead.org>
Subject: Re: [PATCH 1/1] iommu/vt-d: Fix dmar pte read access not set error
Date: Thu, 12 Dec 2019 22:42:17 -0700 [thread overview]
Message-ID: <20191213054217.sykaftujydkaa4r2@cantor> (raw)
In-Reply-To: <6f3bcad9-b9b3-b349-fdad-ce53a79a665b@linux.intel.com>
On Thu Dec 12 19, Lu Baolu wrote:
>Hi,
>
>On 12/12/19 9:49 AM, Jerry Snitselaar wrote:
>>On Wed Dec 11 19, Lu Baolu wrote:
>>>If the default DMA domain of a group doesn't fit a device, it
>>>will still sit in the group but use a private identity domain.
>>>When map/unmap/iova_to_phys come through iommu API, the driver
>>>should still serve them, otherwise, other devices in the same
>>>group will be impacted. Since identity domain has been mapped
>>>with the whole available memory space and RMRRs, we don't need
>>>to worry about the impact on it.
>>>
>>>Link: https://www.spinics.net/lists/iommu/msg40416.html
>>>Cc: Jerry Snitselaar <jsnitsel@redhat.com>
>>>Reported-by: Jerry Snitselaar <jsnitsel@redhat.com>
>>>Fixes: 942067f1b6b97 ("iommu/vt-d: Identify default domains
>>>replaced with private")
>>>Cc: stable@vger.kernel.org # v5.3+
>>>Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com>
>>
>>Reviewed-by: Jerry Snitselaar <jsnitsel@redhat.com>
>
>Can you please try this fix and check whether it can fix your problem?
>If it helps, do you mind adding a Tested-by?
>
>Best regards,
>baolu
>
Tested-by: Jerry Snitselaar <jsnitsel@redhat.com>
>>
>>>---
>>>drivers/iommu/intel-iommu.c | 8 --------
>>>1 file changed, 8 deletions(-)
>>>
>>>diff --git a/drivers/iommu/intel-iommu.c b/drivers/iommu/intel-iommu.c
>>>index 0c8d81f56a30..b73bebea9148 100644
>>>--- a/drivers/iommu/intel-iommu.c
>>>+++ b/drivers/iommu/intel-iommu.c
>>>@@ -5478,9 +5478,6 @@ static int intel_iommu_map(struct
>>>iommu_domain *domain,
>>> int prot = 0;
>>> int ret;
>>>
>>>- if (dmar_domain->flags & DOMAIN_FLAG_LOSE_CHILDREN)
>>>- return -EINVAL;
>>>-
>>> if (iommu_prot & IOMMU_READ)
>>> prot |= DMA_PTE_READ;
>>> if (iommu_prot & IOMMU_WRITE)
>>>@@ -5523,8 +5520,6 @@ static size_t intel_iommu_unmap(struct
>>>iommu_domain *domain,
>>> /* Cope with horrid API which requires us to unmap more than the
>>> size argument if it happens to be a large-page mapping. */
>>> BUG_ON(!pfn_to_dma_pte(dmar_domain, iova >> VTD_PAGE_SHIFT, &level));
>>>- if (dmar_domain->flags & DOMAIN_FLAG_LOSE_CHILDREN)
>>>- return 0;
>>>
>>> if (size < VTD_PAGE_SIZE << level_to_offset_bits(level))
>>> size = VTD_PAGE_SIZE << level_to_offset_bits(level);
>>>@@ -5556,9 +5551,6 @@ static phys_addr_t
>>>intel_iommu_iova_to_phys(struct iommu_domain *domain,
>>> int level = 0;
>>> u64 phys = 0;
>>>
>>>- if (dmar_domain->flags & DOMAIN_FLAG_LOSE_CHILDREN)
>>>- return 0;
>>>-
>>> pte = pfn_to_dma_pte(dmar_domain, iova >> VTD_PAGE_SHIFT, &level);
>>> if (pte)
>>> phys = dma_pte_addr(pte);
>>>--
>>>2.17.1
>>>
>>
>_______________________________________________
>iommu mailing list
>iommu@lists.linux-foundation.org
>https://lists.linuxfoundation.org/mailman/listinfo/iommu
_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu
next prev parent reply other threads:[~2019-12-13 5:42 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-11 1:40 [PATCH 1/1] iommu/vt-d: Fix dmar pte read access not set error Lu Baolu
2019-12-11 16:35 ` Jerry Snitselaar
2019-12-12 1:00 ` Lu Baolu
2019-12-12 1:49 ` Jerry Snitselaar
2019-12-12 2:12 ` Lu Baolu
2019-12-13 0:30 ` Jerry Snitselaar
2019-12-13 2:12 ` Lu Baolu
2019-12-13 2:51 ` Jerry Snitselaar
2019-12-13 3:16 ` Jerry Snitselaar
2019-12-13 5:01 ` Lu Baolu
2019-12-13 5:42 ` Jerry Snitselaar [this message]
2019-12-17 10:28 ` Joerg Roedel
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=20191213054217.sykaftujydkaa4r2@cantor \
--to=jsnitsel@redhat.com \
--cc=ashok.raj@intel.com \
--cc=baolu.lu@linux.intel.com \
--cc=dwmw2@infradead.org \
--cc=iommu@lists.linux-foundation.org \
--cc=jacob.jun.pan@intel.com \
--cc=kevin.tian@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=stable@vger.kernel.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;
as well as URLs for NNTP newsgroup(s).