From: Baolu Lu <baolu.lu@linux.intel.com>
To: "Tian, Kevin" <kevin.tian@intel.com>,
Joerg Roedel <joro@8bytes.org>, "Liu, Yi L" <yi.l.liu@intel.com>,
Jacob Pan <jacob.jun.pan@linux.intel.com>
Cc: baolu.lu@linux.intel.com, Will Deacon <will@kernel.org>,
Robin Murphy <robin.murphy@arm.com>,
"iommu@lists.linux.dev" <iommu@lists.linux.dev>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 2/2] iommu/vt-d: Remove hardware automatic ATS dependency
Date: Tue, 25 Jun 2024 16:40:21 +0800 [thread overview]
Message-ID: <55d50738-cbb6-4bf5-8748-1b1c8c2de21e@linux.intel.com> (raw)
In-Reply-To: <BN9PR11MB5276C8112DEF56C11CFC6F198CD52@BN9PR11MB5276.namprd11.prod.outlook.com>
On 2024/6/25 10:32, Tian, Kevin wrote:
>> From: Lu Baolu<baolu.lu@linux.intel.com>
>> Sent: Monday, June 24, 2024 1:25 PM
>>
>> If a device is listed in the SATC table with ATC_REQUIRED flag set, it
>> indicates that the device has a functional requirement to enable its ATC
>> (via the ATS capability) for device operation. However, when IOMMU is
>> running in the legacy mode, ATS could be automatically supported by the
>> hardware so that the OS has no need to support the ATS functionality.
> hmm I don't think "has no need to support" matches...
>
>> This is a backward compatibility feature which enables older OSs. Since
>> Linux VT-d implementation has already supported ATS features for a long
>> time, there is no need to rely on this compatibility hardware. Remove it
>> to make the driver future-proof.
>>
>> Signed-off-by: Lu Baolu<baolu.lu@linux.intel.com>
>> ---
>> drivers/iommu/intel/iommu.c | 9 +--------
>> 1 file changed, 1 insertion(+), 8 deletions(-)
>>
>> diff --git a/drivers/iommu/intel/iommu.c b/drivers/iommu/intel/iommu.c
>> index 07e394dfccc1..b63347c8bf5d 100644
>> --- a/drivers/iommu/intel/iommu.c
>> +++ b/drivers/iommu/intel/iommu.c
>> @@ -3056,14 +3056,7 @@ static bool dmar_ats_supported(struct pci_dev
>> *dev, struct intel_iommu *iommu)
>> dev = pci_physfn(dev);
>> satcu = dmar_find_matched_satc_unit(dev);
>> if (satcu)
>> - /*
>> - * This device supports ATS as it is in SATC table.
>> - * When IOMMU is in legacy mode, enabling ATS is done
>> - * automatically by HW for the device that requires
>> - * ATS, hence OS should not enable this device ATS
>> - * to avoid duplicated TLB invalidation.
>> - */
> ...what above comment tries to convey.
>
> If this comment is valid, it's not about whether the OS itself supports
> ATS. instead it's a requirement for the OS to not manage ATS when
> it's already managed by HW.
>
> Unless there is a way to disable hw management with this change...
This comment is not correct. The hardware automatic ATS is for older OS
compatible purposes, where the ATS is not aware of by the OS yet, but
ATS is functionally required for some SOC-integrated accelerators.
The HAS specification for those platforms states that OSs supporting ATS
(so-called enlightened OSs) don't require automatic ATS anymore.
From the iommu driver's point of view, automatic ATS is not part of the
VT-d spec and also not enumerable, hence it should be transparent.
Best regards,
baolu
next prev parent reply other threads:[~2024-06-25 8:40 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-24 5:25 [PATCH 1/2] iommu/vt-d: Convert dmar_ats_supported() to return bool Lu Baolu
2024-06-24 5:25 ` [PATCH 2/2] iommu/vt-d: Remove hardware automatic ATS dependency Lu Baolu
2024-06-24 8:06 ` Yi Liu
2024-06-24 8:11 ` Baolu Lu
2024-06-25 2:32 ` Tian, Kevin
2024-06-25 8:40 ` Baolu Lu [this message]
2024-06-26 1:53 ` Tian, Kevin
2024-06-26 2:37 ` Baolu Lu
2024-06-24 8:12 ` [PATCH 1/2] iommu/vt-d: Convert dmar_ats_supported() to return bool Yi Liu
2024-06-25 2:28 ` Tian, Kevin
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=55d50738-cbb6-4bf5-8748-1b1c8c2de21e@linux.intel.com \
--to=baolu.lu@linux.intel.com \
--cc=iommu@lists.linux.dev \
--cc=jacob.jun.pan@linux.intel.com \
--cc=joro@8bytes.org \
--cc=kevin.tian@intel.com \
--cc=linux-kernel@vger.kernel.org \
--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