Skip to contentSkip to conversation

tee: optee: Allow MT_NORMAL_TAGGED shared memory

PATCH In review Hirokazu Honda 3 participants 4 messages Apr 16 – Apr 28

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tee: optee: Allow MT_NORMAL_TAGGED shared memory

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.

---
 drivers/tee/optee/call.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/tee/optee/call.c +2 -1
index 9effe88049e9..e046aff61828 100644
@@ -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
Signature · 1 line
2.54.0.rc1.513.gad8abe7a5a-goog
reviewer Reviewed-by on v1 1/1
#1 lore raw
Quoted 11 lines · Hirokazu Honda

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.

---
 drivers/tee/optee/call.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

-Sumit

Quoted 18 lines
drivers/tee/optee/call.c +2 -1
index 9effe88049e9..e046aff61828 100644
@@ -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
Signature · 1 line
2.54.0.rc1.513.gad8abe7a5a-goog
#2 lore raw

Hi,

Quoted 9 lines · Sumit Garg
Quoted 7 lines · Hirokazu Honda

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.

Quoted 6 lines
Quoted 4 lines
---
 drivers/tee/optee/call.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Looks good. I'm picking up this.

Cheers,
Jens

#3 lore raw

Thanks Sumit and Jens for reviewing!

Quoted 24 lines · Jens Wiklander

Hi,

Quoted 9 lines · Sumit Garg
Quoted 7 lines · Hirokazu Honda

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.

Quoted 6 lines
Quoted 4 lines
---
 drivers/tee/optee/call.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Looks good. I'm picking up this.

Cheers,
Jens