From: Joerg Roedel <joro@8bytes.org>
To: iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org,
Jerry Snitselaar <jsnitsel@redhat.com>,
Joerg Roedel <jroedel@suse.de>
Subject: Re: [PATCH] iommu: Check for deferred attach in iommu_group_do_dma_attach()
Date: Thu, 4 Jun 2020 11:39:36 +0200 [thread overview]
Message-ID: <20200604093936.GK14598@8bytes.org> (raw)
In-Reply-To: <20200604091944.26402-1-joro@8bytes.org>
On Thu, Jun 04, 2020 at 11:19:44AM +0200, Joerg Roedel wrote:
> From: Joerg Roedel <jroedel@suse.de>
>
> The iommu_group_do_dma_attach() must not attach devices which have
> deferred_attach set. Otherwise devices could cause IOMMU faults when
> re-initialized in a kdump kernel.
>
> Fixes: deac0b3bed26 ("iommu: Split off default domain allocation from group assignment")
> Reported-by: Jerry Snitselaar <jsnitsel@redhat.com>
> Reviewed-by: Jerry Snitselaar <jsnitsel@redhat.com>
> Tested-by: Jerry Snitselaar <jsnitsel@redhat.com>
> Signed-off-by: Joerg Roedel <jroedel@suse.de>
> ---
> drivers/iommu/iommu.c | 6 +++++-
> 1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c
> index b5ea203f6c68..5a6d509f72b6 100644
> --- a/drivers/iommu/iommu.c
> +++ b/drivers/iommu/iommu.c
> @@ -1680,8 +1680,12 @@ static void probe_alloc_default_domain(struct bus_type *bus,
> static int iommu_group_do_dma_attach(struct device *dev, void *data)
> {
> struct iommu_domain *domain = data;
> + int ret = 0;
>
> - return __iommu_attach_device(domain, dev);
> + if (!iommu_is_attach_deferred(group->domain, dev))
> + ret = __iommu_attach_device(group->domain, dev);
And of course with the same bug as my original diff. Fixed that up
before applying it. (group->domain -> domain).
Joerg
_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu
WARNING: multiple messages have this Message-ID (diff)
From: Joerg Roedel <joro@8bytes.org>
To: iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org,
Jerry Snitselaar <jsnitsel@redhat.com>,
Joerg Roedel <jroedel@suse.de>
Subject: Re: [PATCH] iommu: Check for deferred attach in iommu_group_do_dma_attach()
Date: Thu, 4 Jun 2020 11:39:36 +0200 [thread overview]
Message-ID: <20200604093936.GK14598@8bytes.org> (raw)
In-Reply-To: <20200604091944.26402-1-joro@8bytes.org>
On Thu, Jun 04, 2020 at 11:19:44AM +0200, Joerg Roedel wrote:
> From: Joerg Roedel <jroedel@suse.de>
>
> The iommu_group_do_dma_attach() must not attach devices which have
> deferred_attach set. Otherwise devices could cause IOMMU faults when
> re-initialized in a kdump kernel.
>
> Fixes: deac0b3bed26 ("iommu: Split off default domain allocation from group assignment")
> Reported-by: Jerry Snitselaar <jsnitsel@redhat.com>
> Reviewed-by: Jerry Snitselaar <jsnitsel@redhat.com>
> Tested-by: Jerry Snitselaar <jsnitsel@redhat.com>
> Signed-off-by: Joerg Roedel <jroedel@suse.de>
> ---
> drivers/iommu/iommu.c | 6 +++++-
> 1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c
> index b5ea203f6c68..5a6d509f72b6 100644
> --- a/drivers/iommu/iommu.c
> +++ b/drivers/iommu/iommu.c
> @@ -1680,8 +1680,12 @@ static void probe_alloc_default_domain(struct bus_type *bus,
> static int iommu_group_do_dma_attach(struct device *dev, void *data)
> {
> struct iommu_domain *domain = data;
> + int ret = 0;
>
> - return __iommu_attach_device(domain, dev);
> + if (!iommu_is_attach_deferred(group->domain, dev))
> + ret = __iommu_attach_device(group->domain, dev);
And of course with the same bug as my original diff. Fixed that up
before applying it. (group->domain -> domain).
Joerg
next prev parent reply other threads:[~2020-06-04 9:39 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-04 9:19 [PATCH] iommu: Check for deferred attach in iommu_group_do_dma_attach() Joerg Roedel
2020-06-04 9:19 ` Joerg Roedel
2020-06-04 9:39 ` Joerg Roedel [this message]
2020-06-04 9:39 ` Joerg Roedel
2020-06-04 12:23 ` kernel test robot
2020-06-04 12:23 ` kernel test robot
2020-06-04 12:23 ` kernel test robot
2020-06-04 18:05 ` kernel test robot
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=20200604093936.GK14598@8bytes.org \
--to=joro@8bytes.org \
--cc=iommu@lists.linux-foundation.org \
--cc=jroedel@suse.de \
--cc=jsnitsel@redhat.com \
--cc=linux-kernel@vger.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.