SlideShare a Scribd company logo
1 of 28
Download to read offline
Stefano Stabellini
VM-to-VM Communication
Mechanisms for Embedded
Existing VM-to-VM Communication Mechanisms
˃ Existing protocols: Xen PV Drivers, VirtIO
discoverable and dynamic
create new connections at runtime
made for IO virtualization
˃ A frontend in the guest connects to the
backend in Dom0 / hypervisor
˃ Created to virtualizedevices
˃ Typically based on memory sharing
˃ VirtIO expects privileged backends
>> 2
Xen
Dom0
Dom0
DomU
Frontend Backend
Hardware
Static Partitioning
Static Partitioning
˃ Static Partitioning is similar to virtualization with some key differences:
No dynamic VMs, a limited number of "partitions" instead
Focus on direct assignment of hardware resources
Configuration defined at "Build Time"
Real-Time, Safety, and Short Boot Times are often key requirements
˃ Example: Xen Dom0less
Xen Dom0less
U-Boot
Xen
Dom0 DomU 1 DomU 2
CPU CPU CPU
loads into memory
loads into memory
Xen Dom0less
U-Boot
Xen
Dom0 DomU 1 DomU 2
CPU CPU CPU
boots
boots
Xen Dom0less Current Status
˃ Static Partitions defined at build time
˃ Fast boot times, real-time support, easier to safety-certify
˃ Dom0 is not required
˃ No "out of the box" communication mechanisms available
Static Partitioning and Communication
˃ Often only VM-to-VM communication is required, not device virtualization
There are enough physical devices to directly assign them to VMs as needed
Device virtualization can be interesting for sharing an SD card among multiple VMs
˃ VM-to-VM communication is differentfrom device virtualization
A simple VM-to-VM channel to send and receive raw data
It doesn't need "frontends" and "backends"
It requires a smaller code base
It is faster for exchanging data but it is unwieldy for virtualizing devices
˃ Static definition of VM-to-VM communication channels
Define connections at "build time"
Required for safety
˃ No privileged backends
Required for safety
˃ Support Linux and non-Linux guests (Zephyr, FreeRTOS, WindRiver, QNX, etc.)
Static Partitioning VM-to-VM communication
˃ No privileged backends
Dom0 DomU 1 DomU 2
Hardware Device
Backend Frontend
Xen PV Drivers
˃ Solid and hardened in production for years (AWS)
˃ Made for device virtualization, can be used for communication:
Network
Block (disks)
Console
2D graphics, mouse and keyboard
Sound
Etc.
˃ Pros:
Very Fast Unprivileged Backends
Available for Linux, BSDs and Windows, less common among RTOSes
˃ Cons:
Might not be available in certain embedded RTOSes (but BSD versions exist for all PV drivers)
Dom0less support is work-in-progress
Xen PV Drivers and Dom0less
>> 11
U-Boot
Xen
Dom0
DomU 1 DomU 2
CPU CPU CPU
Dom0
Backend Frontend
xl
Xen PV Drivers and Dom0less
˃ Domains booted in parallel
˃ PV Drivers connections created after Dom0 is up and running
˃ Advantages compared to regular non-Dom0lessdeployments:
Domains are still started very quickly
Domains can immediately begin to perform critical tasks
Overall time to get PV Drivers up and running is shorter (no domain creation needed in Dom0)
˃ To become available by the end of the year (work by Hipert/Lab @ Unimore)
VirtIO
˃ Frontend Drivers are available in most Operating Systems
˃ "VMM" provides the backends (e.g. QEMU, kvmtools, etc.)
˃ Pros:
Many virtual device classes
˃ Cons:
Backends are currently required to be privileged – backends must be in Dom0
‒ Security implications
‒ Safety implications
Support for Xen is available, but it requires non-upstream toolstack patches
No Dom0less support
VirtIO
>> 14
Dom0
DomU 1 DomU 2
CPU CPU CPU
Dom0
Backend
"VMM"
Frontend
Xen
1. trap
2. ioreq
3. map and emulate
VirtIO
˃ IOREQ infrastructure upstream in Xen
It enables VirtIO backends and any other emulators to run in Dom0 (e.g. QEMU)
No support in the Xen tools for creating VirtIO frontends/backends yet (patch available)
PoC with virtio-block by EPAM
Requires Backends with full privileges, they have to be in Dom0
Good performance with full privileges
˃ Support for Unprivileged Backend is work-in-progress by Linaro Project Stratos
Based on memory copies to/from a pre-shared memory region
Performance to be determined (never done before, underlying protocols designed for sharing)
˃ How to enable VirtIO for Dom0less?
Could VirtIO device hotplug be used to avoid synchronous waiting during boot?
Argo
˃ Hypervisor-Mediated Data Transfers
Argo
˃ Pros:
Great performance and very strong security properties
‒ Hypervisor checks against malicious data senders
‒ Designed and optimized for memory copies
More lightweight than Xen PV Drivers and VirtIO
‒ No Xenstore, no PV backends, no VMM needed
‒ Requires Event Channels and Argo drivers (BSD drivers available here and here)
Straightforward Dom0less enablement: no need for any kind of "wait"
‒ No need to wait for Dom0 to complete booting to communicate with other VMs
˃ Current Status:
It requires one Linux patch to work with Dom0less
‒ Thanks Alec Kwapis from DornerWorks!
˃ Cons:
Requires Argo driver and Xen event channels for notifications
Static Shared Memory and Interrupts
U-Boot
Xen
Dom0
DomU 1 DomU 2
CPU CPU CPU
Dom0
ring
buffer
Static Shared Memory and Interrupts
˃ Plain shared memoryregion
Configured at "build time"
Guests setups ring buffers over shared memory
Can use OpenAMP RPMesg or any other communication libraries based on shared memory
˃ Interrupt-based notifications, work with any OSes
New hypercall to inject SGIs (patch by Xilinx)
˃ Pros:
Very simple
Works with any OS
Great performance if used correctly
˃ Cons:
One non-upstream patch to enable interrupt notifications
Require your own communication library
No dynamic connections
PL-based communication mechanisms
DomU 1 DomU 2
PL
Network
Device
Network
Device
Switch
PL-based communication mechanisms
DomU 1 DomU 2
PL
Data Movers
PL-based communication mechanisms
˃ Create Data Movers in Programmable Logic
From simple Network Devices to optimized Data Movers
˃ Assign PL resources to VMs
˃ VMs use PL to send and receive data to/from other VMs
˃ Pros:
Fastest for larger data sizes
Userspace drivers only
Easy to enable in any OS
˃ Cons:
Requires PL
Summary
Solution Upstream
Status for
regularXen
Upstream
Status for
Dom0less
VM-to-VM
Communication
vs. Device
Virtualization
Compatibility Performance Unprivileged
Backends
Plain shared
memory &
interrupts
Patch available
for interrupts
Patch
available for
interrupts
Static
VM-to-VM
Communication
Can run
anywhere
High if
implemented
correctly
Yes
Argo Upstream One patch
for Linux
available
Dynamic
VM-to-VM
Communication
Linux,
Windows with
a small effort
High Yes
Xen PV
Drivers
Upstream Patches
available
soon
Unprivileged
Device
Virtualization
Most traditional
OSes (Linux,
Windows,
BSDs)
High Yes
VirtIO Hypervisor:
upstream
No Privileged
Device
Virtualization
Most traditional
OSes (Linux,
Windows,
BSDs)
High with full
privileged
Otherwise: ?
No
(work in
progress)
Toolstack:
patches
available
Conclusions
˃ Several solutions are already available, but nothing works out of the box yet
˃ No one-size fits all:
Shared memory and notifications: best for OS compatibility
Argo: best for VM-to-VM communication
Xen PV Drivers: best for virtual devices with unprivileged backends
VirtIO: best for virtual device classes available
Demo
By Luca Miccio and Marco Solieri
Demo: Dom0less + PV Drivers
U-Boot
Xen
Dom0 DomU 1
CPU CPU
boots
boots
Demo: Dom0less + PV Drivers
U-Boot
Xen
CPU CPU
NetBack NetFront
xl
Adaptable.
Intelligent.

More Related Content

What's hot

Whitepaper, lynx secure rootkit detection & protection by means of secure vir...
Whitepaper, lynx secure rootkit detection & protection by means of secure vir...Whitepaper, lynx secure rootkit detection & protection by means of secure vir...
Whitepaper, lynx secure rootkit detection & protection by means of secure vir...
Avishai Ziv
 

What's hot (20)

System Device Tree and Lopper: Concrete Examples - ELC NA 2022
System Device Tree and Lopper: Concrete Examples - ELC NA 2022System Device Tree and Lopper: Concrete Examples - ELC NA 2022
System Device Tree and Lopper: Concrete Examples - ELC NA 2022
 
Kernel Recipes 2017 - An introduction to the Linux DRM subsystem - Maxime Ripard
Kernel Recipes 2017 - An introduction to the Linux DRM subsystem - Maxime RipardKernel Recipes 2017 - An introduction to the Linux DRM subsystem - Maxime Ripard
Kernel Recipes 2017 - An introduction to the Linux DRM subsystem - Maxime Ripard
 
Linux PV on HVM
Linux PV on HVMLinux PV on HVM
Linux PV on HVM
 
XPDS16: Porting Xen on ARM to a new SOC - Julien Grall, ARM
XPDS16: Porting Xen on ARM to a new SOC - Julien Grall, ARMXPDS16: Porting Xen on ARM to a new SOC - Julien Grall, ARM
XPDS16: Porting Xen on ARM to a new SOC - Julien Grall, ARM
 
Virtualization with KVM (Kernel-based Virtual Machine)
Virtualization with KVM (Kernel-based Virtual Machine)Virtualization with KVM (Kernel-based Virtual Machine)
Virtualization with KVM (Kernel-based Virtual Machine)
 
KVM tools and enterprise usage
KVM tools and enterprise usageKVM tools and enterprise usage
KVM tools and enterprise usage
 
Whitepaper, lynx secure rootkit detection & protection by means of secure vir...
Whitepaper, lynx secure rootkit detection & protection by means of secure vir...Whitepaper, lynx secure rootkit detection & protection by means of secure vir...
Whitepaper, lynx secure rootkit detection & protection by means of secure vir...
 
ALSS14: Xen Project Automotive Hypervisor (Demo)
ALSS14: Xen Project Automotive Hypervisor (Demo)ALSS14: Xen Project Automotive Hypervisor (Demo)
ALSS14: Xen Project Automotive Hypervisor (Demo)
 
Xen and the art of embedded virtualization (ELC 2017)
Xen and the art of embedded virtualization (ELC 2017)Xen and the art of embedded virtualization (ELC 2017)
Xen and the art of embedded virtualization (ELC 2017)
 
OSSNA18: Xen Beginners Training
OSSNA18: Xen Beginners Training OSSNA18: Xen Beginners Training
OSSNA18: Xen Beginners Training
 
Embedded Hypervisor for ARM
Embedded Hypervisor for ARMEmbedded Hypervisor for ARM
Embedded Hypervisor for ARM
 
Xen Memory Management
Xen Memory ManagementXen Memory Management
Xen Memory Management
 
Xen Hypervisor
Xen HypervisorXen Hypervisor
Xen Hypervisor
 
EB corbos and the L4Re microhypervisor: Open-source automotive safety
EB corbos and the L4Re microhypervisor: Open-source automotive safetyEB corbos and the L4Re microhypervisor: Open-source automotive safety
EB corbos and the L4Re microhypervisor: Open-source automotive safety
 
SR-IOV Introduce
SR-IOV IntroduceSR-IOV Introduce
SR-IOV Introduce
 
OpenShift Virtualization - VM and OS Image Lifecycle
OpenShift Virtualization - VM and OS Image LifecycleOpenShift Virtualization - VM and OS Image Lifecycle
OpenShift Virtualization - VM and OS Image Lifecycle
 
Software update for IoT: the current state of play
Software update for IoT: the current state of playSoftware update for IoT: the current state of play
Software update for IoT: the current state of play
 
Xen Cache Coloring: Interference-Free Real-Time System
Xen Cache Coloring: Interference-Free Real-Time SystemXen Cache Coloring: Interference-Free Real-Time System
Xen Cache Coloring: Interference-Free Real-Time System
 
Safety-Certifying Open Source Software: The Case of the Xen Hypervisor
Safety-Certifying Open Source Software: The Case of the Xen HypervisorSafety-Certifying Open Source Software: The Case of the Xen Hypervisor
Safety-Certifying Open Source Software: The Case of the Xen Hypervisor
 
Xen Project 15 Years down the Line
Xen Project 15 Years down the LineXen Project 15 Years down the Line
Xen Project 15 Years down the Line
 

Similar to ELC21: VM-to-VM Communication Mechanisms for Embedded

Rmll Virtualization As Is Tool 20090707 V1.0
Rmll Virtualization As Is Tool 20090707 V1.0Rmll Virtualization As Is Tool 20090707 V1.0
Rmll Virtualization As Is Tool 20090707 V1.0
guest72e8c1
 
the NML project
the NML projectthe NML project
the NML project
Lei Yang
 
Xen Euro Par07
Xen Euro Par07Xen Euro Par07
Xen Euro Par07
congvc
 

Similar to ELC21: VM-to-VM Communication Mechanisms for Embedded (20)

LOAD BALANCING OF APPLICATIONS USING XEN HYPERVISOR
LOAD BALANCING OF APPLICATIONS  USING XEN HYPERVISORLOAD BALANCING OF APPLICATIONS  USING XEN HYPERVISOR
LOAD BALANCING OF APPLICATIONS USING XEN HYPERVISOR
 
Xen revisited
Xen revisitedXen revisited
Xen revisited
 
CIF16/Scale14x: The latest from the Xen Project (Lars Kurth, Chairman of Xen ...
CIF16/Scale14x: The latest from the Xen Project (Lars Kurth, Chairman of Xen ...CIF16/Scale14x: The latest from the Xen Project (Lars Kurth, Chairman of Xen ...
CIF16/Scale14x: The latest from the Xen Project (Lars Kurth, Chairman of Xen ...
 
LFCOLLAB15: Xen 4.5 and Beyond
LFCOLLAB15: Xen 4.5 and BeyondLFCOLLAB15: Xen 4.5 and Beyond
LFCOLLAB15: Xen 4.5 and Beyond
 
Aplura virtualization slides
Aplura virtualization slidesAplura virtualization slides
Aplura virtualization slides
 
Enabling DPU Hardware Accelerators in XCP-ng Cloud Platform Environment - And...
Enabling DPU Hardware Accelerators in XCP-ng Cloud Platform Environment - And...Enabling DPU Hardware Accelerators in XCP-ng Cloud Platform Environment - And...
Enabling DPU Hardware Accelerators in XCP-ng Cloud Platform Environment - And...
 
Medusa Project
Medusa ProjectMedusa Project
Medusa Project
 
Xen and Client Virtualization: the case of XenClient XT
Xen and Client Virtualization: the case of XenClient XTXen and Client Virtualization: the case of XenClient XT
Xen and Client Virtualization: the case of XenClient XT
 
Slide final
Slide finalSlide final
Slide final
 
OffensiveCon2022: Case Studies of Fuzzing with Xen
OffensiveCon2022: Case Studies of Fuzzing with XenOffensiveCon2022: Case Studies of Fuzzing with Xen
OffensiveCon2022: Case Studies of Fuzzing with Xen
 
Linaro connect : Introduction to Xen on ARM
Linaro connect : Introduction to Xen on ARMLinaro connect : Introduction to Xen on ARM
Linaro connect : Introduction to Xen on ARM
 
Fuzzing_with_Xen.pdf
Fuzzing_with_Xen.pdfFuzzing_with_Xen.pdf
Fuzzing_with_Xen.pdf
 
.ppt
.ppt.ppt
.ppt
 
Virtualization, The future of computing (archived)
Virtualization, The future of computing (archived)Virtualization, The future of computing (archived)
Virtualization, The future of computing (archived)
 
RMLL / LSM 2009
RMLL / LSM 2009RMLL / LSM 2009
RMLL / LSM 2009
 
Rmll Virtualization As Is Tool 20090707 V1.0
Rmll Virtualization As Is Tool 20090707 V1.0Rmll Virtualization As Is Tool 20090707 V1.0
Rmll Virtualization As Is Tool 20090707 V1.0
 
the NML project
the NML projectthe NML project
the NML project
 
Handout2o
Handout2oHandout2o
Handout2o
 
Xen Euro Par07
Xen Euro Par07Xen Euro Par07
Xen Euro Par07
 
ELC2019: Static Partitioning Made Simple
ELC2019: Static Partitioning Made SimpleELC2019: Static Partitioning Made Simple
ELC2019: Static Partitioning Made Simple
 

More from Stefano Stabellini

More from Stefano Stabellini (10)

Xen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdfXen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdf
 
RunX ELCE 2020
RunX ELCE 2020RunX ELCE 2020
RunX ELCE 2020
 
RunX: deploy real-time OSes as containers at the edge
RunX: deploy real-time OSes as containers at the edgeRunX: deploy real-time OSes as containers at the edge
RunX: deploy real-time OSes as containers at the edge
 
System Device Tree update: Bus Firewalls and Lopper
System Device Tree update: Bus Firewalls and LopperSystem Device Tree update: Bus Firewalls and Lopper
System Device Tree update: Bus Firewalls and Lopper
 
Cache coloring Xen Summit 2020
Cache coloring Xen Summit 2020Cache coloring Xen Summit 2020
Cache coloring Xen Summit 2020
 
Dom0less - Xen Developer Summit 2019
Dom0less  - Xen Developer Summit 2019Dom0less  - Xen Developer Summit 2019
Dom0less - Xen Developer Summit 2019
 
Xen Project for ARM Servers
Xen Project for ARM ServersXen Project for ARM Servers
Xen Project for ARM Servers
 
Xen and OpenStack
Xen and OpenStackXen and OpenStack
Xen and OpenStack
 
XDS15: Project Raisin
XDS15: Project RaisinXDS15: Project Raisin
XDS15: Project Raisin
 
OpenStack and Xen
OpenStack and XenOpenStack and Xen
OpenStack and Xen
 

Recently uploaded

Jax, FL Admin Community Group 05.14.2024 Combined Deck
Jax, FL Admin Community Group 05.14.2024 Combined DeckJax, FL Admin Community Group 05.14.2024 Combined Deck
Jax, FL Admin Community Group 05.14.2024 Combined Deck
Marc Lester
 

Recently uploaded (20)

Alluxio Monthly Webinar | Simplify Data Access for AI in Multi-Cloud
Alluxio Monthly Webinar | Simplify Data Access for AI in Multi-CloudAlluxio Monthly Webinar | Simplify Data Access for AI in Multi-Cloud
Alluxio Monthly Webinar | Simplify Data Access for AI in Multi-Cloud
 
Workshop: Enabling GenAI Breakthroughs with Knowledge Graphs - GraphSummit Milan
Workshop: Enabling GenAI Breakthroughs with Knowledge Graphs - GraphSummit MilanWorkshop: Enabling GenAI Breakthroughs with Knowledge Graphs - GraphSummit Milan
Workshop: Enabling GenAI Breakthroughs with Knowledge Graphs - GraphSummit Milan
 
OpenChain Webinar: AboutCode and Beyond - End-to-End SCA
OpenChain Webinar: AboutCode and Beyond - End-to-End SCAOpenChain Webinar: AboutCode and Beyond - End-to-End SCA
OpenChain Webinar: AboutCode and Beyond - End-to-End SCA
 
A Deep Dive into Secure Product Development Frameworks.pdf
A Deep Dive into Secure Product Development Frameworks.pdfA Deep Dive into Secure Product Development Frameworks.pdf
A Deep Dive into Secure Product Development Frameworks.pdf
 
Abortion Pill Prices Turfloop ](+27832195400*)[ 🏥 Women's Abortion Clinic in ...
Abortion Pill Prices Turfloop ](+27832195400*)[ 🏥 Women's Abortion Clinic in ...Abortion Pill Prices Turfloop ](+27832195400*)[ 🏥 Women's Abortion Clinic in ...
Abortion Pill Prices Turfloop ](+27832195400*)[ 🏥 Women's Abortion Clinic in ...
 
The Evolution of Web App Testing_ An Ultimate Guide to Future Trends.pdf
The Evolution of Web App Testing_ An Ultimate Guide to Future Trends.pdfThe Evolution of Web App Testing_ An Ultimate Guide to Future Trends.pdf
The Evolution of Web App Testing_ An Ultimate Guide to Future Trends.pdf
 
Abortion Pill Prices Germiston ](+27832195400*)[ 🏥 Women's Abortion Clinic in...
Abortion Pill Prices Germiston ](+27832195400*)[ 🏥 Women's Abortion Clinic in...Abortion Pill Prices Germiston ](+27832195400*)[ 🏥 Women's Abortion Clinic in...
Abortion Pill Prices Germiston ](+27832195400*)[ 🏥 Women's Abortion Clinic in...
 
COMPUTER AND ITS COMPONENTS PPT.by naitik sharma Class 9th A mittal internati...
COMPUTER AND ITS COMPONENTS PPT.by naitik sharma Class 9th A mittal internati...COMPUTER AND ITS COMPONENTS PPT.by naitik sharma Class 9th A mittal internati...
COMPUTER AND ITS COMPONENTS PPT.by naitik sharma Class 9th A mittal internati...
 
Food Delivery Business App Development Guide 2024
Food Delivery Business App Development Guide 2024Food Delivery Business App Development Guide 2024
Food Delivery Business App Development Guide 2024
 
GraphSummit Milan & Stockholm - Neo4j: The Art of the Possible with Graph
GraphSummit Milan & Stockholm - Neo4j: The Art of the Possible with GraphGraphSummit Milan & Stockholm - Neo4j: The Art of the Possible with Graph
GraphSummit Milan & Stockholm - Neo4j: The Art of the Possible with Graph
 
Encryption Recap: A Refresher on Key Concepts
Encryption Recap: A Refresher on Key ConceptsEncryption Recap: A Refresher on Key Concepts
Encryption Recap: A Refresher on Key Concepts
 
Optimizing Operations by Aligning Resources with Strategic Objectives Using O...
Optimizing Operations by Aligning Resources with Strategic Objectives Using O...Optimizing Operations by Aligning Resources with Strategic Objectives Using O...
Optimizing Operations by Aligning Resources with Strategic Objectives Using O...
 
From Theory to Practice: Utilizing SpiraPlan's REST API
From Theory to Practice: Utilizing SpiraPlan's REST APIFrom Theory to Practice: Utilizing SpiraPlan's REST API
From Theory to Practice: Utilizing SpiraPlan's REST API
 
Entropy, Software Quality, and Innovation (presented at Princeton Plasma Phys...
Entropy, Software Quality, and Innovation (presented at Princeton Plasma Phys...Entropy, Software Quality, and Innovation (presented at Princeton Plasma Phys...
Entropy, Software Quality, and Innovation (presented at Princeton Plasma Phys...
 
Novo Nordisk: When Knowledge Graphs meet LLMs
Novo Nordisk: When Knowledge Graphs meet LLMsNovo Nordisk: When Knowledge Graphs meet LLMs
Novo Nordisk: When Knowledge Graphs meet LLMs
 
Test Automation Design Patterns_ A Comprehensive Guide.pdf
Test Automation Design Patterns_ A Comprehensive Guide.pdfTest Automation Design Patterns_ A Comprehensive Guide.pdf
Test Automation Design Patterns_ A Comprehensive Guide.pdf
 
The Strategic Impact of Buying vs Building in Test Automation
The Strategic Impact of Buying vs Building in Test AutomationThe Strategic Impact of Buying vs Building in Test Automation
The Strategic Impact of Buying vs Building in Test Automation
 
Jax, FL Admin Community Group 05.14.2024 Combined Deck
Jax, FL Admin Community Group 05.14.2024 Combined DeckJax, FL Admin Community Group 05.14.2024 Combined Deck
Jax, FL Admin Community Group 05.14.2024 Combined Deck
 
Abortion Pill Prices Jane Furse ](+27832195400*)[ 🏥 Women's Abortion Clinic i...
Abortion Pill Prices Jane Furse ](+27832195400*)[ 🏥 Women's Abortion Clinic i...Abortion Pill Prices Jane Furse ](+27832195400*)[ 🏥 Women's Abortion Clinic i...
Abortion Pill Prices Jane Furse ](+27832195400*)[ 🏥 Women's Abortion Clinic i...
 
Modern binary build systems - PyCon 2024
Modern binary build systems - PyCon 2024Modern binary build systems - PyCon 2024
Modern binary build systems - PyCon 2024
 

ELC21: VM-to-VM Communication Mechanisms for Embedded

  • 2. Existing VM-to-VM Communication Mechanisms ˃ Existing protocols: Xen PV Drivers, VirtIO discoverable and dynamic create new connections at runtime made for IO virtualization ˃ A frontend in the guest connects to the backend in Dom0 / hypervisor ˃ Created to virtualizedevices ˃ Typically based on memory sharing ˃ VirtIO expects privileged backends >> 2 Xen Dom0 Dom0 DomU Frontend Backend Hardware
  • 4. Static Partitioning ˃ Static Partitioning is similar to virtualization with some key differences: No dynamic VMs, a limited number of "partitions" instead Focus on direct assignment of hardware resources Configuration defined at "Build Time" Real-Time, Safety, and Short Boot Times are often key requirements ˃ Example: Xen Dom0less
  • 5. Xen Dom0less U-Boot Xen Dom0 DomU 1 DomU 2 CPU CPU CPU loads into memory loads into memory
  • 6. Xen Dom0less U-Boot Xen Dom0 DomU 1 DomU 2 CPU CPU CPU boots boots
  • 7. Xen Dom0less Current Status ˃ Static Partitions defined at build time ˃ Fast boot times, real-time support, easier to safety-certify ˃ Dom0 is not required ˃ No "out of the box" communication mechanisms available
  • 8. Static Partitioning and Communication ˃ Often only VM-to-VM communication is required, not device virtualization There are enough physical devices to directly assign them to VMs as needed Device virtualization can be interesting for sharing an SD card among multiple VMs ˃ VM-to-VM communication is differentfrom device virtualization A simple VM-to-VM channel to send and receive raw data It doesn't need "frontends" and "backends" It requires a smaller code base It is faster for exchanging data but it is unwieldy for virtualizing devices ˃ Static definition of VM-to-VM communication channels Define connections at "build time" Required for safety ˃ No privileged backends Required for safety ˃ Support Linux and non-Linux guests (Zephyr, FreeRTOS, WindRiver, QNX, etc.)
  • 9. Static Partitioning VM-to-VM communication ˃ No privileged backends Dom0 DomU 1 DomU 2 Hardware Device Backend Frontend
  • 10. Xen PV Drivers ˃ Solid and hardened in production for years (AWS) ˃ Made for device virtualization, can be used for communication: Network Block (disks) Console 2D graphics, mouse and keyboard Sound Etc. ˃ Pros: Very Fast Unprivileged Backends Available for Linux, BSDs and Windows, less common among RTOSes ˃ Cons: Might not be available in certain embedded RTOSes (but BSD versions exist for all PV drivers) Dom0less support is work-in-progress
  • 11. Xen PV Drivers and Dom0less >> 11 U-Boot Xen Dom0 DomU 1 DomU 2 CPU CPU CPU Dom0 Backend Frontend xl
  • 12. Xen PV Drivers and Dom0less ˃ Domains booted in parallel ˃ PV Drivers connections created after Dom0 is up and running ˃ Advantages compared to regular non-Dom0lessdeployments: Domains are still started very quickly Domains can immediately begin to perform critical tasks Overall time to get PV Drivers up and running is shorter (no domain creation needed in Dom0) ˃ To become available by the end of the year (work by Hipert/Lab @ Unimore)
  • 13. VirtIO ˃ Frontend Drivers are available in most Operating Systems ˃ "VMM" provides the backends (e.g. QEMU, kvmtools, etc.) ˃ Pros: Many virtual device classes ˃ Cons: Backends are currently required to be privileged – backends must be in Dom0 ‒ Security implications ‒ Safety implications Support for Xen is available, but it requires non-upstream toolstack patches No Dom0less support
  • 14. VirtIO >> 14 Dom0 DomU 1 DomU 2 CPU CPU CPU Dom0 Backend "VMM" Frontend Xen 1. trap 2. ioreq 3. map and emulate
  • 15. VirtIO ˃ IOREQ infrastructure upstream in Xen It enables VirtIO backends and any other emulators to run in Dom0 (e.g. QEMU) No support in the Xen tools for creating VirtIO frontends/backends yet (patch available) PoC with virtio-block by EPAM Requires Backends with full privileges, they have to be in Dom0 Good performance with full privileges ˃ Support for Unprivileged Backend is work-in-progress by Linaro Project Stratos Based on memory copies to/from a pre-shared memory region Performance to be determined (never done before, underlying protocols designed for sharing) ˃ How to enable VirtIO for Dom0less? Could VirtIO device hotplug be used to avoid synchronous waiting during boot?
  • 17. Argo ˃ Pros: Great performance and very strong security properties ‒ Hypervisor checks against malicious data senders ‒ Designed and optimized for memory copies More lightweight than Xen PV Drivers and VirtIO ‒ No Xenstore, no PV backends, no VMM needed ‒ Requires Event Channels and Argo drivers (BSD drivers available here and here) Straightforward Dom0less enablement: no need for any kind of "wait" ‒ No need to wait for Dom0 to complete booting to communicate with other VMs ˃ Current Status: It requires one Linux patch to work with Dom0less ‒ Thanks Alec Kwapis from DornerWorks! ˃ Cons: Requires Argo driver and Xen event channels for notifications
  • 18. Static Shared Memory and Interrupts U-Boot Xen Dom0 DomU 1 DomU 2 CPU CPU CPU Dom0 ring buffer
  • 19. Static Shared Memory and Interrupts ˃ Plain shared memoryregion Configured at "build time" Guests setups ring buffers over shared memory Can use OpenAMP RPMesg or any other communication libraries based on shared memory ˃ Interrupt-based notifications, work with any OSes New hypercall to inject SGIs (patch by Xilinx) ˃ Pros: Very simple Works with any OS Great performance if used correctly ˃ Cons: One non-upstream patch to enable interrupt notifications Require your own communication library No dynamic connections
  • 20. PL-based communication mechanisms DomU 1 DomU 2 PL Network Device Network Device Switch
  • 21. PL-based communication mechanisms DomU 1 DomU 2 PL Data Movers
  • 22. PL-based communication mechanisms ˃ Create Data Movers in Programmable Logic From simple Network Devices to optimized Data Movers ˃ Assign PL resources to VMs ˃ VMs use PL to send and receive data to/from other VMs ˃ Pros: Fastest for larger data sizes Userspace drivers only Easy to enable in any OS ˃ Cons: Requires PL
  • 23. Summary Solution Upstream Status for regularXen Upstream Status for Dom0less VM-to-VM Communication vs. Device Virtualization Compatibility Performance Unprivileged Backends Plain shared memory & interrupts Patch available for interrupts Patch available for interrupts Static VM-to-VM Communication Can run anywhere High if implemented correctly Yes Argo Upstream One patch for Linux available Dynamic VM-to-VM Communication Linux, Windows with a small effort High Yes Xen PV Drivers Upstream Patches available soon Unprivileged Device Virtualization Most traditional OSes (Linux, Windows, BSDs) High Yes VirtIO Hypervisor: upstream No Privileged Device Virtualization Most traditional OSes (Linux, Windows, BSDs) High with full privileged Otherwise: ? No (work in progress) Toolstack: patches available
  • 24. Conclusions ˃ Several solutions are already available, but nothing works out of the box yet ˃ No one-size fits all: Shared memory and notifications: best for OS compatibility Argo: best for VM-to-VM communication Xen PV Drivers: best for virtual devices with unprivileged backends VirtIO: best for virtual device classes available
  • 25. Demo By Luca Miccio and Marco Solieri
  • 26. Demo: Dom0less + PV Drivers U-Boot Xen Dom0 DomU 1 CPU CPU boots boots
  • 27. Demo: Dom0less + PV Drivers U-Boot Xen CPU CPU NetBack NetFront xl