[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <e4460731-a13f-479d-b092-649123fe079f@linux.intel.com>
Date: Thu, 31 Oct 2024 11:42:24 +0800
From: Baolu Lu <baolu.lu@...ux.intel.com>
To: Joel Granados <joel.granados@...nel.org>
Cc: Yi Liu <yi.l.liu@...el.com>, David Woodhouse <dwmw2@...radead.org>,
Joerg Roedel <joro@...tes.org>, Will Deacon <will@...nel.org>,
Robin Murphy <robin.murphy@....com>, Jason Gunthorpe <jgg@...pe.ca>,
Kevin Tian <kevin.tian@...el.com>, Klaus Jensen <its@...elevant.dk>,
linux-kernel@...r.kernel.org, iommu@...ts.linux.dev,
Klaus Jensen <k.jensen@...sung.com>
Subject: Re: [PATCH v4 2/5] iommu/vt-d: Remove the pasid present check in
prq_event_thread
On 10/30/24 22:28, Joel Granados wrote:
>> /*
>> diff --git a/drivers/iommu/intel/svm.c b/drivers/iommu/intel/svm.c
>> index 078d1e32a24e..ff88f31053d1 100644
>> --- a/drivers/iommu/intel/svm.c
>> +++ b/drivers/iommu/intel/svm.c
>> @@ -304,9 +304,6 @@ void intel_drain_pasid_prq(struct device *dev, u32
>> pasid)
>> int qdep;
>>
>> info = dev_iommu_priv_get(dev);
>> - if (WARN_ON(!info || !dev_is_pci(dev)))
>> - return;
> Did you mean to take out both checks?:
> 1. The info pointer check
> 2. the dev_is_pci check
>
> I can understand the dev_is_pci check, but we should definitely take
> action if info is NULL. Right?
WARN_ON(!info) is duplicate as far as I can see. Accessing
info->pri_enable when info is NULL will cause a null pointer dereference
warning. This appears irrelevant to this patch though.
>
>> -
>> if (!info->pri_enabled)
>> return;
>>
>> Generally, intel_drain_pasid_prq() should be called if
>>
>> - a translation is removed from a pasid entry; and
> This is the path that is already mentiond
>
>> - PRI on this device is enabled.
> And this path is:
> -> intel_iommu_enable_iopf
> -> context_flip_pri
> -> intel_context_flush_present
> -> qi_flush_pasid_cache
>
> Right?
Sorry that I didn't make it clear. It should be "PRI on this device was
enabled", a.k.a. info->pri_enabled is true. I didn't meant to say in the
PRI enabling path.
--
baolu
Powered by blists - more mailing lists