Re: [PATCH] tee: optee: Allow MT_NORMAL_TAGGED shared memory

Sumit Garg via OP-TEE <[email protected]> Mon, 20 Apr 2026 17:59:22 +0530
Newsgroups org.trustedfirmware.lists.op-tee,org.kernel.vger.linux-kernel
Message-ID <aeYcIpw6lyUnmIsN@sumit-xelite>
On Thu, Apr 16, 2026 at 03:18:19PM -0700, Hirokazu Honda wrote:
> From: Hirokazu Honda <[email protected]>
> 
> On ARM64, shared memory can have MT_NORMAL_TAGGED attribute when using
> the Memory Tagging Extension (MTE). The OP-TEE driver needs to
> recognize this as normal memory to allow sharing such buffers with the
> Secure World.
> 
> Signed-off-by: Hirokazu Honda <[email protected]>
> ---
>  drivers/tee/optee/call.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)

Reviewed-by: Sumit Garg <[email protected]>

-Sumit

> 
> diff --git a/drivers/tee/optee/call.c b/drivers/tee/optee/call.c
> index 9effe88049e9..e046aff61828 100644
> --- a/drivers/tee/optee/call.c
> +++ b/drivers/tee/optee/call.c
> @@ -602,7 +602,8 @@ static bool is_normal_memory(pgprot_t p)
>  	return (((pgprot_val(p) & L_PTE_MT_MASK) == L_PTE_MT_WRITEALLOC) ||
>  		((pgprot_val(p) & L_PTE_MT_MASK) == L_PTE_MT_WRITEBACK));
>  #elif defined(CONFIG_ARM64)
> -	return (pgprot_val(p) & PTE_ATTRINDX_MASK) == PTE_ATTRINDX(MT_NORMAL);
> +	return ((pgprot_val(p) & PTE_ATTRINDX_MASK) == PTE_ATTRINDX(MT_NORMAL)) ||
> +	       ((pgprot_val(p) & PTE_ATTRINDX_MASK) == PTE_ATTRINDX(MT_NORMAL_TAGGED));
>  #else
>  #error "Unsupported architecture"
>  #endif
> -- 
> 2.54.0.rc1.513.gad8abe7a5a-goog
>