From: Nicolin Chen via iommu <iommu@lists.linux-foundation.org>
To: Jason Gunthorpe <jgg@nvidia.com>
Cc: dwmw2@infradead.org, linux-kernel@vger.kernel.org,
iommu@lists.linux-foundation.org, will@kernel.org
Subject: Re: [PATCH] iommu/vt-d: Try info->iommu in device_to_iommu()
Date: Fri, 13 May 2022 09:48:40 -0700 [thread overview]
Message-ID: <Yn6L6FFf6icax1Cv@Asurada-Nvidia> (raw)
In-Reply-To: <20220513115032.GM1343366@nvidia.com>
On Fri, May 13, 2022 at 08:50:32AM -0300, Jason Gunthorpe wrote:
> > Perhaps, we can make device_to_iommu() only for probe_device() where the
> > per-device info data is not initialized yet. After probe_device(), iommu
> > and sid are retrieved through other helpers by looking up the device
> > info directly?
>
> This design makes the most sense to me... Nicolin you said there was a
> case where attach was happening before probe though??
I was testing on top of our IOMMUFD dev branch actually, which
is still on 5.17 where priv/info seems to be set at the end of
first ->attach_dev() call. In 5.18, Baolu has already cleaned
away some code. So now, just eyeballing here, it should be set
at driver's ->probe_device() call, so it'd be safe to get info
in attach_dev (and in the new op that we are adding).
I am also rebasing our dev branch to more recent version btw.
Thanks
Nic
_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu
WARNING: multiple messages have this Message-ID (diff)
From: Nicolin Chen <nicolinc@nvidia.com>
To: Jason Gunthorpe <jgg@nvidia.com>
Cc: Baolu Lu <baolu.lu@linux.intel.com>, <dwmw2@infradead.org>,
<joro@8bytes.org>, <will@kernel.org>,
<iommu@lists.linux-foundation.org>,
<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] iommu/vt-d: Try info->iommu in device_to_iommu()
Date: Fri, 13 May 2022 09:48:40 -0700 [thread overview]
Message-ID: <Yn6L6FFf6icax1Cv@Asurada-Nvidia> (raw)
In-Reply-To: <20220513115032.GM1343366@nvidia.com>
On Fri, May 13, 2022 at 08:50:32AM -0300, Jason Gunthorpe wrote:
> > Perhaps, we can make device_to_iommu() only for probe_device() where the
> > per-device info data is not initialized yet. After probe_device(), iommu
> > and sid are retrieved through other helpers by looking up the device
> > info directly?
>
> This design makes the most sense to me... Nicolin you said there was a
> case where attach was happening before probe though??
I was testing on top of our IOMMUFD dev branch actually, which
is still on 5.17 where priv/info seems to be set at the end of
first ->attach_dev() call. In 5.18, Baolu has already cleaned
away some code. So now, just eyeballing here, it should be set
at driver's ->probe_device() call, so it'd be safe to get info
in attach_dev (and in the new op that we are adding).
I am also rebasing our dev branch to more recent version btw.
Thanks
Nic
next prev parent reply other threads:[~2022-05-13 16:48 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-13 0:32 [PATCH] iommu/vt-d: Try info->iommu in device_to_iommu() Nicolin Chen via iommu
2022-05-13 0:32 ` Nicolin Chen
2022-05-13 3:32 ` Baolu Lu
2022-05-13 3:32 ` Baolu Lu
2022-05-13 3:59 ` Nicolin Chen via iommu
2022-05-13 3:59 ` Nicolin Chen
2022-05-13 11:50 ` Jason Gunthorpe via iommu
2022-05-13 11:50 ` Jason Gunthorpe
2022-05-13 16:48 ` Nicolin Chen via iommu [this message]
2022-05-13 16:48 ` Nicolin Chen
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=Yn6L6FFf6icax1Cv@Asurada-Nvidia \
--to=iommu@lists.linux-foundation.org \
--cc=dwmw2@infradead.org \
--cc=jgg@nvidia.com \
--cc=linux-kernel@vger.kernel.org \
--cc=nicolinc@nvidia.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.