All of lore.kernel.org
 help / color / mirror / Atom feed
From: Robin Murphy <robin.murphy@arm.com>
To: Janne Grunau <j@jannau.net>, iommu@lists.linux-foundation.org
Cc: Konrad Dybcio <konrad.dybcio@somainline.org>,
	asahi@lists.linux.dev, Sven Peter <sven@svenpeter.dev>,
	Alyssa Rosenzweig <alyssa@rosenzweig.io>,
	Georgi Djakov <quic_c_gdjako@quicinc.com>,
	Hector Martin <marcan@marcan.st>,
	"Isaac J. Manjarres" <isaacm@codeaurora.org>,
	Joerg Roedel <joro@8bytes.org>, Will Deacon <will@kernel.org>,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 4/5] iommu/io-pgtable-dart: Add DART PTE support for t6000
Date: Mon, 27 Jun 2022 16:13:20 +0100	[thread overview]
Message-ID: <2df8c1d1-fb83-5b92-d32a-6b8ba988844c@arm.com> (raw)
In-Reply-To: <20220621071848.14834-5-j@jannau.net>

On 2022-06-21 08:18, Janne Grunau wrote:
> From: Sven Peter <sven@svenpeter.dev>
> 
> The DARTs present in the M1 Pro/Max/Ultra SoC use a diffent PTE format.
> They support a 42bit physical address space by shifting the paddr and
> extending its mask inside the PTE.
> They also come with mandatory sub-page protection now which we just
> configure to always allow access to the entire page. This feature is
> already present but optional on the previous DARTs which allows to
> unconditionally configure it.
> 
> Signed-off-by: Sven Peter <sven@svenpeter.dev>
> Co-developed-by: Janne Grunau <j@jannau.net>
> Signed-off-by: Janne Grunau <j@jannau.net>
> 
> ---
> 
> Changes in v3:
> - apply change to io-pgtable-dart.c
> - handle pte <> paddr conversion based on the pte format instead of
>    the output address size
> 
> Changes in v2:
> - add APPLE_DART2 PTE format
> 
>   drivers/iommu/io-pgtable-dart.c | 51 +++++++++++++++++++++++++++------
>   drivers/iommu/io-pgtable.c      |  1 +
>   include/linux/io-pgtable.h      |  1 +
>   3 files changed, 45 insertions(+), 8 deletions(-)
> 
[...]
> @@ -536,7 +571,7 @@ apple_dart_alloc_pgtable(struct io_pgtable_cfg *cfg, void *cookie)
>   	if (!cfg->coherent_walk)
>   		return NULL;
>   
> -	if (cfg->oas > 36)
> +	if (cfg->oas != 36 && cfg->oas != 42)
>   		return NULL;

Wouldn't it make sense to tie this to the format? Maybe 36-bit OAS is 
still valid with v2, but presumably 42-bit with v1 definitely isn't.

Robin.

WARNING: multiple messages have this Message-ID (diff)
From: Robin Murphy <robin.murphy@arm.com>
To: Janne Grunau <j@jannau.net>, iommu@lists.linux-foundation.org
Cc: "Isaac J. Manjarres" <isaacm@codeaurora.org>,
	Hector Martin <marcan@marcan.st>,
	Konrad Dybcio <konrad.dybcio@somainline.org>,
	linux-kernel@vger.kernel.org, asahi@lists.linux.dev,
	Will Deacon <will@kernel.org>,
	Alyssa Rosenzweig <alyssa@rosenzweig.io>,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v3 4/5] iommu/io-pgtable-dart: Add DART PTE support for t6000
Date: Mon, 27 Jun 2022 16:13:20 +0100	[thread overview]
Message-ID: <2df8c1d1-fb83-5b92-d32a-6b8ba988844c@arm.com> (raw)
In-Reply-To: <20220621071848.14834-5-j@jannau.net>

On 2022-06-21 08:18, Janne Grunau wrote:
> From: Sven Peter <sven@svenpeter.dev>
> 
> The DARTs present in the M1 Pro/Max/Ultra SoC use a diffent PTE format.
> They support a 42bit physical address space by shifting the paddr and
> extending its mask inside the PTE.
> They also come with mandatory sub-page protection now which we just
> configure to always allow access to the entire page. This feature is
> already present but optional on the previous DARTs which allows to
> unconditionally configure it.
> 
> Signed-off-by: Sven Peter <sven@svenpeter.dev>
> Co-developed-by: Janne Grunau <j@jannau.net>
> Signed-off-by: Janne Grunau <j@jannau.net>
> 
> ---
> 
> Changes in v3:
> - apply change to io-pgtable-dart.c
> - handle pte <> paddr conversion based on the pte format instead of
>    the output address size
> 
> Changes in v2:
> - add APPLE_DART2 PTE format
> 
>   drivers/iommu/io-pgtable-dart.c | 51 +++++++++++++++++++++++++++------
>   drivers/iommu/io-pgtable.c      |  1 +
>   include/linux/io-pgtable.h      |  1 +
>   3 files changed, 45 insertions(+), 8 deletions(-)
> 
[...]
> @@ -536,7 +571,7 @@ apple_dart_alloc_pgtable(struct io_pgtable_cfg *cfg, void *cookie)
>   	if (!cfg->coherent_walk)
>   		return NULL;
>   
> -	if (cfg->oas > 36)
> +	if (cfg->oas != 36 && cfg->oas != 42)
>   		return NULL;

Wouldn't it make sense to tie this to the format? Maybe 36-bit OAS is 
still valid with v2, but presumably 42-bit with v1 definitely isn't.

Robin.
_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

WARNING: multiple messages have this Message-ID (diff)
From: Robin Murphy <robin.murphy@arm.com>
To: Janne Grunau <j@jannau.net>, iommu@lists.linux-foundation.org
Cc: Konrad Dybcio <konrad.dybcio@somainline.org>,
	asahi@lists.linux.dev, Sven Peter <sven@svenpeter.dev>,
	Alyssa Rosenzweig <alyssa@rosenzweig.io>,
	Georgi Djakov <quic_c_gdjako@quicinc.com>,
	Hector Martin <marcan@marcan.st>,
	"Isaac J. Manjarres" <isaacm@codeaurora.org>,
	Joerg Roedel <joro@8bytes.org>, Will Deacon <will@kernel.org>,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 4/5] iommu/io-pgtable-dart: Add DART PTE support for t6000
Date: Mon, 27 Jun 2022 16:13:20 +0100	[thread overview]
Message-ID: <2df8c1d1-fb83-5b92-d32a-6b8ba988844c@arm.com> (raw)
In-Reply-To: <20220621071848.14834-5-j@jannau.net>

On 2022-06-21 08:18, Janne Grunau wrote:
> From: Sven Peter <sven@svenpeter.dev>
> 
> The DARTs present in the M1 Pro/Max/Ultra SoC use a diffent PTE format.
> They support a 42bit physical address space by shifting the paddr and
> extending its mask inside the PTE.
> They also come with mandatory sub-page protection now which we just
> configure to always allow access to the entire page. This feature is
> already present but optional on the previous DARTs which allows to
> unconditionally configure it.
> 
> Signed-off-by: Sven Peter <sven@svenpeter.dev>
> Co-developed-by: Janne Grunau <j@jannau.net>
> Signed-off-by: Janne Grunau <j@jannau.net>
> 
> ---
> 
> Changes in v3:
> - apply change to io-pgtable-dart.c
> - handle pte <> paddr conversion based on the pte format instead of
>    the output address size
> 
> Changes in v2:
> - add APPLE_DART2 PTE format
> 
>   drivers/iommu/io-pgtable-dart.c | 51 +++++++++++++++++++++++++++------
>   drivers/iommu/io-pgtable.c      |  1 +
>   include/linux/io-pgtable.h      |  1 +
>   3 files changed, 45 insertions(+), 8 deletions(-)
> 
[...]
> @@ -536,7 +571,7 @@ apple_dart_alloc_pgtable(struct io_pgtable_cfg *cfg, void *cookie)
>   	if (!cfg->coherent_walk)
>   		return NULL;
>   
> -	if (cfg->oas > 36)
> +	if (cfg->oas != 36 && cfg->oas != 42)
>   		return NULL;

Wouldn't it make sense to tie this to the format? Maybe 36-bit OAS is 
still valid with v2, but presumably 42-bit with v1 definitely isn't.

Robin.

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

  reply	other threads:[~2022-06-27 15:13 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-21  7:18 [PATCH v3 0/5] iommu: M1 Pro/Max DART support Janne Grunau
2022-06-21  7:18 ` Janne Grunau
2022-06-21  7:18 ` Janne Grunau
2022-06-21  7:18 ` [PATCH v3 1/5] dt-bindings: iommu: dart: add t6000 compatible Janne Grunau
2022-06-21  7:18   ` Janne Grunau
2022-06-21  7:18   ` Janne Grunau
2022-06-21  7:18 ` [PATCH v3 2/5] iommu/io-pgtable: Move Apple DART support to its own file Janne Grunau
2022-06-21  7:18   ` Janne Grunau
2022-06-21  7:18   ` Janne Grunau
2022-06-27 15:09   ` Robin Murphy
2022-06-27 15:09     ` Robin Murphy
2022-06-27 15:09     ` Robin Murphy
2022-09-01  0:15     ` Janne Grunau
2022-09-01  0:15       ` Janne Grunau
2022-06-21  7:18 ` [PATCH v3 3/5] iommu/io-pgtable: Add DART subpage protection support Janne Grunau
2022-06-21  7:18   ` Janne Grunau
2022-06-21  7:18   ` Janne Grunau
2022-06-21  7:18 ` [PATCH v3 4/5] iommu/io-pgtable-dart: Add DART PTE support for t6000 Janne Grunau
2022-06-21  7:18   ` Janne Grunau
2022-06-21  7:18   ` Janne Grunau
2022-06-27 15:13   ` Robin Murphy [this message]
2022-06-27 15:13     ` Robin Murphy
2022-06-27 15:13     ` Robin Murphy
2022-07-31  7:04     ` Hector Martin
2022-07-31  7:04       ` Hector Martin
2022-09-01  0:22     ` Janne Grunau
2022-09-01  0:22       ` Janne Grunau
2022-06-21  7:18 ` [PATCH v3 5/5] iommu: dart: Support t6000 variant Janne Grunau
2022-06-21  7:18   ` Janne Grunau
2022-06-21  7:18   ` Janne Grunau

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=2df8c1d1-fb83-5b92-d32a-6b8ba988844c@arm.com \
    --to=robin.murphy@arm.com \
    --cc=alyssa@rosenzweig.io \
    --cc=asahi@lists.linux.dev \
    --cc=iommu@lists.linux-foundation.org \
    --cc=isaacm@codeaurora.org \
    --cc=j@jannau.net \
    --cc=joro@8bytes.org \
    --cc=konrad.dybcio@somainline.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcan@marcan.st \
    --cc=quic_c_gdjako@quicinc.com \
    --cc=sven@svenpeter.dev \
    --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.