提交 853735e4 编写于 作者: R Rui Miguel Silva 提交者: Jens Wiklander

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: cdbcf83d ("tee: optee: check type of registered shared memory")
Signed-off-by: NRui Miguel Silva <rui.silva@linaro.org>
Signed-off-by: NJens Wiklander <jens.wiklander@linaro.org>
上级 3cea11cd
...@@ -534,7 +534,8 @@ void optee_free_pages_list(void *list, size_t num_entries) ...@@ -534,7 +534,8 @@ void optee_free_pages_list(void *list, size_t num_entries)
static bool is_normal_memory(pgprot_t p) static bool is_normal_memory(pgprot_t p)
{ {
#if defined(CONFIG_ARM) #if defined(CONFIG_ARM)
return (pgprot_val(p) & L_PTE_MT_MASK) == L_PTE_MT_WRITEALLOC; 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) #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);
#else #else
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册