[PATCH 0/4] [PULL REQUEST] iommu/vt-d: Fixes for v6.1-rc8

Lu Baolu posted 4 patches 2 years, 9 months ago
drivers/iommu/intel/iommu.h |  4 ++
drivers/iommu/intel/dmar.c  |  1 +
drivers/iommu/intel/iommu.c | 73 +++++++++++++++++++++++++++++++++++--
drivers/iommu/intel/svm.c   | 19 +++++++---
4 files changed, 88 insertions(+), 9 deletions(-)
[PATCH 0/4] [PULL REQUEST] iommu/vt-d: Fixes for v6.1-rc8
Posted by Lu Baolu 2 years, 9 months ago
Hi Joerg,

Below fixes are queued for v6.1. They aim to:

- Add a fix to handle a QAT device quirk.
- Fix 3 PCI device refcount leaks.

This series is also available at github.
https://github.com/LuBaolu/intel-iommu/commits/vtd-fix-for-v6.1-rc8

Please consider it for the iommu/fix branch.

Best regards,
Lu Baolu

Jacob Pan (1):
  iommu/vt-d: Add a fix for devices need extra dtlb flush

Xiongfeng Wang (2):
  iommu/vt-d: Fix PCI device refcount leak in has_external_pci()
  iommu/vt-d: Fix PCI device refcount leak in dmar_dev_scope_init()

Yang Yingliang (1):
  iommu/vt-d: Fix PCI device refcount leak in prq_event_thread()

 drivers/iommu/intel/iommu.h |  4 ++
 drivers/iommu/intel/dmar.c  |  1 +
 drivers/iommu/intel/iommu.c | 73 +++++++++++++++++++++++++++++++++++--
 drivers/iommu/intel/svm.c   | 19 +++++++---
 4 files changed, 88 insertions(+), 9 deletions(-)

-- 
2.34.1
Re: [PATCH 0/4] [PULL REQUEST] iommu/vt-d: Fixes for v6.1-rc8
Posted by Joerg Roedel 2 years, 9 months ago
On Thu, Dec 01, 2022 at 12:01:23PM +0800, Lu Baolu wrote:
> Jacob Pan (1):
>   iommu/vt-d: Add a fix for devices need extra dtlb flush
> 
> Xiongfeng Wang (2):
>   iommu/vt-d: Fix PCI device refcount leak in has_external_pci()
>   iommu/vt-d: Fix PCI device refcount leak in dmar_dev_scope_init()
> 
> Yang Yingliang (1):
>   iommu/vt-d: Fix PCI device refcount leak in prq_event_thread()
> 
>  drivers/iommu/intel/iommu.h |  4 ++
>  drivers/iommu/intel/dmar.c  |  1 +
>  drivers/iommu/intel/iommu.c | 73 +++++++++++++++++++++++++++++++++++--
>  drivers/iommu/intel/svm.c   | 19 +++++++---
>  4 files changed, 88 insertions(+), 9 deletions(-)

Applied to iommu/fixes, thanks Baolu.
Re: [PATCH 0/4] [PULL REQUEST] iommu/vt-d: Fixes for v6.1-rc8
Posted by Jacob Pan 2 years, 9 months ago
Hi Joerg,

On Fri, 2 Dec 2022 11:47:23 +0100, Joerg Roedel <joro@8bytes.org> wrote:

> On Thu, Dec 01, 2022 at 12:01:23PM +0800, Lu Baolu wrote:
> > Jacob Pan (1):
> >   iommu/vt-d: Add a fix for devices need extra dtlb flush
There is a bug in this patch, I will send a fix patch. Or can you squash the
fix below?


From: Jacob Pan <jacob.jun.pan@linux.intel.com>
Date: Fri, 2 Dec 2022 16:22:42 -0800
Subject: [PATCH] iommu/vt-d: Fix buggy QAT device mask

Impacted QAT device IDs that need extra dtlb flush quirk is ranging
from 0x4940 to 0x4943. After bitwise AND device ID with 0xfffc the
result should be 0x4940 instead of 0x494c to identify these devices.

Reported-by: Raghunathan Srinivasan <raghunathan.srinivasan@intel.com>
Signed-off-by: Jacob Pan <jacob.jun.pan@linux.intel.com>
---
 drivers/iommu/intel/iommu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/iommu/intel/iommu.c b/drivers/iommu/intel/iommu.c
index d8759f445aff..0b10104c4b99 100644
--- a/drivers/iommu/intel/iommu.c
+++ b/drivers/iommu/intel/iommu.c
@@ -1401,7 +1401,7 @@ static void domain_update_iotlb(struct dmar_domain *domain)
  * This quirk is exempted from risky_device() check because it applies only
  * to the built-in QAT devices and it doesn't grant additional privileges.
  */
-#define BUGGY_QAT_DEVID_MASK 0x494c
+#define BUGGY_QAT_DEVID_MASK 0x4940
 static bool dev_needs_extra_dtlb_flush(struct pci_dev *pdev)
 {
        if (pdev->vendor != PCI_VENDOR_ID_INTEL)

sorry about that,


Thanks,

Jacob