QNX Hypervisor Virtual Machine

Overview

This board enables running Zephyr as a guest inside a QNX Hypervisor virtual machine.

This is an example configuration. VM layouts are typically unique per product, so you will likely need to adjust the devicetree and Kconfig options to match your VM configuration (memory map, interrupt routing, clocks, devices, etc.).

Hardware

Supported Features

The qnxhv_vm board supports the hardware features listed below.

on-chip / on-board
Feature integrated in the SoC / present on the board.
2 / 2
Number of instances that are enabled / disabled.
Click on the label to see the first instance of this feature in the board/SoC DTS files.
vnd,foo
Compatible string for the Devicetree binding matching the feature.
Click on the link to view the binding documentation.

qnxhv_vm/qnxhv_vm target

Type

Location

Description

Compatible

Clock control

on-board

Generic fixed-rate clock provider1

fixed-clock

Interrupt controller

on-board

ARM Generic Interrupt Controller v21

arm,gic-v2

Power management CPU operations

on-board

Power State Coordination Interface (PSCI) version 0.21

arm,psci-0.2

Serial controller

on-board

ARM PL011 UART1

arm,pl011

SRAM

on-board

Generic on-chip SRAM1

mmio-sram

Timer

on-board

per-core ARM architected timer1

arm,armv8-timer

QNX Hypervisor Virtual Machine Configuration

The virtual hardware exposed to the guest depends on the VM configuration file. The above features are supported by following configuration.

# Guest name (optional)
system zephyr

# One vCPU
cpu

# Guest RAM base/size
ram 0x80000000,128M

# Virtual interrupt controller
vdev gic version 2

# Load Zephyr image (ELF is supported by qvm)
load ./zephyr.elf

# PL011 UART mapped into the guest at loc, routed to a host device/endpoint
vdev pl011
        hostdev >-        # QVM console (stdout/stderr), keeps early output visible
        loc 0x1c090000
        intr gic:37

Building and Running

Build an application

Use this board configuration to run basic Zephyr applications as a guest. For example, build the Basic Synchronization sample:

# From the root of the zephyr repository
west build -b qnxhv_vm samples/synchronization

This produces a guest image (e.g. zephyr/zephyr.elf) under the build directory.

Create a VM Configuration file

You also need to create .qvmconf file to configure virtual machine. QNX Hypervisor Virtual Machine Configuration is a example QVM configuration which is support by default qnxhv_vm configuration.

Here, create a file named zephyr.qvmconf with the contents of this example.

Running an application

Transfer both the Zephyr image and the QVM configuration file to the QNX Hypervisor machine, then start the VM:

qvm @zephyr.qvmconf

You will see Zephyr output:

*** Booting Zephyr OS build v4.3.0-3524-g5c47f098ffc4 ***
thread_a: Hello World from cpu 0 on qnxhv_vm!
thread_b: Hello World from cpu 0 on qnxhv_vm!
thread_a: Hello World from cpu 0 on qnxhv_vm!
thread_b: Hello World from cpu 0 on qnxhv_vm!
thread_a: Hello World from cpu 0 on qnxhv_vm!

Use CTRL+C to stop the virtual machine.

References