All of lore.kernel.org
 help / color / mirror / Atom feed
From: Baolu Lu <baolu.lu@linux.intel.com>
To: Jerry Snitselaar <jsnitsel@redhat.com>
Cc: baolu.lu@linux.intel.com, Joerg Roedel <joro@8bytes.org>,
	iommu@lists.linux.dev
Subject: Re: Question on context setup for passthrough
Date: Sun, 23 Feb 2025 22:24:23 +0800	[thread overview]
Message-ID: <82499eb6-00b7-4f83-879a-e97b4144f576@linux.intel.com> (raw)
In-Reply-To: <v7quonl2qcsweqd4r6e2badd6bdhmzgo4zm4v2k3bxkg4zkffi@zpxi53ai4qme>

On 2025/2/22 2:26, Jerry Snitselaar wrote:
> On Fri, Feb 21, 2025 at 04:40:42PM +0800, Baolu Lu wrote:
>> On 2025/2/21 15:16, Jerry Snitselaar wrote:
>>> Hi Baolu,
>> Hi Jerry,
>>
>>> In context_setup_pass_through_cb there is a check that bails out
>>> if dev != &pdev->dev which doesn't exist in the code that sets up the
>>> context entries in the dma domain case. Is there a reason this check is
>>> done in the passthrough case?
>> The check "dev != &pdev->dev" was added to prevent setting a context for
>> a different device that has its own probe path.
> Hi Baolu,
> 
> Why is it different than what happens in the case with the callback in
> the dma domains case? Shouldn't pci_for_each_dma_alias already be
> deciding which devices get called with the callback?  This seems like
> it will always skip setting up the context entry for an alias when
> there is a pcie to pci bridge.

This appears to be a regression introduced by commit <2031c469f816>
('iommu/vt-d: Add support for static identity domain'). Previously, the
context setup for both identity and DMA domains was handled in a single
path, where the condition 'dev != &pdev->dev' did not cause an early
exit. This check was newly added by the commit.

> 
> My initial fix was just the dropping of the check in the callback,
> but I wasn't sure that was correct or not. So I decided to check
> with you, and go back and read some pci spec bits. 🙂

Can you please post a fix for this?

Thanks,
baolu

  reply	other threads:[~2025-02-23 14:24 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-02  2:27 [PATCH 00/14] [PULL REQUEST] Intel IOMMU updates for v6.12 Lu Baolu
2024-09-02  2:27 ` [PATCH 01/14] iommu/vt-d: Require DMA domain if hardware not support passthrough Lu Baolu
2024-09-02  2:27 ` [PATCH 02/14] iommu/vt-d: Remove identity mappings from si_domain Lu Baolu
2024-09-02  2:27 ` [PATCH 03/14] iommu/vt-d: Always reserve a domain ID for identity setup Lu Baolu
2024-09-02  2:27 ` [PATCH 04/14] iommu/vt-d: Remove has_iotlb_device flag Lu Baolu
2024-09-02  2:27 ` [PATCH 05/14] iommu/vt-d: Factor out helpers from domain_context_mapping_one() Lu Baolu
2024-09-02  2:27 ` [PATCH 06/14] iommu/vt-d: Add support for static identity domain Lu Baolu
2025-02-21  7:16   ` Question on context setup for passthrough Jerry Snitselaar
2025-02-21  8:40     ` Baolu Lu
2025-02-21 10:07       ` Jerry Snitselaar
2025-02-21 18:26       ` Jerry Snitselaar
2025-02-23 14:24         ` Baolu Lu [this message]
2024-09-02  2:27 ` [PATCH 07/14] iommu/vt-d: Cleanup si_domain Lu Baolu
2024-09-02  2:27 ` [PATCH 08/14] iommu/vt-d: Fix potential lockup if qi_submit_sync called with 0 count Lu Baolu
2024-09-02  2:27 ` [PATCH 09/14] iommu/vt-d: Move PCI PASID enablement to probe path Lu Baolu
2024-09-02  2:27 ` [PATCH 10/14] iommu/vt-d: Unconditionally flush device TLB for pasid table updates Lu Baolu
2024-09-02  2:27 ` [PATCH 11/14] iommu/vt-d: Factor out invalidation descriptor composition Lu Baolu
2024-09-02  2:27 ` [PATCH 12/14] iommu/vt-d: Refactor IOTLB and Dev-IOTLB flush for batching Lu Baolu
2024-09-02  2:27 ` [PATCH 13/14] iommu/vt-d: Add qi_batch for dmar_domain Lu Baolu
2024-09-02  2:27 ` [PATCH 14/14] iommu/vt-d: Introduce batched cache invalidation Lu Baolu
2024-09-02 16:15 ` [PATCH 00/14] [PULL REQUEST] Intel IOMMU updates for v6.12 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=82499eb6-00b7-4f83-879a-e97b4144f576@linux.intel.com \
    --to=baolu.lu@linux.intel.com \
    --cc=iommu@lists.linux.dev \
    --cc=joro@8bytes.org \
    --cc=jsnitsel@redhat.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 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.