tee: optee: Allow MT_NORMAL_TAGGED shared memory
Subsystems (2)
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
@@ -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
Quoted 11 lines · Hirokazu Honda
From: Hirokazu Honda <[email protected]>
On ARM64, shared memory can have
MT_NORMAL_TAGGEDattribute 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(-)
-Sumit
Quoted 18 lines
drivers/tee/optee/call.c +2
-1@@ -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
Hi,
Quoted 9 lines · Sumit Garg
Quoted 7 lines · Hirokazu Honda
From: Hirokazu Honda <[email protected]>
On ARM64, shared memory can have
MT_NORMAL_TAGGEDattribute 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
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]>
Looks good. I'm picking up this.
Cheers,
Jens
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_TAGGEDattribute 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
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]>Looks good. I'm picking up this.
Cheers,
Jens