G22.3250-001 Robert Grimm New York University Xen and Nooks.

Slides:



Advertisements
Similar presentations
Nooks: Safe Device Drivers with Lightweight Kernel Protection Domains Mike Swift, Steve Martin Hank Levy, Susan Eggers, Brian Bershad University of Washington.
Advertisements

MODERN OPERATING SYSTEMS Third Edition ANDREW S. TANENBAUM Chapter 3 Memory Management Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall,
XEN AND THE ART OF VIRTUALIZATION Paul Barham, Boris Dragovic, Keir Fraser, Steven Hand, Tim Harris, Alex Ho, Rolf Neugebauer, lan Pratt, Andrew Warfield.
Chorus and other Microkernels Presented by: Jonathan Tanner and Brian Doyle Articles By: Jon Udell Peter D. Varhol Dick Pountain.
Bart Miller. Outline Definition and goals Paravirtualization System Architecture The Virtual Machine Interface Memory Management CPU Device I/O Network,
The Kernel Abstraction. Challenge: Protection How do we execute code with restricted privileges? – Either because the code is buggy or if it might be.
Lightweight Remote Procedure Call Brian N. Bershad, Thomas E. Anderson, Edward D. Lazowska, and Henry M. Levy Presented by Alana Sweat.
Architectural Support for OS March 29, 2000 Instructor: Gary Kimura Slides courtesy of Hank Levy.
G Robert Grimm New York University Disco.
Xen and the Art of Virtualization A paper from the University of Cambridge, presented by Charlie Schluting For CS533 at Portland State University.
Nooks: an architecture for safe device drivers Mike Swift, The Wild and Crazy Guy, Hank Levy and Susan Eggers.
G Robert Grimm New York University Extensibility: SPIN and exokernels.
Introduction to Kernel
1 Last Class: Introduction Operating system = interface between user & architecture Importance of OS OS history: Change is only constant User-level Applications.
OPERATING SYSTEMS Introduction
Exokernel: An Operating System Architecture for Application-Level Resource Management Dawson R. Engler, M. Frans Kaashoek, and James O’Toole Jr. M.I.T.
Threads CS 416: Operating Systems Design, Spring 2001 Department of Computer Science Rutgers University
CS533 Concepts of OS Class 16 ExoKernel by Constantia Tryman.
1 OS & Computer Architecture Modern OS Functionality (brief review) Architecture Basics Hardware Support for OS Features.
Xen and the Art of Virtualization Paul Barham, Boris Dragovic, Keir Fraser, Steven Hand, Tim Harris, Alex Ho, Rolf Neugebauer, Ian Pratt, Andrew Warfield.
Xen and the Art of Virtualization. Introduction  Challenges to build virtual machines Performance isolation  Scheduling priority  Memory demand  Network.
Stack Management Each process/thread has two stacks  Kernel stack  User stack Stack pointer changes when exiting/entering the kernel Q: Why is this necessary?
Zen and the Art of Virtualization Paul Barham, et al. University of Cambridge, Microsoft Research Cambridge Published by ACM SOSP’03 Presented by Tina.
System Calls 1.
IMPROVING THE RELIABILITY OF COMMODITY OPERATING SYSTEMS Michael M. Swift Brian N. Bershad Henry M. Levy University of Washington.
Microkernels, virtualization, exokernels Tutorial 1 – CSC469.
Protection and the Kernel: Mode, Space, and Context.
Disco : Running commodity operating system on scalable multiprocessor Edouard et al. Presented by Jonathan Walpole (based on a slide set from Vidhya Sivasankaran)
CS533 Concepts of Operating Systems Jonathan Walpole.
Xen I/O Overview. Xen is a popular open-source x86 virtual machine monitor – full-virtualization – para-virtualization para-virtualization as a more efficient.
Architecture Support for OS CSCI 444/544 Operating Systems Fall 2008.
CHAPTER 2: COMPUTER-SYSTEM STRUCTURES Computer system operation Computer system operation I/O structure I/O structure Storage structure Storage structure.
CS 153 Design of Operating Systems Spring 2015 Lecture 17: Paging.
Xen and The Art of Virtualization Paul Barham, Boris Dragovic, Keir Fraser, Steven Hand, Tim Harris, Alex Ho, Rolf Neugebauer, Ian Pratt & Andrew Warfield.
Improving the Reliability of Commodity Operating Systems.
CS533 Concepts of Operating Systems Jonathan Walpole.
CS533 Concepts of Operating Systems Jonathan Walpole.
Hardware process When the computer is powered up, it begins to execute fetch-execute cycle for the program that is stored in memory at the boot strap entry.
CE Operating Systems Lecture 3 Overview of OS functions and structure.
1 CSE451 Architectural Supports for Operating Systems Autumn 2002 Gary Kimura Lecture #2 October 2, 2002.
Lecture Topics: 10/29 Architectural support for operating systems –timers –kernel mode –system calls –protected instructions.
Operating Systems Security
Processes and Virtual Memory
Full and Para Virtualization
Lecture 26 Virtual Machine Monitors. Virtual Machines Goal: run an guest OS over an host OS Who has done this? Why might it be useful? Examples: Vmware,
1 Lecture 1: Computer System Structures We go over the aspects of computer architecture relevant to OS design  overview  input and output (I/O) organization.
Hardware process When the computer is powered up, it begins to execute fetch-execute cycle for the program that is stored in memory at the boot strap entry.
Efficient software-based fault isolation Robert Wahbe, Steven Lucco, Thomas Anderson & Susan Graham Presented by: Stelian Coros.
Page Replacement Implementation Issues Text: –Tanenbaum ch. 4.7.
CSE 451: Operating Systems Winter 2015 Module 25 Virtual Machine Monitors Mark Zbikowski Allen Center 476 © 2013 Gribble, Lazowska,
What is a Process ? A program in execution.
Efficient Software-Based Fault Isolation Authors: Robert Wahbe Steven Lucco Thomas E. Anderson Susan L. Graham Presenter: Gregory Netland.
Improving the Reliability of Commodity Operating Systems Michael M. Swift, Brian N. Bershad, Henry M. Levy Presented by Ya-Yun Lo EECS 582 – W161.
Virtual Machine Monitors
Introduction to Operating Systems
Xen and the Art of Virtualization
Presented by Yoon-Soo Lee
CS 6560: Operating Systems Design
IMPROVING THE RELIABILITY OF COMMODITY OPERATING SYSTEMS
IMPROVING THE RELIABILITY OF COMMODITY OPERATING SYSTEMS
Architectural Support for OS
CSE 451: Operating Systems Autumn 2003 Lecture 2 Architectural Support for Operating Systems Hank Levy 596 Allen Center 1.
CSE 451: Operating Systems Autumn 2001 Lecture 2 Architectural Support for Operating Systems Brian Bershad 310 Sieg Hall 1.
CSE 451: Operating Systems Winter 2003 Lecture 2 Architectural Support for Operating Systems Hank Levy 412 Sieg Hall 1.
Architectural Support for OS
Xen and the Art of Virtualization
CSE 451: Operating Systems Autumn Module 24 Virtual Machine Monitors
Chapter 13: I/O Systems.
System Virtualization
In Today’s Class.. General Kernel Responsibilities Kernel Organization
Presentation transcript:

G Robert Grimm New York University Xen and Nooks

Agenda  Altogether now: The three questions  The (gory) details of Xen  We already covered Disco, so let’s focus on the details  Nooks  The grand tour

Altogether Now: The Three Questions  What is the problem?  What is new or different?  What are the contributions and limitations?

The (Gory) Details of Xen

The Details of Xen  Memory management  x86 has hardware-accessed page tables and TLB  Guest OS’s responsible for managing page tables  Provide machine memory (from their reservations)  Have direct read-only access  Defer to Xen for (batched) updates  CPU  Guest OS’s run in otherwise unused ring 1  Privileged instructions need to be processed by Xen  Though, the x86 makes life a little difficult (how?)  Fast exception handler does not require Xen interaction  Must execute outside ring 0 (what does Xen need to do?)

The Details of Xen (cont.)  Device I/O  Xen presents idealized device abstraction  Data is transferred through shared-memory buffer rings  Upcalls are delivered through event delivery mechanism

The Gory Details  Control transfer  Hypercalls: synchronous software traps to VMM  Events: asynchronous, possibly batched upcalls to VMs  Data transfer through I/O rings  Separate descriptors from actual data  Zero-copy transfer for data  Support batching and re-ordering

The Gory Details (cont.)  Virtual memory  Remember: Guest OS’s manage page tables (not shadows)  Exposes names and allocation  Validated by types and reference counts  Page directory/table, local/global descriptor table, writable  Page directory and tables pinned  Cannot be swapped (why?)  Physical memory  Controlled through balloon driver  Pins pages, which are then returned to VMM  Mapped into machine memory  Xen publishes machine-to-physical mapping (necessary for what?)

Nooks

Nooks in One Slide  An isolation and recovery service  Manages kernel-space extensions  Targeted at commodity kernels  Implemented in Linux, should be easily portable to other OSs  Detects, removes, and restarts misbehaving extensions  But not malicious ones

Why Do We Need Safe Extensions for Commodity Kernels?  Cost of failures continues to rise  Downtime of mission-critical systems  Staffing for help-desk  Extensions are common-place  70% of Linux code  35,000 different drivers with 120,000 versions for Windows XP  Extensions are leading cause of failures  85% of failures for Windows XP  7 times more bugs in drivers than in rest of kernel for Linux

Why Not Use X?  Capabilities, segments  Need specialized hardware, no support for recovery  Micro-, pico-, exo-kernels  No support for recovery, some performance concerns  Transactions  Sloooooooooooooooooooowwwwwwwwww  Type-safe languages and runtimes  Not backwards compatible  Software fault isolation  No support for recovery

Why Not Use X? (cont.)  Virtual machines  Still have drivers in VMM  But lead us to important insight  Only virtualize interface between kernel and extensions  In other words, we don’t need to be perfect, just good enough.

Nooks Architecture  Two principles  Design for fault resistance, not fault tolerance  Design for mistakes, not abuse  Three goals  Isolation  Recovery  Backward compatibility

Nooks Architecture: Four Functions  Isolation  Lightweight protection domains for extensions  What is the trust relationship?  Extension procedure call (XPC)  Interposition  Wrappers for all kernel  extension crossings  Manage control and data flow  Object-tracking  List of kernel data structures modified by extension  Recovery  Removal, restarting of extensions

Nooks Implementation  Additional layer for Linux  Same privilege for all code (ring 0)  Memory protection through page tables Compared to 2.4 million lines in Linux kernel

Isolation  Lightweight protection domains  Private memory structures for each extension  Heap, stacks, memory-mapped I/O regions, buffers  Different page tables for kernel and each extension (why?)  Kernel can read and write all memory  Each extension can only write its own memory  XPC  Saves caller’s context, finds stack, changes page tables  May be deferred  Amortize cost over several logical transfers

Interposition & Wrappers  How to interpose?  Bind extensions to wrappers instead of kernel functions  Explicitly interpose on extension initialization call  Replace function pointers with wrapped versions  What about kernel objects?  Some are read only  done  Some are written by extensions  Non-performance-critical updates through XPC  Performance-critical updates on shadow copy, synchronized through a deferred XPC on next regular XPC  Call-by-what?

More on Wrappers: What They Do, How to Write Them  Check parameters for validity  Implement call-by-value-result for kernel objects  Perform XPC  Skeleton generated by tool  Body written by hand

Even More on Wrappers: Code Sharing

Object Tracker  Currently supports 43 types  E.g., tasklets, PCI devices, inodes  Records addresses of all objects  Used for one XPC only: table attached to task structure  Used across several XPCs: hash table  Keeps mapping between kernel and extension versions  Tracks object lifetimes  Single XPC call  Explicit allocation and deallocation  Semantics of object (e.g., timer data structure)

Recovery  Triggered by  Parameter validation, livelock detection, exceptions, signals  Performed by  Recovery manager  Cleans up after extension  User-mode agent  Determines recovery policy  Performed in several stages  Disable interrupts, unwind tasks, release resources, unload extension, reload and init extension, re-enable interrupts

Limitations  Extensions run in kernel mode  May execute privileged instructions  May loop forever (but Nooks detects livelock)  Parameter checking is incomplete  Recovery safe only for dynamically loaded extensions

Evaluation  The two eff’s  Effectiveness (reliability)  Efficiency (performance)

Effectiveness Nooks prevents 99% of system crashes But catches only a limited number of non-fatal failures Why the differences?

Efficiency  XPC rate serves as performance indicator  Three broad categories

Efficiency (cont.)  There’s more code to run  The code runs more slowly

Discussion  If only we had a software/tagged TLB…  What about end-to-end benchmarking?  All/most drivers managed by Nooks  Typical application mix  Server/desktop environment  How many wrappers is enough wrappers?  Remember the code-sharing slide…  How general is Nooks?  Only one communication pattern is supported  Kernel  extension, but not between extensions  So, when should we use Nooks?