From: Baolu Lu <baolu.lu@linux.intel.com>
To: Nicolin Chen <nicolinc@nvidia.com>
Cc: baolu.lu@linux.intel.com, Joerg Roedel <joro@8bytes.org>,
Will Deacon <will@kernel.org>,
Robin Murphy <robin.murphy@arm.com>,
Jason Gunthorpe <jgg@ziepe.ca>, Kevin Tian <kevin.tian@intel.com>,
Jean-Philippe Brucker <jean-philippe@linaro.org>,
Yi Liu <yi.l.liu@intel.com>,
Jacob Pan <jacob.jun.pan@linux.intel.com>,
iommu@lists.linux.dev, kvm@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 2/3] iommu: Consolidate pasid dma ownership check
Date: Mon, 21 Aug 2023 13:46:44 +0800 [thread overview]
Message-ID: <6d5303a7-18d2-2481-18d1-c3d8fcf0d864@linux.intel.com> (raw)
In-Reply-To: <ZN8FAKHCzWODGRmC@Asurada-Nvidia>
On 2023/8/18 13:43, Nicolin Chen wrote:
> On Mon, Aug 14, 2023 at 09:17:58AM +0800, Lu Baolu wrote:
>
>> When switching device DMA ownership, it is required that all the device's
>> pasid DMA be disabled. This is done by checking if the pasid array of the
>> group is empty. Consolidate all the open code into a single helper. No
>> intentional functionality change.
>>
>> Signed-off-by: Lu Baolu<baolu.lu@linux.intel.com>
>> ---
>> drivers/iommu/iommu.c | 23 ++++++++++++++++++-----
>> 1 file changed, 18 insertions(+), 5 deletions(-)
>>
>> diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c
>> index f1eba60e573f..d4a06a37ce39 100644
>> --- a/drivers/iommu/iommu.c
>> +++ b/drivers/iommu/iommu.c
>> @@ -3127,6 +3127,19 @@ static bool iommu_is_default_domain(struct iommu_group *group)
>> return false;
>> }
>>
>> +/*
>> + * Assert no PASID DMA when claiming or releasing group's DMA ownership.
> ^
> |...
>
>> + * The device pasid interfaces are only for device drivers that have
>> + * claimed the DMA ownership. Return true if no pasid DMA setup, otherwise
>> + * return false with a WARN().
>> + */
>> +static bool assert_pasid_dma_ownership(struct iommu_group *group)
> ... should it be assert_no_pasid_dma_ownership?
Fair enough. Or, perhaps just assert_no_pasid_dma()?
Best regards,
baolu
next prev parent reply other threads:[~2023-08-21 5:46 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-14 1:17 [PATCH v2 0/3] iommu: Make pasid array per device Lu Baolu
2023-08-14 1:17 ` [PATCH v2 1/3] iommu: Make single-device group for PASID explicit Lu Baolu
2023-08-18 3:56 ` Tian, Kevin
2023-08-21 5:44 ` Baolu Lu
2023-08-21 6:33 ` Tian, Kevin
2023-08-22 6:36 ` Baolu Lu
2023-08-22 8:24 ` Tian, Kevin
2023-08-22 13:51 ` Baolu Lu
2023-08-14 1:17 ` [PATCH v2 2/3] iommu: Consolidate pasid dma ownership check Lu Baolu
2023-08-18 5:43 ` Nicolin Chen
2023-08-21 5:46 ` Baolu Lu [this message]
2023-08-14 1:17 ` [PATCH v2 3/3] iommu: Move pasid array from group to device Lu Baolu
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=6d5303a7-18d2-2481-18d1-c3d8fcf0d864@linux.intel.com \
--to=baolu.lu@linux.intel.com \
--cc=iommu@lists.linux.dev \
--cc=jacob.jun.pan@linux.intel.com \
--cc=jean-philippe@linaro.org \
--cc=jgg@ziepe.ca \
--cc=joro@8bytes.org \
--cc=kevin.tian@intel.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nicolinc@nvidia.com \
--cc=robin.murphy@arm.com \
--cc=will@kernel.org \
--cc=yi.l.liu@intel.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