arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2307.14471cs.PL
收藏

用于虚拟化内存地址的模态抽象

Modal Abstractions for Virtualizing Memory Addresses

Ismail Kuru, Colin S. Gordon

AI总结:

针对操作系统虚拟内存管理代码验证难的问题,提出基于模态抽象的方法,定义虚拟指向关系模拟地址转换,可验证多地址空间操控的指令序列,相关成果已在Coq中机械化验证。

摘要:

操作系统内核采用虚拟内存子系统,该子系统利用CPU的内存管理单元(MMUs)对内存区域的地址进行虚拟化。操作系统操控这些虚拟化的内存映射,以隔离不可信进程、限制不同进程可访问的内存范围、对用户程序隐藏内存限制、确保进程隔离,并实现请求调页和写时复制机制以优化性能和进行资源管控。\n虚拟内存管理(VMM)代码是通用操作系统内核的关键组成部分,但由于硬件接口的复杂性,对该功能的验证极具挑战性。本文提出一种模态抽象,用于描述断言相对于特定虚拟地址空间的真值:[r]P表示P在以r为根的虚拟地址空间中成立。这类模态断言允许不同地址空间相互引用,从而能够对操控多个地址空间的指令序列进行完整验证。要有效使用这些断言,需要将其他断言(例如我们分离逻辑中的指向断言)视为相对于给定地址空间的。因此我们定义了虚拟指向关系,该关系模拟相对于页表根的硬件地址转换。我们通过具有挑战性的VMM代码片段验证了所提方法,结果表明我们的方法能够处理现有工作无法覆盖的示例,包括对指令序列在切换地址空间时的推理。本文提及的所有定义和定理,包括类RISC的x86-64指令集片段的操作模型、运行在该操作模型上的简单语言,以及作为Iris框架实例化的逻辑系统,均已在Coq中实现机械化验证。

英文摘要:

Operating system kernels employ virtual memory subsystems, which use a CPU's memory management units (MMUs) to virtualize the addresses of memory regions Operating systems manipulate these virtualized memory mappings to isolate untrusted processes, restrict which memory is accessible to different processes, hide memory limits from user programs, ensure process isolation, implement demand-paging and copy-on-write behaviors for performance and resource controls. Virtual memory management (VMM) code is a critical piece of general-purpose OS kernels, but verification of this functionality is challenging due to the complexity of the hardware interface. In this paper, we introduce a modal abstraction to describe the truth of assertions relative to a specific virtual address space: [r]P indicating that P holds in the virtual address space rooted at r. Such modal assertions allow different address spaces to refer to each other, enabling complete verification of instruction sequences manipulating multiple address spaces. Using them effectively requires working with other assertions, such as points-to assertions in our separation logic, as relative to a given address space. We therefore define virtual points-to relations, which mimic hardware address translation, relative to a page table root. We demonstrate our approach with challenging fragments of VMM code showing that our approach handles examples beyond what prior work can address, including reasoning about a sequence of instructions as it changes address spaces. All definitions and theorems mentioned in this paper including the operational model of a RISC-like fragment of x86-64, a simple language run on this operational model, and a logic as an instantiation of the Iris framework are mechanized inside Coq.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑