28
Xen on ARM A success story Stefano Stabellini - Citrix Xen Project Team

XPDS13: Xen on ARM Update - Stefano Stabellini, Citrix

Embed Size (px)

DESCRIPTION

Many significant improvements have been made to Xen and Linux for the ARM architecture since September 2012, when initial support for Xen on ARM was introduced in the kernel. The number of contributors considerably increased as the number of different companies behind them. Xen on ARM has become a true multivendor project. Today Linux 3.11 can run on Xen on ARM as a DomU or Dom0, 32-bit or 64-bit, with one or more CPUs. Xen 4.3, out since July 2013, is the first hypervisor release to support ARMv7 and ARMv8 platforms. This talk will discuss the current status of the project, the principal technical advancements achieved during the last year of development and the problems still left unsolved. It will relate the experience of porting Xen to many new ARM SoCs and working with multiple hardware vendors in the ARM ecosystem, within and outside the Linaro Enterprise working Group.

Citation preview

Page 1: XPDS13: Xen on ARM Update - Stefano Stabellini, Citrix

Xen on ARMA success story

Stefano Stabellini - Citrix Xen Project Team

Page 2: XPDS13: Xen on ARM Update - Stefano Stabellini, Citrix

Achievements of one year

11/11 08/12 11/12 03/13 07/13

First Xen on ARM talk atXen Summit 2012

Xen support for ARM upstream in Linux 3.7

Xen running on real ARM hardware

09/12

Xen 64-bit on ARM64

01/13

Citrix announces that will be joining Linaro

Xen support for ARM64 upstream in Linux 3.11

06/13

Xen 4.3 released with ARM and ARM64 support

Part-time Xen ARM hacking starts

You are here

Page 3: XPDS13: Xen on ARM Update - Stefano Stabellini, Citrix

Xen-devel ARM traffic from August 2012: ● 4685 emails: 360 emails per month!● 39% of which are not from Citrix

A growing community

Page 4: XPDS13: Xen on ARM Update - Stefano Stabellini, Citrix

Hardware supportUpstream:● Versatile Express Cortex A15● Arndale board● ARMv8 FVP

In progress:● Calxeda “Midway”● Applied Micro “Mustang”● Cubieboard2● Broadcom Brahma-B15● OMAP5

Page 5: XPDS13: Xen on ARM Update - Stefano Stabellini, Citrix

Upstream featuresXen v4.3:● basic lifecycle operations● memory ballooning● scheduler configurations and vcpu pinning

Linux v3.11:● dom0 and domU support● 32-bit and 64-bit support● SMP support● PV disk, network and console

Page 6: XPDS13: Xen on ARM Update - Stefano Stabellini, Citrix

Coming in Xen 4.4● 64-bit guest support● live-migration● SWIOTLB

Page 7: XPDS13: Xen on ARM Update - Stefano Stabellini, Citrix

Coming in Xen 4.4● 64-bit guest support● live-migration● SWIOTLB

Page 8: XPDS13: Xen on ARM Update - Stefano Stabellini, Citrix
Page 9: XPDS13: Xen on ARM Update - Stefano Stabellini, Citrix

The problem

virtual address

physical address

machine address

hardware

Linu

xX

en

2 st

age

1 S

tage

Page 10: XPDS13: Xen on ARM Update - Stefano Stabellini, Citrix

The problem: dom0 DMA

virtual address

physical address

machine address

Device DMA

Linu

xX

en

2 st

age

1 S

tage

Page 11: XPDS13: Xen on ARM Update - Stefano Stabellini, Citrix

The best solution: IOMMU

virtual address

physical address

machine address

Device DMA IOM

MU

MM

U

Linu

xX

en

2 st

age

Page 12: XPDS13: Xen on ARM Update - Stefano Stabellini, Citrix

The workaround:Dom0 1:1 mapping

virtual address

physical address = machine address

Device DMA

Linu

xX

en

Page 13: XPDS13: Xen on ARM Update - Stefano Stabellini, Citrix

The workaround:Dom0 1:1 mapping● rigid solution● no ballooning in dom0● no page sharing in dom0● does not work with foreign grant table

mappings

Page 14: XPDS13: Xen on ARM Update - Stefano Stabellini, Citrix

UNHAPPY

Page 15: XPDS13: Xen on ARM Update - Stefano Stabellini, Citrix

The alternative: SWIOTLB

virtual address

physical address

machine address

Device DMA

DM

A o

psM

MU

Linu

x

Page 16: XPDS13: Xen on ARM Update - Stefano Stabellini, Citrix

The alternative: SWIOTLB● use memory_exchange_and_pin hypercall

○ create a contiguous buffer in machine memory○ retrieve the machine address of the buffer

● introduce an additional memcpy

● remove the need for the 1:1 workaround

Page 17: XPDS13: Xen on ARM Update - Stefano Stabellini, Citrix

STILL UNHAPPY

Page 18: XPDS13: Xen on ARM Update - Stefano Stabellini, Citrix

SWIOTLB:the improved versionpin and unpin hypercalls:● dynamically retrieve P2M mappings● pin a mapping for DMA● remove additional memcpy

map_page

XENMEM_pin

pin

pfn

pfn

mfn

mfn

Page 19: XPDS13: Xen on ARM Update - Stefano Stabellini, Citrix

SWIOTLB:the “improved” version● Linux rbtree maintenance is expensive● too many uncached address translations in

Xen○ guest virtual to machine○ guest physical to machine

cpu utilization increase

Page 20: XPDS13: Xen on ARM Update - Stefano Stabellini, Citrix

NOT AN IMPROVEMENT

Page 21: XPDS13: Xen on ARM Update - Stefano Stabellini, Citrix

SWIOTLB: the compromise● keep the dom0 1:1 workaround

○ dom0 without ballooning and page sharing is the default configuration in XenServer x86 today

● use the swiotlb only to handle DMA involving foreign grants○ we already know the p2m mappings of grants

■ no need for pin and unpin hypercalls○ can take shortcuts: avoid many tree lookups○ tree lookups are much faster○ avoidable with IOMMU support

Page 22: XPDS13: Xen on ARM Update - Stefano Stabellini, Citrix

SWIOTLB: the compromiseTesting platform:● 1.5Ghz quad-core Cortex A15● 1 Gbit link

Benchmark results:● same network throughput as native (line

rate)● < 2% cpu usage increase

Page 23: XPDS13: Xen on ARM Update - Stefano Stabellini, Citrix

THAT’S BETTER

Page 24: XPDS13: Xen on ARM Update - Stefano Stabellini, Citrix

SWIOTLB: where to find itThe patches (swiotlb-xen v8):http://marc.info/?l=linux-kernel&m=138203180707683&w=2

The kernel tree:git://git.kernel.org/pub/scm/linux/kernel/git/sstabellini/xen.git swiotlb-xen-8

Page 25: XPDS13: Xen on ARM Update - Stefano Stabellini, Citrix

Xen 4.5+● IOMMU support in Xen● device assignment● UEFI booting● ACPI support

Page 26: XPDS13: Xen on ARM Update - Stefano Stabellini, Citrix

DEMO

Page 27: XPDS13: Xen on ARM Update - Stefano Stabellini, Citrix

Questions?

Page 28: XPDS13: Xen on ARM Update - Stefano Stabellini, Citrix