Linux IOMMU Development
 help / color / mirror / Atom feed
From: Baolu Lu <baolu.lu@linux.intel.com>
To: "Tian, Kevin" <kevin.tian@intel.com>,
	Joerg Roedel <joro@8bytes.org>, Will Deacon <will@kernel.org>,
	Robin Murphy <robin.murphy@arm.com>
Cc: "iommu@lists.linux.dev" <iommu@lists.linux.dev>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"stable@vger.kernel.org" <stable@vger.kernel.org>
Subject: Re: [PATCH 1/1] iommu/vt-d: Enable ATS before cache tag assignment
Date: Wed, 25 Jun 2025 12:53:28 +0800	[thread overview]
Message-ID: <c2191a58-5330-406c-b6b0-951a9d370bed@linux.intel.com> (raw)
In-Reply-To: <BN9PR11MB5276371ACFE0B5CEAAA021C88C78A@BN9PR11MB5276.namprd11.prod.outlook.com>

On 6/24/25 16:33, Tian, Kevin wrote:
>> From: Lu Baolu <baolu.lu@linux.intel.com>
>> Sent: Friday, June 20, 2025 2:08 PM
>>
>> Commit <4f1492efb495> ("iommu/vt-d: Revert ATS timing change to fix boot
>> failure") placed the enabling of ATS in the probe_finalize callback. This
>> occurs after the default domain attachment, which is when the ATS cache
>> tag is assigned. Consequently, the device TLB cache tag is missed when the
>> domain is attached, leading to the device TLB not being invalidated in the
>> iommu_unmap paths.
>>
>> Fix it by moving the ATS enabling to the default domain attachment path,
>> ensuring ATS is enabled before the cache tag assignment.
> 
> this means ATS will never be enabled for drivers with driver_managed_dma
> set to '1', as they don't expect their devices attached to the default domain
> automatically.

You are right.

> 
> does it make more sense sticking to current way (enabling ATS in
> probe_finalize) and assigning cache tag for device tlb at that point?
> 

Yes. I will post v2 with this approach.

Thanks,
baolu

      reply	other threads:[~2025-06-25  4:54 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-20  6:08 [PATCH 1/1] iommu/vt-d: Enable ATS before cache tag assignment Lu Baolu
2025-06-24  8:33 ` Tian, Kevin
2025-06-25  4:53   ` Baolu Lu [this message]

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=c2191a58-5330-406c-b6b0-951a9d370bed@linux.intel.com \
    --to=baolu.lu@linux.intel.com \
    --cc=iommu@lists.linux.dev \
    --cc=joro@8bytes.org \
    --cc=kevin.tian@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robin.murphy@arm.com \
    --cc=stable@vger.kernel.org \
    --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