SlideShare a Scribd company logo
XPDDS17: Keynote: Shared Coprocessor Framework on ARM - Oleksandr Andrushchenko, EPAM Systems
Shared coprocessor
framework
on ARM
Oleksandr Andrushchenko, Lead Software Engineer, EPAM Systems Inc.
Kyiv, Ukraine
Team of developers at EPAM Systems Inc., based in Kyiv, Ukraine
We are focused on:
• Xen on ARM
• Automotive use-cases
• Para-virtualized front drivers, backends and managers: sound, display, input
• SoC’s HW virtualization
• TEE integration
• Power management
• FuSa ISO 61508/26262 certification
• Yocto based build system for multi-domain distributions
We are upstreaming to Xen Project: see us at https://github.com/xen-troops
Introduction
In this talk
1. What is it about?
2. Why one would want to share a coprocessor?
3. Scheduling a virtual coprocessor
4. Configuration approaches
5. IOMMU support
6. Proprietary code and native applications
7. Virtual GPU
Rationale
● Not only CPU anymore, but SoC
○ GPUs, multimedia encoders, DSPs, FPGAs… you name it
○ Used to offload processing from CPUs to dedicated HW
● Good for one-OS-does-everything
● We have to isolate parts of the system
○ Split HW blocks between users (if HW allows that, e.g. display)
○ Choose which part uses real HW and which does SW emulation
○ Use para-virtual devices
Safety domain
In-vehicle infotainmentDomD
Split and para-virtualize
Dom0 Instrument cluster
Audio backend
SW GPU/Rendering
Sources: http://www.aa1car.com/library/instrument_cluster.htm;
https://www.xda-developers.com/panasonic-automotive-to-build-android-automotive-in-vehicle-infotainment-system-into-fiat-chrysler-vehicles/
GPU/Rendering Media encoders
Display HW Audio HW Graphics HW Encoders HW
Driver assistance
ADAS
Custom HW
Display backend
SW Audio
Xen
Shared coprocessors
● Why one would bother with sharing coprocessors?
○ Performance and complexity issues with para-virtual devices
■ Memory copying
■ Complex ABI (just imagine para-virtual OpenGL)
○ HW cannot be split
○ Different guests may need to run different FW/driver
○ Multiple domains may benefit from platform’s HW capabilities
● It is always a question what needs to be shared or
para-virtualized
With shared coprocessors
Safety domain
In-vehicle infotainmentDomDDom0 Instrument cluster
Audio backend
Pictures from: http://www.aa1car.com/library/instrument_cluster.htm
https://www.xda-developers.com/panasonic-automotive-to-build-android-automotive-in-vehicle-infotainment-system-into-fiat-chrysler-vehicles/
GPU Media encoders
Display Audio GPU Media encoders
Driver assistance
ADAS
DSP
Display backend
Xen vGPU vMEncodervDSP vFPGA
GPU
Media encoders
FPGA
Shared coprocessor
framework
(SCF)
Shared Coprocessor Framework
• SCF will simplify sharing a coprocessor
• Leave all the burden to the framework, focus on your coproc
• Make coproc support unified
• Benefit from framework bug-fixes and work others do,
contribute
(virtual)Coprocessor
resources
● Memory-mapped I/O ranges
● Interrupts
● Power - reset - clock management (PRCM)
● IOMMU context(s)
● Coprocessor own MMU if any
Scheduling or why not Xen’s vCPU scheduler
• Cannot use vCPU scheduler
• Not all HW allows context switch or it can be complex
• Guest may be inactive, but its tasks may still be processed by coproc
• Active guest may not use coproc at all, so let others utilize it
• IOMMU context switch may be needed for vcoproc
• Requirements for coproc scheduler
• Priority of a guest - mission critical tasks
• Coproc load/usage - time is not the best measure
Scheduling a vCoproc
● Round-robin at the first stage
● Can existing schedulers be used?
○ Null scheduler could be a match
○ Credit/Credit2 seem to need much work
○ Real-time schedulers
■ ARINC 653
■ Real-Time-Deferrable-Server (RTDS)
● Or we need to (re)implement the same for coproc?
● Do we need to be real-time? (mission critical, Audio/Video
use-cases)
Configuration
• Configure: MMIO ranges, interrupts, IOMMU etc.
• Need to configure both privileged and guest domains
• Privileged domains may not have configuration file, e.g. Dom0, but
DomD has
• Guest is configured with a configuration file
• Must be able to configure multiple vcoprocs per domain
• To allow coprocessor sharing within the same guest, running different
FW/Drivers, e.g. OpenGL concurrently with OpenCL for vGPU
Configuration
• Current implementation
• device tree bootargs to configure Dom0
• partial dtb + DomU configuration file (similar to ARM passthrough)
• partial dtb for DomU (with pdtb passed to XEN) was rejected after community
discussion
• How to pass variable structure data to Xen
• Device-tree, but no x86 support
• ACPI, but is it ARM ready yet?
• Introduce new ABI:
• Pass memory ranges, interrupts etc in a flexible way
• Have convertors for ACPI, DTB etc?
IOMMU support
• HW expects to see physically contiguous memory, e.g. for DMA
operations
• Guest cannot guarantee that, “bad” options are:
• 1:1 mapped guest
• If coproc has its own MMU - trap memory access and update MMU manually in SW
• Utilize IOMMU to overcome these problems with better performance:
• 1:1 is not required
• Better memory isolation - control coproc’s memory access
• Overcome 4GB limit for 32-bit DMA capable devices
• Switch handled by the framework
• No changes to existing FW/driver
• No changes to coproc Xen driver
Proprietary code
● There is always room for someone’s IP...
● Cannot disclose source/interface: NDA, incompatible license
● Need to move part of coproc’s code into a black box
● Options are being discussed (Volodymyr Babchuk will cover
in detail during the Summit):
○ Stubdom
○ EL0 applications
● Once decision is made it will be adopted by the framework
What is expected from a “native application”
• Latency is critical
• MMIO access
• IRQ handling
• System stability
• Recovery from misbehaving proprietary code
• Power and clock management
• Solution to legal problems
Next generation car
Picture from http://www.designhmi.com/2015/02/23/in-car-connectivity-and-iot-internet-of-things/
Virtual GPU
● One of the key components for automotive use-cases
○ Instrument cluster (IC)
○ Head-up display (HUD)
○ In-vehicle infotainment (IVI)
● Performance and stability are both critical:
○ Not only OpenGL/Vulkan, but OpenCL and more - different firmware at the same
time, even the same guest
○ IVI crash must not affect IC
vGPU status
● Proof-of-concept is limited, but working
○ Context switch via power off/on sequence of the GPU
○ IOMMU switch is done via
iommu_deassign_dt_device/iommu_assign_dt_device
○ Future work:
■ Avoid complete off/on sequences
■ Faster switch via context save
● Need proper integration with IOMMU
● Need decision on proprietary code placement
SCF status and open questions
• In progress
• Initial shared coprocessor framework design document is available
(needs update)
• Native application approaches are being discussed
• SCF configuration discussion started
• POC is available
• Not started
• Power - reset - clock management
• Need to control clocks and power
• What if external PMIC is used (HW interface, driver, which domain?)
What we are working on
Xen
Native EL0 apps / stub domains
Real time scheduling
Heterogenous big.LITTLE support
PMF (cpufreq, cpuidle, thermal, vcoprocpm)
SCF
IOMMUF & IPMMU support
SMC/HVC bridge
PV frontends
Xen apps
PM governor +SoC drivers
TEE manager +OP-TEE driver
GPU mediator +SGX driver
OP-TEE Mullti-domain support
Integration
Android HALs
Sound/Display managers
PV backends
Certification ISO 61508 path 3s
CI Build/release system
Resources
● https://github.com/xen-troops
○ Shared coprocessor framework
○ Para-virtual drivers and backends (generic backend library, display,
sound, multi-touch etc)
○ Multidomain Yocto-based build system (xt-distro)
● With your help we will upstream it all
Questions
Thank you!

More Related Content

What's hot (20)

PDF
MIPI DevCon 2021: MIPI I3C interface for the ETSI Smart Secure Platform
MIPI Alliance
 
PDF
MIPI DevCon 2021: MIPI I3C Application and Validation Models for IoT Sensor N...
MIPI Alliance
 
PDF
MIPI DevCon Taipei 2019: State of the Alliance
MIPI Alliance
 
PDF
MIPI DevCon 2020 | High Speed MIPI CSI-2 Interface Meeting Automotive ASIL-B
MIPI Alliance
 
PDF
MIPI DevCon Seoul 2018: Powering AI and Automotive Applications with the MIPI...
MIPI Alliance
 
PDF
MIPI DevCon 2021: MIPI HTI, PTI and STP: The Bases for Next-Generation Online...
MIPI Alliance
 
PDF
MIPI DevCon Taipei 2019: Enabling MIPI Camera Applications Including Automoti...
MIPI Alliance
 
PDF
MIPI DevCon 2020 | MIPI DevCon 2020 | How MIPI Interfaces Solve Challenges in...
MIPI Alliance
 
PDF
MIPI DevCon 2020 | MIPI to Bluetooth LE: Leveraging Mobile Technology for Wir...
MIPI Alliance
 
PDF
MIPI DevCon Taipei 2019: New Trends in the High-Volume Manufacturing Test of ...
MIPI Alliance
 
PDF
MIPI DevCon 2021: MIPI Security for Automotive and IoT – Initial Focus on MASS
MIPI Alliance
 
PDF
MIPI DevCon Seoul 2018: Evolving MIPI I3C for New Usages and Industries
MIPI Alliance
 
PDF
MIPI DevCon 2020 | MASS: Automotive Displays Using VDC-M Visually Lossless C...
MIPI Alliance
 
PDF
MPI DevCon Hsinchu City 2017: MIPI I3C Interface - Advanced Features
MIPI Alliance
 
PPTX
MIPI IP Modules for SoC Prototyping
Arasan Chip Systems
 
PDF
MIPI DevCon 2021: MIPI CSI-2 v4.0 Panel Discussion with the MIPI Camera Worki...
MIPI Alliance
 
PDF
MIPI DevCon Seoul 2018: Mobile Technologies for a Smart World
MIPI Alliance
 
PDF
MIPI DevCon Seoul 2018: Next Generation Verification Process for Automotive a...
MIPI Alliance
 
PDF
MIPI DevCon Bangalore 2017: Building Intelligent, High-Speed Sensor Connectiv...
MIPI Alliance
 
PDF
MIPI DevCon 2020 | The Story Behind the MIPI I3C HCI Driver for Linux
MIPI Alliance
 
MIPI DevCon 2021: MIPI I3C interface for the ETSI Smart Secure Platform
MIPI Alliance
 
MIPI DevCon 2021: MIPI I3C Application and Validation Models for IoT Sensor N...
MIPI Alliance
 
MIPI DevCon Taipei 2019: State of the Alliance
MIPI Alliance
 
MIPI DevCon 2020 | High Speed MIPI CSI-2 Interface Meeting Automotive ASIL-B
MIPI Alliance
 
MIPI DevCon Seoul 2018: Powering AI and Automotive Applications with the MIPI...
MIPI Alliance
 
MIPI DevCon 2021: MIPI HTI, PTI and STP: The Bases for Next-Generation Online...
MIPI Alliance
 
MIPI DevCon Taipei 2019: Enabling MIPI Camera Applications Including Automoti...
MIPI Alliance
 
MIPI DevCon 2020 | MIPI DevCon 2020 | How MIPI Interfaces Solve Challenges in...
MIPI Alliance
 
MIPI DevCon 2020 | MIPI to Bluetooth LE: Leveraging Mobile Technology for Wir...
MIPI Alliance
 
MIPI DevCon Taipei 2019: New Trends in the High-Volume Manufacturing Test of ...
MIPI Alliance
 
MIPI DevCon 2021: MIPI Security for Automotive and IoT – Initial Focus on MASS
MIPI Alliance
 
MIPI DevCon Seoul 2018: Evolving MIPI I3C for New Usages and Industries
MIPI Alliance
 
MIPI DevCon 2020 | MASS: Automotive Displays Using VDC-M Visually Lossless C...
MIPI Alliance
 
MPI DevCon Hsinchu City 2017: MIPI I3C Interface - Advanced Features
MIPI Alliance
 
MIPI IP Modules for SoC Prototyping
Arasan Chip Systems
 
MIPI DevCon 2021: MIPI CSI-2 v4.0 Panel Discussion with the MIPI Camera Worki...
MIPI Alliance
 
MIPI DevCon Seoul 2018: Mobile Technologies for a Smart World
MIPI Alliance
 
MIPI DevCon Seoul 2018: Next Generation Verification Process for Automotive a...
MIPI Alliance
 
MIPI DevCon Bangalore 2017: Building Intelligent, High-Speed Sensor Connectiv...
MIPI Alliance
 
MIPI DevCon 2020 | The Story Behind the MIPI I3C HCI Driver for Linux
MIPI Alliance
 

Similar to XPDDS17: Keynote: Shared Coprocessor Framework on ARM - Oleksandr Andrushchenko, EPAM Systems (20)

PDF
"Making Computer Vision Software Run Fast on Your Embedded Platform," a Prese...
Edge AI and Vision Alliance
 
PPTX
Add sale davinci
Akash Sahoo
 
PDF
LCU13: GPGPU on ARM Experience Report
Linaro
 
PDF
LCE13: Android Graphics Upstreaming
Linaro
 
PDF
XPDDS18: CPUFreq in Xen on ARM - Oleksandr Tyshchenko, EPAM Systems
The Linux Foundation
 
PDF
”Bare-Metal Container" presented at HPCC2016
Kuniyasu Suzaki
 
PDF
Current and Future of Non-Volatile Memory on Linux
mountpoint.io
 
ODP
UWE Linux Boot Camp 2007: Hacking embedded Linux on the cheap
edlangley
 
PDF
Ximea - the pc camera, 90 gflps smart camera
XIMEA
 
PPTX
5. IO virtualization
Hwanju Kim
 
PDF
Embedded systems introduction
mohamed drahem
 
PDF
IWOCL 2025 Write Once, Deploy Many – 3D Rendering With SYCL Cross-Vendor Supp...
Xavier Hallade
 
PDF
Polyteda Power DRC/LVS July 2016
Oleksandra Nazola
 
PDF
Introduction to intel galileo board gen2
Harshit Srivastava
 
PDF
SoC Idling for unconf COSCUP 2016
Koan-Sin Tan
 
PDF
RISC-V 30908 patra
RISC-V International
 
PDF
HKG18-110 - net_mdev: Fast path user space I/O
Linaro
 
PDF
Achieving the Ultimate Performance with KVM
DevOps.com
 
PDF
Deep Learning on ARM Platforms - SFO17-509
Linaro
 
PDF
PowerDRC/LVS 2.2 released by POLYTEDA
Alexander Grudanov
 
"Making Computer Vision Software Run Fast on Your Embedded Platform," a Prese...
Edge AI and Vision Alliance
 
Add sale davinci
Akash Sahoo
 
LCU13: GPGPU on ARM Experience Report
Linaro
 
LCE13: Android Graphics Upstreaming
Linaro
 
XPDDS18: CPUFreq in Xen on ARM - Oleksandr Tyshchenko, EPAM Systems
The Linux Foundation
 
”Bare-Metal Container" presented at HPCC2016
Kuniyasu Suzaki
 
Current and Future of Non-Volatile Memory on Linux
mountpoint.io
 
UWE Linux Boot Camp 2007: Hacking embedded Linux on the cheap
edlangley
 
Ximea - the pc camera, 90 gflps smart camera
XIMEA
 
5. IO virtualization
Hwanju Kim
 
Embedded systems introduction
mohamed drahem
 
IWOCL 2025 Write Once, Deploy Many – 3D Rendering With SYCL Cross-Vendor Supp...
Xavier Hallade
 
Polyteda Power DRC/LVS July 2016
Oleksandra Nazola
 
Introduction to intel galileo board gen2
Harshit Srivastava
 
SoC Idling for unconf COSCUP 2016
Koan-Sin Tan
 
RISC-V 30908 patra
RISC-V International
 
HKG18-110 - net_mdev: Fast path user space I/O
Linaro
 
Achieving the Ultimate Performance with KVM
DevOps.com
 
Deep Learning on ARM Platforms - SFO17-509
Linaro
 
PowerDRC/LVS 2.2 released by POLYTEDA
Alexander Grudanov
 
Ad

More from The Linux Foundation (20)

PDF
ELC2019: Static Partitioning Made Simple
The Linux Foundation
 
PDF
XPDDS19: How TrenchBoot is Enabling Measured Launch for Open-Source Platform ...
The Linux Foundation
 
PDF
XPDDS19 Keynote: Xen in Automotive - Artem Mygaiev, Director, Technology Solu...
The Linux Foundation
 
PDF
XPDDS19 Keynote: Xen Project Weather Report 2019 - Lars Kurth, Director of Op...
The Linux Foundation
 
PDF
XPDDS19 Keynote: Unikraft Weather Report
The Linux Foundation
 
PDF
XPDDS19 Keynote: Secret-free Hypervisor: Now and Future - Wei Liu, Software E...
The Linux Foundation
 
PDF
XPDDS19 Keynote: Xen Dom0-less - Stefano Stabellini, Principal Engineer, Xilinx
The Linux Foundation
 
PDF
XPDDS19 Keynote: Patch Review for Non-maintainers - George Dunlap, Citrix Sys...
The Linux Foundation
 
PDF
XPDDS19: Memories of a VM Funk - Mihai Donțu, Bitdefender
The Linux Foundation
 
PPTX
OSSJP/ALS19: The Road to Safety Certification: Overcoming Community Challeng...
The Linux Foundation
 
PPTX
OSSJP/ALS19: The Road to Safety Certification: How the Xen Project is Making...
The Linux Foundation
 
PDF
XPDDS19: Speculative Sidechannels and Mitigations - Andrew Cooper, Citrix
The Linux Foundation
 
PDF
XPDDS19: Keeping Coherency on Arm: Reborn - Julien Grall, Arm ltd
The Linux Foundation
 
PDF
XPDDS19: QEMU PV Backend 'qdevification'... What Does it Mean? - Paul Durrant...
The Linux Foundation
 
PDF
XPDDS19: Status of PCI Emulation in Xen - Roger Pau Monné, Citrix Systems R&D
The Linux Foundation
 
PDF
XPDDS19: [ARM] OP-TEE Mediator in Xen - Volodymyr Babchuk, EPAM Systems
The Linux Foundation
 
PDF
XPDDS19: Bringing Xen to the Masses: The Story of Building a Community-driven...
The Linux Foundation
 
PDF
XPDDS19: Will Robots Automate Your Job Away? Streamlining Xen Project Contrib...
The Linux Foundation
 
PDF
XPDDS19: Client Virtualization Toolstack in Go - Nick Rosbrook & Brendan Kerr...
The Linux Foundation
 
PDF
XPDDS19: Core Scheduling in Xen - Jürgen Groß, SUSE
The Linux Foundation
 
ELC2019: Static Partitioning Made Simple
The Linux Foundation
 
XPDDS19: How TrenchBoot is Enabling Measured Launch for Open-Source Platform ...
The Linux Foundation
 
XPDDS19 Keynote: Xen in Automotive - Artem Mygaiev, Director, Technology Solu...
The Linux Foundation
 
XPDDS19 Keynote: Xen Project Weather Report 2019 - Lars Kurth, Director of Op...
The Linux Foundation
 
XPDDS19 Keynote: Unikraft Weather Report
The Linux Foundation
 
XPDDS19 Keynote: Secret-free Hypervisor: Now and Future - Wei Liu, Software E...
The Linux Foundation
 
XPDDS19 Keynote: Xen Dom0-less - Stefano Stabellini, Principal Engineer, Xilinx
The Linux Foundation
 
XPDDS19 Keynote: Patch Review for Non-maintainers - George Dunlap, Citrix Sys...
The Linux Foundation
 
XPDDS19: Memories of a VM Funk - Mihai Donțu, Bitdefender
The Linux Foundation
 
OSSJP/ALS19: The Road to Safety Certification: Overcoming Community Challeng...
The Linux Foundation
 
OSSJP/ALS19: The Road to Safety Certification: How the Xen Project is Making...
The Linux Foundation
 
XPDDS19: Speculative Sidechannels and Mitigations - Andrew Cooper, Citrix
The Linux Foundation
 
XPDDS19: Keeping Coherency on Arm: Reborn - Julien Grall, Arm ltd
The Linux Foundation
 
XPDDS19: QEMU PV Backend 'qdevification'... What Does it Mean? - Paul Durrant...
The Linux Foundation
 
XPDDS19: Status of PCI Emulation in Xen - Roger Pau Monné, Citrix Systems R&D
The Linux Foundation
 
XPDDS19: [ARM] OP-TEE Mediator in Xen - Volodymyr Babchuk, EPAM Systems
The Linux Foundation
 
XPDDS19: Bringing Xen to the Masses: The Story of Building a Community-driven...
The Linux Foundation
 
XPDDS19: Will Robots Automate Your Job Away? Streamlining Xen Project Contrib...
The Linux Foundation
 
XPDDS19: Client Virtualization Toolstack in Go - Nick Rosbrook & Brendan Kerr...
The Linux Foundation
 
XPDDS19: Core Scheduling in Xen - Jürgen Groß, SUSE
The Linux Foundation
 
Ad

Recently uploaded (20)

PPTX
OA presentation.pptx OA presentation.pptx
pateldhruv002338
 
PPTX
AI in Daily Life: How Artificial Intelligence Helps Us Every Day
vanshrpatil7
 
PPTX
Introduction to Flutter by Ayush Desai.pptx
ayushdesai204
 
PDF
Tea4chat - another LLM Project by Kerem Atam
a0m0rajab1
 
PDF
A Strategic Analysis of the MVNO Wave in Emerging Markets.pdf
IPLOOK Networks
 
PDF
Brief History of Internet - Early Days of Internet
sutharharshit158
 
PPTX
Agile Chennai 18-19 July 2025 Ideathon | AI Powered Microfinance Literacy Gui...
AgileNetwork
 
PDF
Economic Impact of Data Centres to the Malaysian Economy
flintglobalapac
 
PDF
introduction to computer hardware and sofeware
chauhanshraddha2007
 
PPTX
IT Runs Better with ThousandEyes AI-driven Assurance
ThousandEyes
 
PDF
Market Insight : ETH Dominance Returns
CIFDAQ
 
PPTX
Dev Dives: Automate, test, and deploy in one place—with Unified Developer Exp...
AndreeaTom
 
PPTX
AI and Robotics for Human Well-being.pptx
JAYMIN SUTHAR
 
PDF
GDG Cloud Munich - Intro - Luiz Carneiro - #BuildWithAI - July - Abdel.pdf
Luiz Carneiro
 
PPTX
Farrell_Programming Logic and Design slides_10e_ch02_PowerPoint.pptx
bashnahara11
 
PDF
The Future of Artificial Intelligence (AI)
Mukul
 
PDF
How Open Source Changed My Career by abdelrahman ismail
a0m0rajab1
 
PPTX
Applied-Statistics-Mastering-Data-Driven-Decisions.pptx
parmaryashparmaryash
 
PDF
TrustArc Webinar - Navigating Data Privacy in LATAM: Laws, Trends, and Compli...
TrustArc
 
PDF
MASTERDECK GRAPHSUMMIT SYDNEY (Public).pdf
Neo4j
 
OA presentation.pptx OA presentation.pptx
pateldhruv002338
 
AI in Daily Life: How Artificial Intelligence Helps Us Every Day
vanshrpatil7
 
Introduction to Flutter by Ayush Desai.pptx
ayushdesai204
 
Tea4chat - another LLM Project by Kerem Atam
a0m0rajab1
 
A Strategic Analysis of the MVNO Wave in Emerging Markets.pdf
IPLOOK Networks
 
Brief History of Internet - Early Days of Internet
sutharharshit158
 
Agile Chennai 18-19 July 2025 Ideathon | AI Powered Microfinance Literacy Gui...
AgileNetwork
 
Economic Impact of Data Centres to the Malaysian Economy
flintglobalapac
 
introduction to computer hardware and sofeware
chauhanshraddha2007
 
IT Runs Better with ThousandEyes AI-driven Assurance
ThousandEyes
 
Market Insight : ETH Dominance Returns
CIFDAQ
 
Dev Dives: Automate, test, and deploy in one place—with Unified Developer Exp...
AndreeaTom
 
AI and Robotics for Human Well-being.pptx
JAYMIN SUTHAR
 
GDG Cloud Munich - Intro - Luiz Carneiro - #BuildWithAI - July - Abdel.pdf
Luiz Carneiro
 
Farrell_Programming Logic and Design slides_10e_ch02_PowerPoint.pptx
bashnahara11
 
The Future of Artificial Intelligence (AI)
Mukul
 
How Open Source Changed My Career by abdelrahman ismail
a0m0rajab1
 
Applied-Statistics-Mastering-Data-Driven-Decisions.pptx
parmaryashparmaryash
 
TrustArc Webinar - Navigating Data Privacy in LATAM: Laws, Trends, and Compli...
TrustArc
 
MASTERDECK GRAPHSUMMIT SYDNEY (Public).pdf
Neo4j
 

XPDDS17: Keynote: Shared Coprocessor Framework on ARM - Oleksandr Andrushchenko, EPAM Systems

  • 2. Shared coprocessor framework on ARM Oleksandr Andrushchenko, Lead Software Engineer, EPAM Systems Inc. Kyiv, Ukraine
  • 3. Team of developers at EPAM Systems Inc., based in Kyiv, Ukraine We are focused on: • Xen on ARM • Automotive use-cases • Para-virtualized front drivers, backends and managers: sound, display, input • SoC’s HW virtualization • TEE integration • Power management • FuSa ISO 61508/26262 certification • Yocto based build system for multi-domain distributions We are upstreaming to Xen Project: see us at https://github.com/xen-troops Introduction
  • 4. In this talk 1. What is it about? 2. Why one would want to share a coprocessor? 3. Scheduling a virtual coprocessor 4. Configuration approaches 5. IOMMU support 6. Proprietary code and native applications 7. Virtual GPU
  • 5. Rationale ● Not only CPU anymore, but SoC ○ GPUs, multimedia encoders, DSPs, FPGAs… you name it ○ Used to offload processing from CPUs to dedicated HW ● Good for one-OS-does-everything ● We have to isolate parts of the system ○ Split HW blocks between users (if HW allows that, e.g. display) ○ Choose which part uses real HW and which does SW emulation ○ Use para-virtual devices
  • 6. Safety domain In-vehicle infotainmentDomD Split and para-virtualize Dom0 Instrument cluster Audio backend SW GPU/Rendering Sources: http://www.aa1car.com/library/instrument_cluster.htm; https://www.xda-developers.com/panasonic-automotive-to-build-android-automotive-in-vehicle-infotainment-system-into-fiat-chrysler-vehicles/ GPU/Rendering Media encoders Display HW Audio HW Graphics HW Encoders HW Driver assistance ADAS Custom HW Display backend SW Audio Xen
  • 7. Shared coprocessors ● Why one would bother with sharing coprocessors? ○ Performance and complexity issues with para-virtual devices ■ Memory copying ■ Complex ABI (just imagine para-virtual OpenGL) ○ HW cannot be split ○ Different guests may need to run different FW/driver ○ Multiple domains may benefit from platform’s HW capabilities ● It is always a question what needs to be shared or para-virtualized
  • 8. With shared coprocessors Safety domain In-vehicle infotainmentDomDDom0 Instrument cluster Audio backend Pictures from: http://www.aa1car.com/library/instrument_cluster.htm https://www.xda-developers.com/panasonic-automotive-to-build-android-automotive-in-vehicle-infotainment-system-into-fiat-chrysler-vehicles/ GPU Media encoders Display Audio GPU Media encoders Driver assistance ADAS DSP Display backend Xen vGPU vMEncodervDSP vFPGA GPU Media encoders FPGA
  • 10. Shared Coprocessor Framework • SCF will simplify sharing a coprocessor • Leave all the burden to the framework, focus on your coproc • Make coproc support unified • Benefit from framework bug-fixes and work others do, contribute
  • 11. (virtual)Coprocessor resources ● Memory-mapped I/O ranges ● Interrupts ● Power - reset - clock management (PRCM) ● IOMMU context(s) ● Coprocessor own MMU if any
  • 12. Scheduling or why not Xen’s vCPU scheduler • Cannot use vCPU scheduler • Not all HW allows context switch or it can be complex • Guest may be inactive, but its tasks may still be processed by coproc • Active guest may not use coproc at all, so let others utilize it • IOMMU context switch may be needed for vcoproc • Requirements for coproc scheduler • Priority of a guest - mission critical tasks • Coproc load/usage - time is not the best measure
  • 13. Scheduling a vCoproc ● Round-robin at the first stage ● Can existing schedulers be used? ○ Null scheduler could be a match ○ Credit/Credit2 seem to need much work ○ Real-time schedulers ■ ARINC 653 ■ Real-Time-Deferrable-Server (RTDS) ● Or we need to (re)implement the same for coproc? ● Do we need to be real-time? (mission critical, Audio/Video use-cases)
  • 14. Configuration • Configure: MMIO ranges, interrupts, IOMMU etc. • Need to configure both privileged and guest domains • Privileged domains may not have configuration file, e.g. Dom0, but DomD has • Guest is configured with a configuration file • Must be able to configure multiple vcoprocs per domain • To allow coprocessor sharing within the same guest, running different FW/Drivers, e.g. OpenGL concurrently with OpenCL for vGPU
  • 15. Configuration • Current implementation • device tree bootargs to configure Dom0 • partial dtb + DomU configuration file (similar to ARM passthrough) • partial dtb for DomU (with pdtb passed to XEN) was rejected after community discussion • How to pass variable structure data to Xen • Device-tree, but no x86 support • ACPI, but is it ARM ready yet? • Introduce new ABI: • Pass memory ranges, interrupts etc in a flexible way • Have convertors for ACPI, DTB etc?
  • 16. IOMMU support • HW expects to see physically contiguous memory, e.g. for DMA operations • Guest cannot guarantee that, “bad” options are: • 1:1 mapped guest • If coproc has its own MMU - trap memory access and update MMU manually in SW • Utilize IOMMU to overcome these problems with better performance: • 1:1 is not required • Better memory isolation - control coproc’s memory access • Overcome 4GB limit for 32-bit DMA capable devices • Switch handled by the framework • No changes to existing FW/driver • No changes to coproc Xen driver
  • 17. Proprietary code ● There is always room for someone’s IP... ● Cannot disclose source/interface: NDA, incompatible license ● Need to move part of coproc’s code into a black box ● Options are being discussed (Volodymyr Babchuk will cover in detail during the Summit): ○ Stubdom ○ EL0 applications ● Once decision is made it will be adopted by the framework
  • 18. What is expected from a “native application” • Latency is critical • MMIO access • IRQ handling • System stability • Recovery from misbehaving proprietary code • Power and clock management • Solution to legal problems
  • 19. Next generation car Picture from http://www.designhmi.com/2015/02/23/in-car-connectivity-and-iot-internet-of-things/
  • 20. Virtual GPU ● One of the key components for automotive use-cases ○ Instrument cluster (IC) ○ Head-up display (HUD) ○ In-vehicle infotainment (IVI) ● Performance and stability are both critical: ○ Not only OpenGL/Vulkan, but OpenCL and more - different firmware at the same time, even the same guest ○ IVI crash must not affect IC
  • 21. vGPU status ● Proof-of-concept is limited, but working ○ Context switch via power off/on sequence of the GPU ○ IOMMU switch is done via iommu_deassign_dt_device/iommu_assign_dt_device ○ Future work: ■ Avoid complete off/on sequences ■ Faster switch via context save ● Need proper integration with IOMMU ● Need decision on proprietary code placement
  • 22. SCF status and open questions • In progress • Initial shared coprocessor framework design document is available (needs update) • Native application approaches are being discussed • SCF configuration discussion started • POC is available • Not started • Power - reset - clock management • Need to control clocks and power • What if external PMIC is used (HW interface, driver, which domain?)
  • 23. What we are working on Xen Native EL0 apps / stub domains Real time scheduling Heterogenous big.LITTLE support PMF (cpufreq, cpuidle, thermal, vcoprocpm) SCF IOMMUF & IPMMU support SMC/HVC bridge PV frontends Xen apps PM governor +SoC drivers TEE manager +OP-TEE driver GPU mediator +SGX driver OP-TEE Mullti-domain support Integration Android HALs Sound/Display managers PV backends Certification ISO 61508 path 3s CI Build/release system
  • 24. Resources ● https://github.com/xen-troops ○ Shared coprocessor framework ○ Para-virtual drivers and backends (generic backend library, display, sound, multi-touch etc) ○ Multidomain Yocto-based build system (xt-distro) ● With your help we will upstream it all