110 likes | 201 Views
Formally Certified Virtual Memory Manager. Quick Refresher. Verifying VMM using multi-machine v erification Verify each module at natural level of abstraction Use refinement to connect modules Framework makes the process easier Benefits: Easier verification Enforces hard modularity
E N D
Quick Refresher • Verifying VMM using multi-machine verification • Verify each module at natural level of abstraction • Use refinement to connect modules • Framework makes the process easier • Benefits: • Easier verification • Enforces hard modularity • Reuse of certified code
Our First Certified VMM • Green bars – machine models • 50-200 lines of Coq • Yellow bars – code • Mostly boilerplate definitions • Orange proof circles: • actual code verification • 100-400 lines of Coq • Arrows: • code depends on primitive • Lines with circles: • refine and show compatibility • Circle side is weaker • 100-300 lines of Coq each • Not shown: • Machine relations (200-400) • Framework (3000+)
Recent Accomplishments • Cleaner refinements • Less messy definitions • Should be easier to mix and match refinements • Publications • CPP12 • Dissertation • Enhancements to the VMM • Handling of Translation Look-aside Buffer (Nearly Complete) • Dynamic location of page tables (Fully verified) • Multiple address spaces and multiple page tables (Full Design) • Support for multi-level page tables (Initial Planning)
Translation Look-Aside Buffer • Simulate it as a bit indicating whether TLB is consistent • TLB becomes inconsistent when current page table is updated • Semantics of hardware change • TLB is made consistent when paging is reenabled
TLB’s Effect • 3 memory models altered • Gain the TLB bit • Update store semantics (to desync TLB) • Gain resetTLB primitive • Redo cert. and compatibility proofs: • Page table driver • Memory allocator • All other proofs unchanged
Dynamic Location of Page Tables • PE and ALE models have PTROOT register instead of PT constant • pt_set() and pt_lookup() updated to use dynamic location • pt_init() must now allocate space for page table • Requires a special allocator for contiguous pages • init() must now set PTROOT to the dynamic location • Direct-mapped property is now based on dynamic location
Dynamic PT – Changes Summary • PMAP and AS machines and verification unchanged • ALD-PD refinement and mem_init() cert. unchanged • Completely verified in Coq
Multiple Address Spaces • A new API for the kernel – ability to have multiple spaces • Requires an ability to support multiple page tables • Address Space and Pagemap memory models more powerful
Multiple AS - Changes AS PMAP ALE • Huge changes to most parts of the VMM • New memory models / relations • Verification of memory allocator reused • Semantics did not change • Initialization should be unaffected • Upcall to the kernel will be though • However, must propagate ability to select page tables to AS
Multi-Level Page Tables • Page tables that are defined as a tree structure • Require handling complex data invariants • We have planned a set of predicates to work with data structure • We may have other priorities • Code and design should go through a code review • Should consider other components: • Interrupts • Contexts / context switching • Formal specification may take as much as 1 person-year! • Silver lining: changes are limited to page table drivers • We can verify this later, and it should fit right in.