Skip to content

Commit 853735e

Browse files
rmsilvajenswi-linaro
authored andcommitted
optee: add writeback to valid memory type
Only in smp systems the cache policy is setup as write alloc, in single cpu systems the cache policy is set as writeback and it is normal memory, so, it should pass the is_normal_memory check in the share memory registration. Add the right condition to make it work in no smp systems. Fixes: cdbcf83 ("tee: optee: check type of registered shared memory") Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
1 parent 3cea11c commit 853735e

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

drivers/tee/optee/call.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -534,7 +534,8 @@ void optee_free_pages_list(void *list, size_t num_entries)
534534
static bool is_normal_memory(pgprot_t p)
535535
{
536536
#if defined(CONFIG_ARM)
537-
return (pgprot_val(p) & L_PTE_MT_MASK) == L_PTE_MT_WRITEALLOC;
537+
return (((pgprot_val(p) & L_PTE_MT_MASK) == L_PTE_MT_WRITEALLOC) ||
538+
((pgprot_val(p) & L_PTE_MT_MASK) == L_PTE_MT_WRITEBACK));
538539
#elif defined(CONFIG_ARM64)
539540
return (pgprot_val(p) & PTE_ATTRINDX_MASK) == PTE_ATTRINDX(MT_NORMAL);
540541
#else

0 commit comments

Comments
 (0)