diff options
author | Zhang Zhijie <zhangzj@rock-chips.com> | 2018-06-15 11:19:13 +0800 |
---|---|---|
committer | Zhang Zhijie <zhangzj@rock-chips.com> | 2019-03-07 10:07:47 +0800 |
commit | 7757813f899550d93f88b236c6fab227b5a250b2 (patch) | |
tree | 13a2d013f6cde4e3203f74a2d745bbb8c383bb12 /security | |
parent | a6a1e2028648598710676484f25ef38e6f52d7ec (diff) |
OPTEE: check psci state when driver init
Kernel is running in secure mode on some platforms(e.g. rk3128/rv1108),
which has no secure OS to support TEE service.
Change-Id: I275413230b2a8ec3864fc5a5ba043a155d724ced
Signed-off-by: Zhang Zhijie <zhangzj@rock-chips.com>
Diffstat (limited to 'security')
-rw-r--r-- | security/optee_linuxdriver/armtz/tee_tz_drv.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/security/optee_linuxdriver/armtz/tee_tz_drv.c b/security/optee_linuxdriver/armtz/tee_tz_drv.c index 56386a0521f3..fd6e069c2cb0 100644 --- a/security/optee_linuxdriver/armtz/tee_tz_drv.c +++ b/security/optee_linuxdriver/armtz/tee_tz_drv.c @@ -40,6 +40,10 @@ #include "tee_tz_priv.h" #include "handle.h" +#ifdef CONFIG_ARM +#include <asm/psci.h> +#endif + #ifdef CONFIG_OUTER_CACHE #undef CONFIG_OUTER_CACHE #endif @@ -1431,6 +1435,13 @@ static int __init tee_tz_init(void) { int rc; +#ifdef CONFIG_ARM + if (!psci_smp_available()) { + pr_info("tee: kernel is running in secure mode, tee service unavailable.\n"); + return -EACCES; + } +#endif + pr_info("TEE armv7 Driver initialization\n"); #ifdef _TEE_DEBUG |