[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <cbfbe969-1a92-52bf-f00c-3fb89feefd66@linux.intel.com>
Date: Sat, 26 Aug 2023 16:01:16 +0800
From: Baolu Lu <baolu.lu@...ux.intel.com>
To: "Tian, Kevin" <kevin.tian@...el.com>,
Joerg Roedel <joro@...tes.org>, Will Deacon <will@...nel.org>,
Robin Murphy <robin.murphy@....com>,
Jason Gunthorpe <jgg@...pe.ca>,
Jean-Philippe Brucker <jean-philippe@...aro.org>,
Nicolin Chen <nicolinc@...dia.com>
Cc: baolu.lu@...ux.intel.com, "Liu, Yi L" <yi.l.liu@...el.com>,
Jacob Pan <jacob.jun.pan@...ux.intel.com>,
"iommu@...ts.linux.dev" <iommu@...ts.linux.dev>,
"kvm@...r.kernel.org" <kvm@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v4 09/10] iommu: Make iommu_queue_iopf() more generic
On 8/25/23 4:17 PM, Tian, Kevin wrote:
>> +
>> /**
>> * iopf_queue_flush_dev - Ensure that all queued faults have been
>> processed
>> * @dev: the endpoint whose faults need to be flushed.
> Presumably we also need a flush callback per domain given now
> the use of workqueue is optional then flush_workqueue() might
> not be sufficient.
>
The iopf_queue_flush_dev() function flushes all pending faults from the
IOMMU queue for a specific device. It has no means to flush fault queues
out of iommu core.
The iopf_queue_flush_dev() function is typically called when a domain is
detaching from a PASID. Hence it's necessary to flush the pending faults
from top to bottom. For example, iommufd should flush pending faults in
its fault queues after detaching the domain from the pasid.
The fault_param->lock mutex is sufficient to avoid the race condition if
the workqueue is not used. However, if the workqueue is used, then it is
possible for a workqueue thread to be in the middle of delivering a
fault while the fault queue is being flushed.
Best regards,
baolu
Powered by blists - more mailing lists