RISC-V架构下的懒惰影子页表模型
CSTR:
作者:
作者单位:

作者简介:

通讯作者:

罗英伟,E-mail:lyw@pku.edu.cn

中图分类号:

基金项目:

国家重点研发计划项目(2022YFB4500701);国家自然科学基金项目(62032008,62032001,62372011)


Lazy Shadow Paging Under the RISC-V Architecture
Author:
Affiliation:

Fund Project:

  • 摘要
  • |
  • 图/表
  • |
  • 访问统计
  • |
  • 参考文献
  • |
  • 相似文献
  • |
  • 引证文献
  • |
  • 资源附件
  • |
  • 文章评论
    摘要:

    内存虚拟化作为虚拟化技术的核心组成部分,直接影响虚拟机的整体性能.目前,主流的内存虚拟化方法在两维地址翻译开销与页表同步开销之间面临权衡.传统的影子页表模型通过一套由软件维护的页表,实现了与原生(Native)环境相当的地址翻译性能.然而,由于影子页表的同步依赖于基于写保护的机制,频繁的虚拟机退出(VM-exit)会严重影响系统性能.相对而言,嵌套页表模型依靠硬件辅助虚拟化,允许虚拟机的客户页表直接加载到内存管理单元中,从而避免了页表同步的开销.然而,这种方法的两维页表遍历却显著降低了地址翻译效率.基于RISC-V架构下的特权级模型和虚拟化硬件特性,本文提出了一种懒惰影子页表模型LSP(Lazy Shadow Paging),在保留影子页表的地址翻译高效性的同时降低了页表同步开销.懒惰影子页表模型深入分析了客户机对页表页的访问模式,将页表同步与转址旁路缓存(Translation Lookaside Buffer, TLB)刷新操作绑定以降低虚拟机退出的数量.然后,利用RISC-V架构中对TLB的细粒度刷新且可拦截的特性,无效化需同步的影子页表项,将页表同步的软件开销推迟到了首次访问该页面的时刻.此外,懒惰影子页表模型利用RISC-V架构中全新的特权级模型,设计了TLB拦截的快速路径,进一步减少了虚拟机退出带来的软件开销.实验表明,在基础RISC-V架构下,懒惰影子页表相对于传统影子页表在微基准测试中降低了最多50%的虚拟机退出数量.在支持RISC-V的虚拟化扩展架构下,懒惰影子页表对SPEC06基准测试中的典型应用相较于传统影子页表降低了最多25%的虚拟机退出数量,并且相较于嵌套页表每次TLB缺失降低了12次访存.

    Abstract:

    As a key component of virtualization technology, memory virtualization directly affects the performance of virtual machines. However, the current memory virtualization methods always tradeoff between the overhead of two-dimensional address translation and the overhead of page table synchronization. The traditional shadow paging method uses an extra page table maintained by software to achieve the native address translation performance. But the synchronization of shadow page table based on write protection always causes VM-exits, which seriously decreases the performance. The nested paging method uses hardware-assisted virtualization, and the process page table of applications and the nested page table of the VM can be directly loaded into the MMU, thus avoiding the overhead of page table synchronization, but the two-dimensional page table traversal will seriously degrade the address translation performance. Based on the privilege model and hardware features under RISC-V architecture, this paper present Lazy Shadow Paging(LSP), which reduces the overhead of page table synchronization while maintaining the efficiency of address translation of shadow page tables. The lazy shadow paging first analyzes the access characteristics of process page table pages by guest OS, and combines the synchronization with the TLB flush. It then delays the synchronization software overhead to the first visit after that. At the same time, lazy shadow paging designs a fast path for VM-exits based on the privilege level model under RISC-V. Experiments show that under the basic RISC-V architecture, the lazy shadow paging is reduced 50% of the VM-exits compared with the traditional shadow paging in the micro-benchmark. For the typical application in SPEC2006 benchmark, the lazy shadow paging reduces the number of VM-exits by up to 25% compared with the traditional shadow paging, and reduces 12 memory accesses per TLB miss compared with the nested paging.

    参考文献
    相似文献
    引证文献
引用本文

李传东,衣然,罗英伟,汪小林,王振林. RISC-V架构下的懒惰影子页表模型.软件学报,2025,36(9):0

复制
分享
文章指标
  • 点击次数:
  • 下载次数:
  • HTML阅读次数:
  • 引用次数:
历史
  • 收稿日期:2024-08-25
  • 最后修改日期:2024-10-15
  • 录用日期:
  • 在线发布日期: 2024-12-10
  • 出版日期:
文章二维码
您是第位访问者
版权所有:中国科学院软件研究所 京ICP备05046678号-3
地址:北京市海淀区中关村南四街4号,邮政编码:100190
电话:010-62562563 传真:010-62562533 Email:jos@iscas.ac.cn
技术支持:北京勤云科技发展有限公司

京公网安备 11040202500063号