varun sethi sudhanshu mittal

32
TM Freescale, the Freescale logo, AltiVec, C-5, CodeTEST, CodeWarrior, ColdFire, ColdFire+, C-Ware, the Energy Efficient Solutions logo, Kinetis, mobileGT, PowerQUICC, Processor Expert, QorIQ, Qorivva, StarCore, Symphony and VortiQa are trademarks of Freescale Semiconductor, Inc., Reg. U.S. Pat. & Tm. Off. Airfast, BeeKit, BeeStack, CoreNet, Flexis, MagniV, MXC, Platform in a Package, QorIQ Qonverge, QUICC Engine, Ready Play, SafeAssure, the SafeAssure logo, SMARTMOS, TurboLink, Vybrid and Xtrinsic are trademarks of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © 2012 Freescale Semiconductor, Inc. . Varun Sethi Software Architect August 2012 Sudhanshu Mittal Software Manager

Upload: others

Post on 27-Dec-2021

9 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Varun Sethi Sudhanshu Mittal

TM

Freescale, the Freescale logo, AltiVec, C-5, CodeTEST, CodeWarrior, ColdFire,

ColdFire+, C-Ware, the Energy Efficient Solutions logo, Kinetis, mobileGT, PowerQUICC,

Processor Expert, QorIQ, Qorivva, StarCore, Symphony and VortiQa are trademarks of

Freescale Semiconductor, Inc., Reg. U.S. Pat. & Tm. Off. Airfast, BeeKit, BeeStack,

CoreNet, Flexis, MagniV, MXC, Platform in a Package, QorIQ Qonverge, QUICC Engine,

Ready Play, SafeAssure, the SafeAssure logo, SMARTMOS, TurboLink, Vybrid and

Xtrinsic are trademarks of Freescale Semiconductor, Inc. All other product or service

names are the property of their respective owners. © 2012 Freescale Semiconductor, Inc.

.

Varun Sethi Software Architect

August 2012

Sudhanshu Mittal Software Manager

Page 2: Varun Sethi Sudhanshu Mittal

2

Freescale, the Freescale logo, AltiVec, C-5, CodeTEST, CodeWarrior, ColdFire, ColdFire+, C-Ware, the Energy Efficient Solutions logo, Kinetis,

mobileGT, PowerQUICC, Processor Expert, QorIQ, Qorivva, StarCore, Symphony and VortiQa are trademarks of Freescale Semiconductor, Inc.,

Reg. U.S. Pat. & Tm. Off. Airfast, BeeKit, BeeStack, CoreNet, Flexis, MagniV, MXC, Platform in a Package, QorIQ Qonverge, QUICC Engine,

Ready Play, SafeAssure, the SafeAssure logo, SMARTMOS, TurboLink, Vybrid and Xtrinsic are trademarks of Freescale Semiconductor, Inc. All

other product or service names are the property of their respective owners. © 2012 Freescale Semiconductor, Inc.

• Introduction to Partitioning and Virtualization

• Overview of Topaz

• Overview of KVM

• Performance Considerations

Page 3: Varun Sethi Sudhanshu Mittal

TM

Freescale, the Freescale logo, AltiVec, C-5, CodeTEST, CodeWarrior, ColdFire,

ColdFire+, C-Ware, the Energy Efficient Solutions logo, Kinetis, mobileGT, PowerQUICC,

Processor Expert, QorIQ, Qorivva, StarCore, Symphony and VortiQa are trademarks of

Freescale Semiconductor, Inc., Reg. U.S. Pat. & Tm. Off. Airfast, BeeKit, BeeStack,

CoreNet, Flexis, MagniV, MXC, Platform in a Package, QorIQ Qonverge, QUICC Engine,

Ready Play, SafeAssure, the SafeAssure logo, SMARTMOS, TurboLink, Vybrid and

Xtrinsic are trademarks of Freescale Semiconductor, Inc. All other product or service

names are the property of their respective owners. © 2012 Freescale Semiconductor, Inc.

.

Page 4: Varun Sethi Sudhanshu Mittal

4 TM

Freescale, the Freescale logo, AltiVec, C-5, CodeTEST, CodeWarrior, ColdFire, ColdFire+, C-Ware, the Energy Efficient Solutions logo, Kinetis,

mobileGT, PowerQUICC, Processor Expert, QorIQ, Qorivva, StarCore, Symphony and VortiQa are trademarks of Freescale Semiconductor, Inc.,

Reg. U.S. Pat. & Tm. Off. Airfast, BeeKit, BeeStack, CoreNet, Flexis, MagniV, MXC, Platform in a Package, QorIQ Qonverge, QUICC Engine,

Ready Play, SafeAssure, the SafeAssure logo, SMARTMOS, TurboLink, Vybrid and Xtrinsic are trademarks of Freescale Semiconductor, Inc. All

other product or service names are the property of their respective owners. © 2012 Freescale Semiconductor, Inc.

Benefit: Cost/power savings

OS

App App

hypervisor

hardware

OS

App App

hardware

OS

App App

hardware

OS

App App

Page 5: Varun Sethi Sudhanshu Mittal

5 TM

Freescale, the Freescale logo, AltiVec, C-5, CodeTEST, CodeWarrior, ColdFire, ColdFire+, C-Ware, the Energy Efficient Solutions logo, Kinetis,

mobileGT, PowerQUICC, Processor Expert, QorIQ, Qorivva, StarCore, Symphony and VortiQa are trademarks of Freescale Semiconductor, Inc.,

Reg. U.S. Pat. & Tm. Off. Airfast, BeeKit, BeeStack, CoreNet, Flexis, MagniV, MXC, Platform in a Package, QorIQ Qonverge, QUICC Engine,

Ready Play, SafeAssure, the SafeAssure logo, SMARTMOS, TurboLink, Vybrid and Xtrinsic are trademarks of Freescale Semiconductor, Inc. All

other product or service names are the property of their respective owners. © 2012 Freescale Semiconductor, Inc.

• Enables consolidation

− Multiple operating systems/partitions on a multicore chip

• Enables Secure operation of multiple Operating Systems

− Isolation mechanisms are needed for safety, robustness

Multicore System Hardware

Partition

Partition

Partition

OS 1 OS 2 OS 3

Page 6: Varun Sethi Sudhanshu Mittal

6 TM

Freescale, the Freescale logo, AltiVec, C-5, CodeTEST, CodeWarrior, ColdFire, ColdFire+, C-Ware, the Energy Efficient Solutions logo, Kinetis,

mobileGT, PowerQUICC, Processor Expert, QorIQ, Qorivva, StarCore, Symphony and VortiQa are trademarks of Freescale Semiconductor, Inc.,

Reg. U.S. Pat. & Tm. Off. Airfast, BeeKit, BeeStack, CoreNet, Flexis, MagniV, MXC, Platform in a Package, QorIQ Qonverge, QUICC Engine,

Ready Play, SafeAssure, the SafeAssure logo, SMARTMOS, TurboLink, Vybrid and Xtrinsic are trademarks of Freescale Semiconductor, Inc. All

other product or service names are the property of their respective owners. © 2012 Freescale Semiconductor, Inc.

• Security — no enforced isolation, cannot allow untrusted operating

systems

• Requires cooperation among partitions

• How are global hardware resources managed?

− Local access windows

− Interrupt controller

− Shared caches

− IOMMU

• Boot sequence complexity

• Error management

• Resetting/rebooting partitions

• Debugging

core core

OS OS

core

OS

Page 7: Varun Sethi Sudhanshu Mittal

7 TM

Freescale, the Freescale logo, AltiVec, C-5, CodeTEST, CodeWarrior, ColdFire, ColdFire+, C-Ware, the Energy Efficient Solutions logo, Kinetis,

mobileGT, PowerQUICC, Processor Expert, QorIQ, Qorivva, StarCore, Symphony and VortiQa are trademarks of Freescale Semiconductor, Inc.,

Reg. U.S. Pat. & Tm. Off. Airfast, BeeKit, BeeStack, CoreNet, Flexis, MagniV, MXC, Platform in a Package, QorIQ Qonverge, QUICC Engine,

Ready Play, SafeAssure, the SafeAssure logo, SMARTMOS, TurboLink, Vybrid and Xtrinsic are trademarks of Freescale Semiconductor, Inc. All

other product or service names are the property of their respective owners. © 2012 Freescale Semiconductor, Inc.

• Enforcement of separation can be done robustly with adequate

hardware support.

• Partitions are enforced and managed by system software

− Often a hypervisor

Shared Hardware

CPU CPU CPU CPU

I/O I/O I/O I/O

Memory

Shared

Cache

Interrupt

Controller I/O

Software

Multicore System

Hardware

Page 8: Varun Sethi Sudhanshu Mittal

8 TM

Freescale, the Freescale logo, AltiVec, C-5, CodeTEST, CodeWarrior, ColdFire, ColdFire+, C-Ware, the Energy Efficient Solutions logo, Kinetis,

mobileGT, PowerQUICC, Processor Expert, QorIQ, Qorivva, StarCore, Symphony and VortiQa are trademarks of Freescale Semiconductor, Inc.,

Reg. U.S. Pat. & Tm. Off. Airfast, BeeKit, BeeStack, CoreNet, Flexis, MagniV, MXC, Platform in a Package, QorIQ Qonverge, QUICC Engine,

Ready Play, SafeAssure, the SafeAssure logo, SMARTMOS, TurboLink, Vybrid and Xtrinsic are trademarks of Freescale Semiconductor, Inc. All

other product or service names are the property of their respective owners. © 2012 Freescale Semiconductor, Inc.

App

Linux®

App App

Windows®

App App

Linux®

App App

Linux®

App App

Linux®

App App

Windows®

App

Virtualization – Hardware and software technologies

that provide an abstraction layer that enables running

multiple operating systems on a single computer system

Page 9: Varun Sethi Sudhanshu Mittal

9 TM

Freescale, the Freescale logo, AltiVec, C-5, CodeTEST, CodeWarrior, ColdFire, ColdFire+, C-Ware, the Energy Efficient Solutions logo, Kinetis,

mobileGT, PowerQUICC, Processor Expert, QorIQ, Qorivva, StarCore, Symphony and VortiQa are trademarks of Freescale Semiconductor, Inc.,

Reg. U.S. Pat. & Tm. Off. Airfast, BeeKit, BeeStack, CoreNet, Flexis, MagniV, MXC, Platform in a Package, QorIQ Qonverge, QUICC Engine,

Ready Play, SafeAssure, the SafeAssure logo, SMARTMOS, TurboLink, Vybrid and Xtrinsic are trademarks of Freescale Semiconductor, Inc. All

other product or service names are the property of their respective owners. © 2012 Freescale Semiconductor, Inc.

App

Linux®

App App

Windows®

App App

Linux®

App

Hypervisor

App

Linux®

App App

Linux®

App App

Windows®

App

A hypervisor is a software component

that creates and manages virtual

machines which can run operating

systems.

Page 10: Varun Sethi Sudhanshu Mittal

10 TM

Freescale, the Freescale logo, AltiVec, C-5, CodeTEST, CodeWarrior, ColdFire, ColdFire+, C-Ware, the Energy Efficient Solutions logo, Kinetis,

mobileGT, PowerQUICC, Processor Expert, QorIQ, Qorivva, StarCore, Symphony and VortiQa are trademarks of Freescale Semiconductor, Inc.,

Reg. U.S. Pat. & Tm. Off. Airfast, BeeKit, BeeStack, CoreNet, Flexis, MagniV, MXC, Platform in a Package, QorIQ Qonverge, QUICC Engine,

Ready Play, SafeAssure, the SafeAssure logo, SMARTMOS, TurboLink, Vybrid and Xtrinsic are trademarks of Freescale Semiconductor, Inc. All

other product or service names are the property of their respective owners. © 2012 Freescale Semiconductor, Inc.

Partitioning Virtualization

•Resource utilization

•Many virtual machines

•Resources are

shared/virtualized

•Oversubscription –

CPUs, I/O

•Consolidation

•Direct hardware access

• Dedicated CPUs, I/O devices

•Minimal sharing

OS

core core

OS OS OS OS OS

Hypervisor

Page 11: Varun Sethi Sudhanshu Mittal

TM

Freescale, the Freescale logo, AltiVec, C-5, CodeTEST, CodeWarrior, ColdFire,

ColdFire+, C-Ware, the Energy Efficient Solutions logo, Kinetis, mobileGT, PowerQUICC,

Processor Expert, QorIQ, Qorivva, StarCore, Symphony and VortiQa are trademarks of

Freescale Semiconductor, Inc., Reg. U.S. Pat. & Tm. Off. Airfast, BeeKit, BeeStack,

CoreNet, Flexis, MagniV, MXC, Platform in a Package, QorIQ Qonverge, QUICC Engine,

Ready Play, SafeAssure, the SafeAssure logo, SMARTMOS, TurboLink, Vybrid and

Xtrinsic are trademarks of Freescale Semiconductor, Inc. All other product or service

names are the property of their respective owners. © 2012 Freescale Semiconductor, Inc.

.

Page 12: Varun Sethi Sudhanshu Mittal

12 TM

Freescale, the Freescale logo, AltiVec, C-5, CodeTEST, CodeWarrior, ColdFire, ColdFire+, C-Ware, the Energy Efficient Solutions logo, Kinetis,

mobileGT, PowerQUICC, Processor Expert, QorIQ, Qorivva, StarCore, Symphony and VortiQa are trademarks of Freescale Semiconductor, Inc.,

Reg. U.S. Pat. & Tm. Off. Airfast, BeeKit, BeeStack, CoreNet, Flexis, MagniV, MXC, Platform in a Package, QorIQ Qonverge, QUICC Engine,

Ready Play, SafeAssure, the SafeAssure logo, SMARTMOS, TurboLink, Vybrid and Xtrinsic are trademarks of Freescale Semiconductor, Inc. All

other product or service names are the property of their respective owners. © 2012 Freescale Semiconductor, Inc.

• A ―light weight‖ hypervisor for embedded systems − ePAPR compliant

• Primarily focuses on partitioning − CPUs, memory and I/O devices

can be divided into logical partitions

− Supports single guest per core

− Direct device Assignment to guest Limited virtualized I/O support, no

virtio

• Designed to leverage E.HV features in the e500mc/e5500 cores

• Uses a combination of full-virtualization and para-virtualization

Partition Partition

CPU CPU CPU

I/O I/O I/O

Multicore

System

Hardware

Memory

Shared

Cache

Interrupt

Controller

Topaz

Page 13: Varun Sethi Sudhanshu Mittal

13 TM

Freescale, the Freescale logo, AltiVec, C-5, CodeTEST, CodeWarrior, ColdFire, ColdFire+, C-Ware, the Energy Efficient Solutions logo, Kinetis,

mobileGT, PowerQUICC, Processor Expert, QorIQ, Qorivva, StarCore, Symphony and VortiQa are trademarks of Freescale Semiconductor, Inc.,

Reg. U.S. Pat. & Tm. Off. Airfast, BeeKit, BeeStack, CoreNet, Flexis, MagniV, MXC, Platform in a Package, QorIQ Qonverge, QUICC Engine,

Ready Play, SafeAssure, the SafeAssure logo, SMARTMOS, TurboLink, Vybrid and Xtrinsic are trademarks of Freescale Semiconductor, Inc. All

other product or service names are the property of their respective owners. © 2012 Freescale Semiconductor, Inc.

• MMU

− Controlled by hypervisor

− Restricts CPU accesses to physical address space

• IOMMU

− Enforces I/O-to- memory accesses

− Key component in securely partitioned system

Hypervisor

Logical Partition

RTOS

APP APP

Logical Partition Logical Partition

Memory

Linux®

APP APP

Legacy

OS

APP APP

Memory

CPU CPU CPU CPU

I/O Accel I/O I/O

Memory Memory

MMU MMU MMU

IOMMU IOMMU IOMMU

Access

Denied

Access

Denied

Shared

Cache

Interrupt

Controller I/O

Page 14: Varun Sethi Sudhanshu Mittal

14 TM

Freescale, the Freescale logo, AltiVec, C-5, CodeTEST, CodeWarrior, ColdFire, ColdFire+, C-Ware, the Energy Efficient Solutions logo, Kinetis,

mobileGT, PowerQUICC, Processor Expert, QorIQ, Qorivva, StarCore, Symphony and VortiQa are trademarks of Freescale Semiconductor, Inc.,

Reg. U.S. Pat. & Tm. Off. Airfast, BeeKit, BeeStack, CoreNet, Flexis, MagniV, MXC, Platform in a Package, QorIQ Qonverge, QUICC Engine,

Ready Play, SafeAssure, the SafeAssure logo, SMARTMOS, TurboLink, Vybrid and Xtrinsic are trademarks of Freescale Semiconductor, Inc. All

other product or service names are the property of their respective owners. © 2012 Freescale Semiconductor, Inc.

• No latency added by hypervisor for external interrupts

• PIC allows routing of interrupts to specified cores

• External interrupt configured to go directly to guest

• Interrupt acknowledgement automatically done by core and PIC vector is in EPR (external proxy register)

lwz r3,(r4)

PIC hypercall API

Application

Hypervisor

OS

(external interrupt handler)

mfspr EPR

hcall EOI

rfi

External Interrupt

Page 15: Varun Sethi Sudhanshu Mittal

15 TM

Freescale, the Freescale logo, AltiVec, C-5, CodeTEST, CodeWarrior, ColdFire, ColdFire+, C-Ware, the Energy Efficient Solutions logo, Kinetis,

mobileGT, PowerQUICC, Processor Expert, QorIQ, Qorivva, StarCore, Symphony and VortiQa are trademarks of Freescale Semiconductor, Inc.,

Reg. U.S. Pat. & Tm. Off. Airfast, BeeKit, BeeStack, CoreNet, Flexis, MagniV, MXC, Platform in a Package, QorIQ Qonverge, QUICC Engine,

Ready Play, SafeAssure, the SafeAssure logo, SMARTMOS, TurboLink, Vybrid and Xtrinsic are trademarks of Freescale Semiconductor, Inc. All

other product or service names are the property of their respective owners. © 2012 Freescale Semiconductor, Inc.

• Operating

System sees a

virtual core plus

hypervisor

services

− Virtual CPU

− Services via

hypercall

− Debug stub

interface for

debugging guest

operating

systems

Hypervisor

Virtual CPU

-SMP

-64 bit

Services Boot Services

(ePAPR)

Emulation

(privileged instructions)

Guest Operating System

Debug Stub Debug Console

Hypercalls Device Tree

System Hardware

Direct

I/O

Mux

UART

Doorbells

PIC IOMMU Byte

Channels

Partition

Mgmt

UART

Device Tree

MPIC

Platform error

Failover

Page 16: Varun Sethi Sudhanshu Mittal

16 TM

Freescale, the Freescale logo, AltiVec, C-5, CodeTEST, CodeWarrior, ColdFire, ColdFire+, C-Ware, the Energy Efficient Solutions logo, Kinetis,

mobileGT, PowerQUICC, Processor Expert, QorIQ, Qorivva, StarCore, Symphony and VortiQa are trademarks of Freescale Semiconductor, Inc.,

Reg. U.S. Pat. & Tm. Off. Airfast, BeeKit, BeeStack, CoreNet, Flexis, MagniV, MXC, Platform in a Package, QorIQ Qonverge, QUICC Engine,

Ready Play, SafeAssure, the SafeAssure logo, SMARTMOS, TurboLink, Vybrid and Xtrinsic are trademarks of Freescale Semiconductor, Inc. All

other product or service names are the property of their respective owners. © 2012 Freescale Semiconductor, Inc.

• Topaz features mechanisms for configuring partitions in an active/stand-by arrangement

• Features

− Notifications on partition state changes (e.g. watchdog timeout)

− Mechanisms for active and standby partitions to share I/O devices– a standby partition that becomes active can claim active ownership

Interrupt & DMA reconfiguration

− Mechanisms to claim error manager

− If all partitions stop, system will reset

OS OS

Topaz

active standby

OS OS

Topaz

active standby

OS OS

Topaz

Page 17: Varun Sethi Sudhanshu Mittal

TM

Freescale, the Freescale logo, AltiVec, C-5, CodeTEST, CodeWarrior, ColdFire,

ColdFire+, C-Ware, the Energy Efficient Solutions logo, Kinetis, mobileGT, PowerQUICC,

Processor Expert, QorIQ, Qorivva, StarCore, Symphony and VortiQa are trademarks of

Freescale Semiconductor, Inc., Reg. U.S. Pat. & Tm. Off. Airfast, BeeKit, BeeStack,

CoreNet, Flexis, MagniV, MXC, Platform in a Package, QorIQ Qonverge, QUICC Engine,

Ready Play, SafeAssure, the SafeAssure logo, SMARTMOS, TurboLink, Vybrid and

Xtrinsic are trademarks of Freescale Semiconductor, Inc. All other product or service

names are the property of their respective owners. © 2012 Freescale Semiconductor, Inc.

.

Page 18: Varun Sethi Sudhanshu Mittal

18 TM

Freescale, the Freescale logo, AltiVec, C-5, CodeTEST, CodeWarrior, ColdFire, ColdFire+, C-Ware, the Energy Efficient Solutions logo, Kinetis,

mobileGT, PowerQUICC, Processor Expert, QorIQ, Qorivva, StarCore, Symphony and VortiQa are trademarks of Freescale Semiconductor, Inc.,

Reg. U.S. Pat. & Tm. Off. Airfast, BeeKit, BeeStack, CoreNet, Flexis, MagniV, MXC, Platform in a Package, QorIQ Qonverge, QUICC Engine,

Ready Play, SafeAssure, the SafeAssure logo, SMARTMOS, TurboLink, Vybrid and Xtrinsic are trademarks of Freescale Semiconductor, Inc. All

other product or service names are the property of their respective owners. © 2012 Freescale Semiconductor, Inc.

• KVM/QEMU– open source virtualization technology based on the Linux kernel

• Supports e500v2, e500mc, e5500 CPUs

• No or minimal OS changes required

• Virtual I/O – virtual disk, network interfaces, serial

• Direct/pass thru I/O – assign SoC devices to partitions (some limitations)

• ePAPR compliant

• e500v2 uses paravirtualization (OS modifications) for improved performance

Linux® Kernel kvm

Virtual

Machine 1

App

QEMU OS

App

OS

App

QEMU

Virtual

Machine 2

Page 19: Varun Sethi Sudhanshu Mittal

19 TM

Freescale, the Freescale logo, AltiVec, C-5, CodeTEST, CodeWarrior, ColdFire, ColdFire+, C-Ware, the Energy Efficient Solutions logo, Kinetis,

mobileGT, PowerQUICC, Processor Expert, QorIQ, Qorivva, StarCore, Symphony and VortiQa are trademarks of Freescale Semiconductor, Inc.,

Reg. U.S. Pat. & Tm. Off. Airfast, BeeKit, BeeStack, CoreNet, Flexis, MagniV, MXC, Platform in a Package, QorIQ Qonverge, QUICC Engine,

Ready Play, SafeAssure, the SafeAssure logo, SMARTMOS, TurboLink, Vybrid and Xtrinsic are trademarks of Freescale Semiconductor, Inc. All

other product or service names are the property of their respective owners. © 2012 Freescale Semiconductor, Inc.

• QEMU provides

− Virtual machine setup

− Initialization

− Memory allocation

− Virtual I/O services

− Debug stub

• KVM provides

− Virtual CPU services

− API used by QEMU (see

Documentation/kvm/api.txt)

• Kernel schedules VMs

KVM

Linux®

Kernel

VM init,

boot

QEMU

Virtual

I/O

debug

Virtual

CPU

App App

OS

Page 20: Varun Sethi Sudhanshu Mittal

20 TM

Freescale, the Freescale logo, AltiVec, C-5, CodeTEST, CodeWarrior, ColdFire, ColdFire+, C-Ware, the Energy Efficient Solutions logo, Kinetis,

mobileGT, PowerQUICC, Processor Expert, QorIQ, Qorivva, StarCore, Symphony and VortiQa are trademarks of Freescale Semiconductor, Inc.,

Reg. U.S. Pat. & Tm. Off. Airfast, BeeKit, BeeStack, CoreNet, Flexis, MagniV, MXC, Platform in a Package, QorIQ Qonverge, QUICC Engine,

Ready Play, SafeAssure, the SafeAssure logo, SMARTMOS, TurboLink, Vybrid and Xtrinsic are trademarks of Freescale Semiconductor, Inc. All

other product or service names are the property of their respective owners. © 2012 Freescale Semiconductor, Inc.

• Enables sharing of host network

interfaces

• Host

− Bridge (virtual switch) is connected

to physical host interface

− QEMU uses tun/tap device

connected to the bridge

• Guest

− Each guest sees a private ―virtio‖

network device on PCI bus

− Virtio network driver is needed in

guest

Partition 1

App

QEMU

Partition 2

OS

App

OS

App

QEMU

br0 eth0

tap0 tap1

Linux®

Page 21: Varun Sethi Sudhanshu Mittal

21 TM

Freescale, the Freescale logo, AltiVec, C-5, CodeTEST, CodeWarrior, ColdFire, ColdFire+, C-Ware, the Energy Efficient Solutions logo, Kinetis,

mobileGT, PowerQUICC, Processor Expert, QorIQ, Qorivva, StarCore, Symphony and VortiQa are trademarks of Freescale Semiconductor, Inc.,

Reg. U.S. Pat. & Tm. Off. Airfast, BeeKit, BeeStack, CoreNet, Flexis, MagniV, MXC, Platform in a Package, QorIQ Qonverge, QUICC Engine,

Ready Play, SafeAssure, the SafeAssure logo, SMARTMOS, TurboLink, Vybrid and Xtrinsic are trademarks of Freescale Semiconductor, Inc. All

other product or service names are the property of their respective owners. © 2012 Freescale Semiconductor, Inc.

• Give each virtual machine

a private storage device

• Virtual disk could be

single binary image on

host file system or logical

volume on the host’s disk

• Guest sees a private

―virtio‖ device on PCI bus

• Virtio block driver is

needed in guest

Partition 1

App

QEMU

Partition 2

OS

App

OS

App

QEMU

Linux®

Page 22: Varun Sethi Sudhanshu Mittal

22 TM

Freescale, the Freescale logo, AltiVec, C-5, CodeTEST, CodeWarrior, ColdFire, ColdFire+, C-Ware, the Energy Efficient Solutions logo, Kinetis,

mobileGT, PowerQUICC, Processor Expert, QorIQ, Qorivva, StarCore, Symphony and VortiQa are trademarks of Freescale Semiconductor, Inc.,

Reg. U.S. Pat. & Tm. Off. Airfast, BeeKit, BeeStack, CoreNet, Flexis, MagniV, MXC, Platform in a Package, QorIQ Qonverge, QUICC Engine,

Ready Play, SafeAssure, the SafeAssure logo, SMARTMOS, TurboLink, Vybrid and Xtrinsic are trademarks of Freescale Semiconductor, Inc. All

other product or service names are the property of their respective owners. © 2012 Freescale Semiconductor, Inc.

• Debug stub in QEMU

allows guest debugging

using GDB

• QEMU monitor shell

allows examining VM

state

KVM

Linux

Kernel

VM init,

boot

QEMU

Virtual

I/O

debug

Virtual

CPU

App App

OS

GDB

monitor

Page 23: Varun Sethi Sudhanshu Mittal

23 TM

Freescale, the Freescale logo, AltiVec, C-5, CodeTEST, CodeWarrior, ColdFire, ColdFire+, C-Ware, the Energy Efficient Solutions logo, Kinetis,

mobileGT, PowerQUICC, Processor Expert, QorIQ, Qorivva, StarCore, Symphony and VortiQa are trademarks of Freescale Semiconductor, Inc.,

Reg. U.S. Pat. & Tm. Off. Airfast, BeeKit, BeeStack, CoreNet, Flexis, MagniV, MXC, Platform in a Package, QorIQ Qonverge, QUICC Engine,

Ready Play, SafeAssure, the SafeAssure logo, SMARTMOS, TurboLink, Vybrid and Xtrinsic are trademarks of Freescale Semiconductor, Inc. All

other product or service names are the property of their respective owners. © 2012 Freescale Semiconductor, Inc.

USB2.0

I-

Cache

e500 Core0

D-Cache

L2

DDR Controller (RAM) DMA

PCI

Express

I-

Cache

e500 Core1

D-Cache

eT

SE

C

eT

SE

C

eT

SE

C

USB2.0 host

Domain 0 Domain 1

RTOS Supervisor Linux

Linux

(guest) RTOS

(guest)

kvm

Qemu (vmm) Qemu (vmm)

Virtu

al

Eth

Virtu

al

Eth

Page 24: Varun Sethi Sudhanshu Mittal

TM

Freescale, the Freescale logo, AltiVec, C-5, CodeTEST, CodeWarrior, ColdFire,

ColdFire+, C-Ware, the Energy Efficient Solutions logo, Kinetis, mobileGT, PowerQUICC,

Processor Expert, QorIQ, Qorivva, StarCore, Symphony and VortiQa are trademarks of

Freescale Semiconductor, Inc., Reg. U.S. Pat. & Tm. Off. Airfast, BeeKit, BeeStack,

CoreNet, Flexis, MagniV, MXC, Platform in a Package, QorIQ Qonverge, QUICC Engine,

Ready Play, SafeAssure, the SafeAssure logo, SMARTMOS, TurboLink, Vybrid and

Xtrinsic are trademarks of Freescale Semiconductor, Inc. All other product or service

names are the property of their respective owners. © 2012 Freescale Semiconductor, Inc.

.

Page 25: Varun Sethi Sudhanshu Mittal

25

Freescale, the Freescale logo, AltiVec, C-5, CodeTEST, CodeWarrior, ColdFire, ColdFire+, C-Ware, the Energy Efficient Solutions logo, Kinetis,

mobileGT, PowerQUICC, Processor Expert, QorIQ, Qorivva, StarCore, Symphony and VortiQa are trademarks of Freescale Semiconductor, Inc.,

Reg. U.S. Pat. & Tm. Off. Airfast, BeeKit, BeeStack, CoreNet, Flexis, MagniV, MXC, Platform in a Package, QorIQ Qonverge, QUICC Engine,

Ready Play, SafeAssure, the SafeAssure logo, SMARTMOS, TurboLink, Vybrid and Xtrinsic are trademarks of Freescale Semiconductor, Inc. All

other product or service names are the property of their respective owners. © 2012 Freescale Semiconductor, Inc.

• The performance overhead when running on a hypervisor is workload dependent.

• What are the sources of CPU overhead when running under a hypervisor?

− Privileged operations

Instructions– e.g. TLB operations (tlbwe, tlbilx, tlbsx)

Privileged SPRs– e.g. DEC, timer control registers

− Exceptions – Decremeter, TLB misses, DSI/ISI, external interrupts, etc.

− Scheduling / Context switches

May lead to excessive MMU invalidations

− Hypercalls

Page 26: Varun Sethi Sudhanshu Mittal

26

Freescale, the Freescale logo, AltiVec, C-5, CodeTEST, CodeWarrior, ColdFire, ColdFire+, C-Ware, the Energy Efficient Solutions logo, Kinetis,

mobileGT, PowerQUICC, Processor Expert, QorIQ, Qorivva, StarCore, Symphony and VortiQa are trademarks of Freescale Semiconductor, Inc.,

Reg. U.S. Pat. & Tm. Off. Airfast, BeeKit, BeeStack, CoreNet, Flexis, MagniV, MXC, Platform in a Package, QorIQ Qonverge, QUICC Engine,

Ready Play, SafeAssure, the SafeAssure logo, SMARTMOS, TurboLink, Vybrid and Xtrinsic are trademarks of Freescale Semiconductor, Inc. All

other product or service names are the property of their respective owners. © 2012 Freescale Semiconductor, Inc.

• Virtualization extensions on e500mc / e5500 /e6500 cores

− HV privilege level

Only E.HV privilege instructions trap, reduces the trap overhead

− Partition ID / extended virtual address space

Possible to maintain multiple guest mappings on a single core

− Shadow registers

Private copy of registers each for the HV and the guest state

− Direct system calls

No trap during guest system calls

− Direct external hardware interrupts to guest

Reduced interrupt latency with direct assigned devices

• LRAT support on e6500

− Tlbwe instruction can be executed without trap

Page 27: Varun Sethi Sudhanshu Mittal

27 TM

Freescale, the Freescale logo, AltiVec, C-5, CodeTEST, CodeWarrior, ColdFire, ColdFire+, C-Ware, the Energy Efficient Solutions logo, Kinetis,

mobileGT, PowerQUICC, Processor Expert, QorIQ, Qorivva, StarCore, Symphony and VortiQa are trademarks of Freescale Semiconductor, Inc.,

Reg. U.S. Pat. & Tm. Off. Airfast, BeeKit, BeeStack, CoreNet, Flexis, MagniV, MXC, Platform in a Package, QorIQ Qonverge, QUICC Engine,

Ready Play, SafeAssure, the SafeAssure logo, SMARTMOS, TurboLink, Vybrid and Xtrinsic are trademarks of Freescale Semiconductor, Inc. All

other product or service names are the property of their respective owners. © 2012 Freescale Semiconductor, Inc.

• Designed to leverage the virtualization extensions available on QorIQ platforms

• Minimize privilege instruction trap overhead by utilizing additional privilege level

• Supports Direct exception/interrupt delivery to guest

Hypervisor

MSR[PR]=0

MSR[GS]=0

Guest

Kernel

MSR[PR]=0

MSR[GS]=1

Guest User

MSR[PR]=1

MSR[GS]=1

Topaz

Hypervisor

App App

Guest

OS

MPIC

IOMMU

Shared

Cache

Page 28: Varun Sethi Sudhanshu Mittal

28 TM

Freescale, the Freescale logo, AltiVec, C-5, CodeTEST, CodeWarrior, ColdFire, ColdFire+, C-Ware, the Energy Efficient Solutions logo, Kinetis,

mobileGT, PowerQUICC, Processor Expert, QorIQ, Qorivva, StarCore, Symphony and VortiQa are trademarks of Freescale Semiconductor, Inc.,

Reg. U.S. Pat. & Tm. Off. Airfast, BeeKit, BeeStack, CoreNet, Flexis, MagniV, MXC, Platform in a Package, QorIQ Qonverge, QUICC Engine,

Ready Play, SafeAssure, the SafeAssure logo, SMARTMOS, TurboLink, Vybrid and Xtrinsic are trademarks of Freescale Semiconductor, Inc. All

other product or service names are the property of their respective owners. © 2012 Freescale Semiconductor, Inc.

KVM

Linux®

Kernel

VM

init,

boot

QEMU

Virtual

I/O

debug

Virtual

CPU

App

OS

• CPU utilization – VM competes with Linux applications

• Interrupt latency – Not able to support direct interrupt delivery

• I/O emulation overhead

• Privileged instruction overhead on e500v2 based SoCs

− Has 2 privilege levels, OS runs in user mode – additional complexity and overhead due to this. OS modifications needed.

Page 29: Varun Sethi Sudhanshu Mittal

29 TM

Freescale, the Freescale logo, AltiVec, C-5, CodeTEST, CodeWarrior, ColdFire, ColdFire+, C-Ware, the Energy Efficient Solutions logo, Kinetis,

mobileGT, PowerQUICC, Processor Expert, QorIQ, Qorivva, StarCore, Symphony and VortiQa are trademarks of Freescale Semiconductor, Inc.,

Reg. U.S. Pat. & Tm. Off. Airfast, BeeKit, BeeStack, CoreNet, Flexis, MagniV, MXC, Platform in a Package, QorIQ Qonverge, QUICC Engine,

Ready Play, SafeAssure, the SafeAssure logo, SMARTMOS, TurboLink, Vybrid and Xtrinsic are trademarks of Freescale Semiconductor, Inc. All

other product or service names are the property of their respective owners. © 2012 Freescale Semiconductor, Inc.

User mode

MSR[PR]=1

Kernel mode

MSR[PR]=0

KVM

QEMU App App

Guest

OS

MPIC

Linux®

Kernel

User

MSR[PR]=1

MSR[GS]=0

Hypervisor

MSR[PR]=0

MSR[GS]=0

Guest Kernel

MSR[PR]=0

MSR[GS]=1

Guest User

MSR[PR]=1

MSR[GS]=1

KVM

Linux®

Kernel

QEMU App App

Guest

OS

MPIC

Page 30: Varun Sethi Sudhanshu Mittal

30

Freescale, the Freescale logo, AltiVec, C-5, CodeTEST, CodeWarrior, ColdFire, ColdFire+, C-Ware, the Energy Efficient Solutions logo, Kinetis,

mobileGT, PowerQUICC, Processor Expert, QorIQ, Qorivva, StarCore, Symphony and VortiQa are trademarks of Freescale Semiconductor, Inc.,

Reg. U.S. Pat. & Tm. Off. Airfast, BeeKit, BeeStack, CoreNet, Flexis, MagniV, MXC, Platform in a Package, QorIQ Qonverge, QUICC Engine,

Ready Play, SafeAssure, the SafeAssure logo, SMARTMOS, TurboLink, Vybrid and Xtrinsic are trademarks of Freescale Semiconductor, Inc. All

other product or service names are the property of their respective owners. © 2012 Freescale Semiconductor, Inc.

TM

• Topaz is a good solution if:

− Simply trying to statically partition hardware

− Real time constraints

− Topaz type failover

• KVM is a good solution if:

− Your system is based on Linux, and you want to run an

additional OS in a virtual machine

− Need the additional features that come with KVM/QEMU

Need a scheduler to run multiple Oses

Need virtual I/O-- disk, network

Page 31: Varun Sethi Sudhanshu Mittal

31

Freescale, the Freescale logo, AltiVec, C-5, CodeTEST, CodeWarrior, ColdFire, ColdFire+, C-Ware, the Energy Efficient Solutions logo, Kinetis,

mobileGT, PowerQUICC, Processor Expert, QorIQ, Qorivva, StarCore, Symphony and VortiQa are trademarks of Freescale Semiconductor, Inc.,

Reg. U.S. Pat. & Tm. Off. Airfast, BeeKit, BeeStack, CoreNet, Flexis, MagniV, MXC, Platform in a Package, QorIQ Qonverge, QUICC Engine,

Ready Play, SafeAssure, the SafeAssure logo, SMARTMOS, TurboLink, Vybrid and Xtrinsic are trademarks of Freescale Semiconductor, Inc. All

other product or service names are the property of their respective owners. © 2012 Freescale Semiconductor, Inc.

Tweeting? Please use hashtag

#FTF2012

Facebook.com/Freescale Tag yourself in photos

and upload your own!

Session materials will be posted @ www.freescale.com/FTF Look for announcements in the FTF Group on LinkedIn or follow Freescale on Twitter

• Topaz Users Guide in Freescale QorIQ SDK

• KVM Users Guide in Freescale QorIQ SDK

• Freescale Power Architecture Book E Virtual CPU Specification

• KVM

− KVM website: http://www.linux-kvm.org

• QEMU

− QEMU website: http://www.qemu.org

• Device Trees

− ePAPR (Embedded Power Architecture Platform Requirements) version 1.1. https://www.power.org/resources/downloads/Power_ePAPR_APPROVED_v1.1.pdf

Page 32: Varun Sethi Sudhanshu Mittal

TM