summaryrefslogtreecommitdiff
path: root/drivers/tee
diff options
context:
space:
mode:
authorRui Miguel Silva <rui.silva@linaro.org>2020-11-13 18:06:04 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-12-02 10:48:12 +0300
commitd6172283a4706aef3136d704e27b8446e879f010 (patch)
tree662235fb1b1c42d1d001e48b37d1f00fe5484a3a /drivers/tee
parentf862c859218200fa2d4f22f8d2c5bfbbd09a53b9 (diff)
downloadlinux-d6172283a4706aef3136d704e27b8446e879f010.tar.xz
optee: add writeback to valid memory type
[ Upstream commit 853735e404244f5496cdb6188c5ed9a0f9627ee6 ] 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> Signed-off-by: Sasha Levin <sashal@kernel.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 a5afbe6dee68..7cb7efe62b01 100644
--- a/drivers/tee/optee/call.c
+++ b/drivers/tee/optee/call.c
@@ -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