theory of multicore hypervisor verification

Download Theory of  Multicore  Hypervisor Verification

If you can't read please download the document

Upload: chynna

Post on 25-Feb-2016

36 views

Category:

Documents


0 download

DESCRIPTION

Theory of Multicore Hypervisor Verification. W. Paul Saarland University joint work with E. Cohen, S. Schmaltz…. What is a kernel ?. The Classic : Turing machine kernel Simulating k one tape Turing machines by 1 one tape T uring machine Tracks: address translation - PowerPoint PPT Presentation

TRANSCRIPT

Cyber war, formal verification and certified infrastructure

Theory of Multicore Hypervisor VerificationW. PaulSaarland Universityjoint work with E. Cohen, S. Schmaltz.What is a kernel ?The Classic: Turing machine kernelSimulating k one tape Turing machines by 1 one tape Turing machineTracks: address translationHead position and state: process control blockRound robin: schedulingtape(1,left) s_1 tape(1,right)tape(2,left) s_2 tape(2,right)tape(3,left) s_3 tape(3,right)What is an M-kernel ?process virtualization: simulating k machines of type M by 1 one tape machine of type M+ sytem calls for inter process communicationM:MIPS, ARM, Power, x64tape(1,left) s_1 tape(1,right)tape(2,left) s_2 tape(2,right)tape(3,left) s_3 tape(3,right)What is a hypervisor ?guests can be operating systems, i.e. in system mode2 levels of translationhypervisor page tablesguest page tablessubdivide trackshardware supportnested page tablesno hardware support:composition of translations is translationmaintain shadow page tables (SPT) for combined translatioredirect memory management unit (mmu) to SPTsBackground2007-2010: effort to formally verify MS HyperVpart of German Verisoft-XT project (Paul, Broy, Podelski, Rybalchenko), 13 Mio MS Windows + Research (Cohen, Moskal, Leino,)We failed 2010tool development (VCC) successfulcrucial portions of code verifiedtool documentation and soundness argument less than perfectpaper and pencil theory incomplete in 2010We did not know (exactly enough) what to prove

Hypervisor Correctness is eitherOne theorem in 1 theorythen we are in weapons business of cycber waror bug huntingthen we (formal verification ehineers) are competing with the software communityand may get beaten up

This talk (only) 2 years after end of projectoutlines model stack for multicore hypervisor verificationI think completesimulation theorems between layerssoundness of VCC and its usesize of remaining gaps: 1reorder their device steps out of driver run of dev 1pre and post conditions for drivers

Diss. Alkassar http://scidok.sulb.uni-saarland.de/volltexte/2009/2420/pdf/Dissertation_1410_Alka_Eyad_2009.pdf

Alkassar et al: TACAS 08

procdev 1dev kMIPS ISA-u + devices (3) startup Hypervisor:disk: boot loaderAPIC: wake up other coresDiss Pentchev 2013?secure boot:digital signaturesVerisoft (2003-2007)procdev 1dev kOwnership (1)conceptClassify addresseslocal (e.g. C stack)shared and read only (e.g. program)shared owned (temporarily local/locked)shared writeable not owned (locks)invariants: at most 1 owner .disjointnesssafe programs: act like names of address classes suggestaccesses to class 4 atomic at the language levelOwnership (2)Def: structured parallel C (folklore)Classify addresseslocal (e.g. C stack)shared and read only (e.g. program)shared owned (temporarily local/locked)shared writeable not owned (locks)multiple C threadssequentially consistent memoryshared: heap + global variableslocal: stackssafe w.r.t. ownershipclass 4 access: volatile

Ownership (3)structured parallel C to parallel assemblyIFtranslate threads with sequential compilertranslate volatile C access to interlocked ISA-u accessTHENISA program safemulticore ISA-u simulates parallel C

A. Appel, X. Leroy et al: formal work in progressno store buffersDissertation C. Baumann 2012: pushing this through entire language hierarchy on paperOwnership (4)parallel store buffer reduction in ISA-spmaintain local dirty bitsclass 4 write since last local sb- flushclass 4 read only if dirty =0Cohen Schirmer ITP 2010: store buffers invisible formalno mmuto be pushed through hierarchyimplement sb-flush as compiler intrinsic in C

ISA-spISA-u=asmm-asmCcompilerm-assemblerbeforedirtyOwnership (5)semantics from hellDef: VCC-C: structured parallel C with Cohen Schirmer dirty bitsVCC-C + m-asm + asm +ISA-sp

ISA-spISA-u=asmm-asmCcompilerm-assemblerbeforedirtyhyperVguestOwnership (5)semantics from hellVCC-C: structured parallel C with Cohen Schirmer dirty bitsVCC-C + m-asm + asm +ISA-spshared shadow page tables MMU (ISA-sp) walks SPTs (volatile C data structure)order reduction: interleave MMU steps at volatile C accesses to SPTs

ISA-spISA-u=asmm-asmCcompilerm-assemblerbeforedirtyhyperVguestModel stackgates+ regs.+drivers + delaydigital hardwareISA-spVCC-C ++ISA.sptiming analysishardware correctnesscompilation(1)(1)(2-5)model and theory stackTODOSoundness of VCC and ist use VCC is parallel C verifierTheorem: hyperV virtualizes multiple ISA-sp (+ system calls) gates+ regs.+drivers + delaydigital hardwareISA-spVCC-C ++ISA.sptiming analysishardware correctnesscompilation(1)(1)(2-5)soundness hyperV correct(7)(6)VCC (1) soundness: arguing about ownershipC + ghost: Dissertation Schmaltz 2012semantics simulation of C by C+ghostghost code must terminateVCC-C + ghostTODO for VCC soundnessSemantics of assertion language of C + ghost (logics)show that assertions generated by VCC imply ownership + Cohen Schirmer dirty bit disciplinesoundness of verification condition generator used for serial and parallel langue constructs

VCC (2) use for C + m-assembly +ISA-spDissertation Maus (Podelski)hybrid C variables, located in memory outside of regular C variablescode non C portions of ISA-sp in hybrid variableswrite obvious C simulatortranslate m-assembly macros into C function calls in the naive waywildly productive14K LOC verifiedMaus et al: AMAST 2008

soundness: Dissertation ShadrinPaul et al: SEFM 12HyperV correctness (1)kernel layer: many threadsSimulation of K C+masm + ISA-sp threads by k physical ISA-sp threadscompile C partthread control blockssaving and restoring stack and heap pointersC + masm + asmAPICs hard to simulate

similar to kernel correctness from Verisoft-1 Project (14 Mio )paper: Gargano et al: TPHOLs 2005 formal: Alkassar et al, VSTTE 2010Dissertation Alekhin 2013?HyperV correctness (2)shadow page tables2 translationsguest-OS to userhost to guest - OSwith hardware support nested page tablesno formal model and hardware construction yetwithout harware supportcomposition of translations is translationSPT for compositionRedirect MMU to SPTs

SPT-algorithm without sharing beween processors, formalDissertation Kovalev 2012Alkassar et al FMCAD 2010 in MS product SPTs with sharingHyperV correctness(3)ISA-sp virtualization and system callsVirtualizationwith kernel layer and SPTs similar to Verisoft-1new: state of ISA-sp components of sleeping virtual procesorssb emptycaches from hardwaretlb empty or tagged as in hardwareSimple Hypervisorformal in VCCwithout save/restore: Alkassar et al: VSTTE 10with: Paul et al: SEFM 12

system calls and C data strutures of kernel as in formal workseL4 (only C portion but can extend with Verisoft-1 technology)or Diss Drrenbcher 2010 http://www-wjp.cs.uni-saarland.de/publikationen/JD10.pdfor Diss M. Schmidt 2011http://www-wjp.cs.uni-saarland.de/publikationen/MS11.pdf (part of Verisoft automotive subproject. Broy-Paul)

Final remarkPaul VSTTE 2005a formal proof is an engineering objecta paper proof is a building planIFIP working group on verified software 2012lack of such building plans recognized as major obstcle for development of formally verified systemsvery difficult to publish so far Thank You