Dune: Safe User-level Access to Privileged CPU Features

 November 23, 2023 at 10:00 pm

PDF Code

Abstract

Dune is a system that provides applications with direct but safe access to hardware features such as ring protection, page tables, and tagged TLBs, while preserving the existing OS interfaces for processes. Dune uses the virtualization hardware in modern processors to provide a process, rather than a machine abstraction. It consists of a small kernel module that initializes virtualization hardware and mediates interactions with the kernel, and a user-level library that helps applications manage privileged hardware features. We present the implementation of Dune for 64bit x86 Linux. We use Dune to implement three userlevel applications that can benefit from access to privileged hardware: a sandbox for untrusted code, a privilege separation facility, and a garbage collector. The use of Dune greatly simplifies the implementation of these applications and provides significant performance advantages.

Methodology

Turn user-level processes into a lightweight VM-abstraction. This achieves isolation while enhances performance dramatically on syscalls, interrupts and page table operations.

Such abstraction is done by Dune kernel module on the host (VMX root, ring 0), and a libDune in Dune-mode process (VMX non-root, ring 0),

Main complexity comes from exposing EPT, handling syscalls/interrupts, and state registers.

Overheads (compared to native Linux)

- getpid (syscall-vmcall) - page fault - page walk (TLB miss)

Why these two have overhead?

Enhancements

- ptrace (intercept VMCALL) - trap (in VM) - appel1 & appel2 (memory management performance measurement)