Firmware interface for AArch64
The firmware interface provided by QNX Hypervisor VMs on AArch64 (ARMv8) platforms adheres to the Secure Monitor Call Calling Convention (SMCCC) which governs the use of the SMC and HVC (HyperVisor Call) instructions. This interface includes the ARM Architecture Service, ParaVirtualized Timer (PV TIMER), and Power State Coordination Interface (PSCI) services.
The conventions followed by this interface are fully described in the SMC Calling Conventions document that is available at: https://developer.arm.com/documentation/den0028/c.
The conduit (mechanism) that QNX Hypervisor supports for calling firmware functions is the HVC machine instruction, which accepts a function ID to indicate the call being made. The HVC instruction generates a synchronous exception that the hypervisor handles, running at exception level 2 (EL2). Arguments and return values are passed in registers.
The SMCCC specification defines function ID ranges for the various HVC-accessed services while other ARM specifications further define individual services and functions. The table that follows describes the firmware services supported by qvm (i.e., the VMs), including the total range of function IDs reserved for each service.
Service name | Function ID range | Description |
---|---|---|
ARM Architecture | 0xC0000000 – 0xC0008000 | SMC Calls defined in the ARM Architecture range. |
PSCI | 0xC4000000 – 0xC400001F | Interface for OS-directed system power state control. |
PV Timer | 0xC5000020 – 0xC5000040 | Interface for measuring stolen time on virtualized systems. |
The sections that follow list the individual functions of each service and whether they are emulated by qvm, forwarded to the host hardware, or not supported. The unsupported functions are included to clarify which firmware operations guest OSs can or cannot perform via the VMs, and also to give insight into the overall design of these services.
Support for ARM Architecture service
Call name | Function ID | Implementation status |
---|---|---|
SMCCC_VERSION | 0x80000000 | Emulated |
SMCCC_ARCH_FEATURES | 0x80000001 | Emulated |
SMCCC_ARCH_SOC_ID | 0x80000002 | Not supported |
SMCCC_ARCH_WORKAROUND_1 | 0x80008000 | Forwarded to host |
SMCCC_ARCH_WORKAROUND_2 | 0x80007FFF | Supported but ignored |
Call_Count | 0x8000FF00 | Not supported |
Call_UID | 0x8000FF01 | Not supported |
Revision | 0x8000FF03 | Not supported |
For more information, go to Chapter 7 (Arm Architecture Calls
) in the
SMC Calling Conventions document at:
https://developer.arm.com/documentation/den0028/c.
Support for PSCI service
The PSCI service allows guest OSs to control the power of their underlying VMs. By suspending power to a VM, a guest can make its vCPU threads go idle. This action provides more CPU cycles for other threads in the hypervisor host to run, improving performance for host applications and other guests.
Call name | Function ID | Implementation status |
---|---|---|
PSCI_VERSION | 0x84000000 | Emulated |
PSCI_FEATURES | 0x8400000A | Emulated |
PSCI_AFFINITY_INFO_32 | 0x84000004 | Emulated |
PSCI_AFFINITY_INFO | 0xC4000004 | Emulated |
PSCI_CPU_ON_32 | 0x84000003 | Emulated |
PSCI_CPU_ON | 0xC4000003 | Emulated |
PSCI_CPU_OFF | 0x84000002 | Emulated |
PSCI_CPU_SUSPEND_32 | 0x84000001 | Emulated |
PSCI_CPU_SUSPEND | 0xC4000001 | Emulated |
PSCI_CPU_DEFAULT_SUSPEND_32 | 0x8400000C | Emulated |
PSCI_CPU_DEFAULT_SUSPEND | 0xC400000C | Emulated |
PSCI_SYSTEM_OFF | 0x84000008 | Emulated |
PSCI_SYSTEM_RESET | 0x84000009 | Emulated |
PSCI_SYSTEM_SUSPEND_32 | 0x8400000E | Emulated |
PSCI_SYSTEM_SUSPEND | 0xC400000E | Emulated |
PSCI_CPU_FREEZE | 0x8400000B | Not Supported |
PSCI_MIGRATE_32 | 0x84000005 | Not Supported |
PSCI_MIGRATE | 0xC4000005 | Not Supported |
PSCI_MIGRATE_INFO_TYPE | 0x84000006 | Not Supported |
PSCI_MIGRATE_INFO_UP_CPU_32 | 0x84000007 | Not Supported |
PSCI_MIGRATE_INFO_UP_CPU | 0xC4000007 | Not Supported |
PSCI_NODE_HW_STATE_32 | 0x8400000D | Not Supported |
PSCI_NODE_HW_STATE | 0xC400000D | Not Supported |
PSCI_SET_SUSPEND_MODE | 0x8400000F | Not Supported |
PSCI_STAT_RESIDENCY_32 | 0x84000010 | Not Supported |
PSCI_STAT_RESIDENCY | 0xC4000010 | Not Supported |
PSCI_STAT_COUNT_32 | 0x84000011 | Not Supported |
PSCI_STAT_COUNT | 0xC4000011 | Not Supported |
The full specification for the PSCI service and its various functions is given in the Arm Power State Coordination Interface Platform Design Document that's available at: https://developer.arm.com/documentation/den0022/db.
Support for PV Timer service
The PV Timer service allows guest OSs to measure their stolen time on
hypervisor systems. This helps the guests accurately account for their used CPU time
and set correct deadlines when scheduling tasks. Further explanation of stolen time
is provided in the Time
section in the
Understanding QNX Virtual Environments
chapter.
Call name | Function ID | Implementation status |
---|---|---|
PV_TIME_FEATURES | 0xC5000020 | Emulated |
PV_TIME_ST | 0xC5000021 | Emulated |
The full specification for the PV Timer service and its various functions is given in the Arm Paravirtualized Time for Arm-based Systems Platform Design Document that's available at: https://developer.arm.com/documentation/den0057/latest/.