Configuring guests

Guests in a QNX virtualized environment are configured in the same way as they are configured in a non-virtualized environment. For example, for QNX guests use the buildfile.

When you configure the guest, make sure that the configuration for the guest aligns with the configuration of the VM in which it will run (see Assembling and configuring VMs in this chapter), just as you would have to make sure that an OS is configured properly to run on a specific hardware platform.

If you are building a QNX guest, make sure to add the virtual attribute to your guest's buildfile, so that it knows the VM architecture on which it will run. For example, for ARM you need:

[virtual=aarch64le,elf ...

and for x86 you need:

[virtual=x86_64 ...

Both ARM and x86 guests require some additional instructions in their buildfiles (see Building the guests in the Assembling a Hypervisor System and Its Components chapter). For more information about QNX buildfiles in general, see the “OS Image Buildfiles” chapter in Building Embedded Systems.

CAUTION:
A guest must match the VM in which it will run: architecture, board-specifics, memory and CPUs, devices, etc. (see Assembling and configuring VMs).

Guest resource types

Every device exists for the guest in a specific location (or, “space”). This space defines its resource type. In the VM configuration, these location entries start with a resource type identifier followed by a colon. The information that follows the colon depends on the resource type. Supported identifiers and the resource types they identify are:

mem
The location is a guest-physical address (intermediate physical address). The number following the colon gives the physical address as understood by the guest.
io
The location is in the x86 I/O space. The number following is the port number.
pci

The location is a PCI device. It may be followed with two different types of specifier:

  • pci:vendor_id/device_id[/device_index]
  • pci:bus_number:device_number[.function_number]

For example, the following specifies that the vdev is an I/O device on port 4: io:4.

Default resource types

If no resource type identifier is specified in the device configuration, a suitable default is chosen. The most common default resource type is mem, but the default changes according to the vdev. For example, the default resource type for virtIO devices is pci, though these devices can also be specified as mem resources.

See the descriptions of the individual devices for each device's default resource type.

Guest interrupts

A guest interrupt is specified by an entry in the VM configuration. This entry has two parts, separated by a colon. They identify, respectively:

  1. the guest device Progammable Interrupt Controller (PIC) name (specified by the vdev name property; see Common vdev options.
  2. the PIC input line that is asserted when the interrupting device wishes to raise an interrupt

On x86 platforms, the LAPIC hardware is automatically supplied; there is no need to specify a vdev for it, and guest vdevs feeding interrupts to the LAPIC hardware should simply specify “apic” (with no colon or number following) for their interrupts.

On ARM platforms, the GIC hardware is automatically supplied; there is no need to specify this vdev. However, you can specify it if you want to change the values for its options (see vdev gic in this chapter). The default name for guest devices feeding interrupts to the GIC is “gic”, but you can use the vdev's name option to change this.

Examples:

The following creates a virtual I/O APIC device on an x86 platform:

vdev ioapic 
  loc 0xf8000000
  intr apic 
  name myioapic

The following creates a virtual PL011 device on an ARM platform:

vdev pl011 
  loc 0x1c090000 
  intr gic:37