All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Tian, Kevin" <kevin.tian@intel.com>
To: Baolu Lu <baolu.lu@linux.intel.com>,
	Joerg Roedel <joro@8bytes.org>, "Will Deacon" <will@kernel.org>,
	Robin Murphy <robin.murphy@arm.com>,
	"Jason Gunthorpe" <jgg@ziepe.ca>
Cc: "iommu@lists.linux.dev" <iommu@lists.linux.dev>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: RE: [PATCH 1/1] iommu/vt-d: Make context clearing consistent with context mapping
Date: Tue, 14 Nov 2023 04:46:23 +0000	[thread overview]
Message-ID: <BN9PR11MB5276C809A2BF1A63B92F09EA8CB2A@BN9PR11MB5276.namprd11.prod.outlook.com> (raw)
In-Reply-To: <c3053d76-433b-4c4d-b19b-13ff61c7dab4@linux.intel.com>

> From: Baolu Lu <baolu.lu@linux.intel.com>
> Sent: Tuesday, November 14, 2023 11:22 AM
> 
> On 11/14/23 11:20 AM, Tian, Kevin wrote:
> >> From: Lu Baolu <baolu.lu@linux.intel.com>
> >> Sent: Tuesday, November 14, 2023 9:11 AM
> >>
> >> In the iommu probe_device path, domain_context_mapping() allows
> setting
> >> up the context entry for a non-PCI device. However, in the iommu
> >> release_device path, domain_context_clear() only clears context entries
> >> for PCI devices.
> >>
> >> Make domain_context_clear() behave consistently with
> >> domain_context_mapping() by clearing context entries for both PCI and
> >> non-PCI devices.
> >>
> >> Fixes: 579305f75d34 ("iommu/vt-d: Update to use PCI DMA aliases")
> >> Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com>
> >
> > The code before the fix tag also has the same problem. If we really want
> > backport then let's find out the very first commit which exhibits this
> > problem.
> 
> Commit 579305f75d34 allows non-PCI devices.
> 
> +       if (!dev_is_pci(dev))
> +               return domain_context_mapping_one(domain, iommu, bus, devfn,
>                                                    translation);
> +
> +       data.domain = domain;
> +       data.iommu = iommu;
> +       data.translation = translation;
> +
> +       return pci_for_each_dma_alias(to_pci_dev(dev),
> +                                     &domain_context_mapping_cb, &data);
> 
> But it forgot to update the domain_context_clear() helper. So this is
> actually a fix for that commit.

thanks. I didn't note that side effect from commit msg.

> 
> >
> > But I wonder the actual impact w/o such fix. If there is no hot-remove
> > possible for those non-PCI devices the context entry will be leaved
> > enabled until the machine is off. Then this fix is nice-to-have then
> > probably no need to backport?
> 
> It doesn't cause real issues as far as I can see. So there's no need to
> back port it to stable kernels. That's the reason I didn't add cc-stable
> tag. But we still need a fix tag as it's actually a fix.
> 

make sense.

Reviewed-by: Kevin Tian <kevin.tian@intel.com>

  reply	other threads:[~2023-11-14  4:46 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-14  1:10 [PATCH 1/1] iommu/vt-d: Support enforce_cache_coherency only for empty domains Lu Baolu
2023-11-14  1:10 ` [PATCH 1/1] iommu/vt-d: Omit devTLB invalidation requests when TES=0 Lu Baolu
2023-11-14  3:14   ` Tian, Kevin
2023-11-14  3:13     ` Baolu Lu
2023-11-14  4:45       ` Tian, Kevin
2023-11-14  4:54         ` Baolu Lu
2023-11-14  5:31           ` Tian, Kevin
2023-11-29 20:10   ` Jason Gunthorpe
2023-11-30  4:06     ` Baolu Lu
2023-11-30 12:15       ` Jason Gunthorpe
2023-11-14  1:10 ` [PATCH 1/1] iommu/vt-d: Disable PCI ATS in legacy passthrough mode Lu Baolu
2023-11-14  3:14   ` Tian, Kevin
2023-11-16  7:35   ` Baolu Lu
2023-11-16  8:24     ` Tian, Kevin
2023-11-17  1:09       ` Baolu Lu
2023-11-17  2:22         ` Tian, Kevin
2023-11-29 20:13   ` Jason Gunthorpe
2023-11-30  5:44     ` Baolu Lu
2023-11-30 16:18       ` Jason Gunthorpe
2023-11-14  1:10 ` [PATCH 1/1] iommu/vt-d: Make context clearing consistent with context mapping Lu Baolu
2023-11-14  3:20   ` Tian, Kevin
2023-11-14  3:22     ` Baolu Lu
2023-11-14  4:46       ` Tian, Kevin [this message]
2023-11-14  3:16 ` [PATCH 1/1] iommu/vt-d: Support enforce_cache_coherency only for empty domains Tian, Kevin
2023-11-29 20:08 ` Jason Gunthorpe
2023-11-30  3:48   ` Baolu Lu

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=BN9PR11MB5276C809A2BF1A63B92F09EA8CB2A@BN9PR11MB5276.namprd11.prod.outlook.com \
    --to=kevin.tian@intel.com \
    --cc=baolu.lu@linux.intel.com \
    --cc=iommu@lists.linux.dev \
    --cc=jgg@ziepe.ca \
    --cc=joro@8bytes.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.