linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Robin Murphy <robin.murphy@arm.com>
To: Jason Gunthorpe <jgg@nvidia.com>,
	iommu@lists.linux.dev, Maxime Ripard <maxime@cerno.tech>,
	Jernej Skrabec <jernej.skrabec@gmail.com>,
	Joerg Roedel <joro@8bytes.org>,
	linux-arm-kernel@lists.infradead.org,
	linux-sunxi@lists.linux.dev, Samuel Holland <samuel@sholland.org>,
	Chen-Yu Tsai <wens@csie.org>, Will Deacon <will@kernel.org>
Cc: Joerg Roedel <jroedel@suse.de>, Andre Przywara <andre.przywara@arm.com>
Subject: Re: [PATCH] iommu/sun50i: Remove IOMMU_DOMAIN_IDENTITY
Date: Mon, 28 Nov 2022 14:21:56 +0000	[thread overview]
Message-ID: <a4f7157f-bd1d-ed7e-161f-e39c8c940a02@arm.com> (raw)
In-Reply-To: <0-v1-97f0adf27b5e+1f0-s50_identity_jgg@nvidia.com>

On 2022-11-28 14:06, Jason Gunthorpe wrote:
> This driver treats IOMMU_DOMAIN_IDENTITY the same as UNMANAGED, which
> cannot possibly be correct.
> 
> UNMANAGED domains are required to start out blocking all DMAs. This seems
> to be what this driver does as it allocates a first level 'dt' for the IO
> page table that is 0 filled.
> 
> Thus UNMANAGED looks like a working IO page table, and so IDENTITY must be
> a mistake. Remove it.

Ah yes, this did once catch my eye ages ago and Andre confirmed that 
real hardware fell over with "iommu.passthrough=1", but it seems we both 
forgot about it again before a patch got written. Thanks for taking the 
time!

Reviewed-by: Robin Murphy <robin.murphy@arm.com>

> Fixes: 4100b8c229b3 ("iommu: Add Allwinner H6 IOMMU driver")
> Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
> ---
>   drivers/iommu/sun50i-iommu.c | 1 -
>   1 file changed, 1 deletion(-)
> 
> diff --git a/drivers/iommu/sun50i-iommu.c b/drivers/iommu/sun50i-iommu.c
> index cd9b74ee24def1..0843418434ff3a 100644
> --- a/drivers/iommu/sun50i-iommu.c
> +++ b/drivers/iommu/sun50i-iommu.c
> @@ -601,7 +601,6 @@ static struct iommu_domain *sun50i_iommu_domain_alloc(unsigned type)
>   	struct sun50i_iommu_domain *sun50i_domain;
>   
>   	if (type != IOMMU_DOMAIN_DMA &&
> -	    type != IOMMU_DOMAIN_IDENTITY &&
>   	    type != IOMMU_DOMAIN_UNMANAGED)
>   		return NULL;
>   
> 
> base-commit: 328827239b9ce3a95b5c0d33e8875651580de053

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2022-11-28 14:23 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-28 14:06 [PATCH] iommu/sun50i: Remove IOMMU_DOMAIN_IDENTITY Jason Gunthorpe
2022-11-28 14:21 ` Robin Murphy [this message]
2022-12-05 10: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=a4f7157f-bd1d-ed7e-161f-e39c8c940a02@arm.com \
    --to=robin.murphy@arm.com \
    --cc=andre.przywara@arm.com \
    --cc=iommu@lists.linux.dev \
    --cc=jernej.skrabec@gmail.com \
    --cc=jgg@nvidia.com \
    --cc=joro@8bytes.org \
    --cc=jroedel@suse.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-sunxi@lists.linux.dev \
    --cc=maxime@cerno.tech \
    --cc=samuel@sholland.org \
    --cc=wens@csie.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).