Intel Virtualization Technology Overview Yu Ke



Similar documents
Intel Virtualization Technology Processor Virtualization Extensions and Intel Trusted execution Technology

Nested Virtualization

Virtualization. ! Physical Hardware. ! Software. ! Isolation. ! Software Abstraction. ! Encapsulation. ! Virtualization Layer. !

Jukka Ylitalo Tik TKK, April 24, 2006

Intel s Virtualization Extensions (VT-x) So you want to build a hypervisor?

Full and Para Virtualization

Virtualization VMware Inc. All rights reserved

Intel Virtualization Technology and Extensions

Hybrid Virtualization The Next Generation of XenLinux

Intel Virtualization Technology

Virtualization Technology. Zhiming Shen

EE282 Lecture 11 Virtualization & Datacenter Introduction

Virtualization. Jia Rao Assistant Professor in CS

Enabling Intel Virtualization Technology Features and Benefits

Virtualization in Linux KVM + QEMU

Uses for Virtual Machines. Virtual Machines. There are several uses for virtual machines:

CS 695 Topics in Virtualization and Cloud Computing. More Introduction + Processor Virtualization

Hardware virtualization technology and its security

Virtualization. Jukka K. Nurminen

WHITE PAPER Mainstreaming Server Virtualization: The Intel Approach

VMware and CPU Virtualization Technology. Jack Lo Sr. Director, R&D

Chapter 5 Cloud Resource Virtualization

Knut Omang Ifi/Oracle 19 Oct, 2015

Virtual Machines. COMP 3361: Operating Systems I Winter

x86 Virtualization Hardware Support Pla$orm Virtualiza.on

Intel Virtualization Technology (VT) in Converged Application Platforms

Virtualization. Types of Interfaces

Hardware Based Virtualization Technologies. Elsie Wahlig Platform Software Architect

CS5460: Operating Systems. Lecture: Virtualization 2. Anton Burtsev March, 2013

Basics in Energy Information (& Communication) Systems Virtualization / Virtual Machines

Virtual machines and operating systems

Introduction to Virtual Machines

Cloud^H^H^H^H^H Virtualization Technology. Andrew Jones May 2011

Microkernels, virtualization, exokernels. Tutorial 1 CSC469

Virtualization Technologies

PCI-SIG SR-IOV Primer. An Introduction to SR-IOV Technology Intel LAN Access Division

Virtualization. Dr. Yingwu Zhu

Understanding Full Virtualization, Paravirtualization, and Hardware Assist. Introduction...1 Overview of x86 Virtualization...2 CPU Virtualization...

Hypervisors and Virtual Machines

Chapter 16: Virtual Machines. Operating System Concepts 9 th Edition

Enterprise-Class Virtualization with Open Source Technologies

A Superior Hardware Platform for Server Virtualization

COS 318: Operating Systems. Virtual Machine Monitors

Virtual Machines. Virtual Machine (VM) Examples of Virtual Systems. Types of Virtual Machine

Virtualization. Explain how today s virtualization movement is actually a reinvention

System Virtual Machines

Virtualization. P. A. Wilsey. The text highlighted in green in these slides contain external hyperlinks. 1 / 16

Cloud Computing. Dipl.-Wirt.-Inform. Robert Neumann

Nested Virtualization

FRONT FLYLEAF PAGE. This page has been intentionally left blank

Virtualization. Pradipta De

Virtual Machine Monitors. Dr. Marc E. Fiuczynski Research Scholar Princeton University

Taming Hosted Hypervisors with (Mostly) Deprivileged Execution

COM 444 Cloud Computing

Brian Walters VMware Virtual Platform. Linux J. 1999, 63es, Article 6 (July 1999).

matasano Hardware Virtualization Rootkits Dino A. Dai Zovi

Using Linux as Hypervisor with KVM

Volume 10 Issue 03 Published, August 10, 2006 ISSN X DOI: /itj Virtualization Technology

Attacking Hypervisors via Firmware and Hardware

Architecture of the Kernel-based Virtual Machine (KVM)

I/O Virtualization Using Mellanox InfiniBand And Channel I/O Virtualization (CIOV) Technology

Cloud Computing #6 - Virtualization

Virtualization Concepts And Applications. Yash Jain DA-IICT (DCOM Research Group)

Compromise-as-a-Service

Intel Virtualization Technology for Directed I/O

CPET 581 Cloud Computing: Technologies and Enterprise IT Strategies. Virtualization of Clusters and Data Centers

Nested Virtualization

Security Overview of the Integrity Virtual Machines Architecture

Distributed and Cloud Computing

Introduction to Virtualization & KVM

Intel Trusted Platforms Overview

Attacking Hypervisors via Firmware and Hardware

Intel Ethernet and Configuring Single Root I/O Virtualization (SR-IOV) on Microsoft* Windows* Server 2012 Hyper-V. Technical Brief v1.

A Unified View of Virtual Machines

Clouds Under the Covers. Elgazzar - CISC Fall

Hypervisors. Introduction. Introduction. Introduction. Introduction. Introduction. Credits:

9/26/2011. What is Virtualization? What are the different types of virtualization.

The Xen of Virtualization

Cloud Computing CS

Xen and the Art of. Virtualization. Ian Pratt

The Turtles Project: Design and Implementation of Nested Virtualization

Volume 10 Issue 03 Published, August 10, 2006 ISSN X DOI: /itj Virtualization Technology

The NOVA Microhypervisor

Basics of Virtualisation

Virtual Machines. Virtualization

Advanced Computer Networks. Network I/O Virtualization

Chapter 14 Virtual Machines

Outline. Outline. Why virtualization? Why not virtualize? Today s data center. Cloud computing. Virtual resource pool

x86 ISA Modifications to support Virtual Machines

KVM KERNEL BASED VIRTUAL MACHINE

Virtualization and the U2 Databases

A Hypervisor IPS based on Hardware assisted Virtualization Technology

2972 Linux Options and Best Practices for Scaleup Virtualization

Virtualizing a Virtual Machine

evm Virtualization Platform for Windows

MODULE 3 VIRTUALIZED DATA CENTER COMPUTE

Transcription:

Intel Virtualization Technology Overview Yu Ke SSG System Software Division

Agenda Virtualization Overview Intel Virtualization Technology 2

What is Virtualization VM 0 VM 1 VM n Virtual Machines (VMs) Apps Apps Guest OS Guest OS... Virtual Machine Monitor (VMM) Apps Guest OS Platform HW Memory Processors I/O Devices Any problem in computer science can be solved with another layer of indirection. Butler Lampson (1992 Turing Award Lecture) VMM is a new layer of system software Support multiple guest OSes De-privilege each OS to run as Guest OS 3

Server Virtualization Usages Server Consolidation R&D Production Today Emerging App OS HW HW VMM HW Benefit: Cost Savings Power and Cooling Hardware, Software, Management App OS VMM HW App OS Disaster Recovery App OS VMM HW Benefit: Business Continuity and Operational Efficiency App 1 OS App OS Dynamic Load Balancing VMM HW CPU Usage 90% App 2 OS VMM HW Benefit: Business Agility and Productivity App 3 OS VMM HW CPU Usage 30% Benefit: Productivity App 4 OS 4

VMM Requirements VMM should isolate Apps and OS from one another VM 0 VM 1 VM n Apps Guest OS Apps Guest OS... Apps Guest OS VMM should isolate Guest SW stacks from one another Platform HW Virtual Machine Monitor (VMM) Memory Processors I/O Devices To achieve this, VMM must be able to control: - CPU(s) - Memory - I/O devices VMM should run protected from all Guest software VMM should present a virtual platform interface to Guest SW 5

Agenda Virtualization Overview Intel Virtualization Technology CPU Virtualization - VT-x Memory Virtualization: EPT, VPID I/O Virtualization: VT-d, VT-c (VMDq, SR-IOV) 6

Intel Virtualization Technology VM 1 App VM n App Intel Virtualization Technology is a new hardware layer in Intel CPU/chipset/platform. OS OS Virtual Machine Monitor Intel Virtualization Technology Shared Physical Hardware Make VMM implementation simplified Improve VMM efficiency Support full virtualization to be able to run unmodified guest Memory Processors Graphics Network Storage KY/MS "We "We are are on on record as as saying that that VT VT is is the the most significant change to to PC PC architecture this this decade" Martin Martin Reynolds, Reynolds, Gartner Gartner Senior Senior Analyst Analyst eweek eweek September September 9, 9, 2004 2004 7

Intel Virtualization Technology Evolution Vector 3: IO Device Focus Assists for IO sharing: PCI IOV compliant IOV devs VMDq: Multi-context IO End-point DMA VMDq translation caching IO virtualization assists Vector 2: Chipset Focus Core support for IO robustness & device assignment VT-dvia DMA remapping Interrupt filtering & remapping VT-d extensions VT-d2 to track PCI-SIG IOV Vector 1: Processor Focus Close basic processor virtualization VT-x holes in Intel 64 & Itanium CPUs Performance extensions VTx/VTi EPT, APIC-TPR, VT-x2 VPID, ECRR, APIC-V Perf improvements for interrupt intensive VT-x3 env, faster VM boot VMM Software Evolution Software-only VMMs Binary translation Paravirtualization Device emulations Simpler and more secure VMM through use of hardware VT support Better IO/CPU perf and functionality via hardware-mediated access to memory Richer IO-device functionality and IO resource sharing Yesterday: No HW Support 2005-2006 With CPU Support 2007-2008 With Chipset Support & IO improvements 8

CPU Virtualization Goal: present functional virtual CPU to Guest OS CPU from OS point of view: A set of hardware resource: general register (EAX, EBX), FPU register, control register (EFLAG, EIP, CR3 ) Support several privilege: Ring 0 ~ Ring 3 Run instruction with pre-defined semantic: privileged instruction non-privileged instruction Support several address space: logical address, linear address, physical address (memory virtualization) VCPU (virtual CPU) A scheduling entity, containing all the state for virtualized CPU Key to CPU virtualization: Trap and Emulation Non-privileged instruction: untrap and run in native Privileged instruction: Trap and Emulation 9

CPU Virtualization (Cont) Example: STI CLI 10

Traditional IA32 CPU Virtualization: Ring Compression VM 0 VM 01 VM 02 Ring3 Guest Apps Apps Guest Apps Apps Guest Apps Apps Ring1 Guest Kernel OS Guest Kernel OS Guest Kernel OS Ring0 Virtual Machine Monitor (VMM) 11

IA32 Processor Virtualization Holes Some instructions are hard to be virtualized e.g. pushf/popf pushf cli popf //save EFLAG to stack //disable interrupt, i.e. clear EFLAG.IF 17 similar instructions //restore EFLAG from stack, restore EFLAG.IF 12

Addressing IA-32 Virtualization Holes Method 1: Paravirtualization techniques Modify guest OS to work around virtualization holes Typically limited to OSes that can be modified (e.g., Linux) Method 2: Binary translation or patching Modify guest OS binaries on-the-fly Extends range of supported OS s but introduces new complexities E.g., consider self-modifying code, translation caching, etc. Certain forms of excessive trapping remain Goal for Hardware-assisted Virtualization Simplify VMM software by closing virtualization holes by design Eliminate need for paravirtualization and binary translation 13

VT-x: Key Features New mode of operation for guest Allows VMM control of guest operation Need not use segmentation to control guest Guest can run at its intended ring New structure controls CPU operation VMCS: virtual-machine control structure Resides in physical-address space Need not be in guest s linear-address space 14

VT-x Operation VM 1 VM 2 VM n VMX Non-Root Operation Ring 3 Ring 0 Ring 3 Ring 0 Ring 3 Ring 0 VM Exit VMCS 1 VMCS 2 VMCS n VMX Root Operation vmlaunch/ vmresume Ring 3 Ring 0 15

Memory Virtualization Goal: Present Virtual Memory to Guest OS Memory from OS point of view A set of memory unit (e.g. 2G memory) Support different address space: Virtual Address, Physical Address CR3 Virtual Address Page Table Physical Address TLB & Cache Memory Virtualization Guest Virtual Address Guest Physical Address Machine Physical Address (Host Physical Address) 16

Extended Page Tables: Motivation VMM needs to retain control of physical-address space With Intel 64, paging is main mechanism for protecting that space Intel VT provides hooks for page-table virtualization but page-table virtualization in software is a major source of overhead Extended Page Tables (EPT) A new CPU mechanism for remapping guest-physical memory references Allows guest to retain control of legacy Intel 64 paging Reduces frequency of VM exits to VMM 17

Extended Page Tables: Overview Guest CR3 EPT Base Pointer Guest Linear Address Guest Page Table Guest Physical Address EPT Page Table Host Physical Address TLB & Cache Guest can have full control over page tables / events CR3, CR0, CR4 paging bits, INVLPG, page fault VMM controls Extended Page Tables CPU uses both tables EPT (optionally) activated on VM entry When EPT active, EPT base pointer (loaded on VM entry from VMCS) points to extended page tables EPT deactivated on VM exit 18

Extended Page Tables: Performance Estimated EPT benefit is very dependent on workload Typical benefit estimated up to 20% 1 Outliers exist (e.g., forkwait, Cygwin gcc, > 40%) Benefit increases with number of virtual CPUs (relative to MP page table virtualization algorithm) Secondary benefits of EPT: No need for complex page table virtualization algorithm Reduced memory footprint compared with shadow page-table algorithms Shadow page tables required for each guest user process Single EPT supports entire VM EPT improves memory virtualization performance 1 Data derived from Intel internal simulation and modeling tools 19

VPID: Motivation First generation of Intel VT forces flush of Translation Lookaside Buffer (TLB) on each VMX transition Performance loss on all VM exits Performance loss on most VM entries Most of the time, the VMM has not modified the guest page tables and does not require TLB flushing to occur Exceptions include emulating MOV CR3, MOV CR4, INVLPG Better VMM software control of TLB flushes is beneficial 20

VPID: New Support for Software Control of TLB VPID activated if new enable VPID control bit is set in VMCS New 16-bit virtual-processor-id field (VPID) field in VMCS VMM allocates unique value for each guest OS VMM uses VPID of 0x0000, no guest can have this VPID Cached linear translations are tagged with VPID value No flush of TLBs on VM entry or VM exit if VPID active 21

TLB Management by the VMM: INVVPID New instruction to allow VMM to flush guest mappings Three operands: The flush extent (see below) The 16-bit VPID indicating the VPID context to be flushed The 64-bit guest-linear address to be flushed Flush extent operand chooses: Address-specific: invalidation of translations associated with VPID and address operands Context-wide: invalidation of all translations associated with VPID operand Context-wide preserving global translations: invalidation of all non-global translations associated with VPID operand All-context: invalidation of all translations associated with all VPID values Allows VMM to emulate Intel 64 paging faithfully 22

VPID Performance VPID benefit is very dependent on workload and memory virtualization mechanism Without EPT: Most stressful of CPU-intensive workloads (e.g., gzip) show only small improvements with VPID Process and memory-intensive workloads gain an estimated 1.5% - 2% 1 Worst-case synthetic benchmarks gain an estimated 3%-4% 1 With EPT: VM-exit frequency decreases but the cost of TLB fills increases VPIDs required to make EPT effective under stressful loads For process/memory-intensive workloads gain an estimated >2% 1 Worst-case synthetic benchmarks gain an estimated 10%-15% 1 VPID improves TLB performance with small VMM development effort 1 Data derived from Intel internal simulation and modeling tools 23

I/O Virtualization Present virtual I/O device to Guest OS I/O device from OS point of view A set of resource: I/O port, MMIO, Interrupt Can execute I/O command with predefined semantic Key to I/O Virtualization Base on CPU virtualization 24

Software Approaches to I/O Virtualization Device Emulation Virtualization software emulates real hardware device VMs run same driver for the emulated hardware device Good legacy software compatibility However emulation overheads can limit performance I/O Para-virtualization Uses abstract interfaces and protocols for I/O services VMs run virtualization-aware I/O stacks and drivers Offers improved performance over emulation Requires new I/O stack/driver in guest OSs Software Software approaches approaches offer offer I/O I/O sharing sharing with with H/W H/W transparency, transparency, at at a performance performance cost cost 25

I/O Virtualization: Direct Assigned I/O Directly assigned I/O device to Guest Guest OS access I/O device resource directly High performance and low CPU utilization Problem: DMA address mismatch Guest set guest physical address DMA hardware only accept machine physical address Solution: DMA Remapping (a.k.a IOMMU) I/O page table is introduced DMA engineer will translate guest physical address to host physical address according to I/O page table 26

VT-d Overview VT-d provides infrastructure for I/O virtualization Defines architecture for DMA remapping Common architecture across IA platforms Will be supported broadly across Intel chipsets CPU CPU System Bus Integrated Devices North Bridge VT-d PCIe* Root Ports DRAM PCI Express South Bridge PCI, LPC, Legacy devices, *Other names and 27 brands may be claimed as the property of others

How VT-d works? 1000 Each VM thinks it is 0 address based GPA (Guest Physical Address) But mapped to a different address in the system memory HPA (Host Physical Address) VT-d does the address mapping between GPA and HPA Catches any DMA attempt to cross VM memory boundary 100 VM0 0 100 VM1 0 50 300 10 260 700 600 350 250 100 200 VM2 0 100 0 28

DMA Remapping: Hardware Overview DMA Requests Device ID Virtual Address Length Fault Generation Bus 255 Bus N Bus 0 Dev 31, Func 7 Dev P, Func 2 Dev P, Func 1 Dev 0, Func 0 4KB Page Tables 4KB Page Frame DMA Remapping Engine Translation Cache Context Cache Device Assignment Structures Device D1 Device D2 Address Translation Structures Address Translation Structures Memory Access with Host Physical Address Memory-resident Partitioning & Translation Structures 29

Intel VT For Connectivity: VMDq Network Interface Card with Virtual Machine Device Queues (VMDq) Multiple Send/Receive Queues Pre-sort Incoming Packets Benefits Reduce CPU Utilization Higher throughput 30

Putting it all together Virtual Machines (VMs) VM 0 Apps OS VM 1 Apps OS VM 2 Apps OS VM n Apps OS VMM (a.k.a., hypervisor) Higher-level VMM Functions: Resource Discovery / Provisioning / Scheduling / User Interface Processor Virtualization Memory Virtualization I/O Device Virtualization Ring VT-x or VT-i Binary Deprivileging Configuration Translation Page-table EPT Configuration Shadowing DMA I/O DMA and Interrupt Interrupt Remap Remapping Configuration Remapping I/O Device Emulation Physical Platform Resources VT-i VT-x CPU 0 CPU n EPT VT-d PCI SIG Storage Network Processors Memory I/O Devices 31

Virtualization Technology Forecast More usage model Client Virtualization (Desktop) Mobile Virtualization (Cell phone) Cloud Computing More Virtualization Software VMWare MS Hyper-V Xen, KVM Hardware CPU/Memory Virtualization: higher performance I/O Virtualization: SR-IOV, Graphics Virtualization (3D) 32

Summary Exponential grows in virtualization solutions. Hardware-assisted Virtualization Technology can make VMM more efficient, simplified & secure. A lot of un-cultivated areas in virtualization, a lot of opportunity. 33

Resource Intel VT Web Site: http://www.intel.com/technology/virtualization/ Open Source Xen http://www.xen.org/ Open Source KVM (Kernel-based Virtual Machine) http://kvm.qumranet.com/ 34

Q/A 35