From: Robin Murphy <robin.murphy@arm.com>
To: Joerg Roedel <joro@8bytes.org>, Lu Baolu <baolu.lu@linux.intel.com>
Cc: iommu@lists.linux-foundation.org,
Guoqing Jiang <guoqing.jiang@linux.dev>,
Bernice <bernice.zhang@intel.com>,
Zhang@8bytes.org
Subject: Re: [PATCH 1/2] iommu/vt-d: Fix PCI bus rescan device hot add
Date: Mon, 31 Jan 2022 13:53:06 +0000 [thread overview]
Message-ID: <d9c35bb7-e6f5-a439-505b-5352c34f5621@arm.com> (raw)
In-Reply-To: <YfZBlzYTN/RfCGnE@8bytes.org>
On 2022-01-30 07:43, Joerg Roedel wrote:
> Hi Jacob, Baolu,
>
> On Fri, Jan 28, 2022 at 11:10:01AM +0800, Lu Baolu wrote:
>> During PCI bus rescan, adding new devices involve two notifiers.
>> 1. dmar_pci_bus_notifier()
>> 2. iommu_bus_notifier()
>> The current code sets #1 as low priority (INT_MIN) which resulted in #2
>> being invoked first. The result is that struct device pointer cannot be
>> found in DRHD search for the new device's DMAR/IOMMU. Subsequently, the
>> device is put under the "catch-all" IOMMU instead of the correct one.
>
> There are actually iommu_ops pointers invoked from iommu_bus_notifier()
> into IOMMU driver code. Can those be used to enforce the ordering in a
> more reliable way?
Indeed I very nearly asked whether we couldn't just call these from
intel_iommu_{probe,release}_device() directly, but it looks like they
also interact with the interrupt remapping stuff which can be built
independently of the IOMMU API :(
Robin.
_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu
next prev parent reply other threads:[~2022-01-31 13:53 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-28 3:10 [PATCH 0/2] iommu/vt-d: Fixes for v5.17-rc2 Lu Baolu
2022-01-28 3:10 ` [PATCH 1/2] iommu/vt-d: Fix PCI bus rescan device hot add Lu Baolu
2022-01-30 7:43 ` Joerg Roedel
2022-01-31 13:53 ` Robin Murphy [this message]
2022-01-31 15:52 ` Joerg Roedel
2022-02-01 19:19 ` Jacob Pan
2022-02-03 8:25 ` Joerg Roedel
2022-02-09 21:52 ` Jacob Pan
2022-02-14 10:31 ` Joerg Roedel
2022-02-01 18:55 ` Jacob Pan
2022-01-28 3:10 ` [PATCH 2/2] iommu/vt-d: Fix potential memory leak in intel_setup_irq_remapping() Lu Baolu
2022-01-31 15:53 ` 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=d9c35bb7-e6f5-a439-505b-5352c34f5621@arm.com \
--to=robin.murphy@arm.com \
--cc=Zhang@8bytes.org \
--cc=baolu.lu@linux.intel.com \
--cc=bernice.zhang@intel.com \
--cc=guoqing.jiang@linux.dev \
--cc=iommu@lists.linux-foundation.org \
--cc=joro@8bytes.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