summaryrefslogtreecommitdiffstats
path: root/drivers/tee
diff options
context:
space:
mode:
authorRui Miguel Silva <rui.silva@linaro.org>2020-11-13 15:06:04 +0000
committerJens Wiklander <jens.wiklander@linaro.org>2020-11-25 12:51:52 +0100
commit853735e404244f5496cdb6188c5ed9a0f9627ee6 (patch)
tree35a75aa9a0bf6b1846e2ae2c1c5ba85e706cd6b2 /drivers/tee
parent3cea11cd5e3b00d91caf0b4730194039b45c5891 (diff)
downloadlinux-stable-853735e404244f5496cdb6188c5ed9a0f9627ee6.tar.gz
linux-stable-853735e404244f5496cdb6188c5ed9a0f9627ee6.tar.bz2
linux-stable-853735e404244f5496cdb6188c5ed9a0f9627ee6.zip
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>
Diffstat (limited to 'drivers/tee')
-rw-r--r--drivers/tee/optee/call.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/tee/optee/call.c b/drivers/tee/optee/call.c
index 20b6fd7383c5..c981757ba0d4 100644
--- a/drivers/tee/optee/call.c
+++ b/drivers/tee/optee/call.c
@@ -534,7 +534,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