The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Baolu Lu <baolu.lu@linux.intel.com>
To: Yi Liu <yi.l.liu@intel.com>, Joerg Roedel <joro@8bytes.org>,
	Will Deacon <will@kernel.org>,
	Robin Murphy <robin.murphy@arm.com>,
	Kevin Tian <kevin.tian@intel.com>,
	Aditya Garg <gargaditya08@live.com>,
	Dmitry Torokhov <dmitry.torokhov@gmail.com>,
	kobarity <kobarity@gmail.com>
Cc: baolu.lu@linux.intel.com, iommu@lists.linux.dev,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/1] iommu/vt-d: Restore context entry setup order for aliased devices
Date: Fri, 16 May 2025 14:15:37 +0800	[thread overview]
Message-ID: <7055e215-4292-4556-a481-7cd5ffe117fe@linux.intel.com> (raw)
In-Reply-To: <1826e96b-15bd-472d-b535-c72b58e06561@intel.com>

On 5/16/2025 2:11 PM, Yi Liu wrote:
> 
> On 2025/5/14 14:05, Lu Baolu wrote:
>> Commit 2031c469f816 ("iommu/vt-d: Add support for static identity 
>> domain")
>> changed the context entry setup during domain attachment from a
>> set-and-check policy to a clear-and-reset approach. This inadvertently
>> introduced a regression affecting PCI aliased devices behind PCIe-to-PCI
>> bridges.
> 
> I got what the patch does. But just bit confused on the above description.
> I didn't see the commit 2031c469f816 mentioned any policy thing on the
> context entry setup.  To me, the problem looks to be that the info->domain
> is no more accurate to be used for checking if any domain is attached after
> the above commit. Maybe I missed something. feel free correct me.

The problem was introduced by below change:

--- a/drivers/iommu/intel/iommu.c
+++ b/drivers/iommu/intel/iommu.c
@@ -3691,11 +3691,9 @@ int prepare_domain_attach_device(struct 
iommu_domain *domain,
  static int intel_iommu_attach_device(struct iommu_domain *domain,
                                      struct device *dev)
  {
-       struct device_domain_info *info = dev_iommu_priv_get(dev);
         int ret;

-       if (info->domain)
-               device_block_translation(dev);
+       device_block_translation(dev);

And after the introduction of static identity domain, "info->domain ==
NULL" doesn't mean no domain attaching to device anymore. So this patch
uses a specific flag bit to indicate this.

Thanks,
baolu

  reply	other threads:[~2025-05-16  6:15 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-14  6:05 [PATCH 1/1] iommu/vt-d: Restore context entry setup order for aliased devices Lu Baolu
2025-05-15  8:28 ` Tian, Kevin
2025-05-16  6:11 ` Yi Liu
2025-05-16  6:15   ` Baolu Lu [this message]
  -- strict thread matches above, loose matches on Subject: below --
2025-05-20  7:58 [PATCH 0/1][PULL REQUEST] iommu/vt-d: Fixes for v6.16-rc1 Lu Baolu
2025-05-20  7:58 ` [PATCH 1/1] iommu/vt-d: Restore context entry setup order for aliased devices 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=7055e215-4292-4556-a481-7cd5ffe117fe@linux.intel.com \
    --to=baolu.lu@linux.intel.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=gargaditya08@live.com \
    --cc=iommu@lists.linux.dev \
    --cc=joro@8bytes.org \
    --cc=kevin.tian@intel.com \
    --cc=kobarity@gmail.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