UPSTREAM: 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: cdbcf83d29c1 ("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>
(cherry picked from commit 853735e404244f5496cdb6188c5ed9a0f9627ee6)
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I51048c263982850c46b639d12b1bf25604d5dd15
This commit is contained in:
parent
2a6d6f0481
commit
6e3cd2a7be
1 changed files with 2 additions and 1 deletions
|
|
@ -538,7 +538,8 @@ void optee_free_pages_list(void *list, size_t num_entries)
|
|||
static bool is_normal_memory(pgprot_t p)
|
||||
{
|
||||
#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)
|
||||
return (pgprot_val(p) & PTE_ATTRINDX_MASK) == PTE_ATTRINDX(MT_NORMAL);
|
||||
#else
|
||||
|
|
|
|||
Loading…
Reference in a new issue