]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
tee: optee: Allow MT_NORMAL_TAGGED shared memory
authorHirokazu Honda <hiroh@chromium.org>
Thu, 16 Apr 2026 22:18:19 +0000 (15:18 -0700)
committerJens Wiklander <jens.wiklander@linaro.org>
Mon, 27 Apr 2026 12:13:14 +0000 (14:13 +0200)
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 <hiroh@chromium.org>
Reviewed-by: Sumit Garg <sumit.garg@oss.qualcomm.com>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
drivers/tee/optee/call.c

index 9effe88049e9d22c0bf8b01612f31af97af856fb..e046aff6182866823f3a41ed3c83e91cab465bcc 100644 (file)
@@ -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