OS Structures - Xen. Xen Key points Goal: extensibility akin to SPIN and Exokernel goals Main difference: support running several commodity operating.

Slides:



Advertisements
Similar presentations
Virtualization Technology
Advertisements

More on Processes Chapter 3. Process image _the physical representation of a process in the OS _an address space consisting of code, data and stack segments.
XEN AND THE ART OF VIRTUALIZATION Paul Barham, Boris Dragovic, Keir Fraser, Steven Hand, Tim Harris, Alex Ho, Rolf Neugebauer, lan Pratt, Andrew Warfield.
Embedded System Lab. Yoon Jun Kee Xen and the Art of Virtualization.
Bart Miller. Outline Definition and goals Paravirtualization System Architecture The Virtual Machine Interface Memory Management CPU Device I/O Network,
Architectural Support for OS March 29, 2000 Instructor: Gary Kimura Slides courtesy of Hank Levy.
Memory Management (II)
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.
OS Spring’03 Introduction Operating Systems Spring 2003.
Xen and the Art of Virtualization Paul Barham, Boris Dragovic, Keir Fraser, Steven Hand, Tim Harris, Alex Ho, Rolf Neugebauer, Ian Pratt, Andrew Warfield.
November 1, 2004Introduction to Computer Security ©2004 Matt Bishop Slide #29-1 Chapter 33: Virtual Machines Virtual Machine Structure Virtual Machine.
Virtual Machine Monitors CSE451 Andrew Whitaker. Hardware Virtualization Running multiple operating systems on a single physical machine Examples:  VMWare,
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 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.
Basics of Operating Systems March 4, 2001 Adapted from Operating Systems Lecture Notes, Copyright 1997 Martin C. Rinard.
Tanenbaum 8.3 See references
Zen and the Art of Virtualization Paul Barham, et al. University of Cambridge, Microsoft Research Cambridge Published by ACM SOSP’03 Presented by Tina.
Virtual Machines Xen and Terra Rajan Palanivel. Xen and Terra : Papers Xen and the art of virtualization. -Univ. of Cambridge Terra: A VM based platform.
Microkernels, virtualization, exokernels Tutorial 1 – CSC469.
CS533 Concepts of Operating Systems Jonathan Walpole.
Virtualization The XEN Approach. Virtualization 2 CS5204 – Operating Systems XEN: paravirtualization References and Sources Paul Barham, et.al., “Xen.
Benefits: Increased server utilization Reduced IT TCO Improved IT agility.
Xen I/O Overview. Xen is a popular open-source x86 virtual machine monitor – full-virtualization – para-virtualization para-virtualization as a more efficient.
Virtualization Paul Krzyzanowski Distributed Systems Except as otherwise noted, the content of this presentation is licensed.
Xen I/O Overview.
Xen and the Art of Virtualization Paul Barham, Boris Dragovic, Keir Fraser, Steven Hand, Tim Harris, Alex Ho, Rolf Neugebauer, Ian Pratt & Andrew Warfield.
Virtual Machine Monitors: Technology and Trends Jonathan Kaldor CS614 / F07.
Xen and The Art of Virtualization Paul Barham, Boris Dragovic, Keir Fraser, Steven Hand, Tim Harris, Alex Ho, Rolf Neugebauer, Ian Pratt & Andrew Warfield.
Operating Systems ECE344 Ashvin Goel ECE University of Toronto OS-Related Hardware.
CS533 Concepts of Operating Systems Jonathan Walpole.
 Virtual machine systems: simulators for multiple copies of a machine on itself.  Virtual machine (VM): the simulated machine.  Virtual machine monitor.
1 CSE451 Architectural Supports for Operating Systems Autumn 2002 Gary Kimura Lecture #2 October 2, 2002.
Introduction to virtualization
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,
Protection of Processes Security and privacy of data is challenging currently. Protecting information – Not limited to hardware. – Depends on innovation.
Running Commodity Operating Systems on Scalable Multiprocessors Edouard Bugnion, Scott Devine and Mendel Rosenblum Presentation by Mark Smith.
Advanced Operating Systems (CS 202) Virtualization March 7, 2016.
Embedded Real-Time Systems Processing interrupts Lecturer Department University.
Xen and the Art of Virtualization
Virtual Machine Monitors
Advanced Operating Systems (CS 202) Virtualization
Virtualization Technology
Xen and the Art of Virtualization
Presented by Yoon-Soo Lee
Memory Management Paging (continued) Segmentation
CS161 – Design and Architecture of Computer
CSE 120 Principles of Operating
CS 6560: Operating Systems Design
Xen: The Art of Virtualization
CS510 Operating System Foundations
OS Virtualization.
Page Replacement.
Memory Management Paging (continued) Segmentation
Xen and the Art of Virtualization
Exceptions Control Flow
Architectural Support for OS
Translation Buffers (TLB’s)
CSE 451: Operating Systems Autumn 2003 Lecture 10 Paging & TLBs
CSE 451: Operating Systems Autumn Module 24 Virtual Machine Monitors
CSE 451: Operating Systems Autumn 2003 Lecture 10 Paging & TLBs
Architectural Support for OS
Xen and the Art of Virtualization
Memory Management Paging (continued) Segmentation
CSE 451: Operating Systems Autumn Module 24 Virtual Machine Monitors
System Virtualization
Review What are the advantages/disadvantages of pages versus segments?
Presentation transcript:

OS Structures - Xen

Xen

Key points Goal: extensibility akin to SPIN and Exokernel goals Main difference: support running several commodity operating systems on the same hardware simultaneously without sacrificing performance or functionality Why? –Application mobility –Server consolidation –Co-located hosting facilities –Distributed web services –….

Old idea VM 370 –Virtualization for binary support for legacy apps Why resurgence today? –Companies want a share of everybody’s pie IBM zSeries “mainframes” support virtualization for server consolidation –Enables billing and performance isolation while hosting several customers Microsoft has announced virtualization plans to allow easy upgrades and hosting Linux! You can see the dots connecting up –From extensibility (a la SPIN) to virtualization

Possible virtualization approaches Standard OS (such as Linux, Windows) –Meta services (such as grid) for users to install files and run processes –Administration, accountability, and performance isolation become hard Retrofit performance isolation into OSs –Linux/RK, QLinux, SILK –Accounting resource usage correctly can be an issue unless done at the lowest level (e.g. Exokernel) Xen approach –Multiplex physical resource at OS granularity

Full virtualization Virtual hardware identical to real one –Relies on hosted OS trapping to the VMM for privileged instructions –Pros: run unmodified OS binary on top –Cons: supervisor instructions can fail silently in some hardware platforms (e.g. x86) –Solution in VMware: Dynamically rewrite portions of the hosted OS to insert traps need for hosted OS to see real resources: real time, page coloring tricks for optimizing performance, etc…

Xen principles Support for unmodified application binaries Support for multi-application OS –Complex server configuration within a single OS instance Paravirtualization for strong resource isolation on uncooperative hardware (x86) Paravirtualization to enable optimizing guest OS performance and correctness

Xen: VM management What would make VM virtualization easy –Software TLB –Tagged TLB =>no TLB flush on context switch X86 does not have either Xen approach –Guest OS responsible for allocating and managing hardware PT –Xen top 64MB of every address space. Why?

x86 Memory Management Segments –CS (code); SS (stack); DS, ES, FS, GS (all data) –Base address and limit checking Segment base added to CPU address is the linear 32-bit virtual address 4KB pages –Top 10 bits of address: page table –Next 10 bits of address: page table entry

Creating a new PT by Guest OS –allocate and initialize a page and registers it with Xen to serve as the new PT –all subsequent updates to this page (i.e. PT) via Xen –can batch updates to reduce the cost of entering and exiting Xen Segmentation by guest OS virtualized similarly

Xen: CPU virtualization Four privilege levels in x86 –Ring 0 (Xen) –Ring 1 (guest OS) –Ring 3 (apps of the guest OS) Privileged instructions –Validated and executed in Xen (e.g. installing a new PT) Exceptions –Registered with Xen once –Called directly without Xen intervention –All syscalls from apps to guest OS handled this way Page fault handlers are special –Faulting address can be read only in ring 0 –Xen reads the faulting address and passes it via stack to the OS handler in ring 1

Xen: Device I/O virtualization Set of clean and simple device abstractions Allows buffers to be passed directly to/from guest OS to I/O devices Event delivery mechanism for sending asynchronous notifications to the guest OS

Details of subsystem virtualization Control transfer Data transfer These are used in the virtualization of all the subsystems

Control transfer Hypercalls from guest OS to Xen –E.g. set of page table updates Events for notification from Xen to guest OS –E.g. data arrival on network; virtual disk transfer complete Events may be deferred by a guest OS (similar to disabling interrupts)

Data transfer – I/O rings Resource management and accountability –CPU time Demultiplex data to the domains quickly upon interrupt Account computation time for managing buffers to the appropriate domain –Memory buffers relevant domains provide memory for I/O to Xen Xen pins page frames during I/O transfer

I/O descriptors indirectly reference the actual memory buffers

Each request: unique ID from guest OS Response: use this unique ID Network packets –Represented by a set of requests –Responses to these signal packet reception Disk requests –May be reordered for flexibility Zero copy semantics via the descriptors Domain my enqueue multiple entries before invoking a hypercall requests Ditto for responses from Xen

CPU scheduling Base Xen scheduler uses BVT algorithm [Duda & Cheriton, SOSP 99] –Work conserving for different domains (ensuring accountability) with a low-latency wake up on event arrival using virtual time warping

Time and timers Guest OSs have access to Xen’s –Real time (cycle counter accuracy for real time tasks in guest OSs) –Virtual time (enables time slicing within the guest OS) –Wall clock time (real time + domain changeable offset) Guest OS maintain their own internal timer queues and use a pair of Xen timers (real and virtual)

Virtual address translation VMware solution –Each domain with shadow page table –Hypervisor go between the VMM and MMU Xen solution (similar to Exokernel) –Register guest OS PT directly with MMU –Guest OS has read only access –All mods to the PT via Xen –Type associated with a page frame PD, PT, LDT, GDT, RW All except RW: read-only access to the page for guest OS Guest OS can retask a page only when ref count is 0

Physical memory At domain creation, hardware pages “reserved” Domain can increase/decrease its quota Xen does not guarantee that the hardware pages are contiguous Guest OS can maintain “physical memory” that is contiguous mapped to the “hardware pages”

Network Each guest OS has two I/O rings –Receive and transmit Transmit –Enqueue descriptor on the transmit ring Points to the buffer in guest OS space No copying into Xen Page pinned till transmission complete –Round robin packet scheduler across domains Receive –Exchange received page for a page of the guest OS in the receive ring –No copying

Disk Batches of requests from competing domain taken and scheduled Since Xen has knowledge of disk layout, requests may be reordered No copying into Xen “Reoder barrier” to prevent reordering (may be necessary for higher level semantics such as write ahead log)

Performance