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

计算机工程与科学 ›› 2024, Vol. 46 ›› Issue (01): 21-27.

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

基于内存保护键值的细粒度访存监控

王睿伯,吴振伟,张文喆,邬会军,张于舒晴,卢凯   

  1. (国防科技大学计算机学院,湖南 长沙 410073)
  • 收稿日期:2022-12-18 修回日期:2023-06-14 接受日期:2024-01-25 出版日期:2024-01-25 发布日期:2024-01-15
  • 基金资助:
    国家重点研发计划(2021YFB0300100);国防科技大学HPCL重点实验室项目(202101-04)

Fine-grained memory access monitoring based on memory protection keys

WANG Rui-bo,WU Zhen-wei,ZHANG Wen-zhe,WU Hui-jun,ZHANG-YU Shu-qing,LU Kai   

  1. (College of Computer Science and Technology,National University of Defense Technology,Changsha 410073,China)
  • Received:2022-12-18 Revised:2023-06-14 Accepted:2024-01-25 Online:2024-01-25 Published:2024-01-15

摘要: 基于内存保护键值硬件扩展,提出了一种轻量化且细粒度的页保护机制。突破了传统页保护方法仅支持页粒度访存监控的技术局限,实现了能够拦截每个访存操作的细粒度页保护机制。充分利用内存保护键值提供的用户态线程局部页访问权限控制,性能开销相比传统页保护的降低了30%以上。通过融合细粒度页保护与编译插桩,弥补了传统编译插桩方法无法覆盖程序中不可重编译部分的局限性。

关键词: 访存监控, 内存保护键值, 页保护, 编译插桩

Abstract: Based on memory protection key hardware extensions, a lightweight and fine-grained page protection mechanism is proposed. This mechanism overcomes the technical limitations of traditional page protection methods that only support page-grained memory access monitoring, and achieves fine-grained page protection that can intercept each memory access operation. By fully utilizing the user-level thread-local page access permission control provided by memory protection keys, the performance overhead is reduced by more than 30% compared to traditional page protection. Through the integration of fine-grained page protection and compiler instrumentation, the limitations of traditional compiler instrumentation methods that cannot cover non-recompilable portions of programs are addressed.


Key words: memory access monitoring, memory protection keys, page protection, compiler instrumentation