• 中国计算机学会会刊
  • 中国科技核心期刊
  • 中文核心期刊

计算机工程与科学 ›› 2020, Vol. 42 ›› Issue (12): 2141-2150.

• 高性能计算 • 上一篇    下一篇

基于TrustZone的安全应用性能优化

杨保绚1,董攀1,张利军2,丁滟1   

  1. (1.国防科技大学计算机学院,湖南 长沙 410073;2.中国人民解放军32228部队24分队,福建 福州 350101)
  • 收稿日期:2020-06-04 修回日期:2020-07-05 接受日期:2020-12-25 出版日期:2020-12-25 发布日期:2021-01-04
  • 基金资助:
    国家重点研发计划(2018YFB0803501);核高基国家科技重大专项(2017ZX01038104-002);国家自然科学基金 (61602492,61303191,61502510,61872444,U19A2060)

Performance optimization of secure application based on TrustZone

YANG Bao-xuan1,DONG Pan1,ZHANG Li-jun2,DING Yan1   

  1. (1.School of Computer,National University of Defense Technology,Changsha 410073;

    (2.24 Branch,32228 Troop,Chinese People’s Liberation Army,Fuzhou 350101,China)

  • Received:2020-06-04 Revised:2020-07-05 Accepted:2020-12-25 Online:2020-12-25 Published:2021-01-04

摘要: TrustZone技术已广泛应用于各种智能系统的安全防护,例如数据加解密、指纹登录、DRM版权和电子支付等。TrustZone技术为程序提供了一个同主机环境相隔离的可信执行环境(TEE),对重要的代码和数据提供运行时保护,因此基于TrustZone的安全应用程序调用过程发生了变化,增加了安全和非安全世界之间数据共享、消息传递等过程,带来了额外性能开销。通过对基于TrustZone的安全应用运行过程进行深入剖析,发现了影响应用程序性能的4个关键要素:世界切换、中断、共享内存管理和数据内存拷贝,在此基础上针对关键要素分别提出性能优化方法。通过基于TrustZone技术的AES加密服务,对比测试性能优化方法,验证了方法的有效性。实验表明:
(1)通过合理设置参数,最大可以实现31%的性能提升;
(2)屏蔽外部中断,最大可以实现4.5%的性能提升;
(3)内存复用最大可以实现37%的性能提升;
(4)减少内存数据拷贝最大可以实现39%的性能提升。


关键词: TrustZone, TEE, 性能, 优化

Abstract: TrustZone technology has been widely used in the security protection of various smart systems, such as data encryption, fingerprint login, DRM protection, electronic payment and so on.  TrustZone technology provides programs with a trusted execution environment (TEE) that is isolated from the host environment to provide the runtime protection for important code and data. Therefore, the calling process of the security application based on TrustZone has changed, then the application adds processes such as data sharing and messaging between the secure and non-secure worlds, which causes additional performance overhead. This paper locates four key elements that affect the performance of the security application: world switch, interrupt, shared memory management, and data copy. On this base, four corresponding performance optimization methods are proposed. Through the AES encryption ser- vice based on TrustZone technology, the proposed performance optimization methods were compared and tested to verify their effectiveness. Experimental results show that: 1. Setting parameters reasonably can improve the performance by 31% at most. 2. Masking external interrupts can improve the perfor- mance by 4.5% at most. 3. Memory reusing can improve the performance by 37% at most. 4. Reducing memory copy can improve the performance by 39% at most.



Key words: TrustZone, trusted execution environment, performance, optimization