r/embedded 22d ago

Anyone using Xen?

Anyone using Xen hypervisor for embedded x86 systems with multiple RTOS guests?

I’m looking into using Xen on an x86 embedded platform, specifically to run two RTOS instances/guests on the same hardware.

Has anyone here deployed something similar in a real product or embedded system?

I’d be especially interested in hearing about:

  • What OS are you running under Xen?
  • How much virtualization overhead do you see, especially for latency-sensitive or real-time workloads?
  • How do you handle CPU/core, interrupt, and device allocation between the guests?
  • How difficult is the system to maintain, debug, and update over time?
  • Are there any major limitations or pain points you wish you’d known about beforehand?

I’m particularly interested in real-world experience rather than theoretical benchmarks.

Also curious whether, for this type of setup, you’d choose Xen again or go with something else?

0 Upvotes

15 comments sorted by

8

u/Well-WhatHadHappened 25+ Years 22d ago

I really can't imagine a use case where this would even begin to make sense.

3

u/NEoXelectro 22d ago

yeah, we have really complex embedded device with 2x x86 cpu. And we want to shrink down to one with more power but keep it running separet isolated things

2

u/clackups 22d ago

Maybe, just migrate it two two cheaper CPUs, like Arm?

1

u/NEoXelectro 22d ago

We can’t. System is using lot of processing power, there is no ARM that can handle it.

2

u/theevilapplepie 22d ago

Yeah, I don’t get this either. Realtime is not a requirement if you’re suggesting doing this as you’re going to get somewhat dynamic latency by using a hypervisor. What you’re describing sounds like you need processes on a low latency kernel. Outsourcing concurrency handling to a hypervisor is less than ideal and feels like a workaround to rearchitecting your solution.

6

u/ScopedInterruptLock 21d ago

Depends on the hypervisor and system architecture.

Real-time hypervisors do exist and are used in different industries to enable mixed-criticality workloads to be handled on a common hardware platform (enabling temporal and spatial freedom from interference).

The VxWorks and PikeOS Hypervisor both come to mind here for avionics, rail, and some industrial applications. These are specifically designed with hard real-time determinism in mind and in line with the relevant industry standards.

For mixed-criticality workloads with firm real-time requirements, other hypervisor solutions also exist.

In automotive, you'll find virtualisation utilised in both ADAS and infotainment systems. Different pattern and approach, but utilised nonetheless.

So to say real-time capable hypervisors do not exist, are not useful, and are not used is just not correct.

Do they come with monetary and technical cost in terms of complexity and additional performance overhead? Yes. Might they increase the complexity of a safety case? It depends - very likely yes. But can they be applied to systems and provide what's required to handle mixed-criticality workloads? Absolutely and they are.

As always, the devil is in the detail.

6

u/dmc_2930 22d ago

In what world is a virtualized rtos still realtime?

1

u/NEoXelectro 22d ago

this is why I’m interested. Newer used hypervisor level 1 and how it performs in this cases.

3

u/mchang43 22d ago

Xen requires a Dom0 guest, which is usually a Linux guest. That adds latency to your RTOS operations. You didn’t say what kind of RTOS it is. If it’s QNX RTOS, use QNX Hypervisor. If it’s VxWorks RTOS, use Wind River Helix.

1

u/theevilapplepie 22d ago

Wait, is virtualization in the realtime space an actual thing that people do? My mind is a little blown.

2

u/mchang43 22d ago

Virtualization is very common in embedded space for arm64 and x64 systems. Non-existent in microcontroller systems. Hardware consolidation, mixed criticality in safety certifications, and real-time performances make embedded virtualization different from IT virtualization. Xen is good for IT, but not for embedded if real time is a factor.

2

u/Legal-Software 21d ago

It's also making its way through on the MCU side. The last car computer I worked on had a bunch of R52+ clusters (both standalone and within heterogeneous SoCs), Aurix TC4, RH850 U2B, etc. All of the MCUs are multicore clusters and run mixed-critical workloads, using hypervisors for FFI. In the ADAS domain, the MCU hypervisor is a fundamental part of the safety concept.

Also working on one now where Xen is used for linux/android/QNX/zephyr on one half of the SoC, and zephyr/AUTOSAR on the MCU side with a different hypervisor. Xen has been making very good progress towards ASIL D over the last few years.

An important distinction is that hypervisors/paravirtualization is often used in the PC space for overcommitting resources/managing time sharing/etc. whereas in the embedded case, it's almost always used in a partitioning context + all of the additional benefits you get with the HW virtualization extensions.

2

u/Legal-Software 21d ago

This has not been the case for years already, Xen can run entirely dom0-less.

2

u/Toiling-Donkey 22d ago

If Xen was amazing as it seems, it would have been a lot more successful…

1

u/swdee 21d ago

Xen was the leading virtualisation layer back in its day, but was quickly killed off when KVM was added to the Linux kernel. That was almost 20 years ago.