From: Lu Baolu <baolu.lu@linux.intel.com>
To: Kyung Min Park <kyung.min.park@intel.com>,
iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org
Cc: baolu.lu@linux.intel.com, dwmw2@infradead.org, joro@8bytes.org,
will@kernel.org, jacob.jun.pan@linux.intel.com,
ashok.raj@intel.com, ravi.v.shankar@intel.com,
yian.chen@intel.com, sohil.mehta@intel.com
Subject: Re: [PATCH] iommu/vt-d: Disable SVM when ATS/PRI/PASID are not enabled in the device
Date: Mon, 15 Mar 2021 08:30:18 +0800 [thread overview]
Message-ID: <2c02519d-d23b-92d6-9638-36632c06d517@linux.intel.com> (raw)
In-Reply-To: <20210314201534.918-1-kyung.min.park@intel.com>
On 3/15/21 4:15 AM, Kyung Min Park wrote:
> Currently, the Intel VT-d supports Shared Virtual Memory (SVM) only when
> IO page fault is supported. Otherwise, shared memory pages can not be
> swapped out and need to be pinned. The device needs the Address Translation
> Service (ATS), Page Request Interface (PRI) and Process Address Space
> Identifier (PASID) capabilities to be enabled to support IO page fault.
>
> Disable SVM when ATS, PRI and PASID are not enabled in the device.
>
> Signed-off-by: Kyung Min Park <kyung.min.park@intel.com>
> ---
> drivers/iommu/intel/iommu.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/drivers/iommu/intel/iommu.c b/drivers/iommu/intel/iommu.c
> index ee0932307d64..956a02eb40b4 100644
> --- a/drivers/iommu/intel/iommu.c
> +++ b/drivers/iommu/intel/iommu.c
> @@ -5380,6 +5380,9 @@ intel_iommu_dev_enable_feat(struct device *dev, enum iommu_dev_features feat)
> if (!info)
> return -EINVAL;
>
> + if (!info->pasid_enabled || !info->pri_enabled || !info->ats_enabled)
> + return -EINVAL;
> +
> if (info->iommu->flags & VTD_FLAG_SVM_CAPABLE)
> return 0;
> }
>
Thanks for the patch.
Acked-by: Lu Baolu <baolu.lu@linux.intel.com>
Best regards,
baolu
next prev parent reply other threads:[~2021-03-15 0:40 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-14 20:15 [PATCH] iommu/vt-d: Disable SVM when ATS/PRI/PASID are not enabled in the device Kyung Min Park
2021-03-15 0:30 ` Lu Baolu [this message]
2021-03-18 10:24 ` Joerg Roedel
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=2c02519d-d23b-92d6-9638-36632c06d517@linux.intel.com \
--to=baolu.lu@linux.intel.com \
--cc=ashok.raj@intel.com \
--cc=dwmw2@infradead.org \
--cc=iommu@lists.linux-foundation.org \
--cc=jacob.jun.pan@linux.intel.com \
--cc=joro@8bytes.org \
--cc=kyung.min.park@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=ravi.v.shankar@intel.com \
--cc=sohil.mehta@intel.com \
--cc=will@kernel.org \
--cc=yian.chen@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