slide1 n.
Download
Skip this Video
Loading SlideShow in 5 Seconds..
A critical assault upon “A Comparison of Software and Hardware Techniques for x86 Virtualization” PowerPoint Presentation
Download Presentation
A critical assault upon “A Comparison of Software and Hardware Techniques for x86 Virtualization”

Loading in 2 Seconds...

play fullscreen
1 / 12

A critical assault upon “A Comparison of Software and Hardware Techniques for x86 Virtualization” - PowerPoint PPT Presentation


  • 88 Views
  • Uploaded on

A critical assault upon “A Comparison of Software and Hardware Techniques for x86 Virtualization” Chris Smowton. Virtualisation in a slide. Emulate running guest OS on real hardware Use actual hardware where you can Respond to cases where you can't with emulation

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'A critical assault upon “A Comparison of Software and Hardware Techniques for x86 Virtualization”' - iago


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
slide1

A critical assault upon

“A Comparison of Software and Hardware Techniques for x86 Virtualization”

Chris Smowton

virtualisation in a slide
Virtualisation in a slide
  • Emulate running guest OS on real hardware
  • Use actual hardware where you can
  • Respond to cases where you can't with emulation
    • Trap reactively (e.g. catch illegal instruction exception)
    • Or adapt code to call out preemptively
virtualising x86
Virtualising x86
  • Two (major) sources of traps
    • Inherently privileged instructions
      • e.g. “disable interrupts”, “enter kernel mode”
      • Easy to detect
    • Writes to privileged memory
      • e.g. write page table, segment table
      • Could be caused by any ALU op (damn CISC)
classical virtualisation and x86
Classical virtualisation and x86
  • Classical virtualisation: run guest in unprivileged processor mode
    • Including kernel
    • Take and handle exceptions on privileged ops
  • But x86: Guest can tell it's being virtualised
  • And: Some instructions fail silently
two ways out
Two ways out
  • Software binary translation
    • Rewrite those pesky instructions
    • Opportunity to be cleverer than trap-and-emulate
  • Hardware virtualisation
    • i386 v1.1: introduce guest mode
    • Extra pseudo-privileged CPU state
      • Guest exception vectors, interrupt mask...
    • Still trap page table alterations
software bt the vmware way
Software BT (the vmware way)
  • Rewrite guest kernel-mode code on demand
  • Translate inherently privileged ops away
    • Easy ones: emulate without invoking VMM
      • e.g. disable interrupts
    • Hard ones: call into VMM (cheaper than trap)
  • Profile guest memory ops
    • Often faults? Replace with VMM call
    • Or, avoid call altogether!
    • Sort of automatic PV OS generator
guest mmu emulation
Guest MMU emulation
  • Guest will try to write page tables
    • However we detect that action
    • Map guest VAs to pseudo-physical address
  • VMM maps guest PPAs to (real) machine addresses
  • Maintain a “shadow page table” mapping guest VAs to Mas
  • Ensure shadow table always consistent with guest expectations
software bt a neat example
Software BT: a neat example
  • Process creation: build a bunch of page tables
    • Want to avoid fault on every PT write
  • x86: new table entries not valid until TLB flush!
  • Don't call up – instead, save in SHM buffer
  • On TLB flush, VMM processes the buffer
  • Like Xen PV guests, only automatically generated
hardware virt the intel way
Hardware Virt (the Intel way)
  • Replicate privileged processor state in VMCB
  • New processor mode: entered passing VMCB
    • Disable interrupts? Write to VMCB
    • Divide by zero? Check VMCB exc. Vector
    • Enter kernel mode? Same.
  • But, no guest MMU support in hardware
    • Need software MMU emulation as before
relative merits
Relative merits
  • Hardware virt good at anything the VMCB supports
    • Syscalls, interrupt mask...
  • Software BT better at MMU ops
    • Dynamically adapts
    • Could do that for HW guys too...
      • But they don't
results in a nutshell
Results in a nutshell
  • As you might suppose
    • HWVM wins when MMU ops are rare relative to syscalls, exceptions
      • Probably awesome at running getpid
    • SWVM wins the rest of the time
      • Particularly good at running fork-bombs
so criticism
So, criticism?
  • Results probably true
  • Can't reasonably claim obsolete hardware
  • But, a straw man?
  • Restates the same outcome in a dozen guises
  • Ignores the main benefit of classically virtualisable x86:
    • Possible to write a small VMM
    • Which unsurprisingly would be a slower