From: Baolu Lu <baolu.lu@linux.intel.com>
To: Joel Granados <j.granados@samsung.com>
Cc: baolu.lu@linux.intel.com, David Woodhouse <dwmw2@infradead.org>,
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>,
Klaus Jensen <its@irrelevant.dk>,
linux-kernel@vger.kernel.org, iommu@lists.linux.dev
Subject: Re: [PATCH 5/6] iommu: init pasid array while doing domain_replace and iopf is active
Date: Thu, 12 Sep 2024 19:22:30 +0800 [thread overview]
Message-ID: <71f61d8a-9188-4e67-88ca-e5b48a91e6b5@linux.intel.com> (raw)
In-Reply-To: <20240912082512.ydzmmlwpvkcukbt2@joelS2.panther.com>
On 2024/9/12 16:25, Joel Granados wrote:
> /**
> * iommu_attach_group_handle - Attach an IOMMU domain to an IOMMU group
> * @domain: IOMMU domain to attach
> diff --git i/drivers/iommu/iommufd/fault.c w/drivers/iommu/iommufd/fault.c
> index ea7f1bf64892..51cb70465b87 100644
> --- i/drivers/iommu/iommufd/fault.c
> +++ w/drivers/iommu/iommufd/fault.c
> @@ -189,8 +189,15 @@ static int iommufd_init_pasid_array(struct iommu_domain *domain,
> if (!handle)
> return -ENOMEM;
> handle->idev = idev;
> + handle->handle.domain = domain;
> +
> + mutex_lock(&group->mutex);
> + ret = xa_insert(&group->pasid_array, IOMMU_NO_PASID, handle, GFP_KERNEL);
> + mutex_unlock(&group->mutex);
> +
> + if (ret == -EBUSY)
> + ret = 0;
>
> - ret = iommu_init_pasid_array(domain, group, &handle->handle);
> if (ret)
> kfree(handle);
This is supposed to be done automatically when an iopf capable domain is
attached to or replaced with a device. Please refer to
iommufd_fault_domain_attach_dev() and
iommufd_fault_domain_replace_dev().
Is there anything preventing this from happening?
Thanks,
baolu
next prev parent reply other threads:[~2024-09-12 11:22 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-04 13:17 [PATCH 0/6] iommu: Enable user space IOPFs in non-nested and non-svm cases Joel Granados via B4 Relay
2024-09-04 13:17 ` [PATCH 1/6] iommu/vt-d: Separate page request queue from SVM Joel Granados via B4 Relay
2024-09-05 3:18 ` Baolu Lu
2024-09-11 7:28 ` Joel Granados
2024-09-04 13:17 ` [PATCH 2/6] iommu/vt-d: Remove the pasid present check in prq_event_thread Joel Granados via B4 Relay
2024-09-04 13:17 ` [PATCH 3/6] iommu: kconfig: Move IOMMU_IOPF into INTEL_IOMMU Joel Granados via B4 Relay
2024-09-07 12:20 ` Jason Gunthorpe
2024-09-11 7:40 ` Joel Granados
2024-09-15 13:37 ` Jason Gunthorpe
2024-09-16 12:24 ` Joel Granados
2024-09-04 13:17 ` [PATCH 4/6] iommufd: Enable PRI when doing the iommufd_hwpt_alloc Joel Granados via B4 Relay
2024-09-04 13:17 ` [PATCH 5/6] iommu: init pasid array while doing domain_replace and iopf is active Joel Granados via B4 Relay
2024-09-05 3:30 ` Baolu Lu
2024-09-05 3:32 ` Baolu Lu
2024-09-11 9:55 ` Joel Granados
2024-09-12 4:17 ` Baolu Lu
2024-09-12 10:22 ` Joel Granados
2024-09-11 10:56 ` Joel Granados
2024-09-12 4:21 ` Baolu Lu
2024-09-12 8:25 ` Joel Granados
2024-09-12 11:22 ` Baolu Lu [this message]
2024-09-13 8:02 ` Joel Granados
2024-09-12 10:00 ` Joel Granados
2024-09-04 13:17 ` [PATCH 6/6] iommu/vt-d: drop pasid requirement for prq initialization Joel Granados via B4 Relay
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=71f61d8a-9188-4e67-88ca-e5b48a91e6b5@linux.intel.com \
--to=baolu.lu@linux.intel.com \
--cc=dwmw2@infradead.org \
--cc=iommu@lists.linux.dev \
--cc=its@irrelevant.dk \
--cc=j.granados@samsung.com \
--cc=jgg@ziepe.ca \
--cc=joro@8bytes.org \
--cc=kevin.tian@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=robin.murphy@arm.com \
--cc=will@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